[Qemu-devel] [PATCH RFC 02/14] vhost-user: remove useless is_server field

2015-09-08 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- net/vhost-user.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/vhost-user.c b/net/vhost-user.c index 266b54d..5d24129 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -26,7 +26,6 @@ typedef struct VhostUserState { t

[Qemu-devel] [PATCH RFC 04/14] qemu-char: remove all msgfds on disconnect

2015-09-08 Thread marcandre . lureau
From: Marc-André Lureau Disconnect should reset context. Signed-off-by: Marc-André Lureau --- qemu-char.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qemu-char.c b/qemu-char.c index bc37628..d34bfd1 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -2846,6 +2846,7 @@ static void tcp_chr_di

[Qemu-devel] [PATCH RFC 00/14] vhost-user: shutdown and reconnection

2015-09-08 Thread marcandre . lureau
From: Marc-André Lureau In a previous series "Add feature to start QEMU without vhost-user backend", Tetsuya Mukawa proposed to allow the vhost-user backend to disconnect and reconnect. However, Michael Tsirkin pointed out that you can't do that without extra care, because the guest and hyperviso

[Qemu-devel] [PATCH RFC 01/14] vhost-user: Add ability to know vhost-user backend disconnection

2015-09-08 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 RFC 08/14] vhost: add vhost_dev stop callback

2015-09-08 Thread marcandre . lureau
From: Marc-André Lureau vhost backend may want to stop the device, for example if it wants to restart itself (translates to a link down for vhost-net). Signed-off-by: Marc-André Lureau --- hw/net/vhost_net.c| 13 + include/hw/virtio/vhost.h | 4 2 files changed, 17 in

[Qemu-devel] [PATCH RFC 03/14] qemu-char: avoid potential double-free

2015-09-08 Thread marcandre . lureau
From: Marc-André Lureau If tcp_set_msgfds() is called several time with NULL fds, this could lead to double-free. Signed-off-by: Marc-André Lureau --- qemu-char.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qemu-char.c b/qemu-char.c index d956f8d..bc37628 100644 --- a/qemu-char.c +++ b

[Qemu-devel] [PATCH RFC 05/14] qemu-char: make tcp_chr_disconnect() reentrant-safe

2015-09-08 Thread marcandre . lureau
From: Marc-André Lureau During CHR_EVENT_CLOSED, the function could be reentered, make this case safe. Signed-off-by: Marc-André Lureau --- qemu-char.c | 4 1 file changed, 4 insertions(+) diff --git a/qemu-char.c b/qemu-char.c index d34bfd1..c37a9f9 100644 --- a/qemu-char.c +++ b/qemu-c

[Qemu-devel] [PATCH RFC 10/14] qemu-char: add qemu_chr_free()

2015-09-08 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 RFC 07/14] virtio-net: enable tx notification if up and vhost started

2015-09-08 Thread marcandre . lureau
From: Marc-André Lureau When vhost is restarted, make sure the tx notification is on. Signed-off-by: Marc-André Lureau --- hw/net/virtio-net.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 8d28e45..d494c45 100644 --- a/hw/net/virtio-net

[Qemu-devel] [PATCH RFC 09/14] vhost-user: add vhost_user to hold the chr

2015-09-08 Thread marcandre . lureau
From: Marc-André Lureau Next patches will add more fields to the structure Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index b2f46a9..2875b69

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

2015-09-08 Thread marcandre . lureau
From: Marc-André Lureau Check that SLAVE_FD & SHUTDOWN message work and that the master asked for the ring read status. Signed-off-by: Marc-André Lureau --- tests/Makefile | 2 +- tests/vhost-user-test.c | 168 2 files changed, 155 in

[Qemu-devel] [PATCH RFC 06/14] vhost-net: keep VIRTIO_NET_F_STATUS for vhost-user

2015-09-08 Thread marcandre . lureau
From: Marc-André Lureau Even if slave does not declare VIRTIO_NET_F_STATUS, we can keep this feature enabled as it is driven by qemu. Signed-off-by: Marc-André Lureau --- hw/net/vhost_net.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 9850520

