From: Juan Quintela <quintela@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: aliguori@us.ibm.com, jasowang@redhat.com, qemu-devel@nongnu.org,
blauwirbel@gmail.com, hpoussin@reactos.org,
Amos Kong <akong@redhat.com>
Subject: Re: [Qemu-devel] [RESEND PATCH] vmstate: fix varrays with uint32_t indexes
Date: Tue, 13 Mar 2012 18:46:55 +0100 [thread overview]
Message-ID: <8762e8tmuo.fsf@elfo.elfo> (raw)
In-Reply-To: <4F5F781C.4080502@suse.de> ("Andreas Färber"'s message of "Tue, 13 Mar 2012 17:38:52 +0100")
Andreas Färber <afaerber@suse.de> wrote:
> Am 13.03.2012 07:05, schrieb Amos Kong:
>> 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().
>
> So what were the symptoms? Does this need to be backported to stable?
You don't initialize n_elems correctly when saving.
It is only used (currently) with ds1225y.c, that is used on mips_jazz,
and mips_jazz don't support migration. So it is up to you if it is
needed for stable or not (it is not urgent, though).
Later, Juan.
> Andreas
>
>>
>> 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 prev parent reply other threads:[~2012-03-13 19:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-13 6:05 [Qemu-devel] [RESEND PATCH] vmstate: fix varrays with uint32_t indexes Amos Kong
2012-03-13 14:49 ` Juan Quintela
2012-03-13 16:38 ` Andreas Färber
2012-03-13 17:46 ` Juan Quintela [this message]
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=8762e8tmuo.fsf@elfo.elfo \
--to=quintela@redhat.com \
--cc=afaerber@suse.de \
--cc=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 \
/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).