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 <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/393918
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Dariusz Stojaczyk 2018-01-08 14:08:10 +01:00 committed by Jim Harris
parent cd55b3886e
commit 9014e913d9

View File

@ -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;
}