[Qemu-devel] [PATCHv2] tests: re-enable vhost-user-test

2015-10-26 Thread marcandre . lureau
From: Marc-André Lureau Commit 7fe34ca9c2e actually disabled vhost-user-test altogether, since CONFIG_VHOST_NET is a per-target config variable. tests/vhost-user-test is already x86/x64 softmmu specific test, in order to enable it correctly, kvm & vhost-net are also conditions. To check that, se

[Qemu-devel] [RFC 2/3] qga: implement get-memory-info for Linux

2015-07-31 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- qga/commands-posix.c | 94 ++-- qga/main.c | 28 2 files changed, 120 insertions(+), 2 deletions(-) diff --git a/qga/commands-posix.c b/qga/commands-posix.c i

[Qemu-devel] [RFC 0/3] qga: add guest-get-memory-info (for 2.5)

2015-07-31 Thread marcandre . lureau
From: Marc-André Lureau This series implement a new qemu guest agent command to get memory information from the guest. This is based on ovirt-guest-agent "memory-stats" message. I couldn't find documentation for the ovirt message, but the list of fields are summarized in this test https://github

[Qemu-devel] [RFC 1/3] qga: add guest-get-memory-info json

2015-07-31 Thread marcandre . lureau
From: Marc-André Lureau Define a new guest agent message, and document it. Signed-off-by: Marc-André Lureau --- qga/commands-posix.c | 12 qga/commands-win32.c | 6 ++ qga/qapi-schema.json | 48 3 files changed, 66 insertions(+

[Qemu-devel] [RFC 3/3] qga: implement get-memory-info on win32

2015-07-31 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- configure| 1 + qga/commands-win32.c | 164 ++- 2 files changed, 163 insertions(+), 2 deletions(-) diff --git a/configure b/configure index c5c4b82..82ee185 100755 --- a/c

[Qemu-devel] [PATCH v3 00/16] vhost-user: add migration log support (for 2.5)

2015-08-06 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 v3 04/16] vhost: alloc shareable log

2015-08-06 Thread marcandre . lureau
From: Marc-André Lureau If the backend is of type VHOST_BACKEND_TYPE_USER, allocate shareable memory. Note: vhost_log_get() can use a global "vhost_log" that can be shared by several vhost devices. We may want instead a common shareable log and a common non-shareable one. Signed-off-by: Marc-An

[Qemu-devel] [PATCH v3 08/16] vhost-user: send log shm fd along with log_base

2015-08-06 Thread marcandre . lureau
From: Marc-André Lureau Send the shm for the dirty pages logging if the backend support VHOST_USER_PROTOCOL_F_LOG_SHMFD. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c | 16 ++-- hw/virtio/vhost.c | 5 +++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff

[Qemu-devel] [PATCH v3 11/16] vhost-user-test: move wait_for_fds() out

2015-08-06 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 228acb6

[Qemu-devel] [PATCH v3 14/16] vhost-user-test: learn to tweak various qemu arguments

2015-08-06 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 v3 05/16] vhost: document log resizing

2015-08-06 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 862e786..057d548 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -357,6 +357,8 @@ static inline void vhost_d

[Qemu-devel] [PATCH v3 02/16] util: add linux-only memfd fallback

2015-08-06 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 v3 01/16] configure: probe for memfd

2015-08-06 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 cd219d8..3dcbd3e 100755 --- a/configure +++ b/configure @@ -3405,6 +3405,2

[Qemu-devel] [PATCH v3 16/16] vhost-user-test: check ownership during migration

2015-08-06 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 v3 03/16] util: add memfd helpers

2015-08-06 Thread marcandre . lureau
From: Marc-André Lureau Add qemu_memfd_alloc/free() helpers. The function helps to allocate and seal a memfd, and implements an open/unlink/mmap fallback for system that do not support memfd. Signed-off-by: Marc-André Lureau --- include/qemu/memfd.h | 4 +++ util/memfd.c | 74 +++

[Qemu-devel] [PATCH v3 10/16] net: add trace_vhost_user_event

2015-08-06 Thread marcandre . lureau
From: Marc-André Lureau Replace error_report() and use tracing instead. Signed-off-by: Marc-André Lureau --- net/vhost-user.c | 5 +++-- trace-events | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/net/vhost-user.c b/net/vhost-user.c index dc0aa4c..5657992 100644 --

[Qemu-devel] [PATCH v3 15/16] vhost-user-test: add live-migration test

