Patchwork [v2] qxl+vnc: register a vm state change handler for dummy spice_server

login
register
mail settings
Submitter Uri Lublin
Date Dec. 12, 2012, 4:30 p.m.
Message ID <b0d36cf21883b37663f55501d615aafc94ede34f.1355329609.git.uril@redhat.com>
Download mbox | patch
Permalink /patch/205574/
State New
Headers show

Comments

Uri Lublin - Dec. 12, 2012, 4:30 p.m.
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

Signed-off-by: Uri Lublin <uril@redhat.com>
---

v1 -> v2: make checkpatch happy

---
 ui/spice-core.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Gerd Hoffmann - Dec. 17, 2012, 9:19 a.m.
On 12/12/12 17:30, Uri Lublin wrote:
> 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

Patch added to spice patch queue.

thanks,
  Gerd

Patch

diff --git a/ui/spice-core.c b/ui/spice-core.c
index 261c6f2..59ce5f6 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);