From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VViZo-0005Jo-Nh for qemu-devel@nongnu.org; Mon, 14 Oct 2013 09:52:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VViZj-0007ZF-Rv for qemu-devel@nongnu.org; Mon, 14 Oct 2013 09:52:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VViZj-0007Z2-HK for qemu-devel@nongnu.org; Mon, 14 Oct 2013 09:52:47 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9EDqjDK003358 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 14 Oct 2013 09:52:46 -0400 Message-ID: <525BF72C.20700@redhat.com> Date: Mon, 14 Oct 2013 07:52:44 -0600 From: Eric Blake MIME-Version: 1.0 References: <1381559592-6309-1-git-send-email-famz@redhat.com> In-Reply-To: <1381559592-6309-1-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Ened6FgN8M0JNv8Jo9LvpNPm9cVphTGSe" Subject: Re: [Qemu-devel] [PATCH] mirror: drop local_err in mirror_compelte List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Ened6FgN8M0JNv8Jo9LvpNPm9cVphTGSe Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 >=20 > Signed-off-by: Fam Zheng > --- > block/mirror.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) >=20 > 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 =3D container_of(job, MirrorBlockJob, common); > - Error *local_err =3D NULL; > int ret; > =20 > - ret =3D bdrv_open_backing_file(s->target, NULL, &local_err); > + ret =3D 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; } --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Ened6FgN8M0JNv8Jo9LvpNPm9cVphTGSe Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSW/csAAoJEKeha0olJ0NqXtoH+QEnDNGLJJsxxcOZZhTxplkb P7VS1M4sj4n4D6XTetx9CPgdzRMP0Pj10cN5xM0mJEXlay6NoaEYDDryWnN22voH GGSGdp/2RGdNRFl7+YIwIzNpYCkg+XQOh151CevH+xA9iIc56iC5Bl7S2htjaZlR /kOdQKBiUvDIucpeeOhSX1TEoI2aZDO5gfjHK2EmC94COv9p/A8YqQr/Bd2JH/fv lNIQnw1kOI8rx1ahW7VWemucoV0NnGzPWs1IkprzDon23nrQaznmXZYKxmvN0QO1 RW8IuxfQ8Y0PDKvRRLgfhSZhMJ4zZs/0IEATtw9q2SvHu0RWbAZGQG5lhBlLqHQ= =V37l -----END PGP SIGNATURE----- --Ened6FgN8M0JNv8Jo9LvpNPm9cVphTGSe--