[Qemu-devel] [PATCH 1/9] exec: check kvm mmu notifiers earlier

2016-04-12 Thread marcandre . lureau
From: Marc-André Lureau Move kvm mmu notifiers check before calling file_ram_alloc(). This shouldn't change the validation logic. Signed-off-by: Marc-André Lureau --- exec.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/exec.c b/exec.c index c4f9036..dcc6632

[Qemu-devel] [PATCH 2/9] exec: split file_ram_alloc()

2016-04-12 Thread marcandre . lureau
From: Marc-André Lureau Move file opening part in a seperate function file_ram_open(). This allows for reuse of file_ram_alloc() with only a fd. Signed-off-by: Marc-André Lureau --- exec.c | 58 ++ 1 file changed, 34 insertions(+), 24 del

[Qemu-devel] [PATCH 5/9] RFC: ivshmem: use ram_from_fd()

2016-04-12 Thread marcandre . lureau
From: Marc-André Lureau Instead of writing our own mmap handling code, reuse the code from exec.c. RFC because memory_region_init_ram_from_fd() adds some restrictions (check for xen, kvm sync-mmu, etc) and changes (such as size alignment). In practice, this doesn't seem to hurt though. Signed-o

[Qemu-devel] [PATCH 9/9] tests: use memfd in vhost-user-test

2016-04-12 Thread marcandre . lureau
From: Marc-André Lureau This will exercise the memfd memory backend and should generally be better for testing than memory-backend-file (thanks to anonymous files and sealing). Signed-off-by: Marc-André Lureau --- tests/vhost-user-test.c | 12 ++-- 1 file changed, 6 insertions(+), 6 de

[Qemu-devel] [PATCH 7/9] memfd: split qemu_memfd_alloc()

2016-04-12 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- include/qemu/memfd.h | 1 + util/memfd.c | 19 ++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/include/qemu/memfd.h b/include/qemu/memfd.h index 745a8c5..41c24d8 100644 --- a/include/qemu/m

[Qemu-devel] [PATCH 3/9] exec: split qemu_ram_alloc_from_file()

2016-04-12 Thread marcandre . lureau
From: Marc-André Lureau Add qemu_ram_alloc_from_fd(), which can be use to allocate ramblock from fd only. Signed-off-by: Marc-André Lureau --- exec.c | 45 ++--- include/exec/ram_addr.h | 3 +++ 2 files changed, 33 insertions(+), 15 del

[Qemu-devel] [PATCH 4/9] Add memory_region_init_ram_from_fd()

2016-04-12 Thread marcandre . lureau
From: Marc-André Lureau Add a new function to Initialize a RAM memory region with a mmap-ed file descriptor. Signed-off-by: Marc-André Lureau --- include/exec/memory.h | 20 memory.c | 16 2 files changed, 36 insertions(+) diff --git a/includ

[Qemu-devel] [PATCH 6/9] exec: remove qemu_set_ram_fd()

2016-04-12 Thread marcandre . lureau
From: Marc-André Lureau If the previous ivshmem patch is applied, qemu_set_ram_fd() is no longer used. Signed-off-by: Marc-André Lureau --- exec.c | 10 -- include/exec/ram_addr.h | 1 - 2 files changed, 11 deletions(-) diff --git a/exec.c b/exec.c index 8675b5e..ec7

[Qemu-devel] [PATCH 8/9] Add memfd based hostmem

2016-04-12 Thread marcandre . lureau
From: Marc-André Lureau Add a new memory backend, similar to hostmem-file, except that it doesn't need a file path, or hugepages directory permissions. It also try to enforce memory sealing if available. This backend is mainly useful for easily sharing the memory with other processes, for exampl

[Qemu-devel] [PATCH for-2.6] ivshmem: fix crash with ivshmem-plain

2016-04-12 Thread marcandre . lureau
From: Marc-André Lureau "qemu -device ivshmem-plain" will crash, because it doesn't check that 'memdev' was provided. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshm

[Qemu-devel] [PATCHv2 for-2.6] ivshmem: fix ivshmem-{plain, doorbell} crash without arg

2016-04-12 Thread marcandre . lureau
From: Marc-André Lureau "qemu -device ivshmem-{plain,doorbell}" will crash, because the device doesn't check that the required argument is provided. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/hw/mis

