Patchwork vmstate: fix varrays with uint32_t indexes

login
register
mail settings
Submitter Amos Kong
Date April 11, 2011, 2:01 p.m.
Message ID <20110411140143.7200.71424.stgit@localhost6.localdomain6>
Download mbox | patch
Permalink /patch/90602/
State New
Headers show

Comments

Amos Kong - April 11, 2011, 2:01 p.m.
VARRAY_UINT32 only exists in vmstate_load_state(),
but not in vmstate_save_state().

CC: Juan Quintela <quintela@redhat.com>
Signed-off-by: Amos Kong <akong@redhat.com>
---
 savevm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Stefan Hajnoczi - April 12, 2011, 9:57 a.m.
On Mon, Apr 11, 2011 at 3:01 PM, Amos Kong <akong@redhat.com> wrote:
> VARRAY_UINT32 only exists in vmstate_load_state(),
> but not in vmstate_save_state().
>
> CC: Juan Quintela <quintela@redhat.com>
> Signed-off-by: Amos Kong <akong@redhat.com>
> ---
>  savevm.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)

Hmm...Juan wasn't actually CCed on the email.  Fixed.

Stefan

Patch

diff --git a/savevm.c b/savevm.c
index 03fce62..09825e6 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1393,6 +1393,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) {