Fix loadvm
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
Tue, 3 Jul 2007 09:55:03 +0000 (09:55 +0000)
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
Tue, 3 Jul 2007 09:55:03 +0000 (09:55 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3044 c046a42c-6fe2-441c-8c8c-71466251a162

hw/iommu.c
hw/tcx.c

index 082451f9864cae6f127f6e5d425f842bf7afbbff..77d8b817e69128212f63abc7e7140d87ec9f6f73 100644 (file)
@@ -259,7 +259,7 @@ static int iommu_load(QEMUFile *f, void *opaque, int version_id)
         return -EINVAL;
 
     for (i = 0; i < IOMMU_NREGS; i++)
-       qemu_put_be32s(f, &s->regs[i]);
+        qemu_get_be32s(f, &s->regs[i]);
     qemu_get_be64s(f, &s->iostart);
 
     return 0;
index 10ae987fc221a9bf7bf2b3695eeeb0227099fcbf..c334f092347f571ad5f0301e274358d1c4ec6c6a 100644 (file)
--- a/hw/tcx.c
+++ b/hw/tcx.c
@@ -354,9 +354,6 @@ static void tcx_save(QEMUFile *f, void *opaque)
 {
     TCXState *s = opaque;
     
-    qemu_put_be32s(f, (uint32_t *)&s->vram);
-    qemu_put_be32s(f, (uint32_t *)&s->vram24);
-    qemu_put_be32s(f, (uint32_t *)&s->cplane);
     qemu_put_be16s(f, (uint16_t *)&s->height);
     qemu_put_be16s(f, (uint16_t *)&s->width);
     qemu_put_be16s(f, (uint16_t *)&s->depth);
@@ -370,13 +367,16 @@ static void tcx_save(QEMUFile *f, void *opaque)
 static int tcx_load(QEMUFile *f, void *opaque, int version_id)
 {
     TCXState *s = opaque;
-    
-    if (version_id != 3)
+    uint32_t dummy;
+
+    if (version_id != 3 && version_id != 4)
         return -EINVAL;
 
-    qemu_get_be32s(f, (uint32_t *)&s->vram);
-    qemu_get_be32s(f, (uint32_t *)&s->vram24);
-    qemu_get_be32s(f, (uint32_t *)&s->cplane);
+    if (version_id == 3) {
+        qemu_get_be32s(f, (uint32_t *)&dummy);
+        qemu_get_be32s(f, (uint32_t *)&dummy);
+        qemu_get_be32s(f, (uint32_t *)&dummy);
+    }
     qemu_get_be16s(f, (uint16_t *)&s->height);
     qemu_get_be16s(f, (uint16_t *)&s->width);
     qemu_get_be16s(f, (uint16_t *)&s->depth);
@@ -546,7 +546,7 @@ void tcx_init(DisplayState *ds, target_phys_addr_t addr, uint8_t *vram_base,
     cpu_register_physical_memory(addr + 0x00301000ULL, TCX_THC_NREGS_24,
                                  dummy_memory);
 
-    register_savevm("tcx", addr, 3, tcx_save, tcx_load, s);
+    register_savevm("tcx", addr, 4, tcx_save, tcx_load, s);
     qemu_register_reset(tcx_reset, s);
     tcx_reset(s);
     dpy_resize(s->ds, width, height);