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 initialization 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 reaction 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 c23cbd6fa8.
This commit is contained in:
Christian Ehrhardt 2022-03-21 09:07:08 +01:00
parent b24e2ea68e
commit ab9ad87c5f
No known key found for this signature in database
GPG Key ID: BA3E29338280B242

View File

@ -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");