iscsi: Don't set error if already set in iscsi_do_inquiry

This eliminates the possible assertion failure in error_setg().

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Fam Zheng 2014-04-04 19:53:29 +08:00 committed by Kevin Wolf
parent 5913815a17
commit cbee81f6de

View File

@ -1101,8 +1101,10 @@ static struct scsi_task *iscsi_do_inquiry(struct iscsi_context *iscsi, int lun,
return task;
fail:
error_setg(errp, "iSCSI: Inquiry command failed : %s",
iscsi_get_error(iscsi));
if (!error_is_set(errp)) {
error_setg(errp, "iSCSI: Inquiry command failed : %s",
iscsi_get_error(iscsi));
}
if (task != NULL) {
scsi_free_scsi_task(task);
}