qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 2/2] net: netmap: use error_setg_errno() in p


From: Vincenzo Maffione
Subject: Re: [Qemu-devel] [PATCH v2 2/2] net: netmap: use error_setg_errno() in place of error_report()
Date: Mon, 9 Nov 2015 19:47:36 +0100

Ok, preparing them.

2015-11-06 16:35 GMT+01:00 Eric Blake <address@hidden>:
> On 11/06/2015 08:13 AM, Vincenzo Maffione wrote:
>> This update was required to align error reporting of netmap backend
>> initialization to the modifications introduced by commit a30ecde.
>>
>> Signed-off-by: Vincenzo Maffione <address@hidden>
>> ---
>>  net/clients.h |  4 ++--
>>  net/netmap.c  | 32 ++++++++++++++++----------------
>>  2 files changed, 18 insertions(+), 18 deletions(-)
>>
>
>> +++ b/net/netmap.c
>
>> @@ -99,9 +99,9 @@ static int netmap_open(NetmapPriv *me)
>>
>>      me->fd = fd = open(me->fdname, O_RDWR);
>>      if (fd < 0) {
>> -        error_report("Unable to open netmap device '%s' (%s)",
>> -                        me->fdname, strerror(errno));
>> -        return -1;
>> +        error_setg_errno(errp, errno, "Unable to open netmap device '%s'",
>> +                         me->fdname);
>
> We have error_setg_file_open() for reporting open() failures, if
> consistent messages are desired.
>
>> @@ -125,11 +124,12 @@ static int netmap_open(NetmapPriv *me)
>>      me->nifp = NETMAP_IF(me->mem, req.nr_offset);
>>      me->tx = NETMAP_TXRING(me->nifp, 0);
>>      me->rx = NETMAP_RXRING(me->nifp, 0);
>> -    return 0;
>> +
>> +    return;
>>
>>  error:
>>      close(me->fd);
>> -    return -1;
>> +    return;
>>  }
>
> Dead return, if you wanted to remove it.
>
> Minor enough that I'm okay with it whether or not you make those changes:
> Reviewed-by: Eric Blake <address@hidden>
>
> --
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>



-- 
Vincenzo Maffione



reply via email to

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