Received: from eggs.gnu.org ([2001:4830:134:3::10]:43898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVuAF-0005gA-PP for qemu-devel@nongnu.org; Mon, 14 Oct 2013 22:15:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VVuA9-0004Ku-DC for qemu-devel@nongnu.org; Mon, 14 Oct 2013 22:15:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21621) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVuA9-0004JU-4z for qemu-devel@nongnu.org; Mon, 14 Oct 2013 22:15:09 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9F2F6sO005440 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 14 Oct 2013 22:15:06 -0400 Date: Tue, 15 Oct 2013 10:14:59 +0800 From: Fam Zheng Message-ID: <20131015021459.GA5598@T430s.nay.redhat.com> References: <1381559592-6309-1-git-send-email-famz@redhat.com> <525BF72C.20700@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <525BF72C.20700@redhat.com> Subject: Re: [Qemu-devel] [PATCH] mirror: drop local_err in mirror_compelte Reply-To: famz@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On Mon, 10/14 07:52, Eric Blake wrote: > On 10/12/2013 12:33 AM, Fam Zheng wrote: > > There is errp passed in, so no need for local_err and error_propagate. > > s/compelte/complete/ in the subject > > > > > Signed-off-by: Fam Zheng > > --- > > block/mirror.c | 4 +--- > > 1 file changed, 1 insertion(+), 3 deletions(-) > > > > > diff --git a/block/mirror.c b/block/mirror.c > > index 7b95acf..f2e9558 100644 > > --- a/block/mirror.c > > +++ b/block/mirror.c > > @@ -505,15 +505,13 @@ static void mirror_iostatus_reset(BlockJob *job) > > static void mirror_complete(BlockJob *job, Error **errp) > > { > > MirrorBlockJob *s = container_of(job, MirrorBlockJob, common); > > - Error *local_err = NULL; > > int ret; > > > > - ret = bdrv_open_backing_file(s->target, NULL, &local_err); > > + ret = bdrv_open_backing_file(s->target, NULL, errp); > > if (ret < 0) { > > char backing_filename[PATH_MAX]; > > bdrv_get_full_backing_filename(s->target, backing_filename, > > sizeof(backing_filename)); > > - error_propagate(errp, local_err); > > return; > > What purpose does backing_filename serve? It looks like it was rendered > dead code with the introduction of commit 34b5d2c, and that you could > simplify further to: > > if (bdrv_open_backing_file(s->target, NULL, errp) < 0) { > return; > } > Good idea, thanks! Fam