2015-08-06 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 | 162 +++- 1 file changed, 159 insertions(+), 3 deletions(

[Qemu-devel] [PATCH v3 07/16] vhost-user: start and end the va_list

2015-08-06 Thread marcandre . lureau
From: Marc-André Lureau Use a common start and exit branch to open and cleanup the va_list. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c | 32 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhos

[Qemu-devel] [PATCH v3 13/16] vhost-user-test: wrap server in TestServer struct

2015-08-06 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 v3 06/16] vhost: use variable arguments for vhost_call()

2015-08-06 Thread marcandre . lureau
From: Marc-André Lureau It is useful to pass extra arguments to the funtions, for various backend needs. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-backend.c | 4 ++-- hw/virtio/vhost-user.c| 4 ++-- include/hw/virtio/vhost-backend.h | 6 -- 3 files changed, 8

[Qemu-devel] [PATCH v3 12/16] vhost-user-test: remove useless static check

2015-08-06 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 551a664..68badf9 100644 --- a/tests/vhost-user-test.c +++ b/tests/vhost-user-test.c @@ -262,7 +262,6 @@

[Qemu-devel] [PATCH v3 09/16] vhost-user: document migration log

2015-08-06 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- docs/specs/vhost-user.txt | 42 ++ 1 file changed, 42 insertions(+) diff --git a/docs/specs/vhost-user.txt b/docs/specs/vhost-user.txt index 0062baa..0322bcf 100644 --- a/docs/specs/vhost-user.

[Qemu-devel] [PATCH] monitor: remove QAPI_EVENT_VSERPORT_CHANGE throttle

2015-08-11 Thread marcandre . lureau
From: Marc-André Lureau QAPI_EVENT_VSERPORT_CHANGE reports changes of a virtio serial port state. However, the events may be for different ports, but the throttle mechanism may replace the event for a different port, since it only checks the event type. libvirt relies on a correct state to be re

[Qemu-devel] [RFC 0/3] monitor: throttle VSERPORT_CHANGED by "id"

2015-08-12 Thread marcandre . lureau
From: Marc-André Lureau QAPI_EVENT_VSERPORT_CHANGE reports changes of a virtio serial port state. However, the events may be for different ports, but the throttle mechanism may replace the event for a different port, since it only checks the event type. The following series implements throttling

[Qemu-devel] [RFC 2/3] monitor: throttle QAPI_EVENT_VSERPORT_CHANGE by "id"

2015-08-12 Thread marcandre . lureau
From: Marc-André Lureau Use a hash table to lookup the pending event corresponding to the "id" field. The hash table may grow without limit here, the following patch will add some cleaning. Signed-off-by: Marc-André Lureau --- monitor.c | 104 ++-

[Qemu-devel] [RFC 3/3] monitor: remove old entries from event hash table

2015-08-12 Thread marcandre . lureau
From: Marc-André Lureau Do not let the hash table grow without limit, schedule a cleanup for outdated event. Signed-off-by: Marc-André Lureau --- monitor.c | 51 --- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monit

[Qemu-devel] [RFC 1/3] monitor: split MonitorQAPIEventState

2015-08-12 Thread marcandre . lureau
From: Marc-André Lureau Create a seperate pending event structure MonitorQAPIEventPending. Use a MonitorQAPIEventDelay callback to handle the delaying. This allows other implementations of throttling. Signed-off-by: Marc-André Lureau --- monitor.c| 124 +

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

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau val isn't used in ivshmem_update_irq() function. Signed-off-by: Marc-André Lureau --- 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 e890967..3398a57 100644 --- a/hw/misc/ivshmem.

[Qemu-devel] [PATCH v3 25/46] ivshmem: check shm isn't already initialized

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau The server should not change the shm, and this isn't handled by qemu. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index c80503d..493e3c7 100644 --- a/hw/misc/ivshm

[Qemu-devel] [PATCH v3 34/46] ivshmem-server: fix hugetlbfs support

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau As pointed out on the ML by Andrew Jones, glibc no longer permits creating POSIX shm on hugetlbfs directly. When given a hugetlbfs path, create a shareable file there. Signed-off-by: Marc-André Lureau --- contrib/ivshmem-server/ivshmem-server.c | 40

[Qemu-devel] [PATCH v3 02/46] msix: add VMSTATE_MSIX_TEST

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau ivshmem is going to use MSIX state conditionally. Signed-off-by: Marc-André Lureau --- 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 index 954d82b..72e5f93 100644

