Commit fda77c2d65d15ed35b01f60be37a17e2cd83bfe3

Authored by blueswir1
1 parent aeb30be6

Fix loadvm


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3044 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 2 changed files with 10 additions and 10 deletions
hw/iommu.c
@@ -259,7 +259,7 @@ static int iommu_load(QEMUFile *f, void *opaque, int version_id) @@ -259,7 +259,7 @@ static int iommu_load(QEMUFile *f, void *opaque, int version_id)
259 return -EINVAL; 259 return -EINVAL;
260 260
261 for (i = 0; i < IOMMU_NREGS; i++) 261 for (i = 0; i < IOMMU_NREGS; i++)
262 - qemu_put_be32s(f, &s->regs[i]); 262 + qemu_get_be32s(f, &s->regs[i]);
263 qemu_get_be64s(f, &s->iostart); 263 qemu_get_be64s(f, &s->iostart);
264 264
265 return 0; 265 return 0;
hw/tcx.c
@@ -354,9 +354,6 @@ static void tcx_save(QEMUFile *f, void *opaque) @@ -354,9 +354,6 @@ static void tcx_save(QEMUFile *f, void *opaque)
354 { 354 {
355 TCXState *s = opaque; 355 TCXState *s = opaque;
356 356
357 - qemu_put_be32s(f, (uint32_t *)&s->vram);  
358 - qemu_put_be32s(f, (uint32_t *)&s->vram24);  
359 - qemu_put_be32s(f, (uint32_t *)&s->cplane);  
360 qemu_put_be16s(f, (uint16_t *)&s->height); 357 qemu_put_be16s(f, (uint16_t *)&s->height);
361 qemu_put_be16s(f, (uint16_t *)&s->width); 358 qemu_put_be16s(f, (uint16_t *)&s->width);
362 qemu_put_be16s(f, (uint16_t *)&s->depth); 359 qemu_put_be16s(f, (uint16_t *)&s->depth);
@@ -370,13 +367,16 @@ static void tcx_save(QEMUFile *f, void *opaque) @@ -370,13 +367,16 @@ static void tcx_save(QEMUFile *f, void *opaque)
370 static int tcx_load(QEMUFile *f, void *opaque, int version_id) 367 static int tcx_load(QEMUFile *f, void *opaque, int version_id)
371 { 368 {
372 TCXState *s = opaque; 369 TCXState *s = opaque;
373 -  
374 - if (version_id != 3) 370 + uint32_t dummy;
  371 +
  372 + if (version_id != 3 && version_id != 4)
375 return -EINVAL; 373 return -EINVAL;
376 374
377 - qemu_get_be32s(f, (uint32_t *)&s->vram);  
378 - qemu_get_be32s(f, (uint32_t *)&s->vram24);  
379 - qemu_get_be32s(f, (uint32_t *)&s->cplane); 375 + if (version_id == 3) {
  376 + qemu_get_be32s(f, (uint32_t *)&dummy);
  377 + qemu_get_be32s(f, (uint32_t *)&dummy);
  378 + qemu_get_be32s(f, (uint32_t *)&dummy);
  379 + }
380 qemu_get_be16s(f, (uint16_t *)&s->height); 380 qemu_get_be16s(f, (uint16_t *)&s->height);
381 qemu_get_be16s(f, (uint16_t *)&s->width); 381 qemu_get_be16s(f, (uint16_t *)&s->width);
382 qemu_get_be16s(f, (uint16_t *)&s->depth); 382 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, @@ -546,7 +546,7 @@ void tcx_init(DisplayState *ds, target_phys_addr_t addr, uint8_t *vram_base,
546 cpu_register_physical_memory(addr + 0x00301000ULL, TCX_THC_NREGS_24, 546 cpu_register_physical_memory(addr + 0x00301000ULL, TCX_THC_NREGS_24,
547 dummy_memory); 547 dummy_memory);
548 548
549 - register_savevm("tcx", addr, 3, tcx_save, tcx_load, s); 549 + register_savevm("tcx", addr, 4, tcx_save, tcx_load, s);
550 qemu_register_reset(tcx_reset, s); 550 qemu_register_reset(tcx_reset, s);
551 tcx_reset(s); 551 tcx_reset(s);
552 dpy_resize(s->ds, width, height); 552 dpy_resize(s->ds, width, height);