[Qemu-devel] [PULL 1/1] ivshmem: fix ivshmem-{plain, doorbell} crash without arg

2016-04-13 Thread marcandre . lureau
From: Marc-André Lureau "qemu -device ivshmem-{plain,doorbell}" will crash, because the device doesn't check that the required argument is provided. (screwed up in commit 5400c02) Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster --- hw/misc/ivshmem.c | 30 ++

[Qemu-devel] [PULL 0/1] Ivshmem fix

2016-04-13 Thread marcandre . lureau
From: Marc-André Lureau The following changes since commit d44122ecd0fa62d20762bdd8f214f077cb8e011b: Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2016-04-12 17:47:15 +0100) are available in the git repository at: g...@github.com:elmarco/qemu.git tags/ivshme

[Qemu-devel] [PATCH] hostmem-file: plug a small leak

2016-04-13 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- backends/hostmem-file.c | 8 1 file changed, 8 insertions(+) diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index b17a1f1..5c4b808 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -121,11

[Qemu-devel] [PATCH] memory: fix segv on qemu_ram_free(block=0x0)

2016-03-29 Thread marcandre . lureau
From: Marc-André Lureau Since f1060c55bf1377b4, the pointer is directly passed to qemu_ram_free(). However, on initialization failure, it may be called with a NULL pointer. Return immediately in this case. This fixes a SEGV when memory initialization failed, for example permission denied on open

[Qemu-devel] [PATCHv2] tests: start a /qga/guest-exec test

2016-06-03 Thread marcandre . lureau
From: Marc-André Lureau Test a few guest-exec guest agent commands, added in qemu 2.5. Signed-off-by: Marc-André Lureau --- tests/test-qga.c | 81 1 file changed, 81 insertions(+) diff --git a/tests/test-qga.c b/tests/test-qga.c index 7

[Qemu-devel] [PATCH 0/6] Start a contrib/libvhost-user

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau Hi vhost-user & virtio are not so simple and evolve regularly. There isn't a reference code that would help you get started either. And the backends duplicate most of the effort. Furthermore, due to usage of ancillary data, shared memory, eventfd, atomics, it is not so s

[Qemu-devel] [PATCH 2/6] vubr: remove unnecessary dispatcher_remove

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau The call fd is not watched Signed-off-by: Marc-André Lureau --- tests/vhost-user-bridge.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c index 7d548d8..b9bf018 100644 --- a/tests/vhost-user-bridge.c +++ b/tests

[Qemu-devel] [PATCH 4/6] vubr: do not accept more than one connection

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- tests/vhost-user-bridge.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c index b7bb79a..c21cd79 100644 --- a/tests/vhost-user-bridge.c +++ b/tests/vhost-user-bridge.c @@ -1196

[Qemu-devel] [PATCH 1/6] vubr: remove false comment

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau dispatcher_remove() is in use. Signed-off-by: Marc-André Lureau --- tests/vhost-user-bridge.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c index 0779ba2..7d548d8 100644 --- a/tests/vhost-user-bridge.c +++ b/t

[Qemu-devel] [PATCH 6/6] test/vubr: use contrib/libvhost-user

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau Use the libvhost-user library. This ended up being a rather large patch that cannot be easily splitted, due to massive code move and API changes. Signed-off-by: Marc-André Lureau --- tests/Makefile|2 +- tests/vhost-user-bridge.c | 1167 +---

[Qemu-devel] [PATCH 3/6] vubr: indicate peer disconnected

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- tests/vhost-user-bridge.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c index b9bf018..b7bb79a 100644 --- a/tests/vhost-user-bridge.c +++ b/tests/vhost-user-bridge.c @@ -388,7

[Qemu-devel] [PATCH 5/6] contrib: add libvhost-user

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau Add a library to help implementing vhost-user backend (or slave). Dealing with vhost-user as an application developper isn't so easy: you have all the trouble with any protocol: validation, unix ancillary data, shared memory, eventfd, logging, and on top of that you need

[Qemu-devel] [RFC 00/14] vhost-user backends for gpu & input virtio devices

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau Hi, vhost-user allows to drive a virtio device in a seperate process. So far, it has been mainly used with virtio-net. It can work with other devices such as input and gpu, as shown in this series. Some of the benefits of using vhost-user are: - parallelism, since the ba

