From 938b8a36b65e44c44ca29245437f8d7ac0f826e8 Mon Sep 17 00:00:00 2001 From: Uri Lublin Date: Wed, 12 Dec 2012 18:30:47 +0200 Subject: qxl+vnc: register a vm state change handler for dummy spice_server When qxl + vnc are used, a dummy spice_server is initialized. The spice_server has to be told when the VM runstate changes, which is what this patch does. Without it, from qxl_send_events(), the following error message is shown: qxl_send_events: spice-server bug: guest stopped, ignoring Cc: qemu-stable@nongnu.org Signed-off-by: Uri Lublin Signed-off-by: Gerd Hoffmann --- ui/spice-core.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ui') diff --git a/ui/spice-core.c b/ui/spice-core.c index 261c6f2c11..59ce5f6370 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -732,6 +732,8 @@ int qemu_spice_add_interface(SpiceBaseInstance *sin) */ spice_server = spice_server_new(); spice_server_init(spice_server, &core_interface); + qemu_add_vm_change_state_handler(vm_change_state_handler, + &spice_server); } return spice_server_add_interface(spice_server, sin); -- cgit v1.2.3 From 5a49d3e9a799b7e1bf87da7ae7f2a719e01da319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 5 Dec 2012 16:15:34 +0100 Subject: spice-qemu-char: add spiceport chardev Add a new spice chardev to allow arbitrary communication between the host and the Spice client via the spice server. Examples: This allows the Spice client to have a special port for the qemu monitor: ... -chardev spiceport,name=org.qemu.monitor,id=monitorport -mon chardev=monitorport v2: - remove support for chardev to chardev linking - conditionnaly compile with SPICE_SERVER_VERSION Signed-off-by: Gerd Hoffmann --- ui/qemu-spice.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ui') diff --git a/ui/qemu-spice.h b/ui/qemu-spice.h index 3299da87d6..5669767de0 100644 --- a/ui/qemu-spice.h +++ b/ui/qemu-spice.h @@ -46,6 +46,9 @@ void do_info_spice_print(Monitor *mon, const QObject *data); void do_info_spice(Monitor *mon, QObject **ret_data); CharDriverState *qemu_chr_open_spice(QemuOpts *opts); +#if SPICE_SERVER_VERSION >= 0x000c02 +CharDriverState *qemu_chr_open_spice_port(QemuOpts *opts); +#endif #else /* CONFIG_SPICE */ #include "monitor.h" -- cgit v1.2.3 From afd0b4091fef7a1290cf76c6da8c9a24a3553d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 5 Dec 2012 16:15:36 +0100 Subject: spice-qemu-char: register spicevmc ports during qemu_spice_init() Do the delayed registration of spicevmc ports after Spice server is initialized. Signed-off-by: Gerd Hoffmann --- ui/qemu-spice.h | 1 + ui/spice-core.c | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'ui') diff --git a/ui/qemu-spice.h b/ui/qemu-spice.h index 5669767de0..642f012690 100644 --- a/ui/qemu-spice.h +++ b/ui/qemu-spice.h @@ -48,6 +48,7 @@ void do_info_spice(Monitor *mon, QObject **ret_data); CharDriverState *qemu_chr_open_spice(QemuOpts *opts); #if SPICE_SERVER_VERSION >= 0x000c02 CharDriverState *qemu_chr_open_spice_port(QemuOpts *opts); +void qemu_spice_register_ports(void); #endif #else /* CONFIG_SPICE */ diff --git a/ui/spice-core.c b/ui/spice-core.c index 59ce5f6370..ac46deb2be 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -714,6 +714,10 @@ void qemu_spice_init(void) g_free(x509_key_file); g_free(x509_cert_file); g_free(x509_cacert_file); + +#if SPICE_SERVER_VERSION >= 0x000c02 + qemu_spice_register_ports(); +#endif } int qemu_spice_add_interface(SpiceBaseInstance *sin) -- cgit v1.2.3