diff options
author | Fam Zheng <famz@redhat.com> | 2014-04-04 19:53:29 +0800 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2014-04-04 14:11:34 +0200 |
commit | cbee81f6de57ddc1b21ba28f01f6a3b5d87428a5 (patch) | |
tree | a4c1440302572227a43ca9bf082f817d88078501 /block | |
parent | 5913815a17387a5e9825c734ccab760588471ee5 (diff) |
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>
Diffstat (limited to 'block')
-rw-r--r-- | block/iscsi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/block/iscsi.c b/block/iscsi.c index 21c18a39dc..64a509f8f4 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -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); } |