From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51480) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtGlB-000320-Kq for qemu-devel@nongnu.org; Fri, 15 May 2015 10:38:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtGl6-0001Ce-IK for qemu-devel@nongnu.org; Fri, 15 May 2015 10:38:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54496) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtGl6-0001CD-Al for qemu-devel@nongnu.org; Fri, 15 May 2015 10:38:40 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4FEcdGH017488 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 15 May 2015 10:38:39 -0400 Message-ID: <555604EE.6010804@redhat.com> Date: Fri, 15 May 2015 08:38:38 -0600 From: Eric Blake MIME-Version: 1.0 References: <1431691143-1015-1-git-send-email-armbru@redhat.com> <1431691143-1015-16-git-send-email-armbru@redhat.com> In-Reply-To: <1431691143-1015-16-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uMkiHEgA17GT1UfCrHXdRaXHgsNxHCAgB" Subject: Re: [Qemu-devel] [PATCH v2 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) --uMkiHEgA17GT1UfCrHXdRaXHgsNxHCAgB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/15/2015 05:59 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 makes the specific error the QMP error reply. >=20 > Signed-off-by: Markus Armbruster > Reviewed-by: Eric Blake > --- > 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"); Still might be worth deleting the first 'and'; committer could do that when preparing the pull request. But my R-b stands either way. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --uMkiHEgA17GT1UfCrHXdRaXHgsNxHCAgB 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/ iQEbBAEBCAAGBQJVVgTvAAoJEKeha0olJ0Nq0s0H93sJgPprPtt5/niqMNIdCrTl 2hBY9aRS2zYkQ57Tq0oWjMen4mHJ/tOpR9ziSPtE10iSeFKHZH374RprK2wG3RgN Upp3q26JcG16fEUASG3xm/vZguX0j0Hp3QHi3ZEk9xcbHEQBIt8N0Yy2bWc/j94O MXLyABAb+zwf24Ee7TQdni4zE8LV1oyDMkqCrV3WzZkFrNWkHJn/lgvmaU1H4+yE V6obddM3g08q1YWjDX9xGIsG32iq9fG7JLASpg+ZFpFaz432WRF3Y3vs/3RyLEhd YIhM/+hQBww4w3kWU4TYowrDZQ7zyMtzYmGskhmpfzLg8KctGCFryM2QuJwnbg== =vpr9 -----END PGP SIGNATURE----- --uMkiHEgA17GT1UfCrHXdRaXHgsNxHCAgB--