aboutsummaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
authorAmos Kong <akong@redhat.com>2012-03-13 14:05:36 +0800
committerBlue Swirl <blauwirbel@gmail.com>2012-03-17 12:58:51 +0000
commit1329d1896cc627cf71e3833525152ff59dd5113b (patch)
tree283a590daae0432ccad1f210674cb44ea84b6532 /savevm.c
parent4055299ef0e1c6e4a9b09ce000757b1274129991 (diff)
downloadqemu-1329d1896cc627cf71e3833525152ff59dd5113b.zip
qemu-1329d1896cc627cf71e3833525152ff59dd5113b.tar.gz
qemu-1329d1896cc627cf71e3833525152ff59dd5113b.tar.bz2
vmstate: fix varrays with uint32_t indexes
VMSTATE_VARRAY_UINT32() is used in hw/ds1225y.c, and we checked VMS_VARRAY_UINT32 bit of field->flags in vmstate_load_state(), but we don't check this bit in vmstate_save_state(). Signed-off-by: Amos Kong <akong@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'savevm.c')
-rw-r--r--savevm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/savevm.c b/savevm.c
index 80be1ff..694eaa4 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1486,6 +1486,8 @@ void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd,
n_elems = field->num;
} else if (field->flags & VMS_VARRAY_INT32) {
n_elems = *(int32_t *)(opaque+field->num_offset);
+ } else if (field->flags & VMS_VARRAY_UINT32) {
+ n_elems = *(uint32_t *)(opaque+field->num_offset);
} else if (field->flags & VMS_VARRAY_UINT16) {
n_elems = *(uint16_t *)(opaque+field->num_offset);
} else if (field->flags & VMS_VARRAY_UINT8) {