[Qemu-devel] [PATCH RFC 11/14] vhost-user: add slave-fd support

2015-09-08 Thread marcandre . lureau
From: Marc-André Lureau Learn to give a socket to the slave to let him make requests to the master. Signed-off-by: Marc-André Lureau --- docs/specs/vhost-user.txt | 23 +++ hw/virtio/vhost-user.c| 71 ++- 2 files changed, 93 insertion

[Qemu-devel] [PATCH RFC 12/14] vhost-user: add shutdown support

2015-09-08 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- docs/specs/vhost-user.txt | 15 +++ hw/virtio/vhost-user.c| 30 +- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/docs/specs/vhost-user.txt b/docs/specs/vhost-user.txt index

[Qemu-devel] [PATCH RFC 13/14] qemu-char: Add qemu_chr_disconnect to close a fd accepted by listen fd

2015-09-08 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 v2 1/4] qga: add QGA_CONF environment variable

2015-09-11 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 --- qga/main.c | 3 ++- 1 file change

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

2015-09-11 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 v2 0/4] qga: add local tests on linux

2015-09-11 Thread marcandre . lureau
From: Marc-André Lureau v1->v2: - do not loop forever when connection to qga (Michael Roth) - add some config file tests - fix config verbosity - swallow virt-what stderr - only compile and check on Linux Marc-André Lureau (4): qga: add QGA_CONF environment variable qga: do not override conf

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

2015-09-11 Thread marcandre . lureau
From: Marc-André Lureau Add some local guest agent tests (as it is better than nothing) only when CONFIG_LINUX. They can be run inside or outside a VM, when run inside a VM, they will do a bit more side effects, such as freezing/thawing the FS or changing the time. A better test would involve a

[Qemu-devel] [PATCH v2 2/4] qga: do not override configuration verbosity

2015-09-11 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 --- qga/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qga/main.c b/

[Qemu-devel] [PATCH v2 01/12] qga: misc spelling

2015-08-25 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- qga/qapi-schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json index 18e3cc3..6b0bd16 100644 --- a/qga/qapi-schema.json +++ b/qga/qapi-schema.json @@ -793,7 +793,7

[Qemu-devel] [PATCH v2 00/12] qemu-ga: add a configuration file

2015-08-25 Thread marcandre . lureau
From: Marc-André Lureau Hi, The following patches for the qemu agent add support for an optionnal configuration file, and a man page. Since v1: - spelling fixes - change device_path to channel_path - moving config to GAConfig struct - do check_is_frozen() during main - use g_key_file_to_data()

[Qemu-devel] [PATCH v2 02/12] qga: use exit() when parsing options