[Qemu-devel] [PATCH v3 16/46] ivshmem: remove max_peer field

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau max_peer isn't really useful, it tracks the maximum received VM id, but that quickly matches nb_peers, the size of the peers array. Since VM come and go, there might be sparse peers so it doesn't help much in general to have this value around. Signed-off-by: Marc-André Lu

[Qemu-devel] [PATCH v3 08/46] ivshmem: remove useless doorbell field

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 5e4b2cc..1b8204e 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -71,7 +71,6 @@ typedef struct IVShmemState {

[Qemu-devel] [PATCH v3 01/46] char: add qemu_chr_free()

2015-09-15 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 --- include/sysemu/char.h

[Qemu-devel] [PATCH v3 27/46] ivshmem: fix pci_ivshmem_exit()

2015-09-15 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 --- hw/misc/ivshmem.c | 38 +++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/hw/misc/ivshmem.c

[Qemu-devel] [PATCH v3 00/46] ivshmem improvements (please review)

2015-09-15 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). The first two series didn't get much feedback, and the t

[Qemu-devel] [PATCH v3 19/46] ivshmem: print error on invalid peer id

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau The server shouldn't send invalid peer id, so print an error if it's the case. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 52e1e63..1c98ec3 100644 --- a/hw/misc/iv

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

2015-09-15 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 --- hw/misc/ivshmem.c | 59 --- 1 file changed, 39 insertions(+), 20 deletions(-) dif

[Qemu-devel] [PATCH v3 15/46] ivshmem: initialize max_peer to -1

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau There is no peer when device is initialized, do not let doorbell for inexisting peer 0. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 3398a57..07

[Qemu-devel] [PATCH v3 22/46] ivshmem: use common is_power_of_2()

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau The common version correctly checks for 0 value case. Signed-off-by: Marc-André Lureau --- 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 e391396..f40bc98 100644 --- a/hw/misc/ivshme

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

2015-09-15 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. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw

[Qemu-devel] [PATCH v3 41/46] ivshmem: do not keep shm_fd open

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau Remove shm_fd from device state, closing it as early as possible to avoid leaks. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 4adcac5

[Qemu-devel] [PATCH v3 17/46] ivshmem: improve debug messages

2015-09-15 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 cda7dce..084bc89 100644 --- a/hw/misc/ivshmem.c +++

[Qemu-devel] [PATCH v3 26/46] ivshmem: add device description

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 493e3c7..5e96360 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -922,6 +922,7 @@ static void ivshmem_class_in

[Qemu-devel] [PATCH v3 23/46] ivshmem: migrate with VMStateDescription

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau load_state_old() is used to keep compatibility with version 0. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 141 ++ 1 file changed, 88 insertions(+), 53 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/mis

[Qemu-devel] [PATCH v3 12/46] ivshmem: simplify around increase_dynamic_storage()

2015-09-15 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 --- hw/misc/ivshmem.c | 27 +++ 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/hw/mis

[Qemu-devel] [PATCH v3 46/46] ivshmem: use kvm irqfd for msi notifications

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau Use irqfd for improving context switch when notifying the guest. If the host doesn't support kvm irqfd, regular msi notifications are still supported. Note: the ivshmem implementation doesn't allow switching between MSI and IO interrupts, this patch doesn't either. Signe

[Qemu-devel] [PATCH v3 20/46] ivshmem: simplify a bit the code

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau Use some more explicit variables to simplify the code. nth_eventfd variable is the current eventfd to be manipulated. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a

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

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau Failing to create a chardev shouldn't be fatal. Signed-off-by: Marc-André Lureau --- 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 3af73a5..7ba93c0 100644 --- a/hw/misc/ivshmem.c +++ b/h

[Qemu-devel] [PATCH v3 30/46] ivshmem: reset mask on device reset

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau The interrupt mask is a state value, it should be reset, like the value. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 63e4c4f..6c0a829 100644 --- a/hw/misc/ivshmem.

[Qemu-devel] [PATCH v3 21/46] ivshmem: use common return

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau Both if branches return, move this out to common end. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index a60454f..e391396 100644 --- a/hw/misc/ivshmem.c

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

2015-09-15 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 --- hw/misc/ivshmem.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/misc/ivshmem.

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

2015-09-15 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 --- hw/misc/ivshmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c

[Qemu-devel] [PATCH v3 18/46] ivshmem: improve error

