Received: from eggs.gnu.org ([2001:4830:134:3::10]:56212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WW2zb-0002hU-46 for qemu-devel@nongnu.org; Fri, 04 Apr 2014 08:13:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WW2zU-0005dk-L9 for qemu-devel@nongnu.org; Fri, 04 Apr 2014 08:13:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7827) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WW2zU-0005dY-Dp for qemu-devel@nongnu.org; Fri, 04 Apr 2014 08:13:00 -0400 Date: Fri, 4 Apr 2014 14:12:52 +0200 From: Kevin Wolf Message-ID: <20140404121252.GB6465@noname.redhat.com> References: <1396612409-17932-1-git-send-email-famz@redhat.com> <533E9E1F.6080909@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <533E9E1F.6080909@redhat.com> Subject: Re: [Qemu-devel] [PATCH for-2.0] iscsi: Don't set error if already set in iscsi_do_inquiry List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Peter Lieven , Fam Zheng , qemu-devel@nongnu.org, Stefan Hajnoczi Am 04.04.2014 um 13:57 hat Paolo Bonzini geschrieben: > Il 04/04/2014 13:53, Fam Zheng ha scritto: > >This eliminates the possible assertion failure in error_setg(). > > > >Signed-off-by: Fam Zheng > >--- > > block/iscsi.c | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > >diff --git a/block/iscsi.c b/block/iscsi.c > >index 21c18a3..64a509f 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); > > } > > > > Reviewed-by: Paolo Bonzini > > Kevin, Stefan, can you send the pull request for this? Thanks, applied to the block branch. Kevin