From 9014e913d9384a34f85975b95525a29ecaac93a0 Mon Sep 17 00:00:00 2001 From: Dariusz Stojaczyk Date: Mon, 8 Jan 2018 14:08:10 +0100 Subject: [PATCH] scsi/dev: print an error when cannot find bdev with specified name When trying to create a scsi dev with inexistent lun (bdev name), the scsi_dev_construct would just return a NULL without printing any error. We should probably return an error code of some kind, but for now let's just print an extra message. Change-Id: I28823c2cb83204c11207d3e7011fecbf725a691c Signed-off-by: Dariusz Stojaczyk Reviewed-on: https://review.gerrithub.io/393918 Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Reviewed-by: Ben Walker --- lib/scsi/dev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/scsi/dev.c b/lib/scsi/dev.c index f48ddc23a..f95bf0aa3 100644 --- a/lib/scsi/dev.c +++ b/lib/scsi/dev.c @@ -165,6 +165,8 @@ spdk_scsi_dev_construct(const char *name, char *lun_name_list[], int *lun_id_lis for (i = 0; i < num_luns; i++) { bdev = spdk_bdev_get_by_name(lun_name_list[i]); if (bdev == NULL) { + SPDK_ERRLOG("device %s: cannot find bdev '%s' (target %d)\n", + name, lun_name_list[i], i); goto error; }