2015-08-25 Thread marcandre . lureau
From: Marc-André Lureau The option parsing is going to be moved to a separate function, use exit() consistently. Signed-off-by: Marc-André Lureau Reviewed-by: Denis V. Lunev Reviewed-by: Eric Blake --- qga/main.c | 24 1 file changed, 12 insertions(+), 12 deletions(-

[Qemu-devel] [PATCH v2 03/12] qga: move string split in separate function

2015-08-25 Thread marcandre . lureau
From: Marc-André Lureau The function is going to be reused in a later patch. Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth --- qga/main.c | 33 ++--- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/qga/main.c b/qga/main.c index 10bb2f7.

[Qemu-devel] [PATCH v2 06/12] qga: move option parsing to seperate function

2015-08-25 Thread marcandre . lureau
From: Marc-André Lureau Move option parsing out of giant main(). Signed-off-by: Marc-André Lureau --- qga/main.c | 165 +++-- 1 file changed, 96 insertions(+), 69 deletions(-) diff --git a/qga/main.c b/qga/main.c index 83b7804..a8dda38 1

[Qemu-devel] [PATCH v2 07/12] qga: fill default options in main()

2015-08-25 Thread marcandre . lureau
From: Marc-André Lureau Fill all default options during main(). This is a preparation patch to allow to dump the configuration. Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth --- qga/main.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-

[Qemu-devel] [PATCH v2 05/12] qga: copy argument strings

2015-08-25 Thread marcandre . lureau
From: Marc-André Lureau A following patch will return allocated string. Signed-off-by: Marc-André Lureau --- qga/main.c | 57 +++-- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/qga/main.c b/qga/main.c index ede5306..83b7804

[Qemu-devel] [PATCH v2 04/12] qga: rename 'path' to 'channel_path'

2015-08-25 Thread marcandre . lureau
From: Marc-André Lureau 'path' is already a global function, rename the variable since it's going to be in global scope in a later patch. Signed-off-by: Marc-André Lureau --- qga/main.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qga/main.c b/qga/main.c index e

[Qemu-devel] [PATCH v2 09/12] qga: free a bit more

2015-08-25 Thread marcandre . lureau
From: Marc-André Lureau Now that main() has a single exit point, we can free a few more allocations. Signed-off-by: Marc-André Lureau --- qga/main.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qga/main.c b/qga/main.c index 118847c..58f2fc7 100644 --- a/qga/main.c

[Qemu-devel] [PATCH v2 11/12] qga: add --dump-conf option

2015-08-25 Thread marcandre . lureau
From: Marc-André Lureau This new option allows to review the agent configuration, and ease the task of writing a configuration file. Signed-off-by: Marc-André Lureau --- qga/main.c | 62 ++ 1 file changed, 62 insertions(+) diff --git

[Qemu-devel] [PATCH v2 08/12] qga: move agent run in a seperate function

2015-08-25 Thread marcandre . lureau
From: Marc-André Lureau Once the options are populated, move the running state to a run_agent() function. Signed-off-by: Marc-André Lureau --- qga/main.c | 164 + 1 file changed, 89 insertions(+), 75 deletions(-) diff --git a/qga/mai

[Qemu-devel] [PATCH v2 10/12] qga: add an optionnal qemu-ga.conf system configuration

2015-08-25 Thread marcandre . lureau
From: Marc-André Lureau Learn to configure the agent with a system configuration. This may simplify command-line handling, especially when the blacklist is long. Among the other benefits, this may standardize the configuration of a init service (instead of distro-specific init keys/files) Sign

[Qemu-devel] [PATCH v2 12/12] qga: start a man page

2015-08-25 Thread marcandre . lureau
From: Marc-André Lureau Add a simple man page for the qemu agent. Signed-off-by: Marc-André Lureau --- Makefile | 14 +- qemu-doc.texi | 6 +++ qemu-ga.texi | 136 ++ 3 files changed, 154 insertions(+), 2 deletions(-) create

[Qemu-devel] [PATCH v3 00/12] qemu-ga: add a configuration file

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau Hi, The following patches for the qemu agent add support for an optionnal configuration file, and a man page. Since v1: - spelling fixes - change device_path to channel_path - moving config to GAConfig struct - do check_is_frozen() during main - use g_key_file_to_data()

[Qemu-devel] [PATCH v3 01/12] qga: misc spelling

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake Reviewed-by: Denis V. Lunev Reviewed-by: Michael Roth --- qga/qapi-schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json index 18e3cc3..6b0bd

[Qemu-devel] [PATCH v3 05/12] qga: copy argument strings

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau A following patch will return allocated string. Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth --- qga/main.c | 57 +++-- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/qga/main.c b/qga/ma

[Qemu-devel] [PATCH v3 04/12] qga: rename 'path' to 'channel_path'

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau 'path' is already a global function, rename the variable since it's going to be in global scope in a later patch. Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth --- qga/main.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qga/

[Qemu-devel] [PATCH v3 02/12] qga: use exit() when parsing options

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau The option parsing is going to be moved to a separate function, use exit() consistently. Signed-off-by: Marc-André Lureau Reviewed-by: Denis V. Lunev Reviewed-by: Eric Blake Reviewed-by: Michael Roth --- qga/main.c | 24 1 file changed, 12 in

[Qemu-devel] [PATCH v3 03/12] qga: move string split in separate function

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau The function is going to be reused in a later patch. Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth --- qga/main.c | 33 ++--- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/qga/main.c b/qga/main.c index 10bb2f7.

[Qemu-devel] [PATCH v3 08/12] qga: move agent run in a separate function

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau Once the options are populated, move the running state to a run_agent() function. Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth --- qga/main.c | 164 + 1 file changed, 89 insertions(+), 75 deletio

[Qemu-devel] [PATCH v3 09/12] qga: free a bit more

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau Now that main() has a single exit point, we can free a few more allocations. Signed-off-by: Marc-André Lureau --- qga/main.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qga/main.c b/qga/main.c index 118847c..58f2fc7 100644 --- a/qga/main.c

[Qemu-devel] [PATCH v3 06/12] qga: move option parsing to separate function

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau Move option parsing out of giant main(). Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth --- qga/main.c | 165 +++-- 1 file changed, 96 insertions(+), 69 deletions(-) diff --git a/qga/main.c b/qga/main

[Qemu-devel] [PATCH v3 10/12] qga: add an optionnal qemu-ga.conf system configuration

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau Learn to configure the agent with a system configuration. This may simplify command-line handling, especially when the blacklist is long. Among the other benefits, this may standardize the configuration of a init service (instead of distro-specific init keys/files) Sign

[Qemu-devel] [PATCH v3 07/12] qga: fill default options in main()

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau Fill all default options during main(). This is a preparation patch to allow to dump the configuration. Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth --- qga/main.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-)

