dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone

Blame 0404-qxl-don-t-render-stuff-when-the-vm-is-stopped.patch

56753f
From 29fdb0f3a401e5590e465a0cc37d82383f3d5f07 Mon Sep 17 00:00:00 2001
56753f
From: Gerd Hoffmann <kraxel@redhat.com>
56753f
Date: Wed, 15 Feb 2012 14:04:44 +0100
56753f
Subject: [PATCH 404/434] qxl: don't render stuff when the vm is stopped.
56753f
56753f
This patch fixes the local qxl renderer to not kick spice-server
56753f
in case the vm is stopped.  First it is largely pointless because
56753f
we ask spice-server to process all not-yet processed commands when
56753f
the vm is stopped, so there isn't much do do anyway.  Second we
56753f
avoid triggering an assert in spice-server.
56753f
56753f
The patch makes sure we still honor redraw requests, even if we don't
56753f
ask spice-server for updates.  This is needed to handle displaysurface
56753f
changes with a stopped vm correctly.
56753f
56753f
With this patch applied it is possible to take screen shots (via
56753f
screendump monitor command) from a qxl gpu even in case the guest
56753f
is stopped.
56753f
56753f
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
56753f
---
56753f
 hw/qxl-render.c |   12 +++++-------
56753f
 1 file changed, 5 insertions(+), 7 deletions(-)
56753f
56753f
diff --git a/hw/qxl-render.c b/hw/qxl-render.c
56753f
index 2c51ba9..a7891b2 100644
56753f
--- a/hw/qxl-render.c
56753f
+++ b/hw/qxl-render.c
56753f
@@ -121,19 +121,17 @@ void qxl_render_update(PCIQXLDevice *qxl)
56753f
         dpy_resize(vga->ds);
56753f
     }
56753f
 
56753f
-    if (!qxl->guest_primary.commands) {
56753f
-        return;
56753f
-    }
56753f
-    qxl->guest_primary.commands = 0;
56753f
-
56753f
     update.left   = 0;
56753f
     update.right  = qxl->guest_primary.surface.width;
56753f
     update.top    = 0;
56753f
     update.bottom = qxl->guest_primary.surface.height;
56753f
 
56753f
     memset(dirty, 0, sizeof(dirty));
56753f
-    qxl_spice_update_area(qxl, 0, &update,
56753f
-                          dirty, ARRAY_SIZE(dirty), 1, QXL_SYNC);
56753f
+    if (runstate_is_running() && qxl->guest_primary.commands) {
56753f
+        qxl->guest_primary.commands = 0;
56753f
+        qxl_spice_update_area(qxl, 0, &update,
56753f
+                              dirty, ARRAY_SIZE(dirty), 1, QXL_SYNC);
56753f
+    }
56753f
     if (redraw) {
56753f
         memset(dirty, 0, sizeof(dirty));
56753f
         dirty[0] = update;
56753f
-- 
56753f
1.7.10
56753f