From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsvJv-0002vh-IT for qemu-devel@nongnu.org; Thu, 14 May 2015 11:45:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YsvJs-0001RY-Cd for qemu-devel@nongnu.org; Thu, 14 May 2015 11:45:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57129) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsvJs-0001RI-3R for qemu-devel@nongnu.org; Thu, 14 May 2015 11:45:08 -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 t4EFj7u7007364 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 14 May 2015 11:45:07 -0400 Message-ID: <5554C301.6000505@redhat.com> Date: Thu, 14 May 2015 09:45:05 -0600 From: Eric Blake MIME-Version: 1.0 References: <1431432187-10993-1-git-send-email-armbru@redhat.com> <1431432187-10993-3-git-send-email-armbru@redhat.com> In-Reply-To: <1431432187-10993-3-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hCo3j1iLq3ujeEbVldmPKACFRNPp7WJmQ" Subject: Re: [Qemu-devel] [PATCH 02/15] net: Permit incremental conversion of init functions to Error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --hCo3j1iLq3ujeEbVldmPKACFRNPp7WJmQ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/12/2015 06:02 AM, Markus Armbruster wrote: > Error reporting for netdev_add is broken: the net_client_init_fun[] > report the actual errors with (at best) error_report(), and their > caller net_client_init1() makes up a generic error on top. >=20 > For command line and HMP, this produces an mildly ugly error cascande. s/cascande/cascade/ >=20 > In QMP, the actual errors go to stderr, and the generic error becomes > the command's error reply. >=20 > To fix this, we need to convert the net_client_init_fun[] to Error. >=20 > To permit fixing them one by one, add an Error ** parameter to the > net_client_init_fun[]. If the call fails without returning an Error, > make up the same generic Error as before. But if it returns one, use > that instead. Since none of them does so far, no functional change. >=20 > Signed-off-by: Markus Armbruster > --- > @@ -802,7 +803,7 @@ static int net_init_nic(const NetClientOptions *opt= s, const char *name, > static int (* const net_client_init_fun[NET_CLIENT_OPTIONS_KIND_MAX])(= > const NetClientOptions *opts, > const char *name, > - NetClientState *peer) =3D { > + NetClientState *peer, Error **errp) =3D { > [NET_CLIENT_OPTIONS_KIND_NIC] =3D net_init_nic, Not this patch, but would this be easier to read with the use of a typedef for the function pointer? Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --hCo3j1iLq3ujeEbVldmPKACFRNPp7WJmQ 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/ iQEcBAEBCAAGBQJVVMMCAAoJEKeha0olJ0NqiQkH/RUU21xBR2Mb3Vq29mkXrWT4 rphfWwV2H2pAxlqMpBXAwZxhwXUIwHOq0Dbv4ZcRG4BJYmDhugcGuMFiWMacJK28 +a0fkS+NNHqDr5hiU+c/duk2clQp669WL/q0yP2NIEkaaFqsw+QJCZFrZj1ogKQI xrRaSxbgzoUeDzInMEYku3/juylC/24DKhrHlhaKkuz9KKj5xFFBiyBcMQlPQ/cZ FDvrgDAnGO/c1CT89DrDIkbhNUQAe2KKwgOBXo3Jd7KgM8/9XM3p7D0IGi9QSYjH ST6+U3HeKe1fW0pWI6iPWi/0JgUvTkMxM17XA41tu8SfGG17xAblMJURGjA6hDY= =mubc -----END PGP SIGNATURE----- --hCo3j1iLq3ujeEbVldmPKACFRNPp7WJmQ--