[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: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2 2/2] net: netmap: use error_setg_errno() in place of error_report() |
Date: |
Fri, 6 Nov 2015 08:35:50 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
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
signature.asc
Description: OpenPGP digital signature