[Qemu-devel] [RFC 02/14] Add vhost-user-backend

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau Create a vhost-user-backend object that holds a connection to a vhost-user backend and can be referenced from virtio devices that support it. Currently, you may specify the executable to spawn directly from command line, ex: -object vhost-user-backend,id=vui,cmd="./vhost-

[Qemu-devel] [RFC 03/14] vhost-user: split vhost_user_read()

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau Split vhost_user_read(), so only header can be read with vhost_user_read_header(). Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c | 28 +++- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/v

[Qemu-devel] [RFC 07/14] misc: rename virtio-gpu.h header guard

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- include/hw/virtio/virtio-gpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 1602a13..0cc8e67 100644 --- a/include/hw/virtio/virtio-gpu.h

[Qemu-devel] [RFC 09/14] qemu-char: use READ_RETRIES

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau The define was introduced with qemu_chr_fe_read_all() in 7b0bfdf52d, however never used. Signed-off-by: Marc-André Lureau --- qemu-char.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index caa737d..efa1e2a 100644 ---

[Qemu-devel] [RFC 08/14] vhost: make sure call fd has been received

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau vhost switches between masked notifier and guest notifier when unmasking. virtio_pci_vq_vector_unmask() checks if there was pending notification, but at the time it is checked, vhost-user backend doesn't guarantee that the switch happened yet, so it may lose some events.

[Qemu-devel] [RFC 11/14] console: add dpy_gl_scanout2()

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau Add a new scanout callback that doesn't require any gl context in qemu (importing a dmabuf fd would require qemu egl&gl contexts, and would be unnecessary when using spice anyway) Signed-off-by: Marc-André Lureau --- include/ui/console.h | 10 ++ ui/console.c

[Qemu-devel] [RFC 05/14] Add vhost-user backend to virtio-input-host

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau Learn to use a vhost-user as a virtio-input backend. Usage: -object vhost-user-backend,id=vuid -device virtio-input-host-pci,vhost-user=vuid Signed-off-by: Marc-André Lureau --- hw/input/virtio-input-host.c | 67 ++-- hw/input/vi

[Qemu-devel] [RFC 01/14] Add qemu_chr_open_socket()

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau Create a CharDriver from an existing socket fd. Is there a better way to do that? Signed-off-by: Marc-André Lureau --- include/sysemu/char.h | 2 ++ qemu-char.c | 37 - 2 files changed, 38 insertions(+), 1 deletion(-) diff

[Qemu-devel] [RFC 10/14] qemu-char: block during sync read

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau A sync read should block until data is available, instead of retrying. Change the channel to blocking during read. Signed-off-by: Marc-André Lureau --- qemu-char.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qemu-char.c b/qemu-char.c index efa1e2a..ce09226 100

[Qemu-devel] [RFC 13/14] vhost-user: add vhost_user_gpu_set_socket()

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau Add a new vhost-user message to give a unix socket for gpu updates to a vhost-user backend. Signed-off-by: Marc-André Lureau --- contrib/libvhost-user/libvhost-user.h | 1 + hw/virtio/vhost-user.c| 11 +++ include/hw/virtio/vhost-backend.h |

[Qemu-devel] [RFC 04/14] vhost-user: add vhost_user_input_get_config()

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- docs/specs/vhost-user.txt | 9 ++ hw/virtio/vhost-user.c| 58 +++ include/hw/virtio/vhost-backend.h | 4 +++ 3 files changed, 71 insertions(+) diff --git a/docs/specs/vhos

[Qemu-devel] [RFC 14/14] Add virtio-gpu vhost-user backend

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau Add to virtio-gpu devices a "vhost-user" property. When set, the associated vhost-user backend is used to handle the virtio rings. For now, a socketpair is created for the backend to share the rendering results with qemu via a simple VHOST_GPU protocol. Example usage: -o

[Qemu-devel] [RFC 06/14] contrib: add vhost-user-input

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau Add a vhost-user input backend example, based on virtio-input-host device. It takes an evdev path as argument, and can be associated with a vhost-user-backend object, ex: -object vhost-user-backend,id=vuid,cmd="vhost-user-input /dev/input/event0" Signed-off-by: Marc-Andr

[Qemu-devel] [RFC 12/14] contrib: add vhost-user-gpu

2016-06-04 Thread marcandre . lureau
From: Marc-André Lureau Add a vhost-user gpu backend example, based on virtio-gpu/3d device. It is to be associated with a vhost-user-backend object, ex: -object vhost-user-backend,id=vug,cmd="vhost-user-gpu" Signed-off-by: Marc-André Lureau --- Makefile |3 +

