]> git.proxmox.com Git - mirror_qemu.git/commit - net/l2tpv3.c
l2tpv3: Improve -netdev/netdev_add/-net/... error reporting
authorMarkus Armbruster <armbru@redhat.com>
Wed, 17 Oct 2018 08:26:37 +0000 (10:26 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Fri, 19 Oct 2018 12:51:34 +0000 (14:51 +0200)
commit007e5f8782673d8e476398baaa5b4813741e970b
treed70d9d3b0dce866f4bfde33b22d031d0d76e2d14
parent4dd32b3dda3ebc3ac9dd6b951a40a3e4f2f0fd47
l2tpv3: Improve -netdev/netdev_add/-net/... error reporting

When -netdev l2tpv3 fails, it first reports a specific error, then a
generic one, like this:

    $ qemu-system-x86_64 -netdev l2tpv3,id=foo,src=,dst=,txsession=1
    qemu-system-x86_64: -netdev l2tpv3,id=foo,src=,dst=,txsession=1: l2tpv3_open : could not resolve src, errno = Name or service not known
    qemu-system-x86_64: Device 'l2tpv3' 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.

Cc: Jason Wang <jasowang@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20181017082702.5581-14-armbru@redhat.com>
net/l2tpv3.c