[Qemu-devel] [PATCH 14/36] monitor: remove usage of generated marshal functions

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau Once the middle mode is removed, the generated marshal functions will no longer be exported. Signed-off-by: Marc-André Lureau --- monitor.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/monitor.c b/monitor.c index 7e8ad0c..410c3a

[Qemu-devel] [PATCH 09/36] qapi: remove qmp-events.txt

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau Move the examples in the json file with the rest of the documentation to avoid duplication. Signed-off-by: Marc-André Lureau --- docs/qmp/qmp-events.txt | 664 qapi/block-core.json| 59 - qapi/block.json

[Qemu-devel] [PATCH 16/36] qmp: register qapi commands (no middle mode)

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau The marshal functions are no longer exported, they are registered in the dispatch table instead. The following patches will make use of qmp_dispatch(). This patch temporarily breaks qmp/hmp commands. Signed-off-by: Marc-André Lureau --- Makefile | 2 +- qmp-

[Qemu-devel] [PATCH 13/36] build-sys: do not generate qmp-commands-old.h

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau It's static file now. Signed-off-by: Marc-André Lureau --- Makefile.target| 7 +- qmp-commands-old.h | 683 + qmp-commands.hx| 683 - 3 files changed, 685 i

[Qemu-devel] [PATCH 18/36] qapi: remove "middle" mode

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau Now that the register function is always generated, we can remove the so-called "middle" mode to the generator script. Signed-off-by: Marc-André Lureau --- scripts/qapi-commands.py | 29 + 1 file changed, 5 insertions(+), 24 deletions(-) dif

[Qemu-devel] [PATCH 19/36] qmp: implement qmp_query_commands without qmp_cmds

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau So we can get rid of the static qmp_cmds table. Signed-off-by: Marc-André Lureau --- monitor.c | 25 ++--- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/monitor.c b/monitor.c index bfa0329..a2eb228 100644 --- a/monitor.c +++ b/monit

[Qemu-devel] [PATCH 25/36] qmp: introduce async command type

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau Learn a new type of command, QmpCommandFuncAsync. They can return later thanks to QmpReturn. This commit introduces the new types and register functions. Signed-off-by: Marc-André Lureau --- include/qapi/qmp/dispatch.h | 5 + qapi/qmp-dispatch.c | 3 +++ q

[Qemu-devel] [PATCH 17/36] qmp: use qmp_dispatch()

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau Replace the old "middle mode" dispatch code using the manually maintained table by the one generated by qapi scripts. Signed-off-by: Marc-André Lureau --- monitor.c | 316 +++--- 1 file changed, 34 insertions(+), 2

[Qemu-devel] [PATCH 21/36] misc: spelling

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau --- monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor.c b/monitor.c index 4deef29..25f9608 100644 --- a/monitor.c +++ b/monitor.c @@ -306,7 +306,7 @@ static void monitor_flush_locked(Monitor *mon) return; }

[Qemu-devel] [PATCH 34/36] console: graphic_hw_update return true if async

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau Let the caller know if the update is immediate or async. Signed-off-by: Marc-André Lureau --- hw/display/qxl-render.c | 5 +++-- hw/display/qxl.c| 8 hw/display/qxl.h| 2 +- include/ui/console.h| 3 ++- ui/console.c| 14 +

[Qemu-devel] [PATCH 20/36] qmp: remove old qmp-commands table

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau The table is no longer used. Signed-off-by: Marc-André Lureau --- monitor.c | 7 - qmp-commands-old.h | 554 - 2 files changed, 561 deletions(-) delete mode 100644 qmp-commands-old.h diff --git a/monitor.c

[Qemu-devel] [PATCH 24/36] qmp: add QmpClient

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau Add a new QmpClient structure holding the dispatch return callback and the list of pending QmpReturns. When a client disconnects, call qmp_client_destroy(). This will remove all pending returns from the client list, and prevent a reply from being sent later to new clients

