From: Amos Kong <akong@redhat.com>
To: aliguori@us.ibm.com, quintela@redhat.com, jasowang@redhat.com,
qemu-devel@nongnu.org, blauwirbel@gmail.com,
hpoussin@reactos.org
Subject: [Qemu-devel] [RESEND PATCH] vmstate: fix varrays with uint32_t indexes
Date: Tue, 13 Mar 2012 14:05:36 +0800 [thread overview]
Message-ID: <20120313060536.7941.37036.stgit@dhcp-8-167.nay.redhat.com> (raw)
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>
---
savevm.c | 2 ++
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) {
next reply other threads:[~2012-03-13 6:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-13 6:05 Amos Kong [this message]
2012-03-13 14:49 ` [Qemu-devel] [RESEND PATCH] vmstate: fix varrays with uint32_t indexes Juan Quintela
2012-03-13 16:38 ` Andreas Färber
2012-03-13 17:46 ` Juan Quintela
2012-03-14 6:19 ` Hervé Poussineau
2012-03-17 16:20 ` Blue Swirl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120313060536.7941.37036.stgit@dhcp-8-167.nay.redhat.com \
--to=akong@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=blauwirbel@gmail.com \
--cc=hpoussin@reactos.org \
--cc=jasowang@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).