[Qemu-devel] [PATCH 02/10] tests/vhost-user-bridge: add client mode

2016-06-06 Thread marcandre . lureau
From: Marc-André Lureau If -c is specified, vubr will try to connect to the socket instead of listening for connections. Signed-off-by: Marc-André Lureau Tested-by: Yuanhan Liu Reviewed-by: Yuanhan Liu --- tests/vhost-user-bridge.c | 38 ++ 1 file changed,

[Qemu-devel] [PATCH 06/10] vhost-net: do not crash if backend is not present

2016-06-06 Thread marcandre . lureau
From: Marc-André Lureau Do not crash when backend is not present while enabling the ring. A following patch will save the enabled state so it can be restored once the backend is started. Signed-off-by: Marc-André Lureau Tested-by: Yuanhan Liu Reviewed-by: Yuanhan Liu --- hw/net/vhost_net.c |

[Qemu-devel] [PATCH 00/10] vhost-user: simple reconnection support

2016-06-06 Thread marcandre . lureau
From: Marc-André Lureau Hi, In a previous series "RFCv2: vhost-user: shutdown and reconnection", I proposed to add a new slave request to handle graceful shutdown, for both qemu configuration, server or client, while keeping the guest running with link down status. However, for the simple case

[Qemu-devel] [PATCH 05/10] vhost-user: disconnect on start failure

2016-06-06 Thread marcandre . lureau
From: Marc-André Lureau If the backend failed to start (for example feature negociation failed), do not exit, but disconnect the char device instead. Slightly more robust for reconnect case. Signed-off-by: Marc-André Lureau Tested-by: Yuanhan Liu Reviewed-by: Yuanhan Liu --- net/vhost-user.c

[Qemu-devel] [PATCH 10/10] test: start vhost-user reconnect test