[Qemu-devel] [PATCH v3 12/12] qga: start a man page

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau Add a simple man page for the qemu agent. Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth --- Makefile | 14 +- qemu-doc.texi | 6 +++ qemu-ga.texi | 136 ++ 3 files changed, 154 insertions

[Qemu-devel] [PATCH v3 11/12] qga: add --dump-conf option

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau This new option allows to review the agent configuration, and ease the task of writing a configuration file. Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth --- qga/main.c | 62 ++ 1 file changed, 6

[Qemu-devel] [PATCH v4 02/13] qga: use exit() when parsing options

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau The option parsing is going to be moved to a separate function, use exit() consistently. Signed-off-by: Marc-André Lureau Reviewed-by: Denis V. Lunev Reviewed-by: Eric Blake Reviewed-by: Michael Roth --- qga/main.c | 24 1 file changed, 12 in

[Qemu-devel] [PATCH v4 01/13] qga: misc spelling

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake Reviewed-by: Denis V. Lunev Reviewed-by: Michael Roth --- qga/qapi-schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json index 18e3cc3..6b0bd

[Qemu-devel] [PATCH v4 00/13] qemu-ga: add a configuration file

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau Hi, The following patches for the qemu agent add support for an optionnal configuration file, and a man page. v3->v4: - some spelling fixes - add a patch to allocate in split_list() - add more details in "copy argument strings" patch - add some g_free() in config_parse()

[Qemu-devel] [PATCH v4 06/13] qga: copy argument strings

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau Following patch will return allocated strings, so we must correctly initialize alloc & free them. The nice side effect is that we no longer have to check for "fixed_state_dir" to call ga_install_service() with a NULL state dir. The default values are set after parsing the

[Qemu-devel] [PATCH v4 07/13] qga: move option parsing to separate function

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau Move option parsing out of giant main(). Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth Reviewed-by: Denis V. Lunev --- qga/main.c | 165 +++-- 1 file changed, 96 insertions(+), 69 deletions(-) diff

[Qemu-devel] [PATCH v4 04/13] qga: make split_list() return allocated strings

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau In order to avoid any confusion, let's allocate new strings when splitting. Signed-off-by: Marc-André Lureau --- qga/commands-posix.c | 6 +++--- qga/commands-win32.c | 4 ++-- qga/main.c | 22 +- 3 files changed, 14 insertions(+), 18 del

