From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49312) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDxrK-00065j-Ty for qemu-devel@nongnu.org; Thu, 13 Feb 2014 10:05:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDxrG-0000Yd-1A for qemu-devel@nongnu.org; Thu, 13 Feb 2014 10:05:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDxrF-0000YS-Fj for qemu-devel@nongnu.org; Thu, 13 Feb 2014 10:05:45 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1DF5hUb010604 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 13 Feb 2014 10:05:44 -0500 Message-ID: <52FCDF46.3070309@redhat.com> Date: Thu, 13 Feb 2014 08:05:42 -0700 From: Eric Blake MIME-Version: 1.0 References: <20aba630c8a70a11c19404ca7020f3bd6c42f21e.1392301375.git.jcody@redhat.com> In-Reply-To: <20aba630c8a70a11c19404ca7020f3bd6c42f21e.1392301375.git.jcody@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6oAoVbAIP3ax5sT3npxvNfw0TxuF4AFbC" Subject: Re: [Qemu-devel] [PATCH v2] block: mirror - use local_err to avoid NULL errp List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody , qemu-devel@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, armbru@redhat.com, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6oAoVbAIP3ax5sT3npxvNfw0TxuF4AFbC Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/13/2014 07:23 AM, Jeff Cody wrote: > When starting a block job, commit_active_start() relies on whether *err= p > is set by mirror_start_job. This allows it to determine if the mirror > job start failed, so that it can clean up any changes to open flags fro= m > the bdrv_reopen(). If errp is NULL, then it will not be able to > determine if mirror_start_job failed or not. >=20 > To avoid this, use a local Error variable, and then propagate the error= > (if any) to errp. >=20 > Reported-by: Markus Armbruster > Signed-off-by: Jeff Cody > --- > block/mirror.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/block/mirror.c b/block/mirror.c > index 2a43334..ddb5765 100644 > --- a/block/mirror.c > +++ b/block/mirror.c > @@ -633,6 +633,8 @@ void commit_active_start(BlockDriverState *bs, Bloc= kDriverState *base, > { > int64_t length, base_length; > int orig_base_flags; > + Error *local_err =3D NULL; > + > =20 > orig_base_flags =3D bdrv_get_flags(base); Why the double blank line? Besides that, Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --6oAoVbAIP3ax5sT3npxvNfw0TxuF4AFbC 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJS/N9GAAoJEKeha0olJ0NqI5QH/inL8W8UybpCAuJvQGi0BR+U XqfiHG+4+lwtjYKhAlU9HKmAtXSPu7QeKLCqskoaNA5Cwgd9JcmF26CZHjZyjuqH caCayioBZfCVb+0gzgaPISSyl2OseUMG+eS7nsmK1uPTYCPH7j3SpqAWAoR2MZxb KSCKHi6ciDfeKwH7BkA/9C1jJUjmu9qTaACsJfuPgkbtQj4zXevxBgQ4Zr58fi1S 45/f2Ke6CjssxR91NI2JF+As9BK2YxgnOHDSdzbymFo9MASnhTJA97dwrhGZqdfa 8Gc9G/lC+jGAUT81NS3viQVL+zJu1xL6s9vwU4lexEnItbt2usTvNsuHttsn9/g= =RhrS -----END PGP SIGNATURE----- --6oAoVbAIP3ax5sT3npxvNfw0TxuF4AFbC--