iscsi: Don't set error if already set in iscsi_do_inquiry
PATCH 1/1 iscsi: Don't set error if already set in iscsi_do_inquiry
This eliminates the possible assertion failure in error_setg().
--- block/iscsi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
block/iscsi.c +4 -2
@@ -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); }
Signature · 1 line
1.9.1
Il 04/04/2014 13:53, Fam Zheng ha scritto:
Quoted 15 lines
This eliminates the possible assertion failure in
error_setg().Signed-off-by Fam Zheng <[email protected]>--- block/iscsi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)block/iscsi.c +0
-0@@ -1101,8 +1101,10 @@ static struct scsi_task *iscsi_do_inquiry(struct iscsi_context *iscsi, int lun,return task;
block/iscsi.c static struct scsi_task *iscsi_do_inquiry(struct iscsi_context *iscsi, int lun, · line 1110
Quoted 10 lines
block/iscsi.c +4
-2fail: -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); }
Kevin, Stefan, can you send the pull request for this?
Paolo
Kevin Wolf
AppliedAm 04.04.2014 um 13:57 hat Paolo Bonzini geschrieben:
Quoted 29 lines
Il 04/04/2014 13:53, Fam Zheng ha scritto:
Quoted 16 lines
This eliminates the possible assertion failure in
error_setg().Signed-off-by Fam Zheng <[email protected]>---
block/iscsi.c| 6 ++++--1 file changed, 4 insertions(+), 2 deletions(-)block/iscsi.c +0
-0@@ -1101,8 +1101,10 @@ static struct scsi_task *iscsi_do_inquiry(struct iscsi_context *iscsi, int lun,return task;fail:
block/iscsi.c static struct scsi_task *iscsi_do_inquiry(struct iscsi_context *iscsi, int lun, · line 1110
Quoted 9 lines
block/iscsi.c +4
-2-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); }Reviewed-by Paolo Bonzini <[email protected]>
Quoted 1 line
Kevin, Stefan, can you send the pull request for this?
Thanks, applied to the block branch.
Kevin
Quoted 6 lines · Fam Zheng
This eliminates the possible assertion failure in
error_setg().Signed-off-by Fam Zheng <[email protected]>--- block/iscsi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)