[Spice-devel] [PATCH] qxl: make sure primary surface is saved on migration also in compat mode

Yonit Halperin yhalperi at redhat.com
Tue Feb 14 00:10:18 PST 2012


RHBZ #790083

Signed-off-by: Yonit Halperin <yhalperi at redhat.com>
---
 hw/qxl.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/hw/qxl.c b/hw/qxl.c
index bc03c1d..a2a3380 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1478,14 +1478,21 @@ static void qxl_vm_change_state_handler(void *opaque, int running,
          * called
          */
          qxl_update_irq(qxl);
-    } else if (qxl->mode == QXL_MODE_NATIVE) {
-        /* dirty all vram (which holds surfaces) and devram (primary surface)
+    } else {
+        /* dirty all vram (which holds surfaces) and the primary surface
          * to make sure they are saved */
         /* FIXME #1: should go out during "live" stage */
         /* FIXME #2: we only need to save the areas which are actually used */
-        qxl_set_dirty(&qxl->vram_bar, 0, qxl->vram_size);
-        qxl_set_dirty(&qxl->vga.vram, qxl->shadow_rom.draw_area_offset,
-                      qxl->shadow_rom.surface0_area_size);
+        switch (qxl->mode) {
+        case QXL_MODE_NATIVE:
+            qxl_set_dirty(&qxl->vram_bar, 0, qxl->vram_size);
+        case QXL_MODE_COMPAT:
+            qxl_set_dirty(&qxl->vga.vram, qxl->shadow_rom.draw_area_offset,
+                          qxl->shadow_rom.surface0_area_size);
+            break;
+        default:
+            break;
+        }
     }
 }
 
-- 
1.7.7.6



More information about the Spice-devel mailing list