dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone

Blame 0216-qxl-Ignore-set_client_capabilities-pre-post-migrate.patch

Hans de Goede 393f81
From 68d246d6a904e0a851c521a08a18187598e1c696 Mon Sep 17 00:00:00 2001
Hans de Goede 393f81
From: Hans de Goede <hdegoede@redhat.com>
Hans de Goede 393f81
Date: Fri, 7 Sep 2012 21:29:22 +0200
Hans de Goede 393f81
Subject: [PATCH] qxl: Ignore set_client_capabilities pre/post migrate
Hans de Goede 393f81
Hans de Goede 393f81
The recent introduction of set_client_capabilities has broken
Hans de Goede 393f81
(seamless) migration by trying to call qxl_send_events pre (seamless
Hans de Goede 393f81
incoming) and post (*) migration, triggering the following assert:
Hans de Goede 393f81
qxl_send_events: Assertion `qemu_spice_display_is_running(&d->ssd)' failed.
Hans de Goede 393f81
Hans de Goede 393f81
The solution is easy, pre migration the guest will have already received
Hans de Goede 393f81
the client caps on the migration source side, and post migration there no
Hans de Goede 393f81
longer is a guest, so we can simply ignore the set_client_capabilities call
Hans de Goede 393f81
in both those scenarios.
Hans de Goede 393f81
Hans de Goede 393f81
*) Post migration, so not fatal for to the migration itself, but still a crash
Hans de Goede 393f81
Hans de Goede 393f81
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede 393f81
---
Hans de Goede 393f81
 hw/qxl.c | 5 +++++
Hans de Goede 393f81
 1 file changed, 5 insertions(+)
Hans de Goede 393f81
Hans de Goede 393f81
diff --git a/hw/qxl.c b/hw/qxl.c
Hans de Goede 393f81
index 045432e..1b400f1 100644
Hans de Goede 393f81
--- a/hw/qxl.c
Hans de Goede 393f81
+++ b/hw/qxl.c
Hans de Goede 393f81
@@ -953,6 +953,11 @@ static void interface_set_client_capabilities(QXLInstance *sin,
Hans de Goede 393f81
 {
Hans de Goede 393f81
     PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
Hans de Goede 393f81
 
Hans de Goede 393f81
+    if (runstate_check(RUN_STATE_INMIGRATE) ||
Hans de Goede 393f81
+        runstate_check(RUN_STATE_POSTMIGRATE)) {
Hans de Goede 393f81
+        return;
Hans de Goede 393f81
+    }
Hans de Goede 393f81
+
Hans de Goede 393f81
     qxl->shadow_rom.client_present = client_present;
Hans de Goede 393f81
     memcpy(qxl->shadow_rom.client_capabilities, caps, sizeof(caps));
Hans de Goede 393f81
     qxl->rom->client_present = client_present;
Hans de Goede 393f81
-- 
Hans de Goede 393f81
1.7.12
Hans de Goede 393f81