[Qemu-devel] [PATCH v4 03/13] qga: move string split in separate function

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau The function is going to be reused in a later patch. Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth --- qga/main.c | 33 ++--- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/qga/main.c b/qga/main.c index 10bb2f7.

[Qemu-devel] [PATCH v4 12/13] qga: add --dump-conf option

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau This new option allows to review the agent configuration, and ease the task of writing a configuration file. Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth --- qga/main.c | 64 ++ 1 file changed, 6

[Qemu-devel] [PATCH v4 09/13] qga: move agent run in a separate function

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau Once the options are populated, move the running state to a run_agent() function. Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth Reviewed-by: Denis V. Lunev --- qga/main.c | 166 + 1 file changed,

[Qemu-devel] [PATCH v4 05/13] qga: rename 'path' to 'channel_path'

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau 'path' is already a global function, rename the variable since it's going to be in global scope in a later patch. Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth Reviewed-by: Denis V. Lunev --- qga/main.c | 9 + 1 file changed, 5 insertions(+), 4 de

[Qemu-devel] [PATCH v4 10/13] qga: free a bit more

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau Now that main() has a single exit point, we can free a few more allocations. Signed-off-by: Marc-André Lureau Reviewed-by: Denis V. Lunev --- qga/main.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qga/main.c b/qga/main.c index 6518e1f..710

[Qemu-devel] [PATCH v4 08/13] qga: fill default options in main()

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau Fill all default options during main(). This is a preparation patch to allow to dump the configuration. Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth Reviewed-by: Denis V. Lunev --- qga/main.c | 34 +- 1 file changed, 17 in

[Qemu-devel] [PATCH v4 11/13] qga: add an optional qemu-ga.conf system configuration

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau Learn to configure the agent with a system configuration. This may simplify command-line handling, especially when the blacklist is long. Among the other benefits, this may standardize the configuration of an init service (instead of distro-specific init keys/files) Sig

[Qemu-devel] [PATCH v4 13/13] qga: start a man page

2015-08-26 Thread marcandre . lureau
From: Marc-André Lureau Add a simple man page for the qemu agent. Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth --- Makefile | 14 +- qemu-doc.texi | 6 +++ qemu-ga.texi | 136 ++ 3 files changed, 154 insertions

[Qemu-devel] [PATCH] docs: fix a qga/qapi-schema.json comment

2015-08-27 Thread marcandre . lureau
From: Marc-André Lureau For consistency with the rest of the comment blocks. Signed-off-by: Marc-André Lureau --- qga/qapi-schema.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json index 6b0bd16..82894c6 100644 --- a/qga/qapi-

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

2015-08-27 Thread marcandre . lureau
From: Marc-André Lureau Add some local guest agent tests (as it is better than nothing). They can be run inside or outside a VM, when run inside a VM, they will do a bit more side effects, such as freezing/thawing the FS or changing the time. A better test would involve a managed VM (or contain

[Qemu-devel] [PATCH 1/2] qtest: add a few fd-level qmp helpers

2015-08-27 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 --- tests/libqtest.c | 45 + tests/libqtest.h | 7 +++ 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/tests/libqt

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

2015-09-02 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 1/3] monitor: split MonitorQAPIEventState

2015-09-02 Thread marcandre . lureau
From: Marc-André Lureau Create a separate 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 2/3] monitor: throttle QAPI_EVENT_VSERPORT_CHANGE by "id"

2015-09-02 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 3/3] monitor: remove old entries from event hash table

2015-09-02 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 | 47 ++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/monitor.c b/monitor.c

[Qemu-devel] [PATCH] char: translate from QIOChannel error to errno

2016-03-11 Thread marcandre . lureau
From: Marc-André Lureau Caller of CharDriverState.chr* callback assume errno error conventions. Translate QIOChannel error to errno (this fixes potential EAGAIN regression, for ex if a vhost-user backend block, qemu_chr_fe_read_all() could get error -2 and not wait) Signed-off-by: Marc-André Lur

