* [Qemu-devel] [PATCH v3 0/2] Fix compilation of netmap backend
@ 2015-11-10 9:47 Vincenzo Maffione
2015-11-10 9:47 ` [Qemu-devel] [PATCH v3 1/2] net: netmap: Fix compilation issue Vincenzo Maffione
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Vincenzo Maffione @ 2015-11-10 9:47 UTC (permalink / raw)
To: qemu-devel; +Cc: rizzo, jasowang, armbru, v.maffione, g.lettieri
This patch series adds some fixes to the netmap net backend. It contains
two changes:
(1) Fix compilation issue of netmap.c introduced by the reorganization
of struct NetClientOptions
(2) Address the FIXME comment that was asking to use error_setg()
variants in place of error_report()
CHANGELOG:
- removed dead return and use error_setg_file_open() in place
of error_setg_errno()
- I noticed that net_init_netmap() has to return int, so I restored
the return statements in that function
Vincenzo Maffione (2):
net: netmap: Fix compilation issue
net: netmap: use error_setg() helpers in place of error_report()
net/netmap.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
--
2.6.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH v3 1/2] net: netmap: Fix compilation issue
2015-11-10 9:47 [Qemu-devel] [PATCH v3 0/2] Fix compilation of netmap backend Vincenzo Maffione
@ 2015-11-10 9:47 ` Vincenzo Maffione
2015-11-10 9:47 ` [Qemu-devel] [PATCH v3 2/2] net: netmap: use error_setg() helpers in place of error_report() Vincenzo Maffione
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Vincenzo Maffione @ 2015-11-10 9:47 UTC (permalink / raw)
To: qemu-devel; +Cc: rizzo, jasowang, armbru, v.maffione, g.lettieri
Reorganization of struct NetClientOptions (commit e4ba22b) caused a
compilation failure of the netmap backend. This patch fixes the issue
by properly accessing the union field.
Signed-off-by: Vincenzo Maffione <v.maffione@gmail.com>
---
net/netmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netmap.c b/net/netmap.c
index 508b829..4197a9c 100644
--- a/net/netmap.c
+++ b/net/netmap.c
@@ -439,7 +439,7 @@ int net_init_netmap(const NetClientOptions *opts,
const char *name, NetClientState *peer, Error **errp)
{
/* FIXME error_setg(errp, ...) on failure */
- const NetdevNetmapOptions *netmap_opts = opts->netmap;
+ const NetdevNetmapOptions *netmap_opts = opts->u.netmap;
NetClientState *nc;
NetmapPriv me;
NetmapState *s;
--
2.6.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH v3 2/2] net: netmap: use error_setg() helpers in place of error_report()
2015-11-10 9:47 [Qemu-devel] [PATCH v3 0/2] Fix compilation of netmap backend Vincenzo Maffione
2015-11-10 9:47 ` [Qemu-devel] [PATCH v3 1/2] net: netmap: Fix compilation issue Vincenzo Maffione
@ 2015-11-10 9:47 ` Vincenzo Maffione
2015-11-10 15:15 ` [Qemu-devel] [PATCH for-2.5 v3 0/2] Fix compilation of netmap backend Eric Blake
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Vincenzo Maffione @ 2015-11-10 9:47 UTC (permalink / raw)
To: qemu-devel; +Cc: rizzo, jasowang, armbru, v.maffione, g.lettieri
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/netmap.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/net/netmap.c b/net/netmap.c
index 4197a9c..5558368 100644
--- a/net/netmap.c
+++ b/net/netmap.c
@@ -90,7 +90,7 @@ pkt_copy(const void *_src, void *_dst, int l)
* Open a netmap device. We assume there is only one queue
* (which is the case for the VALE bridge).
*/
-static int netmap_open(NetmapPriv *me)
+static void netmap_open(NetmapPriv *me, Error **errp)
{
int fd;
int err;
@@ -99,9 +99,8 @@ 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_file_open(errp, errno, me->fdname);
+ return;
}
memset(&req, 0, sizeof(req));
pstrcpy(req.nr_name, sizeof(req.nr_name), me->ifname);
@@ -109,15 +108,14 @@ static int netmap_open(NetmapPriv *me)
req.nr_version = NETMAP_API;
err = ioctl(fd, NIOCREGIF, &req);
if (err) {
- error_report("Unable to register %s: %s", me->ifname, strerror(errno));
+ error_setg_errno(errp, errno, "Unable to register %s", me->ifname);
goto error;
}
l = me->memsize = req.nr_memsize;
me->mem = mmap(0, l, PROT_WRITE | PROT_READ, MAP_SHARED, fd, 0);
if (me->mem == MAP_FAILED) {
- error_report("Unable to mmap netmap shared memory: %s",
- strerror(errno));
+ error_setg_errno(errp, errno, "Unable to mmap netmap shared memory");
me->mem = NULL;
goto error;
}
@@ -125,11 +123,11 @@ 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;
}
static void netmap_send(void *opaque);
@@ -438,9 +436,9 @@ static NetClientInfo net_netmap_info = {
int net_init_netmap(const NetClientOptions *opts,
const char *name, NetClientState *peer, Error **errp)
{
- /* FIXME error_setg(errp, ...) on failure */
const NetdevNetmapOptions *netmap_opts = opts->u.netmap;
NetClientState *nc;
+ Error *err = NULL;
NetmapPriv me;
NetmapState *s;
@@ -448,7 +446,9 @@ int net_init_netmap(const NetClientOptions *opts,
netmap_opts->has_devname ? netmap_opts->devname : "/dev/netmap");
/* Set default name for the port if not supplied. */
pstrcpy(me.ifname, sizeof(me.ifname), netmap_opts->ifname);
- if (netmap_open(&me)) {
+ netmap_open(&me, &err);
+ if (err) {
+ error_propagate(errp, err);
return -1;
}
/* Create the object. */
--
2.6.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.5 v3 0/2] Fix compilation of netmap backend
2015-11-10 9:47 [Qemu-devel] [PATCH v3 0/2] Fix compilation of netmap backend Vincenzo Maffione
2015-11-10 9:47 ` [Qemu-devel] [PATCH v3 1/2] net: netmap: Fix compilation issue Vincenzo Maffione
2015-11-10 9:47 ` [Qemu-devel] [PATCH v3 2/2] net: netmap: use error_setg() helpers in place of error_report() Vincenzo Maffione
@ 2015-11-10 15:15 ` Eric Blake
2015-11-10 15:49 ` [Qemu-devel] [PATCH " Markus Armbruster
2015-11-12 8:19 ` Jason Wang
4 siblings, 0 replies; 6+ messages in thread
From: Eric Blake @ 2015-11-10 15:15 UTC (permalink / raw)
To: Vincenzo Maffione, qemu-devel; +Cc: g.lettieri, rizzo, jasowang, armbru
[-- Attachment #1: Type: text/plain, Size: 941 bytes --]
On 11/10/2015 02:47 AM, Vincenzo Maffione wrote:
> This patch series adds some fixes to the netmap net backend. It contains
> two changes:
> (1) Fix compilation issue of netmap.c introduced by the reorganization
> of struct NetClientOptions
> (2) Address the FIXME comment that was asking to use error_setg()
> variants in place of error_report()
>
> CHANGELOG:
> - removed dead return and use error_setg_file_open() in place
> of error_setg_errno()
> - I noticed that net_init_netmap() has to return int, so I restored
> the return statements in that function
>
> Vincenzo Maffione (2):
> net: netmap: Fix compilation issue
> net: netmap: use error_setg() helpers in place of error_report()
Series belongs in 2.5.
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 --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH v3 0/2] Fix compilation of netmap backend
2015-11-10 9:47 [Qemu-devel] [PATCH v3 0/2] Fix compilation of netmap backend Vincenzo Maffione
` (2 preceding siblings ...)
2015-11-10 15:15 ` [Qemu-devel] [PATCH for-2.5 v3 0/2] Fix compilation of netmap backend Eric Blake
@ 2015-11-10 15:49 ` Markus Armbruster
2015-11-12 8:19 ` Jason Wang
4 siblings, 0 replies; 6+ messages in thread
From: Markus Armbruster @ 2015-11-10 15:49 UTC (permalink / raw)
To: Vincenzo Maffione; +Cc: g.lettieri, jasowang, rizzo, qemu-devel
Vincenzo Maffione <v.maffione@gmail.com> writes:
> This patch series adds some fixes to the netmap net backend. It contains
> two changes:
> (1) Fix compilation issue of netmap.c introduced by the reorganization
> of struct NetClientOptions
> (2) Address the FIXME comment that was asking to use error_setg()
> variants in place of error_report()
Series
Reviewed-by: Markus Armbruster <armbru@redhat.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH v3 0/2] Fix compilation of netmap backend
2015-11-10 9:47 [Qemu-devel] [PATCH v3 0/2] Fix compilation of netmap backend Vincenzo Maffione
` (3 preceding siblings ...)
2015-11-10 15:49 ` [Qemu-devel] [PATCH " Markus Armbruster
@ 2015-11-12 8:19 ` Jason Wang
4 siblings, 0 replies; 6+ messages in thread
From: Jason Wang @ 2015-11-12 8:19 UTC (permalink / raw)
To: Vincenzo Maffione, qemu-devel; +Cc: g.lettieri, rizzo, armbru
On 11/10/2015 05:47 PM, Vincenzo Maffione wrote:
> This patch series adds some fixes to the netmap net backend. It contains
> two changes:
> (1) Fix compilation issue of netmap.c introduced by the reorganization
> of struct NetClientOptions
> (2) Address the FIXME comment that was asking to use error_setg()
> variants in place of error_report()
>
> CHANGELOG:
> - removed dead return and use error_setg_file_open() in place
> of error_setg_errno()
> - I noticed that net_init_netmap() has to return int, so I restored
> the return statements in that function
>
> Vincenzo Maffione (2):
> net: netmap: Fix compilation issue
> net: netmap: use error_setg() helpers in place of error_report()
>
> net/netmap.c | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
I've picked this series in https://github.com/jasowang/qemu/commits/net
Thanks
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-11-12 8:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-10 9:47 [Qemu-devel] [PATCH v3 0/2] Fix compilation of netmap backend Vincenzo Maffione
2015-11-10 9:47 ` [Qemu-devel] [PATCH v3 1/2] net: netmap: Fix compilation issue Vincenzo Maffione
2015-11-10 9:47 ` [Qemu-devel] [PATCH v3 2/2] net: netmap: use error_setg() helpers in place of error_report() Vincenzo Maffione
2015-11-10 15:15 ` [Qemu-devel] [PATCH for-2.5 v3 0/2] Fix compilation of netmap backend Eric Blake
2015-11-10 15:49 ` [Qemu-devel] [PATCH " Markus Armbruster
2015-11-12 8:19 ` Jason Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).