2015-09-15 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 --- hw/misc/

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

2015-09-15 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 --- hw/misc/ivshmem.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/

[Qemu-devel] [PATCH v3 07/46] ivshmem: remove superflous ivshmem_attr field

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- 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..5e4b2cc 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -85,7 +85,6

[Qemu-devel] [PATCH v3 09/46] ivshmem: more qdev conversion

2015-09-15 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 --- hw/misc/ivshmem.c | 119 +++---

[Qemu-devel] [PATCH v3 28/46] ivshmem: replace 'guest' for 'peer' appropriately

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau The terms 'guest' and 'peer' are used sometime interchangeably which may be confusing. Instead, use 'peer' for the remote instances of ivshmem clients, and 'guest' for the local VM. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 28 ++--

[Qemu-devel] [PATCH v3 31/46] contrib: add ivshmem client and server

2015-09-15 Thread marcandre . lureau
From: 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 [fix a valgrind warning, op

[Qemu-devel] [PATCH v3 24/46] ivshmem: shmfd can be 0

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau 0 is a valid fd value, so change conditions and set -1 value early Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 14c7d58..c80503d 100644 --- a/

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

2015-09-15 Thread marcandre . lureau
From: 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

[Qemu-devel] [PATCH v3 39/46] qtest: add qtest_add_abrt_handler()

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau Allow a test to add abort handlers, use GHook for all handlers. There is currently no way to remove a handler, but it could be later added if needed. Signed-off-by: Marc-André Lureau --- tests/libqtest.c | 37 - tests/libqtest.h | 2

[Qemu-devel] [PATCH v3 29/46] ivshmem: error on too many eventfd received

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau The number of eventfd that can be handled per peer is limited by the number of vectors. Return an error when receiving too many of them. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/misc/ivshmem.c b

[Qemu-devel] [PATCH v3 32/46] ivshmem-client: check the number of vectors

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau Check the number of vectors received from the server, to avoid out of bound array access. Signed-off-by: Marc-André Lureau --- contrib/ivshmem-client/ivshmem-client.c | 4 1 file changed, 4 insertions(+) diff --git a/contrib/ivshmem-client/ivshmem-client.c b/cont

[Qemu-devel] [PATCH v3 37/46] contrib: remove unnecessary strdup()

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau getopt() optarg points to argv memory, no need to dup those values, fixes small leaks detected by clang-analyzer. Signed-off-by: Marc-André Lureau --- contrib/ivshmem-client/main.c | 2 +- contrib/ivshmem-server/main.c | 6 +++--- 2 files changed, 4 insertions(+), 4 del

[Qemu-devel] [PATCH v3 33/46] ivshmem-server: use a uint16 for client ID

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau In practice, the number of VM is limited to MAXUINT16 in ivshmem, so use the same limit on the server (removes a theorical infinite loop) Signed-off-by: Marc-André Lureau --- contrib/ivshmem-server/ivshmem-server.c | 11 ++- contrib/ivshmem-server/ivshmem-server

[Qemu-devel] [PATCH v3 06/46] ivshmem: remove unnecessary dup()

2015-09-15 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 --- hw/misc/ivshmem.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index dd1

[Qemu-devel] [PATCH v3 44/46] ivshmem: remove EventfdEntry.vector

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau No need to store an extra int for the vector number when it can be computed easily by looking at the position in the array. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/misc/ivshmem

[Qemu-devel] [PATCH v3 36/46] ivshmem: add check on protocol version in QEMU

2015-09-15 Thread marcandre . lureau
From: David Marchand Send a protocol version as the first message from server, clients must close communication if they don't support this protocol version. Older QEMUs should be fine with this change in the protocol since they overrides their own vm_id on reception of an id associated to no eve

[Qemu-devel] [PATCH v3 45/46] ivshmem: rename MSI eventfd_table

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau The array is used to have vector specific data, so use a more descriptive name. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 976f

[Qemu-devel] [PATCH v3 38/46] msix: implement pba write (but read-only)

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau qpci_msix_pending() writes on pba region, causing qemu to SEGV: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x77fba8c0 (LWP 25882)] 0x in ?? () (gdb) bt #0 0x in () #1 0x556556c5 in m

[Qemu-devel] [PATCH v3 40/46] tests: add ivshmem qtest

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau Adds 4 ivshmemtests: - single qemu instance and basic IO - pair of instances, check memory sharing - pair of instances with server, and MSIX - hot plug/unplug A temporary shm is created as well as a directory to place server socket, both should be clear on exit and abort.

