mvadkert / rpms / qemu

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