qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] ui: fix spice display regression


From: marcandre . lureau
Subject: [PATCH] ui: fix spice display regression
Date: Wed, 27 Jan 2021 14:02:06 +0400

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Since commit b4e1a342112e50e05b609e857f38c1f2b7aafdc4 ("vl: remove
separate preconfig main_loop"), spice initialization is a bit dodgy, and
the client get stuck waiting for server events.

The initialization order changed, so that qemu_spice_display_start() is
called before the display interfaces are added. The new interfaces
aren't started by spice-server automatically (yet?), so we have to tell
the server explicitely when we are already running.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 ui/spice-core.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/ui/spice-core.c b/ui/spice-core.c
index 5746d0aae7..6eebf12e3c 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -830,6 +830,8 @@ static void qemu_spice_init(void)
 
 static int qemu_spice_add_interface(SpiceBaseInstance *sin)
 {
+    int ret;
+
     if (!spice_server) {
         if (QTAILQ_FIRST(&qemu_spice_opts.head) != NULL) {
             error_report("Oops: spice configured but not active");
@@ -848,7 +850,13 @@ static int qemu_spice_add_interface(SpiceBaseInstance *sin)
         qemu_add_vm_change_state_handler(vm_change_state_handler, NULL);
     }
 
-    return spice_server_add_interface(spice_server, sin);
+    ret = spice_server_add_interface(spice_server, sin);
+    /* make sure the newly added interface is started */
+    if (ret == 0 && spice_display_is_running) {
+        spice_server_vm_start(spice_server);
+    }
+
+    return ret;
 }
 
 static GSList *spice_consoles;
-- 
2.29.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]