Skip to contentSkip to conversation

qxl: make sure primary surface is saved on migration

PATCH Superseded Yonit Halperin 2 participants 2 messages Jul 4, 2011

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 qxl: make sure primary surface is saved on migration

---
 hw/qxl.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
hw/qxl.c +6 -3
index 2bb36c6..cff95a4 100644
@@ -1165,11 +1165,14 @@ static void qxl_vm_change_state_handler(void *opaque, int running, int reason)
     qemu_spice_vm_change_state_handler(&qxl->ssd, running, reason);
 
     if (!running && qxl->mode == QXL_MODE_NATIVE) {
-        /* dirty all vram (which holds surfaces) to make sure it is saved */
+        /* dirty all vram (which holds surfaces) and devram (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 */
-        ram_addr_t addr = qxl->vram_offset;
-        qxl_set_dirty(addr, addr + qxl->vram_size);
+        ram_addr_t vram_addr = qxl->vram_offset;
+        ram_addr_t devram_addr = qxl->vga.vram_offset;
+        qxl_set_dirty(vram_addr, vram_addr + qxl->vram_size);
+        qxl_set_dirty(devram_addr, devram_addr + qxl->rom->surface0_area_size);
     }
 }
 
Signature · 1 line
1.7.4.4
#1 lore raw

Hi,

Quoted 1 line

+ qxl_set_dirty(devram_addr, devram_addr + qxl->rom->surface0_area_size);

s/rom/shadow_rom/, then it is perfect. rom points directly to guest memory, better don't trust that.

cheers,
Gerd