All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RESEND PATCH] vmstate: fix varrays with uint32_t indexes
@ 2012-03-13  6:05 Amos Kong
  2012-03-13 14:49 ` Juan Quintela
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Amos Kong @ 2012-03-13  6:05 UTC (permalink / raw)
  To: aliguori, quintela, jasowang, qemu-devel, blauwirbel, hpoussin

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) {

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [RESEND PATCH] vmstate: fix varrays with uint32_t indexes
  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
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Juan Quintela @ 2012-03-13 14:49 UTC (permalink / raw)
  To: Amos Kong; +Cc: blauwirbel, aliguori, hpoussin, jasowang, qemu-devel

Amos Kong <akong@redhat.com> wrote:
> 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>

Acked-by: Juan Quintela <quintela@redhat.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [RESEND PATCH] vmstate: fix varrays with uint32_t indexes
  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
  2012-03-14  6:19 ` Hervé Poussineau
  2012-03-17 16:20 ` Blue Swirl
  3 siblings, 1 reply; 6+ messages in thread
From: Andreas Färber @ 2012-03-13 16:38 UTC (permalink / raw)
  To: Amos Kong; +Cc: aliguori, quintela, jasowang, qemu-devel, blauwirbel, hpoussin

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?

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) {

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [RESEND PATCH] vmstate: fix varrays with uint32_t indexes
  2012-03-13 16:38 ` Andreas Färber
@ 2012-03-13 17:46   ` Juan Quintela
  0 siblings, 0 replies; 6+ messages in thread
From: Juan Quintela @ 2012-03-13 17:46 UTC (permalink / raw)
  To: Andreas Färber
  Cc: aliguori, jasowang, qemu-devel, blauwirbel, hpoussin, Amos Kong

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) {

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [RESEND PATCH] vmstate: fix varrays with uint32_t indexes
  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-14  6:19 ` Hervé Poussineau
  2012-03-17 16:20 ` Blue Swirl
  3 siblings, 0 replies; 6+ messages in thread
From: Hervé Poussineau @ 2012-03-14  6:19 UTC (permalink / raw)
  To: Amos Kong; +Cc: qemu-devel, blauwirbel, aliguori, jasowang, quintela

Amos Kong a écrit :
> 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>

Acked-by: Hervé Poussineau <hpoussin@reactos.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [RESEND PATCH] vmstate: fix varrays with uint32_t indexes
  2012-03-13  6:05 [Qemu-devel] [RESEND PATCH] vmstate: fix varrays with uint32_t indexes Amos Kong
                   ` (2 preceding siblings ...)
  2012-03-14  6:19 ` Hervé Poussineau
@ 2012-03-17 16:20 ` Blue Swirl
  3 siblings, 0 replies; 6+ messages in thread
From: Blue Swirl @ 2012-03-17 16:20 UTC (permalink / raw)
  To: Amos Kong; +Cc: qemu-devel, aliguori, hpoussin, jasowang, quintela

Thanks, applied.

On Tue, Mar 13, 2012 at 06:05, Amos Kong <akong@redhat.com> wrote:
> 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) {
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-03-17 16:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2012-03-14  6:19 ` Hervé Poussineau
2012-03-17 16:20 ` Blue Swirl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.