yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
Blob Blame History Raw
From 9085aa99ac8f2ac99440e23cfed4b80c44f89814 Mon Sep 17 00:00:00 2001
From: Fam Zheng <famz@redhat.com>
Date: Sun, 6 Apr 2014 01:10:17 +0200
Subject: [PATCH 08/12] iscsi: Don't set error if already set in iscsi_do_inquiry

RH-Author: Fam Zheng <famz@redhat.com>
Message-id: <1396746617-11978-1-git-send-email-famz@redhat.com>
Patchwork-id: 58350
O-Subject: [RHEL-7 0day qemu-kvm PATCH 8/7] iscsi: Don't set error if already set in iscsi_do_inquiry
Bugzilla: 1083413
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1083413
Brew: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=7308220

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>
(cherry picked from commit cbee81f6de57ddc1b21ba28f01f6a3b5d87428a5)
Signed-off-by: Fam Zheng <famz@redhat.com>
---
 block/iscsi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 block/iscsi.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/block/iscsi.c b/block/iscsi.c
index 78ab91e..ff5ca20 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1280,8 +1280,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);
     }
-- 
1.7.1