[Qemu-devel] [PATCH 05/18] vhost-user: check reconnect comes with wait

2016-04-01 Thread marcandre . lureau
From: Marc-André Lureau If the client socket has the 'reconnect' option, make sure the 'wait' option is also used. That way, an initial connection will be ensured before the VM start and the virtio device is configured. Signed-off-by: Marc-André Lureau --- net/vhost-user.c | 12 1

[Qemu-devel] [PATCH 02/18] char: lower reconnect error to trace event

2016-04-01 Thread marcandre . lureau
From: Marc-André Lureau This message is an information rather than an error. Use a trace event instead. This allows using reconnect in tests without extra error messages. Signed-off-by: Marc-André Lureau --- qemu-char.c | 4 ++-- trace-events | 3 +++ 2 files changed, 5 insertions(+), 2 dele

[Qemu-devel] [PATCH 01/18] tests: append i386 tests

2016-04-01 Thread marcandre . lureau
From: Marc-André Lureau Do not overwrite x86-64 tests, re-enable vhost-user-test. Signed-off-by: Marc-André Lureau --- tests/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Makefile b/tests/Makefile index 45b9048..9293d49 100644 --- a/tests/Makefile +++ b/tes

[Qemu-devel] [PATCH 00/18] RFCv2: vhost-user: shutdown and reconnection

2016-04-01 Thread marcandre . lureau
From: Marc-André Lureau Hi This is a follow-up on previous RFC allowing the slave to request a "managed" shutdown and reconnect later. A new optional communication socket is added for the slave to make request to the master (since vhost-user protocol isn't bidirectional) The initial connection

[Qemu-devel] [PATCH 03/18] char: use a trace for when the char is waiting

2016-04-01 Thread marcandre . lureau
From: Marc-André Lureau Similarly to the reconnect error, this is an information message rather than an error. Use a trace event instead. Signed-off-by: Marc-André Lureau --- qemu-char.c | 3 +-- trace-events | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-char.c b/

[Qemu-devel] [PATCH 07/18] vhost: add vhost_dev stop callback

2016-04-01 Thread marcandre . lureau
From: Marc-André Lureau vhost backend may want to stop the device, for example if it wants to restart itself (translates to a link down for vhost-net). Signed-off-by: Marc-André Lureau --- hw/net/vhost_net.c| 14 ++ include/hw/virtio/vhost.h | 4 2 files changed, 18 i

[Qemu-devel] [PATCH 04/18] char: add wait support for reconnect

2016-04-01 Thread marcandre . lureau
From: Marc-André Lureau Until now, 'wait' was solely used for listening sockets. However, it can also be useful for 'reconnect' socket kind, where the first open must succeed before continuing. This allows for instance (with other support patches) having vhost-user wait for an initial connection

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

2016-04-01 Thread marcandre . lureau
From: Marc-André Lureau Check that SLAVE_FD & SHUTDOWN message work and that the master asked for the ring read status. Signed-off-by: Marc-André Lureau --- tests/Makefile | 2 +- tests/vhost-user-test.c | 184 2 files changed, 170 in

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

2016-04-01 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 06/18] vhost-user: add ability to know vhost-user backend disconnection

2016-04-01 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 08/18] vhost-user: add vhost_user to hold the chr

2016-04-01 Thread marcandre . lureau
From: Marc-André Lureau Next patches will add more fields to the structure Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 5914e85..02ac1fc

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

2016-04-01 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 --- hw/net/vhost_net.c | 7 ++- 1 file changed, 6 insertions(+), 1 del

[Qemu-devel] [PATCH 10/18] vhost-user: add slave-fd support

2016-04-01 Thread marcandre . lureau
From: Marc-André Lureau Learn to give a socket to the slave to let him make requests to the master. Signed-off-by: Marc-André Lureau --- docs/specs/vhost-user.txt | 23 hw/virtio/vhost-user.c| 69 +++ 2 files changed, 92 insertio

