diff options
author | Juan Quintela <quintela@redhat.com> | 2009-08-20 19:42:33 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-08-27 20:30:22 -0500 |
commit | 0c83bfb3e17b3a6755067acfb56a8add3713ad2b (patch) | |
tree | 98677ce93b156351e5fdf5d77cafb41b454bbff8 /savevm.c | |
parent | e6a1ec6cca7e730e0c691c2e8560d9a3debd1495 (diff) | |
download | qemu-0c83bfb3e17b3a6755067acfb56a8add3713ad2b.tar.gz qemu-0c83bfb3e17b3a6755067acfb56a8add3713ad2b.tar.bz2 qemu-0c83bfb3e17b3a6755067acfb56a8add3713ad2b.zip |
Add VMState support for variable sized arrays
This patch add supports for variable sized arrays whose size is
another field of the state.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'savevm.c')
-rw-r--r-- | savevm.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -997,6 +997,8 @@ int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd, if (field->flags & VMS_ARRAY) { n_elems = field->num; + } else if (field->flags & VMS_VARRAY) { + n_elems = *(size_t *)(opaque+field->num_offset); } if (field->flags & VMS_POINTER) { base_addr = *(void **)base_addr; @@ -1031,6 +1033,8 @@ void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd, if (field->flags & VMS_ARRAY) { n_elems = field->num; + } else if (field->flags & VMS_VARRAY) { + n_elems = *(size_t *)(opaque+field->num_offset); } if (field->flags & VMS_POINTER) { base_addr = *(void **)base_addr; |