Re: [Qemu-devel] [PATCH v6 3/3] ivshmem: add check on protocol version in QEMU

2014-09-25 Thread David Marchand
ation that break things (user mixing and matching incompatible software). Ok, so how about keeping with this simple mechanism at the moment ? If this versionning system is too limited in the future, I think we will need a global rework on the protocol, anyway. -- David Marchand

Re: [Qemu-devel] [PATCH v2] ivshmem: use error_report

2014-09-19 Thread David Marchand
uncate shared file"); } } else if ((fd = shm_open(s->shmobj, O_CREAT|O_RDWR, S_IRWXU|S_IRWXG|S_IRWXO)) < 0) { -fprintf(stderr, "ivshmem: could not open shared file\n"); -exit(-1); +error_report("could not open shared file"); +exit(1); } if (check_shm_size(s, fd) == -1) { -exit(-1); +exit(1); } create_shared_memory_BAR(s, fd); Looks good to me (a comment on a dependency on Andreas patchset would have been good). Acked-by: David Marchand -- David Marchand

[Qemu-devel] [PATCH v6 0/3] ivshmem: update documentation, add client/server tools

2014-09-08 Thread David Marchand
se first patches are ok. -- David Marchand David Marchand (3): contrib: add ivshmem client and server docs: update ivshmem device spec ivshmem: add check on protocol version in QEMU Makefile|8 + configure |3 + contri

[Qemu-devel] [PATCH v6 2/3] docs: update ivshmem device spec

2014-09-08 Thread David Marchand
Add some notes on the parts needed to use ivshmem devices: more specifically, explain the purpose of an ivshmem server and the basic concept to use the ivshmem devices in guests. Move some parts of the documentation and re-organise it. Signed-off-by: David Marchand Reviewed-by: Claudio Fontana

[Qemu-devel] [PATCH v6 3/3] ivshmem: add check on protocol version in QEMU

2014-09-08 Thread David Marchand
ff-by: David Marchand --- contrib/ivshmem-client/ivshmem-client.c | 13 ++--- contrib/ivshmem-client/ivshmem-client.h |1 + contrib/ivshmem-server/ivshmem-server.c |9 + contrib/ivshmem-server/ivshmem-server.h |1 + docs/specs/ivshmem_device_spec.txt |9 ++--

[Qemu-devel] [PATCH v6 1/3] contrib: add ivshmem client and server

2014-09-08 Thread David Marchand
When using ivshmem devices, notifications between guests can be sent as interrupts using a ivshmem-server (typical use described in documentation). The client is provided as a debug tool. Signed-off-by: Olivier Matz Signed-off-by: David Marchand --- Makefile

Re: [Qemu-devel] [PATCH v5 3/3] ivshmem: add check on protocol version in QEMU

2014-09-05 Thread David Marchand
Hello Stefan, On 09/05/2014 12:29 PM, Stefan Hajnoczi wrote: On Thu, Sep 04, 2014 at 02:51:01PM +0200, David Marchand wrote: diff --git a/contrib/ivshmem-client/ivshmem-client.c b/contrib/ivshmem-client/ivshmem-client.c index ad210c8..0c4e016 100644 --- a/contrib/ivshmem-client/ivshmem

Re: [Qemu-devel] [PATCH v5 1/3] contrib: add ivshmem client and server

2014-09-05 Thread David Marchand
thing acceptable ? Do you have a better idea ? Thanks. -- David Marchand

[Qemu-devel] [PATCH v5 3/3] ivshmem: add check on protocol version in QEMU

2014-09-04 Thread David Marchand
ff-by: David Marchand --- contrib/ivshmem-client/ivshmem-client.c | 14 +++--- contrib/ivshmem-client/ivshmem-client.h |1 + contrib/ivshmem-server/ivshmem-server.c |7 + contrib/ivshmem-server/ivshmem-server.h |1 + docs/specs/ivshmem_device_spec.txt |9 --- hw

[Qemu-devel] [PATCH v5 1/3] contrib: add ivshmem client and server

