From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH v2] device-assignment: Register as un-migratable Date: Tue, 16 Nov 2010 00:11:09 +0100 Message-ID: <4CE1BE0D.4000904@web.de> References: <20101115230552.3872.96887.stgit@s20.home> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig01593871D0E6261306A70538" Cc: kvm@vger.kernel.org, mst@redhat.com To: Alex Williamson Return-path: Received: from fmmailgate02.web.de ([217.72.192.227]:45647 "EHLO fmmailgate02.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752435Ab0KOXMR (ORCPT ); Mon, 15 Nov 2010 18:12:17 -0500 In-Reply-To: <20101115230552.3872.96887.stgit@s20.home> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig01593871D0E6261306A70538 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am 16.11.2010 00:06, Alex Williamson wrote: > Use register_device_unmigratable() to declare ourselves as > non-migratable. >=20 > Signed-off-by: Alex Williamson > --- >=20 > v2: Use dummy vmsd instead of dummy save_state >=20 > hw/device-assignment.c | 10 ++++++++++ > 1 files changed, 10 insertions(+), 0 deletions(-) >=20 > diff --git a/hw/device-assignment.c b/hw/device-assignment.c > index bde231d..154bb1a 100644 > --- a/hw/device-assignment.c > +++ b/hw/device-assignment.c > @@ -1434,6 +1434,10 @@ static void assigned_dev_unregister_msix_mmio(As= signedDevice *dev) > dev->msix_table_page =3D NULL; > } > =20 > +static const VMStateDescription vmstate_assigned_device =3D { > + .name =3D "pci-assign" > +}; > + > static int assigned_initfn(struct PCIDevice *pci_dev) > { > AssignedDevice *dev =3D DO_UPCAST(AssignedDevice, dev, pci_dev); > @@ -1490,6 +1494,11 @@ static int assigned_initfn(struct PCIDevice *pci= _dev) > =20 > assigned_dev_load_option_rom(dev); > QLIST_INSERT_HEAD(&devs, dev, next); > + > + /* Register a vmsd so that we can mark it unmigratable. */ > + vmstate_register(&dev->dev.qdev, 0, &vmstate_assigned_device, dev)= ; Almost: You can register this vmstate description via assign_info (.qdev.vmsd =3D ....). Jan > + register_device_unmigratable(&dev->dev.qdev, "pci-assign", dev); > + > return 0; > =20 > assigned_out: > @@ -1503,6 +1512,7 @@ static int assigned_exitfn(struct PCIDevice *pci_= dev) > { > AssignedDevice *dev =3D DO_UPCAST(AssignedDevice, dev, pci_dev); > =20 > + vmstate_unregister(&dev->dev.qdev, &vmstate_assigned_device, dev);= > QLIST_REMOVE(dev, next); > deassign_device(dev); > free_assigned_device(dev); >=20 --------------enig01593871D0E6261306A70538 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAkzhvg0ACgkQitSsb3rl5xRWdACfRPRvsClOBKFSJNkl5AkgrGs0 heEAoNhjd6h4QAJTVIVF2Jm82j5bqeCH =T0EI -----END PGP SIGNATURE----- --------------enig01593871D0E6261306A70538--