From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5G6D-0005bJ-5v for qemu-devel@nongnu.org; Wed, 17 Jun 2015 12:22:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5G67-0003rr-GR for qemu-devel@nongnu.org; Wed, 17 Jun 2015 12:22:01 -0400 Message-ID: <558192F9.3050001@redhat.com> Date: Wed, 17 Jun 2015 09:32:09 -0600 From: Eric Blake MIME-Version: 1.0 References: <1434525861-21768-1-git-send-email-mst@redhat.com> <1434525861-21768-4-git-send-email-mst@redhat.com> In-Reply-To: <1434525861-21768-4-git-send-email-mst@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DItTnLdxlGwRNW8FpsnIfMBQDR8oxOk4v" Subject: Re: [Qemu-devel] [PATCH v2 3/3] block/nfs: switch to error_init_local List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, Jeff Cody , Peter Lieven , armbru@redhat.com, dgilbert@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DItTnLdxlGwRNW8FpsnIfMBQDR8oxOk4v Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/17/2015 01:24 AM, Michael S. Tsirkin wrote: > We probably should just switch everyone, this is > just to demonstrate the API usage. >=20 > Signed-off-by: Michael S. Tsirkin > --- > block/nfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/block/nfs.c b/block/nfs.c > index ca9e24e..de4b8c3 100644 > --- a/block/nfs.c > +++ b/block/nfs.c > @@ -385,7 +385,7 @@ static int nfs_file_open(BlockDriverState *bs, QDic= t *options, int flags, > NFSClient *client =3D bs->opaque; > int64_t ret; > QemuOpts *opts; > - Error *local_err =3D NULL; > + Error *local_err =3D error_init_local(errp); > =20 > client->aio_context =3D bdrv_get_aio_context(bs); More context: > opts =3D qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); > qemu_opts_absorb_qdict(opts, options, &local_err); > if (local_err) { > error_propagate(errp, local_err); > ret =3D -EINVAL; Oops. Your initialization means that if the caller passed in &error_abort, then local_err is now non-NULL, and we will attempt to do error_propagate(errp, error_abort), which will abort(). You'd have to change that to if (!error_is_abort(local_err)) { --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --DItTnLdxlGwRNW8FpsnIfMBQDR8oxOk4v Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVgZL5AAoJEKeha0olJ0Nq5U0H/2ekbtnKfFfdvK8xZW/xhm8Y hXBf4AfC6De1ls7FR1nV9uaoQHaG+Ep/OlhoTeG/X55ekRcaOYc43QIEotOb4nS+ UdR3/ZWNK8oe/eR9D+onK6oGXeq5ot0C7ykXGv4e5i+B4j1JirjeeGNAkqOXzV2k +rmrz8yDPGcC/Y/7FdzLAAiPS/72CeLRADC39sSWb8FoW1ARG348B9q9mEXoAcRH MSNRmalCRWgKCd414LRx2tRNsOXkZB2DKDr0I8fRwbi0Wq0ogHsmG65CgghsWogX NBzgrefSunDp5/8FRoxpSd+/Cn0KOobzvo3r0OgPwzJ2mY/aLG2xcOwL0B5TX8E= =2slv -----END PGP SIGNATURE----- --DItTnLdxlGwRNW8FpsnIfMBQDR8oxOk4v--