Commit 9014e913 authored by Dariusz Stojaczyk's avatar Dariusz Stojaczyk Committed by Jim Harris
Browse files

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: default avatarDariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/393918


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatar <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent cd55b388
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
		}