From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 15/15] tap: Improve -netdev/netdev_add/-net/... tap error reporting
Date: Fri, 15 May 2015 08:38:38 -0600 [thread overview]
Message-ID: <555604EE.6010804@redhat.com> (raw)
In-Reply-To: <1431691143-1015-16-git-send-email-armbru@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2106 bytes --]
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:
>
> $ qemu-system-x86_64 -netdev tap,id=foo
> qemu-system-x86_64: -netdev tap,id=foo: could not configure /dev/net/tun: Operation not permitted
> qemu-system-x86_64: -netdev tap,id=foo: Device 'tap' could not be initialized
>
> 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.
>
> Convert net_init_tap() to Error. This suppresses the unwanted second
> message, and makes the specific error the QMP error reply.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> ---
> net/tap.c | 45 ++++++++++++++++++++++-----------------------
> 1 file changed, 22 insertions(+), 23 deletions(-)
>
> @@ -807,15 +807,15 @@ int net_init_tap(const NetClientOptions *opts, const 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=, script=, downscript=, and vnet_hdr= "
> - "queues=, and vhostfds= are invalid with helper=");
> + error_setg(errp, "ifname=, script=, downscript=, and vnet_hdr=, "
> + "queues=, and vhostfds= are invalid with helper=");
Still might be worth deleting the first 'and'; committer could do that
when preparing the pull request. But my R-b stands either way.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2015-05-15 14:38 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-15 11:58 [Qemu-devel] [PATCH v2 00/15] net: Improve error reporting Markus Armbruster
2015-05-15 11:58 ` [Qemu-devel] [PATCH v2 01/15] net: Improve error message for -net hubport a bit Markus Armbruster
2015-05-15 11:58 ` [Qemu-devel] [PATCH v2 02/15] net: Permit incremental conversion of init functions to Error Markus Armbruster
2015-05-15 11:58 ` [Qemu-devel] [PATCH v2 03/15] net: Improve -net nic error reporting Markus Armbruster
2015-05-15 11:58 ` [Qemu-devel] [PATCH v2 04/15] net/dump: Improve -net/host_net_add dump " Markus Armbruster
2015-05-15 11:58 ` [Qemu-devel] [PATCH v2 05/15] tap: net_tap_fd_init() can't fail, drop dead error handling Markus Armbruster
2015-05-15 11:58 ` [Qemu-devel] [PATCH v2 06/15] tap: Improve -netdev/netdev_add/-net/... bridge error reporting Markus Armbruster
2015-05-15 11:58 ` [Qemu-devel] [PATCH v2 07/15] tap: Convert tap_set_sndbuf() to Error Markus Armbruster
2015-05-15 11:58 ` [Qemu-devel] [PATCH v2 08/15] tap: Convert net_init_tap_one() " Markus Armbruster
2015-05-19 12:52 ` Stefan Hajnoczi
2015-05-15 11:58 ` [Qemu-devel] [PATCH v2 09/15] tap: Convert launch_script() " Markus Armbruster
2015-05-15 11:58 ` [Qemu-devel] [PATCH v2 10/15] tap: Permit incremental conversion of tap_open() " Markus Armbruster
2015-05-15 11:58 ` [Qemu-devel] [PATCH v2 11/15] tap-linux: Convert " Markus Armbruster
2015-05-15 11:59 ` [Qemu-devel] [PATCH v2 12/15] tap-bsd: " Markus Armbruster
2015-05-15 14:36 ` Eric Blake
2015-05-15 11:59 ` [Qemu-devel] [PATCH v2 13/15] tap-solaris: " Markus Armbruster
2015-05-15 11:59 ` [Qemu-devel] [PATCH v2 14/15] tap: Finish conversion of " Markus Armbruster
2015-05-15 11:59 ` [Qemu-devel] [PATCH v2 15/15] tap: Improve -netdev/netdev_add/-net/... tap error reporting Markus Armbruster
2015-05-15 14:38 ` Eric Blake [this message]
2015-05-19 13:15 ` [Qemu-devel] [PATCH v2 00/15] net: Improve " Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=555604EE.6010804@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).