Skip to content
  • Markus Armbruster's avatar
    l2tpv3: Improve -netdev/netdev_add/-net/... error reporting · 007e5f87
    Markus Armbruster authored
    
    
    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: default avatarMarkus Armbruster <armbru@redhat.com>
    Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <20181017082702.5581-14-armbru@redhat.com>
    007e5f87