[03/12] vmstate: fix missing ARRAY_OF_POINTERS support on save state

Submitted by Juan Quintela on Dec. 2, 2009, 11:36 a.m.

Details

Message ID c3628cb30f508c38f3083fc58d3cd94dc9716770.1259753146.git.quintela@redhat.com
State New
Headers show

Commit Message

Juan Quintela Dec. 2, 2009, 11:36 a.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 savevm.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/savevm.c b/savevm.c
index 833bf3c..8fac502 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1206,6 +1206,9 @@  void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd,
             for (i = 0; i < n_elems; i++) {
                 void *addr = base_addr + field->size * i;

+                if (field->flags & VMS_ARRAY_OF_POINTER) {
+                    addr = *(void **)addr;
+                }
                 if (field->flags & VMS_STRUCT) {
                     vmstate_save_state(f, field->vmsd, addr);
                 } else {