From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGNM0-0003Si-54 for qemu-devel@nongnu.org; Fri, 15 Mar 2013 01:39:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UGNLx-0007Rm-Mw for qemu-devel@nongnu.org; Fri, 15 Mar 2013 01:38:56 -0400 Received: from e23smtp04.au.ibm.com ([202.81.31.146]:36147) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGNLx-0007Pf-65 for qemu-devel@nongnu.org; Fri, 15 Mar 2013 01:38:53 -0400 Received: from /spool/local by e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 15 Mar 2013 15:28:36 +1000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [9.190.235.152]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 493D62CE804A for ; Fri, 15 Mar 2013 16:38:43 +1100 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r2F5PkuB4260208 for ; Fri, 15 Mar 2013 16:25:47 +1100 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r2F5cgtF019582 for ; Fri, 15 Mar 2013 16:38:42 +1100 Date: Fri, 15 Mar 2013 16:36:39 +1100 From: David Gibson Message-ID: <20130315053639.GL9351@truffula.fritz.box> References: <1363057565-23671-1-git-send-email-david@gibson.dropbear.id.au> <1363057565-23671-5-git-send-email-david@gibson.dropbear.id.au> <87ppz2f92y.fsf@elfo.elfo> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1rguoi8KZGYj2k4L" Content-Disposition: inline In-Reply-To: <87ppz2f92y.fsf@elfo.elfo> Subject: Re: [Qemu-devel] [PATCH 4/6] savevm: Add VMSTATE_STRUCT_VARRAY_POINTER_UINT32 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, agraf@suse.de --1rguoi8KZGYj2k4L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 14, 2013 at 01:40:37PM +0100, Juan Quintela wrote: > David Gibson 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 > > --- > > 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 =3D vmstate_offset_pointer(_state, _field, _type), = \ > > } > > =20 > > +#define VMSTATE_STRUCT_VARRAY_POINTER_UINT32(_field, _state, _field_nu= m, _vmsd, _type) { \ > > + .name =3D (stringify(_field)), = \ > > + .version_id =3D 0, = \ > > + .num_offset =3D vmstate_offset_value(_state, _field_num, uint32_t)= ,\ > > + .size =3D sizeof(_type), = \ > > + .vmsd =3D &(_vmsd), = \ > > + .flags =3D VMS_POINTER | VMS_VARRAY_INT32 | VMS_STRUCT, = \ >=20 > 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. --=20 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 --1rguoi8KZGYj2k4L Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlFCs2cACgkQaILKxv3ab8akEQCbBmWV2vDMJo0WGyCxxrkeCpKN eE8An13h65HIl2rZKlmj27egBNAN9ccJ =CJzF -----END PGP SIGNATURE----- --1rguoi8KZGYj2k4L--