On 05/28/2015 06:21 AM, Markus Armbruster wrote:
> When -netdev vhost-user fails, it first reports a specific error, then
> one or more generic ones, like this:
> 
>     $ qemu-system-x86_64 -netdev vhost-user,id=foo,chardev=xxx
>     qemu-system-x86_64: -netdev vhost-user,id=foo,chardev=xxx: chardev "xxx" 
> not found
>     qemu-system-x86_64: -netdev vhost-user,id=foo,chardev=xxx: No suitable 
> chardev found
>     qemu-system-x86_64: -netdev vhost-user,id=foo,chardev=xxx: Device 
> 'vhost-user' could not be initialized
> 
> With the command line, the messages go to stderr.  In HMP, they go to
> the monitor.  In QMP, the last one becomes the error reply, and the
> others go to stderr.
> 
> Convert net_init_vhost_user() and its helpers to Error.  This
> suppresses the unwanted unspecific error messages, and makes the
> specific error the QMP error reply.
> 
> Cc: Stefan Hajnoczi <stefa...@redhat.com>
> Cc: Jason Wang <jasow...@redhat.com>
> Signed-off-by: Markus Armbruster <arm...@redhat.com>
> ---
>  net/vhost-user.c | 27 ++++++++++++---------------
>  1 file changed, 12 insertions(+), 15 deletions(-)
> 

Reviewed-by: Eric Blake <ebl...@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to