lib/iscsi: Delete SCSI device before deleting iSCSI target node

Subsequent patches will make iSCSI target possible to wait for
completion of SCSI device destruction by using callback.

This patch moves spdk_scsi_dev_destruct() before starting to
free iSCSI target node resource as a preparation.

Change-Id: I9cfe7662a05b1211292a5cc448bbba60a929f356
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450582
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Shuhei Matsumoto 2019-04-09 13:14:48 +09:00 committed by Ben Walker
parent 29ca9d63b8
commit 907ef2555f

View File

@ -631,10 +631,11 @@ iscsi_tgt_node_destruct(struct spdk_iscsi_tgt_node *target)
return;
}
spdk_scsi_dev_destruct(target->dev);
free(target->name);
free(target->alias);
iscsi_tgt_node_delete_all_pg_maps(target);
spdk_scsi_dev_destruct(target->dev);
pthread_mutex_destroy(&target->mutex);
free(target);