2014-09-04 Thread David Marchand
When using ivshmem devices, notifications between guests can be sent as interrupts using a ivshmem-server (typical use described in documentation). The client is provided as a debug tool. Signed-off-by: Olivier Matz Signed-off-by: David Marchand --- Makefile

[Qemu-devel] [PATCH v5 2/3] docs: update ivshmem device spec

2014-09-04 Thread David Marchand
Add some notes on the parts needed to use ivshmem devices: more specifically, explain the purpose of an ivshmem server and the basic concept to use the ivshmem devices in guests. Move some parts of the documentation and re-organise it. Signed-off-by: David Marchand Reviewed-by: Claudio Fontana

[Qemu-devel] [PATCH v5 0/3] ivshmem: update documentation, add client/server tools

2014-09-04 Thread David Marchand
tfd, the lack of irqfd support) and some parts of the ivshmem code clearly need cleanup. I will try to address this in future patches when these first patches are ok. -- David Marchand David Marchand (3): contrib: add ivshmem client and server docs: update ivshmem device spec ivshmem: add c

Re: [Qemu-devel] [PATCH v4 00/14] ivshmem: update documentation, add client/server tools

2014-09-03 Thread David Marchand
Hello Eric, On 09/02/2014 10:31 PM, Eric Blake wrote: On 09/02/2014 09:25 AM, David Marchand wrote: Here is a patchset containing an update on ivshmem specs documentation and importing ivshmem server and client tools. These tools have been written from scratch and are not related to what is

[Qemu-devel] [PATCH v4 14/14] ivshmem: add check on protocol version in QEMU

2014-09-02 Thread David Marchand
ff-by: David Marchand --- contrib/ivshmem-client/ivshmem-client.c | 14 +++--- contrib/ivshmem-client/ivshmem-client.h |1 + contrib/ivshmem-server/ivshmem-server.c |7 + contrib/ivshmem-server/ivshmem-server.h |1 + docs/specs/ivshmem_device_spec.txt |9 --- hw

[Qemu-devel] [PATCH v4 13/14] contrib/ivshmem-server: align server default parameter values

2014-09-02 Thread David Marchand
ivshmem server should use the same default values as hw/misc/ivshmem. Update accordingly. Signed-off-by: David Marchand --- contrib/ivshmem-server/main.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/ivshmem-server/main.c b/contrib/ivshmem-server/main.c

[Qemu-devel] [PATCH v4 11/14] contrib/ivshmem-*: rework error handling

2014-09-02 Thread David Marchand
Following Gonglei comments, rework error handling using goto. Signed-off-by: David Marchand --- contrib/ivshmem-client/ivshmem-client.c | 17 - contrib/ivshmem-server/ivshmem-server.c | 19 ++- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a

[Qemu-devel] [PATCH v4 10/14] contrib/ivshmem-server: fix mem leak on error

2014-09-02 Thread David Marchand
Signed-off-by: David Marchand --- contrib/ivshmem-server/ivshmem-server.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/ivshmem-server/ivshmem-server.c b/contrib/ivshmem-server/ivshmem-server.c index 15d468c..4732dab 100644 --- a/contrib/ivshmem-server/ivshmem

[Qemu-devel] [PATCH v4 07/14] contrib/ivshmem-*: add missing const and static attrs

2014-09-02 Thread David Marchand
Signed-off-by: David Marchand --- contrib/ivshmem-client/main.c |6 +++--- contrib/ivshmem-server/main.c |8 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/contrib/ivshmem-client/main.c b/contrib/ivshmem-client/main.c index f8a7b66..a8e1586 100644 --- a/contrib

[Qemu-devel] [PATCH v4 12/14] contrib/ivshmem-*: various fixes

2014-09-02 Thread David Marchand
More fixes following Gonglei comments: - add a missing \n in a debug message. - add an explicit initialisation of sock_fd. - fix a check on vector index. Signed-off-by: David Marchand --- contrib/ivshmem-client/ivshmem-client.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff

