qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 15/15] tap: Improve -netdev/netdev_add/-net/...


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 15/15] tap: Improve -netdev/netdev_add/-net/... tap error reporting
Date: Fri, 15 May 2015 10:49:57 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Eric Blake <address@hidden> writes:

> On 05/12/2015 06:03 AM, Markus Armbruster wrote:
>> 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 and makes the specific error the QMP error reply.
>
> s/and and/and/

Fixing...

>> Signed-off-by: Markus Armbruster <address@hidden>
>> ---
>>  net/tap.c | 45 ++++++++++++++++++++++-----------------------
>>  1 file changed, 22 insertions(+), 23 deletions(-)
>> 
>
>
>> @@ -807,15 +807,15 @@ int net_init_tap(const NetClientOptions *opts, const 
>> char *name,
>>                               tap->has_vhostfds ? vhost_fds[i] : NULL,
>>                               vnet_hdr, fd, &err);
>>              if (err) {
>> -                error_report_err(err);
>> +                error_propagate(errp, err);
>>                  return -1;
>>              }
>>          }
>>      } else if (tap->has_helper) {
>>          if (tap->has_ifname || tap->has_script || tap->has_downscript ||
>>              tap->has_vnet_hdr || tap->has_queues || tap->has_vhostfds) {
>> -            error_report("ifname=, script=, downscript=, and vnet_hdr= "
>> -                         "queues=, and vhostfds= are invalid with helper=");
>> +            error_setg(errp, "ifname=, script=, downscript=, and vnet_hdr= "
>> +                       "queues=, and vhostfds= are invalid with helper=");
>
> As long as you are touching this, s/and vnet_hdr=/vnet_hdr=,/

Yes.

> Minor enough that I'm okay with fixing it, and adding:
> Reviewed-by: Eric Blake <address@hidden>

Thanks!



reply via email to

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