From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiCHv-0005FH-EP for qemu-devel@nongnu.org; Mon, 21 Mar 2016 22:43:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiCHs-000375-TX for qemu-devel@nongnu.org; Mon, 21 Mar 2016 22:43:19 -0400 Date: Tue, 22 Mar 2016 12:31:59 +1100 From: David Gibson Message-ID: <20160322013159.GX23586@voom.redhat.com> References: <1458546426-26222-1-git-send-email-aik@ozlabs.ru> <1458546426-26222-9-git-send-email-aik@ozlabs.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kLdbqvpuLRxNeSq5" Content-Disposition: inline In-Reply-To: <1458546426-26222-9-git-send-email-aik@ozlabs.ru> Subject: Re: [Qemu-devel] [PATCH qemu v14 08/18] spapr_iommu: Migrate full state 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 --kLdbqvpuLRxNeSq5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 21, 2016 at 06:46:56PM +1100, Alexey Kardashevskiy wrote: > This adds @bus_offset, @page_shift, @enabled members to migration stream. > These cannot change without dynamic DMA windows so no change in > behavior is expected. >=20 > Signed-off-by: Alexey Kardashevskiy I think you should combine this patch with the previous one. They're both simple, and the functions in the previous one check tcet->enabled, which doesn't make a lot of sense if you're not migrating that value. The version bump here looks correct, but it will break migration of (for example) a pseries-2.5 VM running under qemu-2.7 back into qemu-2.5. That sort of backwards migration isn't considered essential, but it is nice to have (and it's something RH cares about downstream). So, if possible it would be preferable to do the migration in a backwards compatible way. The standard trick for that seems to be to add an optional section with the extra info, and make the "needed" function return true iff the parameters differ from the defaults. > --- > Changes: > v14: > * new to the series > --- > hw/ppc/spapr_iommu.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c > index 549cd94..5ea5948 100644 > --- a/hw/ppc/spapr_iommu.c > +++ b/hw/ppc/spapr_iommu.c > @@ -180,7 +180,7 @@ static int spapr_tce_table_post_load(void *opaque, in= t version_id) > =20 > static const VMStateDescription vmstate_spapr_tce_table =3D { > .name =3D "spapr_iommu", > - .version_id =3D 2, > + .version_id =3D 3, > .minimum_version_id =3D 2, > .pre_save =3D spapr_tce_table_pre_save, > .post_load =3D spapr_tce_table_post_load, > @@ -189,6 +189,9 @@ static const VMStateDescription vmstate_spapr_tce_tab= le =3D { > VMSTATE_UINT32_EQUAL(liobn, sPAPRTCETable), > =20 > /* IOMMU state */ > + VMSTATE_BOOL_V(enabled, sPAPRTCETable, 3), > + VMSTATE_UINT64_V(bus_offset, sPAPRTCETable, 3), > + VMSTATE_UINT32_V(page_shift, sPAPRTCETable, 3), > VMSTATE_UINT32(mig_nb_table, sPAPRTCETable), > VMSTATE_BOOL(bypass, sPAPRTCETable), > VMSTATE_VARRAY_UINT32_ALLOC(mig_table, sPAPRTCETable, nb_table, = 0, --=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 --kLdbqvpuLRxNeSq5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJW8KCPAAoJEGw4ysog2bOSnCkP/35vCbxz1zKNwO//C35DxcqN lfbd/ByZT9sJ/Bx+G7jZRRpmm5n5s/dTAnBk4YvGaIrA1dRSg9JKtNBtAZ3pwqq7 +PT2nSDbhBA8c0haJdX1OPDy/MJg3GwV0iIfZCpdawYKVthZlPZWeoHUurdxtU7x GxLQKjq3PSnWZDI+UwhpPe0Bim4nbZ7GVWMFa0ejqhDU72uK2oxk/cd/vGQULzC8 Nm5aRhypij1TyyssqBoFuknXfiwpKWQGm53JEN61eWNwzZw6AhexdqQo5g66nY4d gLYC4IklYUgeqnKsTdNc3+L97bX8JN3eKU8rkHBPRnM4qEuEILRUzXaLtkBaGtYC dKJgFRTZCYL9vuDTCa/LrNsA4pCXPGSqC4EZh6xdLvnpE5HKqtwE68Lb3T7dMSx3 SkQjHtBEBRAKCtxaQgMkFefkH5ax4Hi/bkwWs2flmNT/uXZtMzZayVaqrnNPvmlM Tsh0pEpJM6/HNZBdX7IhOLe8mbVgrX8zea0CNc/7in6GF02E6S/t8jZp1GKaM3G2 mSDitie+TMVtJilDCGchvQO2xRGn9+yCEk0vFWMQkhhUo6oajl6jB6DOb61JTz7K WnAWUpc9mM6+wpnlEIpyQJRujDgzeTd88wSaW2x1zyBPvAU6EQVMafy4tBTCTtJM ElcU96LFbG4nhLLfvxJf =96Ee -----END PGP SIGNATURE----- --kLdbqvpuLRxNeSq5--