[Qemu-devel] [PATCH v4 05/14] contrib/ivshmem-*: switch to QEMU headers

2014-09-02 Thread David Marchand
Reuse parsers from QEMU, C99 boolean. Signed-off-by: David Marchand --- contrib/ivshmem-client/ivshmem-client.c | 12 + contrib/ivshmem-client/ivshmem-client.h |4 +- contrib/ivshmem-client/main.c | 12 + contrib/ivshmem-server/ivshmem-server.c | 14 +- contrib

[Qemu-devel] [PATCH v4 09/14] contrib/ivshmem-*: switch to g_malloc0/g_free

2014-09-02 Thread David Marchand
Signed-off-by: David Marchand --- contrib/ivshmem-client/ivshmem-client.c |9 ++--- contrib/ivshmem-server/ivshmem-server.c | 12 ++-- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/contrib/ivshmem-client/ivshmem-client.c b/contrib/ivshmem-client/ivshmem

[Qemu-devel] [PATCH v4 06/14] contrib/ivshmem-server: set client sockets as non blocking

2014-09-02 Thread David Marchand
Signed-off-by: David Marchand --- contrib/ivshmem-server/ivshmem-server.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/ivshmem-server/ivshmem-server.c b/contrib/ivshmem-server/ivshmem-server.c index 0afa6e8..e0d4d1d 100644 --- a/contrib/ivshmem-server/ivshmem

[Qemu-devel] [PATCH v4 01/14] contrib: add ivshmem client and server

2014-09-02 Thread David Marchand
When using ivshmem devices, notifications between guests can be sent as interrupts using a ivshmem-server (typical use described in documentation). The client is provided as a debug tool. Signed-off-by: Olivier Matz Signed-off-by: David Marchand --- contrib/ivshmem-client/Makefile

[Qemu-devel] [PATCH v4 08/14] contrib/ivshmem-*: plug client and server in QEMU top Makefile

2014-09-02 Thread David Marchand
Signed-off-by: David Marchand --- Makefile|8 configure |3 +++ contrib/ivshmem-client/Makefile | 29 - contrib/ivshmem-server/Makefile | 29 - 4 files changed, 11

[Qemu-devel] [PATCH v4 02/14] docs: update ivshmem device spec

2014-09-02 Thread David Marchand
Add some notes on the parts needed to use ivshmem devices: more specifically, explain the purpose of an ivshmem server and the basic concept to use the ivshmem devices in guests. Move some parts of the documentation and re-organise it. Signed-off-by: David Marchand Reviewed-by: Claudio Fontana

[Qemu-devel] [PATCH v4 04/14] contrib/ivshmem-*: reuse qemu/queue.h

2014-09-02 Thread David Marchand
Switch to qemu/queue.h strutures. Signed-off-by: David Marchand --- contrib/ivshmem-client/ivshmem-client.c | 17 contrib/ivshmem-client/ivshmem-client.h |7 --- contrib/ivshmem-server/ivshmem-server.c | 33 --- contrib/ivshmem-server

[Qemu-devel] [PATCH v4 03/14] contrib/ivshmem-*: comply with QEMU coding style

2014-09-02 Thread David Marchand
Fix coding style for structures. Signed-off-by: David Marchand --- contrib/ivshmem-client/ivshmem-client.c | 47 ++- contrib/ivshmem-client/ivshmem-client.h | 76 +++ contrib/ivshmem-client/main.c | 21 - contrib/ivshmem-server

[Qemu-devel] [PATCH v4 00/14] ivshmem: update documentation, add client/server tools

2014-09-02 Thread David Marchand
orry, no ASCII art here). By the way, there are still some functionnalities that need description (use of ioeventfd, the lack of irqfd support) and some parts of the ivshmem code clearly need cleanup. I will try to address this in future patches when these first patches are ok. -- David

Re: [Qemu-devel] [PATCH v3 2/2] docs: update ivshmem device spec

