diff -Nru spice-0.15.0/debian/changelog spice-0.15.0/debian/changelog --- spice-0.15.0/debian/changelog 2021-12-01 16:10:53.000000000 +0000 +++ spice-0.15.0/debian/changelog 2022-03-21 08:23:33.000000000 +0000 @@ -1,3 +1,10 @@ +spice (0.15.0-2ubuntu4) jammy; urgency=medium + + * d/p/Revert-reds-start-QXL-devices-if-VM-is-running-fix-r.patch: fix race + on spice init (LP: #1964777) + + -- Christian Ehrhardt Mon, 21 Mar 2022 09:23:33 +0100 + spice (0.15.0-2ubuntu3) jammy; urgency=medium * No-change rebuild against openssl3 diff -Nru spice-0.15.0/debian/patches/Revert-reds-start-QXL-devices-if-VM-is-running-fix-r.patch spice-0.15.0/debian/patches/Revert-reds-start-QXL-devices-if-VM-is-running-fix-r.patch --- spice-0.15.0/debian/patches/Revert-reds-start-QXL-devices-if-VM-is-running-fix-r.patch 1970-01-01 00:00:00.000000000 +0000 +++ spice-0.15.0/debian/patches/Revert-reds-start-QXL-devices-if-VM-is-running-fix-r.patch 2022-03-21 08:23:33.000000000 +0000 @@ -0,0 +1,55 @@ +From 252729adbdca81e0ceefe8e4fc48b8cab83bfcf5 Mon Sep 17 00:00:00 2001 +From: Christian Ehrhardt +Date: Mon, 21 Mar 2022 09:07:08 +0100 +Subject: [PATCH] Revert "reds: start QXL devices if VM is running" (fix race) + +Due to reds->vm_running being initialized to TRUE (since c302e12c +"spice.h: add entries for tracking vm state") the assumption in c23cbd6f +"reds: start QXL devices if VM is running" was wrong and we can't check +on vm_running until that initalization isn't on TRUE (it is that way for +backward compatibility). + +Without this revert on qemu initializing spice we will have the +display_init side of qemu not yet ready and therefore respond badly when +spice sends an event as raction to `red_qxl_start`: + "qxl_send_events: spice-server bug: guest stopped, ignoring." + +At least with qemu > v2.0 as a spice consumer is not showing issues as +`red_qxl_start` will be called just after the qemu side is ready +`qemu_spice_display_start` -> `spice_server_vm_start` ... `red_qxl_start`. + +Therefore - for now to avoid the current regression - Revert c23cbd6f +"reds: start QXL devices if VM is running" until that old (2012) +initialization is updated (probably an ABI change and therefore taking +some time). + +Fixes: https://gitlab.freedesktop.org/spice/spice/-/issues/64 + +This reverts commit c23cbd6fa821fea8ac4ed97ca679afebe2333c8c. +--- + server/reds.cpp | 3 --- + +1 file changed, 3 deletions(-) + +Forwarded: https://gitlab.freedesktop.org/spice/spice/-/merge_requests/202 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/spice/+bug/1964777 +Bug-Upstream: https://gitlab.freedesktop.org/spice/spice/-/issues/64 +Last-Update: 2022-03-21 + +diff --git a/server/reds.cpp b/server/reds.cpp +index 11eb4cb27e..1ada47d8be 100644 +--- a/server/reds.cpp ++++ b/server/reds.cpp +@@ -3244,9 +3244,6 @@ SPICE_GNUC_VISIBLE int spice_server_add_interface(SpiceServer *reds, + * be called. */ + red_qxl_attach_worker(qxl); + red_qxl_set_compression_level(qxl, calc_compression_level(reds)); +- if (reds->vm_running) { +- red_qxl_start(qxl); +- } + } else if (strcmp(base_interface->type, SPICE_INTERFACE_TABLET) == 0) { + SpiceTabletInstance *tablet = SPICE_UPCAST(SpiceTabletInstance, sin); + spice_debug("SPICE_INTERFACE_TABLET"); +-- +2.35.1 + diff -Nru spice-0.15.0/debian/patches/series spice-0.15.0/debian/patches/series --- spice-0.15.0/debian/patches/series 2021-11-10 13:22:14.000000000 +0000 +++ spice-0.15.0/debian/patches/series 2022-03-21 08:23:33.000000000 +0000 @@ -1,3 +1,4 @@ disable-failing-test-listen.patch do-not-run-nonexisting-doxygen-sh.patch 0001-test-leaks-fix-the-test-with-OpenSSL3.patch +Revert-reds-start-QXL-devices-if-VM-is-running-fix-r.patch