From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WD25s-0004LF-A8 for qemu-devel@nongnu.org; Mon, 10 Feb 2014 20:25:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WD25j-0000F7-7e for qemu-devel@nongnu.org; Mon, 10 Feb 2014 20:25:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60387) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WD25i-0000Bk-Vr for qemu-devel@nongnu.org; Mon, 10 Feb 2014 20:24:51 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1B1OnkB012973 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 10 Feb 2014 20:24:49 -0500 Date: Tue, 11 Feb 2014 09:24:55 +0800 From: Fam Zheng Message-ID: <20140211012455.GA2923@T430.nay.redhat.com> References: <1391090848-2115-1-git-send-email-armbru@redhat.com> <20140210155441.5c403529@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140210155441.5c403529@redhat.com> Subject: Re: [Qemu-devel] [PATCH] Use error_is_set() only when necessary List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: Markus Armbruster , qemu-devel@nongnu.org On Mon, 02/10 15:54, Luiz Capitulino wrote: > > @@ -875,13 +875,13 @@ DriveInfo *drive_init(QemuOpts *all_opts, BlockInterfaceType block_default_type) > > /* Actual block device init: Functionality shared with blockdev-add */ > > dinfo = blockdev_init(filename, bs_opts, type, &local_err); > > if (dinfo == NULL) { > > - if (error_is_set(&local_err)) { > > + if (local_err) { > > qerror_report_err(local_err); > > error_free(local_err); > > } > > goto fail; > > } else { > > - assert(!error_is_set(&local_err)); > > + assert(!local_err); > > } > > Not related to this patch, but this else clause is checking if > dinfo != NULL and local_err != NULL, right? Shouldn't it be moved > into blockdev_init() instead? This is just an caller checking that the output of blockdev_init is sane, so I think it's OK to put an assertion here. Fam