2014-09-01 Thread David Marchand
On 08/28/2014 11:49 AM, Stefan Hajnoczi wrote: On Tue, Aug 26, 2014 at 01:04:30PM +0200, Paolo Bonzini wrote: Il 26/08/2014 08:47, David Marchand ha scritto: Using a version message supposes we want to keep ivshmem-server and QEMU separated (for example, in two distribution packages) while we

Re: [Qemu-devel] [PATCH v3 2/2] docs: update ivshmem device spec

2014-08-25 Thread David Marchand
Hello Stefan, On 08/08/2014 05:02 PM, Stefan Hajnoczi wrote: On Fri, Aug 08, 2014 at 10:55:18AM +0200, David Marchand wrote: +For each client (QEMU processes) that connects to the server: +- the server assigns an ID for this client and sends this ID to him as the first + message, +- the

Re: [Qemu-devel] [PATCH v3 1/2] contrib: add ivshmem client and server

2014-08-18 Thread David Marchand
const struct ivshmem_client_peer *peer) +{ +unsigned vector; +int ret = 0; + +for (vector = 0; vector < peer->vectors_count; vector++) { +if (ivshmem_client_notify(client, peer, vector) < 0) { +ret = -1; The ret's value will be covered when multi clients failed. Do we need store the failed status for server?. It indicates that we could not notify *all* clients. Thanks Gonglei. -- David Marchand

Re: [Qemu-devel] [PATCH v3 1/2] contrib: add ivshmem client and server

2014-08-18 Thread David Marchand
On 08/08/2014 04:51 PM, Stefan Hajnoczi wrote: On Fri, Aug 08, 2014 at 10:55:17AM +0200, David Marchand wrote: Looks good, a few minor comments: diff --git a/contrib/ivshmem-client/Makefile b/contrib/ivshmem-client/Makefile new file mode 100644 index 000..eee97c6 --- /dev/null +++ b

Re: [Qemu-devel] [PATCH v3 0/2] ivshmem: update documentation, add client/server tools

2014-08-08 Thread David Marchand
started by only specifying -S /path/to/ivshmem_socket. We made comments into the source code, so I am not sure what could be added. What do you miss ? -- David Marchand

Re: [Qemu-devel] [PATCH v3 2/2] docs: update ivshmem device spec

2014-08-08 Thread David Marchand
Hello Claudio, On 08/08/2014 11:04 AM, Claudio Fontana wrote: On 08.08.2014 10:55, David Marchand wrote: Add some notes on the parts needed to use ivshmem devices: more specifically, explain the purpose of an ivshmem server and the basic concept to use the ivshmem devices in guests. Move some

[Qemu-devel] [PATCH v3 1/2] contrib: add ivshmem client and server

2014-08-08 Thread David Marchand
When using ivshmem devices, notifications between guests can be sent as interrupts using a ivshmem-server (typical use described in documentation). The client is provided as a debug tool. Signed-off-by: Olivier Matz Signed-off-by: David Marchand --- contrib/ivshmem-client/Makefile

[Qemu-devel] [PATCH v3 0/2] ivshmem: update documentation, add client/server tools

2014-08-08 Thread David Marchand
t need description (use of ioeventfd, the lack of irqfd support) and some parts of the ivshmem code clearly need cleanup. I will try to address this in future patches when these first patches are ok. -- David Marchand David Marchand (2): contrib: add ivshmem client and server docs: update ivshmem

[Qemu-devel] [PATCH v3 2/2] docs: update ivshmem device spec

2014-08-08 Thread David Marchand
Add some notes on the parts needed to use ivshmem devices: more specifically, explain the purpose of an ivshmem server and the basic concept to use the ivshmem devices in guests. Move some parts of the documentation and re-organise it. Signed-off-by: David Marchand --- docs/specs

Re: [Qemu-devel] [PATCH v2 1/2] contrib: add ivshmem client and server

2014-08-08 Thread David Marchand
le in the top-level directory. [...] Back from holidays, sorry for the late response. I will send a v3 for these issues. -- David Marchand

Re: [Qemu-devel] [PATCH v2 1/2] contrib: add ivshmem client and server

2014-07-21 Thread David Marchand
Hello Eric, On 07/21/2014 04:21 PM, Eric Blake wrote: On 07/20/2014 03:38 AM, David Marchand wrote: +# Copyright 2014 6WIND S.A. +# All rights reserved This file has no other license, and is therefore incompatible with GPLv2. You'll need to resubmit under an appropriately open li

[Qemu-devel] [PATCH v2 1/2] contrib: add ivshmem client and server

2014-07-20 Thread David Marchand
When using ivshmem devices, notifications between guests can be sent as interrupts using a ivshmem-server (typical use described in documentation). The client is provided as a debug tool. Signed-off-by: Olivier Matz Signed-off-by: David Marchand --- contrib/ivshmem-client/Makefile

[Qemu-devel] [PATCH v2 2/2] docs: update ivshmem device spec

2014-07-20 Thread David Marchand
Add some notes on the parts needed to use ivshmem devices: more specifically, explain the purpose of an ivshmem server and the basic concept to use the ivshmem devices in guests. Move some parts of the documentation and re-organise it. Signed-off-by: David Marchand --- docs/specs

[Qemu-devel] [PATCH v2 0/2] ivshmem: update documentation, add client/server tools

2014-07-20 Thread David Marchand
try to address this in future patches when these first patches are ok. -- David Marchand David Marchand (2): contrib: add ivshmem client and server docs: update ivshmem device spec contrib/ivshmem-client/Makefile | 26 ++ contrib/ivshmem-client/ivshmem-client.c

Re: [Qemu-devel] [PATCH 1/2] docs: update ivshmem device spec

2014-06-25 Thread David Marchand
"optional" section is a good idea too. I will work on this at my return. Anyway, thanks for the review. -- David Marchand On 06/23/2014 04:18 PM, Claudio Fontana wrote: Hi, we were reading through this quickly today, and these are some of the questions that we think can ca

[Qemu-devel] [PATCH 0/2] ivshmem: update documentation, add client/server tools

2014-06-20 Thread David Marchand
put them in contrib/ directory as the qemu-doc.texi was already telling the server was supposed to be there. -- David Marchand David Marchand (2): docs: update ivshmem device spec contrib: add ivshmem client and server contrib/ivshmem-client/Makefile | 26 ++ contrib/ivshmem-client

[Qemu-devel] [PATCH 2/2] contrib: add ivshmem client and server

2014-06-20 Thread David Marchand
When using ivshmem devices, notifications between guests can be sent as interrupts using a ivshmem-server (typical use described in documentation). The client is provided as a debug tool. Signed-off-by: David Marchand --- contrib/ivshmem-client/Makefile | 26 ++ contrib/ivshmem-client

[Qemu-devel] [PATCH 1/2] docs: update ivshmem device spec

2014-06-20 Thread David Marchand
Add some notes on the parts needed to use ivshmem devices: more specifically, explain the purpose of an ivshmem server and the basic concept to use the ivshmem devices in guests. Signed-off-by: David Marchand --- docs/specs/ivshmem_device_spec.txt | 41 ++-- 1

Re: [Qemu-devel] Why I advise against using ivshmem

2014-06-19 Thread David Marchand
ut ivshmem server, yes I will look at it. I will see what I can propose or if importing nahanni implementation as-is is the best solution. Anyway, first, documentation. -- David Marchand

Re: [Qemu-devel] Why I advise against using ivshmem

2014-06-18 Thread David Marchand
s using regular networking APIs. If you have access to source code, this should not be a problem. -- David Marchand

Re: [Qemu-devel] Why I advise against using ivshmem

2014-06-18 Thread David Marchand
to send a fix and I will review it. Please also see the bug fixes in the following unapplied patch: "[PATCH] ivshmem: fix potential OOB r/w access (#2)" by Sebastian Krahmer https://lists.gnu.org/archive/html/qemu-devel/2014-04/msg03538.html Thanks for the pointer. I'll check it. -- David Marchand

Re: [Qemu-devel] Why I advise against using ivshmem

2014-06-17 Thread David Marchand
inside the guest. Actually, you can avoid this memory copy using frameworks like DPDK. Unless someone steps up and maintains ivshmem, I think it should be deprecated and dropped from QEMU. Then I can maintain ivshmem for QEMU. If this is ok, I will send a patch for MAINTAINERS file. -- David

[Qemu-devel] [PATCH v2] char: fix avail_connections init in qemu_chr_open_eventfd()

2014-06-11 Thread David Marchand
rties". Fix this, by setting avail_connections to 1 in qemu_chr_open_eventfd(). Signed-off-by: David Marchand --- qemu-char.c |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) Changes since v1 - fix coding style issue (missing braces) -- David Marchand diff --git a/qemu-cha

[Qemu-devel] [PATCH] char: fix avail_connections init in qemu_chr_open_eventfd()

2014-06-11 Thread David Marchand
rties". Fix this, by setting avail_connections to 1 in qemu_chr_open_eventfd(). Signed-off-by: David Marchand --- qemu-char.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) No change since initial patch: http://patchwork.ozlabs.org/patch/316785/ I just rebased this patch

Re: [Qemu-devel] [PATCH RFC] char: fix avail_connections init in qemu_chr_open_eventfd()

2014-03-27 Thread David Marchand
On 02/21/2014 05:10 PM, David Marchand wrote: On Mon, Feb 17, 2014 at 12:52 PM, David Marchand mailto:david.march...@6wind.com>> wrote: Since this change has no impact, can it be pulled in current git tree ? ping http://patchwork.ozlabs.org/patch/316785/ ping -- David Marchand

Re: [Qemu-devel] [PATCH RFC] char: fix avail_connections init in qemu_chr_open_eventfd()

2014-02-21 Thread David Marchand
On Mon, Feb 17, 2014 at 12:52 PM, David Marchand wrote: > > Since this change has no impact, can it be pulled in current git tree ? > > ping http://patchwork.ozlabs.org/patch/316785/ -- David Marchand

Re: [Qemu-devel] [PATCH RFC] char: fix avail_connections init in qemu_chr_open_eventfd()

2014-02-17 Thread David Marchand
Hello all, On Fri, Feb 14, 2014 at 1:16 PM, David Marchand wrote: > > In HEAD, ivshmem seems to be the only place where qemu_chr_open_eventfd() > is used : > $ git grep qemu_chr_open_eventfd > hw/misc/ivshmem.c:chr = qemu_chr_open_eventfd(eventfd); > include/sysemu/char

Re: [Qemu-devel] [PATCH RFC] char: fix avail_connections init in qemu_chr_open_eventfd()

2014-02-14 Thread David Marchand
eventfd(eventfd); include/sysemu/char.h:CharDriverState *qemu_chr_open_eventfd(int eventfd); qemu-char.c:CharDriverState *qemu_chr_open_eventfd(int eventfd) I suppose my change is not that impacting :-) Regards, -- David Marchand

Re: [Qemu-devel] [PATCH RFC] char: fix avail_connections init in qemu_chr_open_eventfd()

2014-02-13 Thread David Marchand
Hello, Can someone take a look at my previous email and tell me if my patch is just wrong ? Thank you. -- David Marchand On Tue, Feb 4, 2014 at 10:17 PM, David Marchand wrote: > Hello, > > First of all, this is a pure RFC patch, I did not take too much time to > dig into > q

[Qemu-devel] [PATCH RFC] char: fix avail_connections init in qemu_chr_open_eventfd()

2014-02-04 Thread David Marchand
ns to 1 in qemu_chr_open_eventfd(). Signed-off-by: David Marchand --- qemu-char.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qemu-char.c b/qemu-char.c index 30c5a6a..c0adb04 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -2492,7 +2492,12 @@ static gboolean tcp_chr_read(