2016-06-06 Thread marcandre . lureau
From: Marc-André Lureau This is a simple reconnect test, that simply checks if vhost-user reconnection is possible and restore the state. A more complete test would actually manipulate and check the ring contents (such extended testing would benefit from the libvhost-user proposed in QEMU list to

[Qemu-devel] [PATCH 08/10] vhost-net: save & restore vring enable state

2016-06-06 Thread marcandre . lureau
From: Marc-André Lureau A driver may change the vring enable state at run time but vhost-user backend may not be present (a contrived example is when the backend is disconnected and the device is reconfigured after driver rebinding) Restore the vring state when the vhost-user backend is started,

[Qemu-devel] [PATCH 09/10] tests: append i386 tests

2016-06-06 Thread marcandre . lureau
From: Marc-André Lureau Do not overwrite x86-64 tests, re-enable vhost-user-test. Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake --- tests/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Makefile b/tests/Makefile index a3e20e3..932ad2a 100644 --- a

[Qemu-devel] [PATCH 01/10] vhost-user: add ability to know vhost-user backend disconnection

2016-06-06 Thread marcandre . lureau
From: Tetsuya Mukawa Current QEMU cannot detect vhost-user backend disconnection. The patch adds ability to know it. To know disconnection, add watcher to detect G_IO_HUP event. When G_IO_HUP event is detected, the disconnected socket will be read to cause a CHR_EVENT_CLOSED. Signed-off-by: Tets

[Qemu-devel] [PATCH 03/10] tests/vhost-user-bridge: workaround stale vring base

2016-06-06 Thread marcandre . lureau
From: Marc-André Lureau This patch is a similar solution to what Yuanhan Liu/Huawei Xie have suggested for DPDK. When vubr quits (killed or crashed), a restart of vubr would get stale vring base from QEMU. That would break the kernel virtio net completely, making it non-work any more, unless a dr

[Qemu-devel] [PATCH 04/10] qemu-char: add qemu_chr_disconnect to close a fd accepted by listen fd

2016-06-06 Thread marcandre . lureau
From: Tetsuya Mukawa The patch introduces qemu_chr_disconnect(). The function is used for closing a fd accepted by listen fd. Though we already have qemu_chr_delete(), but it closes not only accepted fd but also listen fd. This new function is used when we still want to keep listen fd. Signed-of

[Qemu-devel] [PATCH 07/10] vhost-net: save & restore vhost-user acked features

2016-06-06 Thread marcandre . lureau
From: Marc-André Lureau The initial vhost-user connection sets the features to be negotiated with the driver. Renegotiation isn't possible without device reset. To handle reconnection of vhost-user backend, ensure the same set of features are provided, and reuse already acked features. Signed-o

[Qemu-devel] [PATCH] tests: use static qga config file

2016-06-13 Thread marcandre . lureau
From: Marc-André Lureau Do not create a leaking temporary file, but use a static file instead. Signed-off-by: Marc-André Lureau Reported-by: Peter Maydell --- tests/test-qga-config | 8 tests/test-qga.c | 27 --- 2 files changed, 12 insertions(+), 23 del

[Qemu-devel] [PATCH 0/2] Remove test-qga temporary file

2016-06-14 Thread marcandre . lureau
From: Marc-André Lureau Hi, Here are 2 small patches to remove the need for temporary file creation in test-qga. Marc-André Lureau (2): build-sys: define QEMU_SRC_PATH tests: use static qga config file scripts/create_config | 3 +++ tests/test-qga-config | 8 tests/test-qga.c

[Qemu-devel] [PATCH 2/2] tests: use static qga config file

2016-06-14 Thread marcandre . lureau
From: Marc-André Lureau Do not create a leaking temporary file, but use a static file instead. Signed-off-by: Marc-André Lureau Reported-by: Peter Maydell --- tests/test-qga-config | 8 tests/test-qga.c | 27 --- 2 files changed, 12 insertions(+), 23 del

[Qemu-devel] [PATCH 1/2] build-sys: define QEMU_SRC_PATH

2016-06-14 Thread marcandre . lureau
From: Marc-André Lureau Define QEMU_SRC_PATH in config-host.h, to ease accessing of tests data files. Signed-off-by: Marc-André Lureau --- scripts/create_config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/create_config b/scripts/create_config index 1dd6a35..2fbe126 100755 --

[Qemu-devel] [PATCH 2/3] spice: use the right head for multi-monitor

2016-06-14 Thread marcandre . lureau
From: Marc-André Lureau Look up the associated head monitor config. Signed-off-by: Marc-André Lureau --- ui/spice-display.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ui/spice-display.c b/ui/spice-display.c index 34095fb..142c941 100644 --- a/ui/spice-dis

[Qemu-devel] [PATCH 0/3] virtio-gpu & spice multihead fixes

2016-06-14 Thread marcandre . lureau
From: Marc-André Lureau Hi Here are a few fixes for virtio-gpu multihead & spice support. To actually test this, you also need pending kernel fixes, and a small fix in spice-gtk for the virgl case. Marc-André Lureau (3): virgl: count the calls to gl_block spice: use the right head for multi

[Qemu-devel] [PATCH 3/3] virgl: pass whole GL scanout dimensions

2016-06-14 Thread marcandre . lureau
From: Marc-André Lureau Spice client needs the whole GL texture dimension to be able to show a scanout with a monitor offset (different than +0+0). Furthermore, this fixes a crash when calling surface_{width,height}() after dpy_gfx_replace_surface(con, NULL) was called in virgl_cmd_set_scanout()

[Qemu-devel] [PATCH 1/3] virgl: count the calls to gl_block

2016-06-14 Thread marcandre . lureau
From: Marc-André Lureau In virgl_cmd_resource_flush(), when several consoles are updated, it needs to keep blocking until all spice gl draws are done. This fixes an assert() in spice when using multiple monitors with virgl. Signed-off-by: Marc-André Lureau --- hw/display/virtio-gpu.c|

[Qemu-devel] [PATCH v2 2/2] tests: use static qga config file

2016-06-15 Thread marcandre . lureau
From: Marc-André Lureau Do not create a leaking temporary file, but use a static file instead. Signed-off-by: Marc-André Lureau Reported-by: Peter Maydell --- tests/data/test-qga-config | 8 tests/test-qga.c | 27 --- 2 files changed, 12 insertions(

[Qemu-devel] [PATCH v2 0/2] Remove test-qga temporary file

2016-06-15 Thread marcandre . lureau
From: Marc-André Lureau Hi, Here are 2 small patches to remove the need for temporary file creation in test-qga. v1->v2: - use a symlink to tests/data instead of hardcoding SRC_PATH Marc-André Lureau (2): build-sys: link tests/data tests: use static qga config file configure

[Qemu-devel] [PATCH v2 1/2] build-sys: link tests/data

2016-06-15 Thread marcandre . lureau
From: Marc-André Lureau Link a common tests data directory to the build directory. Signed-off-by: Marc-André Lureau --- configure | 5 + 1 file changed, 5 insertions(+) diff --git a/configure b/configure index 8c2f90b..c79234c 100755 --- a/configure +++ b/configure @@ -6008,6 +6008,11 @@

[Qemu-devel] [PATCH 0/3] chardev cleanups

2016-06-16 Thread marcandre . lureau
From: Marc-André Lureau Hi A small series to do some chardev cleanup when removing them and leaving qemu. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1347077 Marc-André Lureau (3): char: clean up remaining chardevs when leaving socket: add listen feature socket: unlink unix socket

[Qemu-devel] [PATCH 1/3] char: clean up remaining chardevs when leaving

2016-06-16 Thread marcandre . lureau
From: Marc-André Lureau This helps to remove various chardev resources leaks when leaving qemu. Signed-off-by: Marc-André Lureau --- include/sysemu/char.h | 7 +++ qemu-char.c | 9 + vl.c | 1 + 3 files changed, 17 insertions(+) diff --git a/include/syse

[Qemu-devel] [PATCH 2/3] socket: add listen feature

2016-06-16 Thread marcandre . lureau
From: Marc-André Lureau Add a flag to tell whether the channel socket is listening. Signed-off-by: Marc-André Lureau --- include/io/channel.h | 1 + io/channel-socket.c | 7 +++ 2 files changed, 8 insertions(+) diff --git a/include/io/channel.h b/include/io/channel.h index d37acd2..e52f0

[Qemu-devel] [PATCH 3/3] socket: unlink unix socket on remove

2016-06-16 Thread marcandre . lureau
From: Marc-André Lureau qemu leaves unix socket files behind when removing a listening chardev or leaving. qemu could clean that up, even if doing so isn't race-free. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1347077 Signed-off-by: Marc-André Lureau --- include/qemu/sockets.h

[Qemu-devel] [PATCH v2 0/3] chardev cleanups

2016-06-16 Thread marcandre . lureau
From: Marc-André Lureau Hi A small series to do some chardev cleanup when removing them and leaving qemu. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1347077 v1->v2: - use atexit() for qemu_chr_cleanup() - add missing braces Marc-André Lureau (3): char: clean up remaining chardevs wh

[Qemu-devel] [PATCH v2 1/3] char: clean up remaining chardevs when leaving

2016-06-16 Thread marcandre . lureau
From: Marc-André Lureau This helps to remove various chardev resources leaks when leaving qemu. Signed-off-by: Marc-André Lureau --- qemu-char.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/qemu-char.c b/qemu-char.c index c926e9a..98dcd49 100644 --- a/qemu-char.c +++ b/qemu

[Qemu-devel] [PATCH v2 3/3] socket: unlink unix socket on remove

2016-06-16 Thread marcandre . lureau
From: Marc-André Lureau qemu leaves unix socket files behind when removing a listening chardev or leaving. qemu could clean that up, even if doing so isn't race-free. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1347077 Signed-off-by: Marc-André Lureau --- include/qemu/sockets.h

[Qemu-devel] [PATCH v2 2/3] socket: add listen feature

2016-06-16 Thread marcandre . lureau
From: Marc-André Lureau Add a flag to tell whether the channel socket is listening. Signed-off-by: Marc-André Lureau --- include/io/channel.h | 1 + io/channel-socket.c | 7 +++ 2 files changed, 8 insertions(+) diff --git a/include/io/channel.h b/include/io/channel.h index d37acd2..e52f0

[Qemu-devel] [RFC PATCH] build-sys: add make 'help' target

2016-06-20 Thread marcandre . lureau
From: Marc-André Lureau Add a make 'help', to print a summary of the main Makefile targets. The format is loosely inspired by Linux make 'help' output. Signed-off-by: Marc-André Lureau --- Makefile | 33 + 1 file changed, 33 insertions(+) diff --git a/Makefile

[Qemu-devel] [PATCH 03/24] qemu-char: check socket is actually connected

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau Calling qemu_chr_fe_set_msgfds() on unconnected socket can lead to crash if s->ioc is NULL. Signed-off-by: Marc-André Lureau --- qemu-char.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 84f49ac..06eaba3 1

[Qemu-devel] [PATCH 04/24] vhost-user: check qemu_chr_fe_set_msgfds() return value

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau Check return value, and drop the unnecessary 'if' check for fd_num. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 495e09f..5dae496

[Qemu-devel] [PATCH 02/24] vhost-user: minor simplification

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- net/vhost-user.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/vhost-user.c b/net/vhost-user.c index d72ce9b..392f982 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -310,7 +310,6 @@ static int net_

[Qemu-devel] [PATCH 00/24] vhost-user reconnect fixes

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau Hi, Since 'vhost-user: simple reconnection support' was merged, it is possible to disconnect and reconnect a vhost-user backend. However, many code paths in qemu may trigger assert() when the backend is disconnected. Some assert() could simply be replaced by error_report

[Qemu-devel] [PATCH 08/24] vhost-user: return a read error

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau Return read errors (not sure why those were ignored) Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index e51df27..819481d 100644 --- a

[Qemu-devel] [PATCH 06/24] vhost-user: check vhost_user_write() return value

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau Just some more error checking. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c | 44 +++- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 5dae496..e

[Qemu-devel] [PATCH 07/24] vhost: use error_report() instead of fprintf(stderr, ...)

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau Let's use qemu proper error reporting API. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 21 + 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index e2d1614..4e23d73 100644 --- a/hw/virt

[Qemu-devel] [PATCH 12/24] vhost: make vhost_dev_cleanup() idempotent

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau May be called on multiple code path, so it's easier to make it safe in the first place. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index

[Qemu-devel] [PATCH 11/24] vhost: add vhost device only after all success

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau This helps following vhost_dev_cleanup() patch to check if the device was added before removing it from the list. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vho

[Qemu-devel] [PATCH 19/24] vhost-net: success if backend has no ops->vhost_migration_done

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/net/vhost_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 22ea653..cc2f68a 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -383,7 +383,7 @@ void vh

[Qemu-devel] [PATCH 01/24] misc: indentation

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/net/vhost_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 50f4dcd..3f1fecc 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -313,7 +313,7 @@ int vho

[Qemu-devel] [PATCH 13/24] vhost-net: always call vhost_dev_cleanup() on failure

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau vhost_dev_init() may need to be cleaned up on failure too. Just call vhost_dev_cleanup() in all cases. But first zero-alloc the struct to avoid the garbage. Signed-off-by: Marc-André Lureau --- hw/net/vhost_net.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(

[Qemu-devel] [PATCH 16/24] vhost-user: keep vhost_net after a disconnection

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau Lot of code path assumes get_vhost_net() return non-null. Keep it after a successful vhost_net_init(). vhost_net_cleanup() will clear the vhost-dev connection-related data after vhost_user_stop(). Signed-off-by: Marc-André Lureau --- hw/net/vhost_net.c | 1 - net/tap.c

[Qemu-devel] [PATCH 24/24] tests: add /vhost-user/connect-fail test

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau Check early connection failure and resume. Signed-off-by: Marc-André Lureau --- tests/vhost-user-test.c | 37 + 1 file changed, 37 insertions(+) diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c index 8b2164b..7fe12e6 10

[Qemu-devel] [PATCH 09/24] vhost: make vhost_log_put() idempotent

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau Clear dev->log* when calling vhost_log_put() Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 4e23d73..febf64f 100644 --- a/hw/virtio/vhost.c +++

[Qemu-devel] [PATCH 10/24] vhost: call vhost_log_put() on cleanup

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau Make sure the log is being released on cleanup and the structure cleared. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index febf64f..237db77 100644 --- a/hw/virtio/vhost

[Qemu-devel] [PATCH 18/24] get_vhost_net() should be != null after vhost_user_init

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/net/vhost_net.c | 1 + net/vhost-user.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index f1dd367..22ea653 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -417,6 +417

[Qemu-devel] [PATCH 05/24] vhost: change some assert() for error_report() or silent fail

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau Calling a vhost operation may fail, especially with disconnectable backends. Treat some that look harmless as recoverable errors (print error, or ignore on error code path). Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 32 +--- 1

[Qemu-devel] [PATCH 14/24] vhost: don't assume opaque is a fd, use backend cleanup

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index c3d3481..2c6535c 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -1004,21 +10

[Qemu-devel] [PATCH 17/24] Revert "vhost-net: do not crash if backend is not present"

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau Now that get_vhost_net() returns non-null after a successful vhost_net_init(), we no longer need to check this case. This reverts commit ecd34898596c60f79886061618dd7e01001113ad. Signed-off-by: Marc-André Lureau --- hw/net/vhost_net.c | 7 +-- 1 file changed, 1 ins

[Qemu-devel] [PATCH 21/24] char: add chr_wait_connected callback

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau A function to wait on the backend to be connected, to be used in the following patches. Signed-off-by: Marc-André Lureau --- include/sysemu/char.h | 8 qemu-char.c | 9 + 2 files changed, 17 insertions(+) diff --git a/include/sysemu/char.h b/

[Qemu-devel] [PATCH 15/24] vhost: fix calling vhost_dev_cleanup() after vhost_dev_init()

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau vhost_net_init() calls vhost_dev_init() and in case of failure, calls vhost_dev_cleanup() directly. However, the structure is already partially cleaned on error. Calling vhost_dev_cleanup() again will call vhost_virtqueue_cleanup() on already clean queues, and causing pote

[Qemu-devel] [PATCH 23/24] vhost-user: wait until link is up

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau The chardev waits for an initial connection before starting qemu, vhost-user wants the backend negotiation to be completed. vhost-user is started in the net_vhost_user_event callback, which is synchronously called after the socket is connected. Signed-off-by: Marc-André L

[Qemu-devel] [PATCH 22/24] char: add and use tcp_chr_wait_connected

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau Add a chr_wait_connected for the tcp backend, and use it in the open_socket() function. Signed-off-by: Marc-André Lureau --- qemu-char.c | 63 ++--- 1 file changed, 44 insertions(+), 19 deletions(-) diff --git a/q

[Qemu-devel] [PATCH 20/24] vhost: add assert() to check runtime behaviour

2016-06-21 Thread marcandre . lureau
From: Marc-André Lureau All these functions must be called only after the backend is connected. They are called from virtio-net.c, after either virtio or link status change. The check for nc->peer->link_down should ensure vhost_net_{start,stop}() are always called between vhost_user_{start,stop}

[Qemu-devel] [PATCH 01/12] qapi-schema: use generated marshaller for 'qmp_capabilities'

2016-06-22 Thread marcandre . lureau
From: Marc-André Lureau qapi'fy the 'qmp_capabilities' command. Signed-off-by: Marc-André Lureau --- monitor.c| 4 ++-- qapi-schema.json | 19 +++ qmp-commands.hx | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index bbd5

[Qemu-devel] [PATCH 03/12] monitor: register gen:false commands manually

2016-06-22 Thread marcandre . lureau
From: Marc-André Lureau Since a few commands are using 'gen': false, they are not registered automatically by the generator. Register manually instead. This is in preparation for removal of qapi 'middle' mode generation. Signed-off-by: Marc-André Lureau --- monitor.c | 11 +++ 1 file

[Qemu-devel] [PATCH 02/12] qapi-schema: add 'device_add'

2016-06-22 Thread marcandre . lureau
From: Marc-André Lureau Even though device_add is not fully qapi'fied, we may add it to the json schema with 'gen': false, so registration and documentation can be generated. Signed-off-by: Marc-André Lureau --- qapi-schema.json | 26 ++ 1 file changed, 26 insertions(+)

[Qemu-devel] [PATCH 05/12] monitor: register the qapi generated commands

2016-06-22 Thread marcandre . lureau
From: Marc-André Lureau Stop using the so-called 'middle' mode. Instead, use qmp_find_command() from generated qapi commands registry. Note: this commit requires a 'make clean' prior to make, since the generated files do not depend on Makefile (due to a cyclic rule introduced in 4115852bb0). Si

[Qemu-devel] [PATCH 00/12] qapi: remove the 'middle' mode

2016-06-22 Thread marcandre . lureau
From: Marc-André Lureau Hi, Although some QMP commands are still not fully qapi'fied, it is possible to use more qapi common and generated code by dropping the 'middle' mode. This series of patches was sent last year as part of a larger series 'post-Eric's fixes, QAPI improvements'. It is still

[Qemu-devel] [PATCH 09/12] qapi: remove the "middle" mode

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

<    3   4   5   6   7   8   9   10   11   12   >