Home
last modified time | relevance | path

Searched hist:a308817743be5cc051d3379477f54027deb0befb (Results 1 – 1 of 1) sorted by relevance

/qemu/net/
H A Dtap.ca308817743be5cc051d3379477f54027deb0befb Fri May 15 11:59:03 UTC 2015 Markus Armbruster <armbru@redhat.com> tap: Improve -netdev/netdev_add/-net/... tap error reporting

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.

[Dropped duplicate "and" from error message as suggested by Eric Blake:
"ifname=, script=, downscript=, and vnet_hdr=, "
"queues=, and vhostfds= are invalid with helper="
--Stefan]

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1431691143-1015-16-git-send-email-armbru@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>