[Qemu-devel] [PATCH 22/36] qmp: teach qmp_dispatch() to take a pre-filled QDict

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau In order to prepare for the async support, give an optionnal qdict for the dispatch call to be used for the reply. The qemu monitor will have the request "id" pre-filled. Signed-off-by: Marc-André Lureau --- include/qapi/qmp/dispatch.h | 2 +- monitor.c

[Qemu-devel] [PATCH 36/36] console: add screendump-async

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau Learn a new async command to make a correct screendump. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1230527 Signed-off-by: Marc-André Lureau --- qapi-schema.json | 21 +++- ui/console.c | 59 +++

[Qemu-devel] [PATCH 26/36] qmp: check that async command have an 'id'

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau The async support mandates that request have an 'id' (see documentation in following patch). Signed-off-by: Marc-André Lureau --- qapi/qmp-dispatch.c | 5 + 1 file changed, 5 insertions(+) diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c index 83ecab5..73ba3a

[Qemu-devel] [PATCH 30/36] tests: change /0.15/* tests to /qmp/*

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau Presumably 0.15 was the version it was first introduced, but qmp keeps evolving. There is no point in having that version has test prefix, qmp makes more sense. Signed-off-by: Marc-André Lureau --- tests/test-qmp-commands.c | 10 +- 1 file changed, 5 insertions(

[Qemu-devel] [PATCH 28/36] scripts: ensure -async commands are declared async

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau We could have arbitrary async command name, but it make sense to use a specific name to avoid confusion. Signed-off-by: Marc-André Lureau --- scripts/qapi.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/qapi.py b/scripts/qapi.py index 96901ab..d614673 100

[Qemu-devel] [PATCH 27/36] scripts: learn 'async' qapi commands

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau Commands with the 'async' key will be registered as async type (see previous commit), and will allow a synchronous (in command cb) or asynchronous return (when ready, in idle etc). Ex: { 'command': 'foo-async, 'data': {'arg': 'str'}, async: true } Signed-off-by: Marc-And

[Qemu-devel] [PATCH 29/36] qapi: take 'id' from request

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau Copy 'id' from request to reply dict. This can be done earlier, such as done by the monitor (because the qemu monitor may reply directly without qmp_dispatch), but is now done as well in qmp_dispatch() as convenience for other users such as QGA and tests. Signed-off-by: M

[Qemu-devel] [PATCH 31/36] tests: add /qmp/dispatch_cmd_async test

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau Check that async disaptch works. Signed-off-by: Marc-André Lureau --- tests/qapi-schema/qapi-schema-test.json | 2 ++ tests/qapi-schema/qapi-schema-test.out | 5 +++ tests/test-qmp-commands.c | 61 + 3 files changed, 68 i

[Qemu-devel] [PATCH 23/36] qmp: use a return callback for the command reply

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau Introduce QmpDispatchReturn, a callback called when a command reply is ready to be sent. Future patches will extend the concept to allow async replies. QmpReturn and associated functions is used internally for sync fonctions, but will be the basis of a async context (the

[Qemu-devel] [PATCH 35/36] console: add graphic_hw_update_done()

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau Add a function to be called when an async graphic update is done. Signed-off-by: Marc-André Lureau --- hw/display/qxl-render.c | 9 +++-- include/ui/console.h| 1 + ui/console.c| 4 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a

[Qemu-devel] [PATCH 32/36] qmp: update qmp-spec about async capability

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- docs/qmp/qmp-spec.txt | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/qmp/qmp-spec.txt b/docs/qmp/qmp-spec.txt index 4c28cd9..f1af7f7 100644 --- a/docs/qmp/qmp-spec.txt +++ b/docs/qmp/qmp-sp

[Qemu-devel] [PATCH 33/36] monitor: add 'async' capability

2015-09-25 Thread marcandre . lureau
From: Marc-André Lureau Existing clients may not handle async replies very well. In order to avoid the potential issues, let's introduce a capability that the client must declare in order to make use of async commands. Eventually, client should already handle unexpected events after a command is

[Qemu-devel] [PATCH v6 02/24] configure: probe for memfd

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau Check if memfd_create() is part of system libc. Signed-off-by: Marc-André Lureau --- configure | 19 +++ 1 file changed, 19 insertions(+) diff --git a/configure b/configure index f14454e..5e77ed5 100755 --- a/configure +++ b/configure @@ -3486,6 +3486,2

[Qemu-devel] [PATCH v6 04/24] util: add linux-only memfd fallback

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau Implement memfd_create() fallback if not available in system libc. memfd_create() is still not included in glibc today, atlhough it's been available since Linux 3.17 in Oct 2014. memfd has numerous advantages over traditional shm/mmap for ipc memory sharing with fd handle

[Qemu-devel] [PATCH v6 08/24] vhost: add vhost_set_log_base op

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau Split VHOST_SET_LOG_BASE call in a seperate function callback, so that type safety works and more arguments can be added in the next patches. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-backend.c | 8 hw/virtio/vhost-user.c| 17 +++

[Qemu-devel] [PATCH v6 17/24] vhost user: add rarp sending after live migration for legacy guest

2015-09-30 Thread marcandre . lureau
From: Thibaut Collet A new vhost user message is added to allow QEMU to ask to vhost user backend to broadcast a fake RARP after live migration for guest without GUEST_ANNOUNCE capability. This new message is sent only if the backend supports the new VHOST_USER_PROTOCOL_F_RARP protocol feature.

[Qemu-devel] [PATCH v6 14/24] vhost-user: document migration log

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- docs/specs/vhost-user.txt | 48 +-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/docs/specs/vhost-user.txt b/docs/specs/vhost-user.txt index 4eadad1..e0292a0 100644 --- a/d

[Qemu-devel] [PATCH v6 19/24] vhost-user-test: remove useless static check

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- tests/vhost-user-test.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c index 88714ff..6662ca9 100644 --- a/tests/vhost-user-test.c +++ b/tests/vhost-user-test.c @@ -262,7 +262,6 @@

[Qemu-devel] [PATCH v6 01/24] vhost-user: unit test for new messages

2015-09-30 Thread marcandre . lureau
From: "Michael S. Tsirkin" Data is empty for now, but do make sure master sets the new feature bit flag. Signed-off-by: Michael S. Tsirkin --- tests/vhost-user-test.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c inde

[Qemu-devel] [PATCH v6 13/24] vhost: use a function for each call

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau Replace the generic vhost_call() by specific functions for each function call to help with type safety and changing arguments. While doing this, I found that "unsigned long long" and "uint64_t" were used interchangeably and causing compilation warnings, using uint64_t ins

[Qemu-devel] [PATCH v6 06/24] memfd: add fallback for memfd

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau Add an open/unlink/mmap fallback for system that do not support memfd. This patch may require additional SELinux policies to work for enforced systems, but should gracefully fail nonetheless. Signed-off-by: Marc-André Lureau --- util/memfd.c | 22 --

[Qemu-devel] [PATCH v6 00/24] vhost-user: add migration support

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau Hi, The following series implement shareable log for vhost-user to support memory tracking during live migration. On qemu-side, the solution is fairly straightfoward since vhost already supports the dirty log, only vhost-user couldn't access the log memory until then. Th

[Qemu-devel] [PATCH v6 15/24] net: add trace_vhost_user_event

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau Replace error_report() and use tracing instead. It's not an error to get a connection or a disconnection, so silence this and trace it instead. Signed-off-by: Marc-André Lureau --- net/vhost-user.c | 4 ++-- trace-events | 3 +++ 2 files changed, 5 insertions(+), 2

[Qemu-devel] [PATCH v6 10/24] vhost: alloc shareable log

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau If the backend is requires it, allocate shareable memory. vhost_log_get() now uses 2 globals "vhost_log" and "vhost_log_shm", that way there is a common non-shareable log and a common shareable one. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 57 ++

[Qemu-devel] [PATCH v6 05/24] util: add memfd helpers

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau Add qemu_memfd_alloc/free() helpers. The function helps to allocate and seal a memfd. Signed-off-by: Marc-André Lureau --- include/qemu/memfd.h | 4 util/memfd.c | 59 ++-- 2 files changed, 61 insertions(+),

[Qemu-devel] [PATCH v6 21/24] vhost-user-test: learn to tweak various qemu arguments

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau Add a new macro to make the qemu command line with other values of memory size, and specific chardev id. Signed-off-by: Marc-André Lureau --- tests/vhost-user-test.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/vhost-user-test

[Qemu-devel] [PATCH v6 23/24] vhost-user-test: check ownership during migration

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau Check that backend source and destination do not have simultaneous ownership during migration. Signed-off-by: Marc-André Lureau --- tests/vhost-user-test.c | 38 ++ 1 file changed, 38 insertions(+) diff --git a/tests/vhost-user-test.

[Qemu-devel] [PATCH v6 07/24] vhost: document log resizing

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index c0ed5b2..67e09fe 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -334,6 +334,8 @@ static inline void vhost_d

[Qemu-devel] [PATCH v6 03/24] linux-headers: add unistd.h

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau New syscalls are not yet widely distributed. Add them to qemu linux-headers include directory. Update based on v4.3-rc3 kernel headers. Exclude mips for now, which is more problematic due to extra header inclusion and probably unnecessary here. Signed-off-by: Marc-André

[Qemu-devel] [PATCH v6 22/24] vhost-user-test: add live-migration test

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau This test checks that the log fd is given to the migration source, and mark dirty pages during migration. Signed-off-by: Marc-André Lureau --- tests/vhost-user-test.c | 171 +++- 1 file changed, 168 insertions(+), 3 deletions(

[Qemu-devel] [PATCH v6 09/24] vhost-user: add vhost_user_requires_shm_log()

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau Check if the backend has VHOST_USER_PROTOCOL_F_LOG_SHMFD feature and require a shared log. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c| 14 -- include/hw/virtio/vhost-backend.h | 4 2 files changed, 16 insertions(+), 2 delet

[Qemu-devel] [PATCH v6 12/24] vhost-user: add a migration blocker

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau If VHOST_USER_PROTOCOL_F_LOG_SHMFD is not announced, block vhost-user migration. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c | 13 + 1 file changed, 13 insertions(+) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index cf14e38.

[Qemu-devel] [PATCH v6 11/24] vhost-user: send log shm fd along with log_base

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau Send the shm for the dirty pages logging if the backend supports VHOST_USER_PROTOCOL_F_LOG_SHMFD. Wait for a reply to make sure the old log is no longer used. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-backend.c | 3 ++- hw/virtio/vhost-user.c

[Qemu-devel] [PATCH v6 24/24] vhost-user: use an enum helper for features mask

2015-09-30 Thread marcandre . lureau
From: Thibaut Collet The VHOST_USER_PROTOCOL_FEATURE_MASK will be automatically updated when adding new features to the enum. Signed-off-by: Thibaut Collet [Adapted from mailing list discussion - Marc-André] Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c | 13 + 1 fil

[Qemu-devel] [PATCH v6 16/24] vhost user: add support of live migration

2015-09-30 Thread marcandre . lureau
From: Thibaut Collet Some vhost user backends are able to support live migration. To provide this service the following features must be added: 1. Add the VIRTIO_NET_F_GUEST_ANNOUNCE capability to vhost-net when netdev backend is vhost-user. 2. Provide a nop receive callback to vhost-user.

[Qemu-devel] [PATCH v6 18/24] vhost-user-test: move wait_for_fds() out

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau This function is a precondition for most vhost-user tests. Signed-off-by: Marc-André Lureau --- tests/vhost-user-test.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c index 77b7b68

[Qemu-devel] [PATCH v6 20/24] vhost-user-test: wrap server in TestServer struct

2015-09-30 Thread marcandre . lureau
From: Marc-André Lureau In the coming patches, a test will use several servers simultaneously. Wrap the server in a struct, out of the global scope. Signed-off-by: Marc-André Lureau --- tests/vhost-user-test.c | 146 ++-- 1 file changed, 92 insertion

[Qemu-devel] [PATCH v7 09/24] vhost: alloc shareable log

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau If the backend is requires it, allocate shareable memory. vhost_log_get() now uses 2 globals "vhost_log" and "vhost_log_shm", that way there is a common non-shareable log and a common shareable one. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 57 ++

[Qemu-devel] [PATCH v7 06/24] vhost: document log resizing

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index c0ed5b2..67e09fe 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -334,6 +334,8 @@ static inline void vhost_d

[Qemu-devel] [PATCH v7 19/24] vhost-user-test: move wait_for_fds() out

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau This function is a precondition for most vhost-user tests. Signed-off-by: Marc-André Lureau --- tests/vhost-user-test.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c index 56df5c

[Qemu-devel] [PATCH v7 20/24] vhost-user-test: remove useless static check

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- tests/vhost-user-test.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c index 827c0c4..4be5583 100644 --- a/tests/vhost-user-test.c +++ b/tests/vhost-user-test.c @@ -186,7 +186,6 @@

[Qemu-devel] [PATCH v7 03/24] util: add linux-only memfd fallback

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau Implement memfd_create() fallback if not available in system libc. memfd_create() is still not included in glibc today, atlhough it's been available since Linux 3.17 in Oct 2014. memfd has numerous advantages over traditional shm/mmap for ipc memory sharing with fd handle

[Qemu-devel] [PATCH v7 07/24] vhost: add vhost_set_log_base op

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau Split VHOST_SET_LOG_BASE call in a seperate function callback, so that type safety works and more arguments can be added in the next patches. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-backend.c | 8 hw/virtio/vhost-user.c| 17 +++

[Qemu-devel] [PATCH v7 00/24] vhost-user: add migration support

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau Hi, The following series implement shareable log for vhost-user to support memory tracking during live migration. On qemu-side, the solution is fairly straightfoward since vhost already supports the dirty log, only vhost-user couldn't access the log memory until then. Th

[Qemu-devel] [PATCH v7 08/24] vhost-user: add vhost_user_requires_shm_log()

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau Check if the backend has VHOST_USER_PROTOCOL_F_LOG_SHMFD feature and require a shared log. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c| 14 -- include/hw/virtio/vhost-backend.h | 4 2 files changed, 16 insertions(+), 2 delet

[Qemu-devel] [PATCH v7 22/24] vhost-user-test: learn to tweak various qemu arguments

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau Add a new macro to make the qemu command line with other values of memory size, and specific chardev id. Signed-off-by: Marc-André Lureau --- tests/vhost-user-test.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/tests/vh

[Qemu-devel] [PATCH v7 10/24] vhost-user: send log shm fd along with log_base

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau Send the shm for the dirty pages logging if the backend supports VHOST_USER_PROTOCOL_F_LOG_SHMFD. Wait for a reply to make sure the old log is no longer used. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-backend.c | 3 ++- hw/virtio/vhost-user.c

[Qemu-devel] [PATCH v7 01/24] configure: probe for memfd

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau Check if memfd_create() is part of system libc. Signed-off-by: Marc-André Lureau --- configure | 19 +++ 1 file changed, 19 insertions(+) diff --git a/configure b/configure index f14454e..5e77ed5 100755 --- a/configure +++ b/configure @@ -3486,6 +3486,2

[Qemu-devel] [PATCH v7 11/24] vhost-user: add a migration blocker

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau If VHOST_USER_PROTOCOL_F_LOG_SHMFD is not announced, block vhost-user migration. The blocker is removed in vhost_dev_cleanup(). Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c | 9 + hw/virtio/vhost.c | 16 2 files changed, 21

[Qemu-devel] [PATCH v7 04/24] util: add memfd helpers

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau Add qemu_memfd_alloc/free() helpers. The function helps to allocate and seal shared memory. Signed-off-by: Marc-André Lureau --- include/qemu/memfd.h | 4 +++ util/memfd.c | 75 ++-- 2 files changed, 77 insertion

[Qemu-devel] [PATCH v7 02/24] linux-headers: add unistd.h

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau New syscalls are not yet widely distributed. Add them to qemu linux-headers include directory. Update based on v4.3-rc3 kernel headers. Exclude mips for now, which is more problematic due to extra header inclusion and probably unnecessary here. Signed-off-by: Marc-André

[Qemu-devel] [PATCH v7 15/24] vhost user: add support of live migration

2015-10-01 Thread marcandre . lureau
From: Thibaut Collet Some vhost user backends are able to support live migration. To provide this service the following features must be added: 1. Add the VIRTIO_NET_F_GUEST_ANNOUNCE capability to vhost-net when netdev backend is vhost-user. 2. Provide a nop receive callback to vhost-user.

[Qemu-devel] [PATCH v7 05/24] util: add fallback for qemu_memfd_alloc()

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau Add an open/unlink/mmap fallback for system that do not support memfd (only available since 3.17, ~1y ago). This patch may require additional SELinux policies to work for enforced systems, but should fail gracefully in this case. Signed-off-by: Marc-André Lureau --- ut

[Qemu-devel] [PATCH v7 13/24] vhost-user: document migration log

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- docs/specs/vhost-user.txt | 48 +-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/docs/specs/vhost-user.txt b/docs/specs/vhost-user.txt index 4eadad1..e0292a0 100644 --- a/d

[Qemu-devel] [PATCH v7 23/24] vhost-user-test: add live-migration test

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau This test checks that the log fd is given to the migration source, and mark dirty pages during migration. Signed-off-by: Marc-André Lureau --- tests/vhost-user-test.c | 171 +++- 1 file changed, 169 insertions(+), 2 deletions(

[Qemu-devel] [PATCH v7 14/24] net: add trace_vhost_user_event

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau Replace error_report() and use tracing instead. It's not an error to get a connection or a disconnection, so silence this and trace it instead. Signed-off-by: Marc-André Lureau --- net/vhost-user.c | 4 ++-- trace-events | 3 +++ 2 files changed, 5 insertions(+), 2

[Qemu-devel] [PATCH v7 12/24] vhost: use a function for each call

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau Replace the generic vhost_call() by specific functions for each function call to help with type safety and changing arguments. While doing this, I found that "unsigned long long" and "uint64_t" were used interchangeably and causing compilation warnings, using uint64_t ins

[Qemu-devel] [PATCH v7 17/24] vhost-user: use an enum helper for features mask

2015-10-01 Thread marcandre . lureau
From: Thibaut Collet The VHOST_USER_PROTOCOL_FEATURE_MASK will be automatically updated when adding new features to the enum. Signed-off-by: Thibaut Collet [Adapted from mailing list discussion - Marc-André] Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c | 13 + 1 fil

[Qemu-devel] [PATCH v7 16/24] vhost user: add rarp sending after live migration for legacy guest

2015-10-01 Thread marcandre . lureau
From: Thibaut Collet A new vhost user message is added to allow QEMU to ask to vhost user backend to broadcast a fake RARP after live migration for guest without GUEST_ANNOUNCE capability. This new message is sent only if the backend supports the new VHOST_USER_PROTOCOL_F_RARP protocol feature.

[Qemu-devel] [PATCH v7 21/24] vhost-user-test: wrap server in TestServer struct

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau In the coming patches, a test will use several servers simultaneously. Wrap the server in a struct, out of the global scope. Signed-off-by: Marc-André Lureau --- tests/vhost-user-test.c | 139 +++- 1 file changed, 89 insertion

[Qemu-devel] [PATCH v7 18/24] vhost: add migration block if memfd failed

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c| 3 +++ include/qemu/memfd.h | 2 ++ util/memfd.c | 22 ++ 3 files changed, 27 insertions(+) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 1e8ee76..eaf8117 100644 --- a/h

[Qemu-devel] [PATCH v7 24/24] vhost-user-test: check ownership during migration

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau Check that backend source and destination do not have simultaneous ownership during migration. Signed-off-by: Marc-André Lureau --- tests/vhost-user-test.c | 38 ++ 1 file changed, 38 insertions(+) diff --git a/tests/vhost-user-test.

[Qemu-devel] [RFC PATCH] Add qemu .clang-format

2015-10-01 Thread marcandre . lureau
From: Marc-André Lureau clang-format is awesome to reflow your code according to qemu coding style in an editor (in the region you modify). (note: clang-tidy should be able to add missing braces around statements, but I haven't tried it, it's quite recent) Signed-off-by: Marc-André Lureau ---

[Qemu-devel] [PATCH v3 0/5] qga: add local tests on linux

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau v2->v3: - add patch to introduce g_assert_* from recent glib versions - check QGA_TEST_SIDE_EFFECTING environment variable instead of VM run - use base64 decoder/encoder functions instead of hardcoded strings - fix some copy/paste comment v1->v2: - do not loop forever whe

[Qemu-devel] [PATCH v3 3/5] qtest: add a few fd-level qmp helpers

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau Add a few functions to interact with qmp via a simple fd. Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth --- tests/libqtest.c | 45 + tests/libqtest.h | 7 +++ 2 files changed, 48 insertions(+), 4 deletions(-

[Qemu-devel] [PATCH v3 4/5] glib-compat: add 2.38/2.40/2.46 asserts

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau Those are mostly useful for writing tests. Signed-off-by: Marc-André Lureau --- include/glib-compat.h | 61 +++ 1 file changed, 61 insertions(+) diff --git a/include/glib-compat.h b/include/glib-compat.h index 318e000..fb

[Qemu-devel] [PATCH v3 2/5] qga: do not override configuration verbosity

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau Move the default verbosity settings before loading the configuration file, or it will overwrite it. Found thanks to writing qga tests :) Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth --- qga/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[Qemu-devel] [PATCH v3 1/5] qga: add QGA_CONF environment variable

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau Having a environment variable allows to override default configuration path, useful for testing. Note that this can't easily be an argument, since loading config is done before parsing the arguments. Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth --- qga/ma

[Qemu-devel] [PATCH v3 5/5] tests: add a local test for guest agent

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau Add some local guest agent tests, as it is better than nothing, only when CONFIG_POSIX (using unix sockets). With the QGA_TEST_SIDE_EFFECTING environment variable, it will include tests with side effects, such as freezing/thawing the FS or changing the time. (a better te

[Qemu-devel] [PATCH v5 01/48] char: add qemu_chr_free()

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau If a chardev is allowed to be created outside of QMP, then it must be also possible to free it. This is useful for ivshmem that creates chardev anonymously and must be able to free them. Signed-off-by: Marc-André Lureau Acked-by: Paolo Bonzini Reviewed-by: Claudio Fonta

[Qemu-devel] [PATCH v5 00/48] ivshmem improvements

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau Hi, This series is mostly about adding the client/server code from David Marchand, code cleanups, and little improvements and fixes for ivshmem. Finally there is some ivshmem tests (they work fine without kvm btw). Git: https://github.com/elmarco/qemu.git ivshmem branch

[Qemu-devel] [PATCH v5 03/48] ivhsmem: read do not accept more than sizeof(long)

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau ivshmem_read() only reads sizeof(long) from the input buffer. Accepting more could lead to fifo8 abort() on 32bit systems if fifo is not empty. A following patch will change the protocol to 64-bit little-endian instead. Signed-off-by: Marc-André Lureau Reviewed-by: Cla

[Qemu-devel] [PATCH v5 04/48] ivshmem: fix number of bytes to push to fifo

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau If the fifo has 0 bytes, and the read is of size 1, the call to fifo8_push_all() will copy off boundary data. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc

[Qemu-devel] [PATCH v5 08/48] ivshmem: remove useless doorbell field

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 7138b8d..dea4096 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -71,7 +71,6 @@ t

[Qemu-devel] [PATCH v5 07/48] ivshmem: remove superflous ivshmem_attr field

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index fbeb731..7138b8d 100644 --- a/hw/misc/ivshmem.c +++ b/hw/

[Qemu-devel] [PATCH v5 02/48] msix: add VMSTATE_MSIX_TEST

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau ivshmem is going to use MSIX state conditionally. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- include/hw/pci/msix.h | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/include/hw/pci/msix.h b/include/hw/pci/msix.h

[Qemu-devel] [PATCH v5 05/48] ivshmem: factor out the incoming fifo handling

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau Make a new function fifo_update_and_get() that can be reused by other functions (in next commits). Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 59 --- 1 file changed, 39 inser

[Qemu-devel] [PATCH v5 09/48] ivshmem: more qdev conversion

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau Use the latest qemu device modeling API, in particular, convert to realize to fix the error handling; right now a botched device_add ivhsmem command kills the VM. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 119

[Qemu-devel] [PATCH v5 18/48] ivshmem: improve error handling

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau The test whether the chardev is an AF_UNIX socket rejects "-chardev socket,id=chr0,path=/tmp/foo,server,nowait -device ivshmem,chardev=chr0", but fails to explain why. Use an explicit error on why a chardev may be rejected. Signed-off-by: Marc-André Lureau Reviewed-by:

[Qemu-devel] [PATCH v5 10/48] ivshmem: remove last exit(1)

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau Failing to create a chardev shouldn't be fatal. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 62547c0..e7224b9 100644 -

[Qemu-devel] [PATCH v5 11/48] ivshmem: limit maximum number of peers to G_MAXUINT16

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau Limit the maximum number of peers to MAXUINT16. This is more realistic and better matches the limit of the doorbell register. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)

[Qemu-devel] [PATCH v5 06/48] ivshmem: remove unnecessary dup()

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau qemu_chr_fe_get_msgfd() transfers ownership, there is no need to dup the fd. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/hw/misc/ivshmem.c

[Qemu-devel] [PATCH v5 13/48] ivshmem: allocate eventfds in resize_peers()

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau It simplifies a bit the code to allocate the array when setting the number of peers instead of lazily when receiving the first vector. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 11 ++- 1 file changed, 2 insertions(+),

[Qemu-devel] [PATCH v5 22/48] ivshmem: use common is_power_of_2()

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau The common version correctly checks for 0 value case. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index fbb6f40..e678b

[Qemu-devel] [PATCH v5 27/48] ivshmem: fix pci_ivshmem_exit()

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau Free all objects owned by the device, making sure the device is free, fixing hot-unplug. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 38 +++--- 1 file changed, 35 insertions(+), 3 deletions(-) d

[Qemu-devel] [PATCH v5 14/48] ivshmem: remove useless ivshmem_update_irq() val argument

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau val isn't used in ivshmem_update_irq() function. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 19640bb..374ecff

[Qemu-devel] [PATCH v5 17/48] ivshmem: improve debug messages

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau Some misc improvements to ivshmem debug. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index c4c130d..50f9c8f 100644 --- a/hw/misc/ivshmem.c +++

[Qemu-devel] [PATCH v5 12/48] ivshmem: simplify around increase_dynamic_storage()

2015-10-02 Thread marcandre . lureau
From: Marc-André Lureau Set the number of peers and array allocation in a single place. Rename to better reflect the function content. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 27 +++ 1 file changed, 11 insertions(+), 16 del

  1   2   3   4   5   6   7   8   9   10   >