From: David Gibson <dwg@au1.ibm.com>
To: Juan Quintela <quintela@redhat.com>
Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, agraf@suse.de
Subject: Re: [Qemu-devel] [PATCH 4/6] savevm: Add VMSTATE_STRUCT_VARRAY_POINTER_UINT32
Date: Fri, 15 Mar 2013 16:36:39 +1100 [thread overview]
Message-ID: <20130315053639.GL9351@truffula.fritz.box> (raw)
In-Reply-To: <87ppz2f92y.fsf@elfo.elfo>
[-- Attachment #1: Type: text/plain, Size: 1989 bytes --]
On Thu, Mar 14, 2013 at 01:40:37PM +0100, Juan Quintela wrote:
> David Gibson <david@gibson.dropbear.id.au> wrote:
> > Currently the savevm code contains a VMSTATE_STRUCT_VARRAY_POINTER_INT32
> > helper (a variably sized array with the number of elements in an int32_t),
> > but not VMSTATE_STRUCT_VARRAY_POINTER_UINT32 (... with the number of
> > elements in a uint32_t). This patch (trivially) fixes the deficiency.
> >
> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> > ---
> > include/migration/vmstate.h | 10 ++++++++++
> > 1 file changed, 10 insertions(+)
> >
> > diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
> > index f0a6374..fe39cd9 100644
> > --- a/include/migration/vmstate.h
> > +++ b/include/migration/vmstate.h
> > @@ -339,6 +339,16 @@ extern const VMStateInfo vmstate_info_bitmap;
> > .offset = vmstate_offset_pointer(_state, _field, _type), \
> > }
> >
> > +#define VMSTATE_STRUCT_VARRAY_POINTER_UINT32(_field, _state, _field_num, _vmsd, _type) { \
> > + .name = (stringify(_field)), \
> > + .version_id = 0, \
> > + .num_offset = vmstate_offset_value(_state, _field_num, uint32_t),\
> > + .size = sizeof(_type), \
> > + .vmsd = &(_vmsd), \
> > + .flags = VMS_POINTER | VMS_VARRAY_INT32 | VMS_STRUCT, \
>
> We are overridding VMS_VARRAYS_INT32 here, but if we have so many
> elements in the array, we have other problems to fix O:-)
More to the point, negative numbers of elements make no sense, so in
practice the only sensible interpretation of the field is unsigned
anyway.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2013-03-15 5:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-12 3:05 [Qemu-devel] [0/6] Simple extensions to VMStateDescription features David Gibson
2013-03-12 3:06 ` [Qemu-devel] [PATCH 1/6] savevm: Add VMSTATE_UINT64_EQUAL helpers David Gibson
2013-03-12 3:06 ` [Qemu-devel] [PATCH 2/6] savevm: Add VMSTATE_UINTTL_EQUAL helper David Gibson
2013-03-12 3:06 ` [Qemu-devel] [PATCH 3/6] savevm: Add VMSTATE_FLOAT64 helpers David Gibson
2013-03-12 3:06 ` [Qemu-devel] [PATCH 4/6] savevm: Add VMSTATE_STRUCT_VARRAY_POINTER_UINT32 David Gibson
2013-03-14 12:40 ` Juan Quintela
2013-03-15 5:36 ` David Gibson [this message]
2013-03-12 3:06 ` [Qemu-devel] [PATCH 5/6] savevm: Fix bugs in the VMSTATE_VBUFFER_MULTIPLY definition David Gibson
2013-03-12 3:06 ` [Qemu-devel] [PATCH 6/6] savevm: Implement VMS_DIVIDE flag David Gibson
2013-03-14 12:42 ` [Qemu-devel] [0/6] Simple extensions to VMStateDescription features Juan Quintela
2013-03-15 5:37 ` David Gibson
2013-04-08 4:55 ` David Gibson
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=20130315053639.GL9351@truffula.fritz.box \
--to=dwg@au1.ibm.com \
--cc=agraf@suse.de \
--cc=aliguori@us.ibm.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).