[Qemu-devel] [PATCH v3 42/46] ivshmem: make ivshmem_get_size() more generic

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau Use a more explicit function name parse_mem_size(). I guess such function could be common (or exists already somewhere). Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/misc/ivshmem

[Qemu-devel] [PATCH v3 43/46] ivshmem: add hostmem backend

2015-09-15 Thread marcandre . lureau
From: Marc-André Lureau Instead of handling allocation, teach ivshmem to use a memory backend. This allows to use hugetlbfs backed memory now. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c| 84 tests/ivshmem-test.c | 12

[Qemu-devel] [PATCH 1/2] utils: rename strtosz to use qemu prefix

2015-09-16 Thread marcandre . lureau
From: Marc-André Lureau Not only it makes sense, but it gets rid of checkpatch warning: WARNING: consider using qemu_strtosz in preference to strtosz Also remove get rid of tabs to please checkpatch. Signed-off-by: Marc-André Lureau --- include/qemu-common.h | 27 ++-

[Qemu-devel] [PATCH 2/2] tests: add some qemu_strtosz() tests

2015-09-16 Thread marcandre . lureau
From: Marc-André Lureau While reading the function I decided to write some tests. Signed-off-by: Marc-André Lureau --- tests/test-cutils.c | 91 + 1 file changed, 91 insertions(+) diff --git a/tests/test-cutils.c b/tests/test-cutils.c index

[Qemu-devel] [PATCH v2 0/5] monitor: throttle VSERPORT_CHANGED by "id"

2015-09-17 Thread marcandre . lureau
From: Marc-André Lureau QAPI_EVENT_VSERPORT_CHANGE reports changes of a virtio serial port state. However, the events may be for different ports, but the throttle mechanism may replace the event for a different port, since it only checks the event type. The following series implements throttling

[Qemu-devel] [PATCH v2 1/5] monitor: split MonitorQAPIEventState

2015-09-17 Thread marcandre . lureau
From: Marc-André Lureau Create a separate structure MonitorQAPIEventPending for holding the data related to pending event. The next commits are going to reuse this structure for different throttling implementations. Signed-off-by: Marc-André Lureau --- monitor.c | 85 +

[Qemu-devel] [PATCH v2 2/5] monitor: introduce MonitorQAPIEventDelay callback

2015-09-17 Thread marcandre . lureau
From: Marc-André Lureau Move the delay handling in a seperate function that can be changed for different throttling implementations, as will be done in following commits. Signed-off-by: Marc-André Lureau --- monitor.c| 85 +++- trace-

[Qemu-devel] [PATCH v2 4/5] monitor: throttle QAPI_EVENT_VSERPORT_CHANGE by "id"

2015-09-17 Thread marcandre . lureau
From: Marc-André Lureau Use a hash table to lookup the pending event corresponding to the "id" field. The hash table may grow without limit here, the following patch will add some cleaning. Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake --- monitor.c | 104 ++

[Qemu-devel] [PATCH v2 3/5] monitor: rename QDict *data->qdict

2015-09-17 Thread marcandre . lureau
From: Marc-André Lureau As suggested by Markus Armbruster, this is a bit more specific for the event qdict than 'data'. Signed-off-by: Marc-André Lureau --- monitor.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/monitor.c b/monitor.

[Qemu-devel] [PATCH v2 5/5] monitor: remove old entries from event hash table

2015-09-17 Thread marcandre . lureau
From: Marc-André Lureau Do not let the hash table grow without limit, schedule a cleanup for outdated event. Signed-off-by: Marc-André Lureau --- monitor.c | 58 +- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/monitor.c

[Qemu-devel] [PATCH v2 1/4] utils: rename strtosz to use qemu prefix

2015-09-18 Thread marcandre . lureau
From: Marc-André Lureau Not only it makes sense, but it gets rid of checkpatch warning: WARNING: consider using qemu_strtosz in preference to strtosz Also remove the tabs to please checkpatch. Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake --- include/qemu-common.h | 27 +++

[Qemu-devel] [PATCH v2 3/4] checkpatch: recommend strtok_r

2015-09-18 Thread marcandre . lureau
From: Marc-André Lureau If anything, it should recommend strtok_r! (strtok_r() is reentrant-safe and thread-safe) Signed-off-by: Paolo Bonzini [Better matching and error message - Marc-André] Signed-off-by: Marc-André Lureau --- scripts/checkpatch.pl | 8 ++-- 1 file changed, 6 insertion

