From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoYsS-0005ot-Tz for qemu-devel@nongnu.org; Thu, 05 Dec 2013 08:22:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VoYsN-0004dU-Uh for qemu-devel@nongnu.org; Thu, 05 Dec 2013 08:22:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35641) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoYsN-0004dD-M0 for qemu-devel@nongnu.org; Thu, 05 Dec 2013 08:21:55 -0500 Message-ID: <52A07DF0.3010408@redhat.com> Date: Thu, 05 Dec 2013 06:21:52 -0700 From: Eric Blake MIME-Version: 1.0 References: <46e453b90b9822456f6ffb97f9c03ccbf36a0214.1386203851.git.peter.crosthwaite@xilinx.com> <874n6n7ghy.fsf@blackfin.pond.sub.org> In-Reply-To: <874n6n7ghy.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sLktpT2t8rcmxT8q5i6NRcjFtHqkS7A9s" Subject: Re: [Qemu-devel] [PATCH v2 1/6] error: Add error_abort List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , Peter Crosthwaite Cc: imammedo@redhat.com, qemu-devel@nongnu.org, afaerber@suse.de, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --sLktpT2t8rcmxT8q5i6NRcjFtHqkS7A9s Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12/05/2013 03:13 AM, Markus Armbruster wrote: >> >> For error_propagate, if the destination error is &error_abort, then >> the abort happens at propagation time. >> >> Signed-off-by: Peter Crosthwaite >> --- >> changed since v1: >> Delayed assertions that *errp =3D=3D NULL. >=20 > Care to explain why you want to delay these assertions? I'm not sure I= > get it... error_abort as a global variable is always NULL. >=20 > [...] >> @@ -31,7 +33,6 @@ void error_set(Error **errp, ErrorClass err_class, c= onst char *fmt, ...) >> if (errp =3D=3D NULL) { >> return; >> } >> - assert(*errp =3D=3D NULL); So *&error_abort is null and this assertion would fire, unless we delay the check for NULL... >> =20 >> err =3D g_malloc0(sizeof(*err)); >> =20 >> @@ -40,6 +41,12 @@ void error_set(Error **errp, ErrorClass err_class, = const char *fmt, ...) >> va_end(ap); >> err->err_class =3D err_class; >> =20 >> + if (errp =3D=3D &error_abort) { >> + error_report("%s", error_get_pretty(err)); >> + abort(); >> + } >> + >> + assert(*errp =3D=3D NULL); =2E..until after the check for &error_abort. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --sLktpT2t8rcmxT8q5i6NRcjFtHqkS7A9s 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/ iQEcBAEBCAAGBQJSoH3wAAoJEKeha0olJ0NqqHoH/3QFUVor/At2NFuuDowI+B97 Ae7f1zRyWH6tXp5TvRHztzI79sbfRc/YBS2AF8WFhVNtl0iBmoTsoVK15SxsZWvx DtJ6rvY9+IedWLeDqYylv7yr4wp3PU5i9nv5rosAAeWyatD+05xWLVSw1chsZKv1 2kArnWP6gDL+2QseEznA04p3DrnvViYFiaPja6gDcNnaN18ZhtktswzZP+LP8zXO 6xYMDIS1oJvKgpLD1KhqQEeYOXtyUysosn+kTQI6J0yV0OO7gq4t+MKbx3iHfdpR uXkHmao2e7iH8awIaFrx1VrIhFBRbFNJaYTOzzYiWCguIQLMy7Ah59cZeYMWuAY= =kIAs -----END PGP SIGNATURE----- --sLktpT2t8rcmxT8q5i6NRcjFtHqkS7A9s--