qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 04/15] net/dump: Improve -net/host_net_add dump


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 04/15] net/dump: Improve -net/host_net_add dump error reporting
Date: Thu, 14 May 2015 10:37:45 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 05/12/2015 06:02 AM, Markus Armbruster wrote:
> When -net dump fails, it first reports a specific error, then a
> generic one, like this:
> 
>     $ qemu-system-x86_64 -net dump,id=foo,file=/eperm
>     qemu-system-x86_64: -net dump,id=foo,file=/eperm: -net dump: can't open 
> /eperm
>     qemu-system-x86_64: -net dump,id=foo,file=/eperm: Device 'dump' could not 
> be initialized
> 
> Convert net_init_tap() to Error.  This suppresses the unwanted second
> message.
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  net/dump.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 

> @@ -111,7 +112,7 @@ static int net_dump_init(NetClientState *peer, const char 
> *device,
>  
>      fd = open(filename, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0644);
>      if (fd < 0) {
> -        error_report("-net dump: can't open %s", filename);
> +        error_setg_errno(errp, errno, "-net dump: can't open %s", filename);

It also adds the strerror() text into the output of this message.  Might
be worth mentioning that in the commit message.

Reviewed-by: Eric Blake <address@hidden>

-- 
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

[Prev in Thread] Current Thread [Next in Thread]