[Qemu-devel] [PATCH v2 2/4] tests: add some qemu_strtosz() tests

2015-09-18 Thread marcandre . lureau
From: Marc-André Lureau While reading the function I decided to write some tests. Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake --- tests/test-cutils.c | 91 + 1 file changed, 91 insertions(+) diff --git a/tests/test-cutils.c b/t

[Qemu-devel] [PATCH v2 4/4] Replace strotok() by strtok_r()

2015-09-18 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- block/archipelago.c | 10 +- block/sheepdog.c| 5 +++-- qom/cpu.c | 12 ++-- target-i386/cpu.c | 6 +++--- target-sparc/cpu.c | 10 +- vl.c| 6 +++--- 6 files changed, 25 ins

[Qemu-devel] [PATCH] vhost-scsi: include linux/vhost.h

2015-09-18 Thread marcandre . lureau
From: Marc-André Lureau Replace ad-hoc declarations with the linux header. Signed-off-by: Marc-André Lureau --- hw/scsi/vhost-scsi.c | 1 + include/hw/virtio/vhost-scsi.h | 25 - 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/hw/scsi/vhost-scs

[Qemu-devel] [PATCH v4 00/22] vhost-user: add migration support

2015-09-19 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 v4 05/22] util: add linux-only memfd fallback

2015-09-19 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 v4 03/22] vhost-user: unit test for new messages

2015-09-19 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 v4 02/22] vhost-user: add protocol feature negotiation

2015-09-19 Thread marcandre . lureau
From: "Michael S. Tsirkin" Support a separate bitmask for vhost-user protocol features, and messages to get/set protocol features. Invoke them at init. No features are defined yet. Signed-off-by: Michael S. Tsirkin --- docs/specs/vhost-user.txt | 37 + hw/net/

[Qemu-devel] [PATCH v4 06/22] util: add memfd helpers

2015-09-19 Thread marcandre . lureau
From: Marc-André Lureau Add qemu_memfd_alloc/free() helpers. The function helps to allocate and seal a memfd, and implements an open/unlink/mmap fallback for system that do not support memfd. Signed-off-by: Marc-André Lureau --- include/qemu/memfd.h | 4 +++ util/memfd.c | 74 +++

[Qemu-devel] [PATCH v4 01/22] vhost-user: refactor ioctl translation

2015-09-19 Thread marcandre . lureau
From: "Michael S. Tsirkin" translate at the outset, have rest of code use vhost-user features exclusively. Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost-user.c | 87 ++ 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/hw/vi

[Qemu-devel] [PATCH v4 07/22] vhost: alloc shareable log

2015-09-19 Thread marcandre . lureau
From: Marc-André Lureau If the backend is of type VHOST_BACKEND_TYPE_USER, allocate shareable memory. Next patch will only allocate when the backend has the required feature. Note: vhost_log_get() can use a global "vhost_log" that can be shared by several vhost devices. We may want instead a com

[Qemu-devel] [PATCH v4 10/22] vhost-user: remove vhost_user_request_translate()

2015-09-19 Thread marcandre . lureau
From: Marc-André Lureau The translation is no longer needed. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c | 36 1 file changed, 36 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index d5b7951..d3334f5 100644 --- a/

[Qemu-devel] [PATCH v4 04/22] configure: probe for memfd

2015-09-19 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 52f5b79..a7cdfa4 100755 --- a/configure +++ b/configure @@ -3455,6 +3455,2

[Qemu-devel] [PATCH v4 08/22] vhost: document log resizing

2015-09-19 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 cd3af16..81209ba 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -357,6 +357,8 @@ static inline void vhost_d

[Qemu-devel] [PATCH v4 14/22] net: add trace_vhost_user_event

2015-09-19 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 | 5 +++-- trace-events | 4 2 files changed, 7 insertions(+),

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

2015-09-19 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. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-backend.c | 3 ++- hw/virtio/vhost-user.c| 17 ++--- hw/virtio/vhost.c

[Qemu-devel] [PATCH v4 09/22] vhost: use a function for each call

2015-09-19 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. Signed-off-by: Marc-André Lureau --- hw/net/vhost_net.c| 12 +- hw/scsi/vhost-scsi.c | 7 +- hw/virtio/vhost-ba

<    1   2   3   4   5   6   7   8   9   10   >