[Qemu-devel] [PATCH 11/18] vhost-user: add shutdown support

2016-04-01 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- docs/specs/vhost-user.txt | 15 +++ hw/virtio/vhost-user.c| 16 2 files changed, 31 insertions(+) diff --git a/docs/specs/vhost-user.txt b/docs/specs/vhost-user.txt index 8a635fa..60d6d13 100644 --- a

[Qemu-devel] [PATCH 16/18] test: vubr check vring enable state

2016-04-01 Thread marcandre . lureau
From: Marc-André Lureau The rings shouldn't be processed unless previously enabled. Signed-off-by: Marc-André Lureau --- tests/vhost-user-bridge.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c index 0779ba2.

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

2016-04-01 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 12/18] vhost-user: disconnect on start failure

2016-04-01 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. Signed-off-by: Marc-André Lureau --- net/vhost-user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/vhost-user.c b/n

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

2016-04-01 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 18/18] test: add shutdown support vubr test

2016-04-01 Thread marcandre . lureau
From: Marc-André Lureau The bridge can now be interrupted with ctrl-c. Once the slave channel is up, it will request a shutdown, and wait for success reply to exit. Signed-off-by: Marc-André Lureau --- tests/vhost-user-bridge.c | 102 -- 1 file chang

[Qemu-devel] [PATCH 0/2] vhost-user: release chardev on cleanup

2016-04-06 Thread marcandre . lureau
From: Marc-André Lureau The following 2 one-liners remove the chardev from the vhost-user netdev it is attached to. This prevents from further reuse of the chardev that would likely fail to setup again with the slave. Related to: https://bugzilla.redhat.com/show_bug.cgi?id=1256619 https://bugzil

[Qemu-devel] [PATCH 1/2] vhost-user: release chardev on cleanup

2016-04-06 Thread marcandre . lureau
From: Marc-André Lureau On init, vhost-user does qemu_chr_fe_claim_no_fail(). Do the opposite on cleanup to allow removing or reusing the chardev. Signed-off-by: Marc-André Lureau --- net/vhost-user.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/vhost-user.c b/net/vhost-user.c ind

[Qemu-devel] [PATCH 2/2] vhost-user: delete chardev on cleanup

2016-04-06 Thread marcandre . lureau
From: Marc-André Lureau Remove the chardev implicitely when cleaning up the netdev. This prevents from reusing the chardev since it would be in an incorrect state with the slave. Signed-off-by: Marc-André Lureau --- net/vhost-user.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost

[Qemu-devel] [PATCH 1/2] specs/vhost-user: improve VHOST_SET_VRING_NUM documentation

2016-04-09 Thread marcandre . lureau
From: Marc-André Lureau "number of vrings" doesn't help me understand the purpose of this message. My understanding is that it is rather the size of the queue (in modern terms). Signed-off-by: Marc-André Lureau --- docs/specs/vhost-user.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[Qemu-devel] [PATCH 2/2] specs/vhost-user: spelling fix

2016-04-09 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- docs/specs/vhost-user.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/specs/vhost-user.txt b/docs/specs/vhost-user.txt index 4778241..777c49c 100644 --- a/docs/specs/vhost-user.txt +++ b/docs/specs/vhost-u

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

2016-04-09 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 backends duplicate most of the effort. Furthermore, due to usage of ancillary data, shared memory, eventfd, atomics, it is not so simpl

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

2016-04-09 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] [RFC 2/6] vubr: remove unnecessary dispatcher_remove

2016-04-09 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] [RFC 4/6] vubr: do not accept more than one connection

2016-04-09 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] [RFC 3/6] vubr: indicate peer disconnected

2016-04-09 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] [RFC 6/6] test/vubr: use contrib/libvhost-user

2016-04-09 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] [RFC 5/6] contrib: add libvhost-user

2016-04-09 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] [PATCH 0/9] RFC: add memfd memory backend

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

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