From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abR2P-0002rJ-Cu for qemu-devel@nongnu.org; Thu, 03 Mar 2016 06:03:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abR2J-0001sZ-J5 for qemu-devel@nongnu.org; Thu, 03 Mar 2016 06:03:21 -0500 Date: Thu, 3 Mar 2016 17:31:24 +1100 From: David Gibson Message-ID: <20160303063124.GM1620@voom.redhat.com> References: <1456823441-46757-1-git-send-email-aik@ozlabs.ru> <1456823441-46757-13-git-send-email-aik@ozlabs.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VLAOICcq5m4DWEYr" Content-Disposition: inline In-Reply-To: <1456823441-46757-13-git-send-email-aik@ozlabs.ru> Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH qemu v13 12/16] vmstate: Define VARRAY with VMS_ALLOC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: Alex Williamson , qemu-ppc@nongnu.org, qemu-devel@nongnu.org --VLAOICcq5m4DWEYr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 01, 2016 at 08:10:37PM +1100, Alexey Kardashevskiy wrote: > This allows dynamic allocation for migrating arrays. >=20 > Already existing VMSTATE_VARRAY_UINT32 requires an array to be > pre-allocated, however there are cases when the size is not known in > advance and there is no real need to enforce it. >=20 > This defines another variant of VMSTATE_VARRAY_UINT32 with WMS_ALLOC > flag which tells the receiving side to allocate memory for the array > before receiving the data. >=20 > The first user of it is a dynamic DMA window which existence and size > are totally dynamic. >=20 > Signed-off-by: Alexey Kardashevskiy > Reviewed-by: David Gibson > Reviewed-by: Thomas Huth This looks fine, but it might be worth sending separately, to seek review from Juan or Dave Gilbert. > --- > include/migration/vmstate.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) >=20 > diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h > index 84ee355..1622638 100644 > --- a/include/migration/vmstate.h > +++ b/include/migration/vmstate.h > @@ -386,6 +386,16 @@ extern const VMStateInfo vmstate_info_bitmap; > .offset =3D vmstate_offset_pointer(_state, _field, _type), \ > } > =20 > +#define VMSTATE_VARRAY_UINT32_ALLOC(_field, _state, _field_num, _version= , _info, _type) {\ > + .name =3D (stringify(_field)), \ > + .version_id =3D (_version), \ > + .num_offset =3D vmstate_offset_value(_state, _field_num, uint32_t),\ > + .info =3D &(_info), \ > + .size =3D sizeof(_type), \ > + .flags =3D VMS_VARRAY_UINT32|VMS_POINTER|VMS_ALLOC, \ > + .offset =3D vmstate_offset_pointer(_state, _field, _type), \ > +} > + > #define VMSTATE_VARRAY_UINT16_UNSAFE(_field, _state, _field_num, _versio= n, _info, _type) {\ > .name =3D (stringify(_field)), \ > .version_id =3D (_version), \ --=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 --VLAOICcq5m4DWEYr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJW19o7AAoJEGw4ysog2bOSWewP/2Nr5sJsCRaMpcPiGPcuqdnc znf/2vOUfoz5MpVH35OquOkTBA+NleNkNZOVfZQzkXudRsGTeZrNpmNboZ05MXX0 MIM216Jz8nSYGzWnPYi/NkPOio4mXwNOTVyoNiSX/IaMQxIu5SAc8cWN4OFtCMix tousBLtyqNUnfqyP8wfZF6OOBvNlk6fO13S9nXcw+doJAEpFI8dwA5qigVIBsMq1 66VW+7pYDhylvvSqShICXStfPq6ouk2dM7dLvDfUNQDZZRawrs1zs96jUdyO6lfI dwFNbl6zwED2mPc5hY9frjoanMz2mHZqFNciNSZTHnA/1ENfkV4T+Cihzphg3290 KDFZ5w+CslduWs1vuCI2tiwqd5tjqc4kNAy8Uz4BE7RHLoTkb7uABQ9KQ3VaQkrU kswhR1BPnTDoR5fdb6pxiHQrCww6zLCKc6bo7FTG6fwAcXsAGb/DTA54tKIHNBYv 8r7pycge0Q9WyZMTT6yO24gAJva7wkyRl8osaYUfCG1hj2gbPxaAh2YPgov0Ol3v aoD/NcWeFWYw9SnuGS/mMtSPlDRaDscltHNm44Mx7+0SYkT5hEHUOphyywUQR9eJ KFSCeUY+8zniZ/qjW0N2qAGFLAZOV2wcqNP0UBYetXS5ecot+YzMcxZHLdXjRHBQ 22NtV5DY/1NMPBmNEtzB =MV8O -----END PGP SIGNATURE----- --VLAOICcq5m4DWEYr--