From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yt1Y8-0006oc-3i for qemu-devel@nongnu.org; Thu, 14 May 2015 18:24:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yt1Y3-0004wl-5U for qemu-devel@nongnu.org; Thu, 14 May 2015 18:24:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49098) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yt1Y2-0004vM-TT for qemu-devel@nongnu.org; Thu, 14 May 2015 18:24:11 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 763CD5D for ; Thu, 14 May 2015 22:24:10 +0000 (UTC) Message-ID: <55552089.5040204@redhat.com> Date: Thu, 14 May 2015 16:24:09 -0600 From: Eric Blake MIME-Version: 1.0 References: <1431432187-10993-1-git-send-email-armbru@redhat.com> <1431432187-10993-16-git-send-email-armbru@redhat.com> In-Reply-To: <1431432187-10993-16-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="WiBxx5ngg3CpJJ4c8uXd40DF1B0EsCMAA" Subject: Re: [Qemu-devel] [PATCH 15/15] tap: Improve -netdev/netdev_add/-net/... tap error reporting 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) --WiBxx5ngg3CpJJ4c8uXd40DF1B0EsCMAA Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/12/2015 06:03 AM, Markus Armbruster wrote: > When -netdev tap fails, it first reports a specific error, then a > generic one, like this: >=20 > $ qemu-system-x86_64 -netdev tap,id=3Dfoo > qemu-system-x86_64: -netdev tap,id=3Dfoo: could not configure /dev/= net/tun: Operation not permitted > qemu-system-x86_64: -netdev tap,id=3Dfoo: Device 'tap' could not be= initialized >=20 > With the command line, the messages go to stderr. In HMP, they go to > the monitor. In QMP, the second one becomes the error reply, and the > first one goes to stderr. >=20 > Convert net_init_tap() to Error. This suppresses the unwanted second > message, and and makes the specific error the QMP error reply. s/and and/and/ >=20 > Signed-off-by: Markus Armbruster > --- > net/tap.c | 45 ++++++++++++++++++++++----------------------- > 1 file changed, 22 insertions(+), 23 deletions(-) >=20 > @@ -807,15 +807,15 @@ int net_init_tap(const NetClientOptions *opts, co= nst char *name, > tap->has_vhostfds ? vhost_fds[i] : NULL, > vnet_hdr, fd, &err); > if (err) { > - error_report_err(err); > + error_propagate(errp, err); > return -1; > } > } > } else if (tap->has_helper) { > if (tap->has_ifname || tap->has_script || tap->has_downscript = || > tap->has_vnet_hdr || tap->has_queues || tap->has_vhostfds)= { > - error_report("ifname=3D, script=3D, downscript=3D, and vne= t_hdr=3D " > - "queues=3D, and vhostfds=3D are invalid with = helper=3D"); > + error_setg(errp, "ifname=3D, script=3D, downscript=3D, and= vnet_hdr=3D " > + "queues=3D, and vhostfds=3D are invalid with he= lper=3D"); As long as you are touching this, s/and vnet_hdr=3D/vnet_hdr=3D,/ Minor enough that I'm okay with fixing it, and adding: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --WiBxx5ngg3CpJJ4c8uXd40DF1B0EsCMAA 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/ iQEcBAEBCAAGBQJVVSCJAAoJEKeha0olJ0NqNH8H/214JxpchV419M/ThRC/VguQ dETQnKnjY0JEUctwhVHzRx5XoUHdRW/b+llGpDNt8xBMxGS+FAyDgFGtb8jRXBbg oxZ+QNBXHEeu+gugXs6XRcXfiNVFemdTLUB233IbvwKr/NqaJrfnQEy0ZDYolLQZ xFvJr3PDMs4mrohtBJtHsZv9Jzh08KzpoQ039o8hjI4NORNaaom9FZVsnnXRmOyg lSAAIYvtupvDEVXZinQdrm17UnAPA0hJvSms/xKomw9ZhPG49k5JvqvOsKSghVx/ eQaJkjZzbidMNycc4HB9WiM7KkQYZVudMbRO7eZ4IWWdz3yL0tI2RrjraG2JJdU= =lbdI -----END PGP SIGNATURE----- --WiBxx5ngg3CpJJ4c8uXd40DF1B0EsCMAA--