From: Eric Blake <eblake@redhat.com>
To: Vincenzo Maffione <v.maffione@gmail.com>, qemu-devel@nongnu.org
Cc: jasowang@redhat.com, rizzo@iet.unipi.it, g.lettieri@iet.unipi.it,
armbru@redhat.com
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 [thread overview]
Message-ID: <563CC8D6.9070904@redhat.com> (raw)
In-Reply-To: <896ac39693833166f8ab806c557bc6552226a773.1446822384.git.v.maffione@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1541 bytes --]
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 <v.maffione@gmail.com>
> ---
> 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 <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2015-11-06 15:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-06 15:13 [Qemu-devel] [PATCH v2 0/2] Fix compilation of netmap backend Vincenzo Maffione
2015-11-06 15:13 ` [Qemu-devel] [PATCH v2 1/2] net: netmap: Fix compilation issue Vincenzo Maffione
2015-11-06 15:30 ` Eric Blake
2015-11-06 15:13 ` [Qemu-devel] [PATCH v2 2/2] net: netmap: use error_setg_errno() in place of error_report() Vincenzo Maffione
2015-11-06 15:35 ` Eric Blake [this message]
2015-11-09 18:47 ` Vincenzo Maffione
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=563CC8D6.9070904@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=g.lettieri@iet.unipi.it \
--cc=jasowang@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rizzo@iet.unipi.it \
--cc=v.maffione@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.