From: Alex Williamson <alex.williamson@xxxxxxxxxx> Use register_device_unmigratable() to declare ourselves as non-migratable. Signed-off-by: Alex Williamson <alex.williamson@xxxxxxxxxx> Signed-off-by: Marcelo Tosatti <mtosatti@xxxxxxxxxx> diff --git a/hw/device-assignment.c b/hw/device-assignment.c index 5f5bde1..c2a7b27 100644 --- a/hw/device-assignment.c +++ b/hw/device-assignment.c @@ -1434,6 +1434,10 @@ static void assigned_dev_unregister_msix_mmio(AssignedDevice *dev) dev->msix_table_page = NULL; } +static const VMStateDescription vmstate_assigned_device = { + .name = "pci-assign" +}; + static int assigned_initfn(struct PCIDevice *pci_dev) { AssignedDevice *dev = DO_UPCAST(AssignedDevice, dev, pci_dev); @@ -1495,6 +1499,12 @@ static int assigned_initfn(struct PCIDevice *pci_dev) 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); + register_device_unmigratable(&dev->dev.qdev, + vmstate_assigned_device.name, dev); + return 0; assigned_out: @@ -1508,6 +1518,7 @@ static int assigned_exitfn(struct PCIDevice *pci_dev) { AssignedDevice *dev = DO_UPCAST(AssignedDevice, dev, pci_dev); + vmstate_unregister(&dev->dev.qdev, &vmstate_assigned_device, dev); QLIST_REMOVE(dev, next); deassign_device(dev); free_assigned_device(dev); -- To unsubscribe from this list: send the line "unsubscribe kvm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html