From 2837c8ea1f10c281c9ff68f397405f3596f8ce0b Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 8 Jul 2011 10:44:35 +0200 Subject: vmstate: add no_migrate flag to VMStateDescription This allows to easily tag devices as non-migratable, so any attempt to migrate a virtual machine with the device in question active will make migration fail. Signed-off-by: Gerd Hoffmann --- hw/hw.h | 1 + savevm.c | 1 + 2 files changed, 2 insertions(+) diff --git a/hw/hw.h b/hw/hw.h index 9dd7096..df6ca65 100644 --- a/hw/hw.h +++ b/hw/hw.h @@ -324,6 +324,7 @@ typedef struct VMStateSubsection { struct VMStateDescription { const char *name; + int unmigratable; int version_id; int minimum_version_id; int minimum_version_id_old; diff --git a/savevm.c b/savevm.c index 8139bc7..1c5abe2 100644 --- a/savevm.c +++ b/savevm.c @@ -1234,6 +1234,7 @@ int vmstate_register_with_alias_id(DeviceState *dev, int instance_id, se->opaque = opaque; se->vmsd = vmsd; se->alias_id = alias_id; + se->no_migrate = vmsd->unmigratable; if (dev && dev->parent_bus && dev->parent_bus->info->get_dev_path) { char *id = dev->parent_bus->info->get_dev_path(dev); -- cgit v1.1 From b7ce1b27f652630e6bc201497ea451b67ad549fa Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 8 Jul 2011 10:48:37 +0200 Subject: ahci doesn't support migration Signed-off-by: Gerd Hoffmann --- hw/ide/ich.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/ide/ich.c b/hw/ide/ich.c index 054e073..d241ea8 100644 --- a/hw/ide/ich.c +++ b/hw/ide/ich.c @@ -72,6 +72,11 @@ #include #include +static const VMStateDescription vmstate_ahci = { + .name = "ahci", + .unmigratable = 1, +}; + static int pci_ich9_ahci_init(PCIDevice *dev) { struct AHCIPCIState *d; @@ -123,6 +128,7 @@ static PCIDeviceInfo ich_ahci_info[] = { .qdev.name = "ich9-ahci", .qdev.alias = "ahci", .qdev.size = sizeof(AHCIPCIState), + .qdev.vmsd = &vmstate_ahci, .init = pci_ich9_ahci_init, .exit = pci_ich9_uninit, .config_write = pci_ich9_write_config, -- cgit v1.1 From 9490fb0624e67bce90297444fb960c2d9476239e Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 8 Jul 2011 10:48:46 +0200 Subject: ehci doesn't support migration Signed-off-by: Gerd Hoffmann --- hw/usb-ehci.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c index a4758f9..8b0dcc3 100644 --- a/hw/usb-ehci.c +++ b/hw/usb-ehci.c @@ -2244,6 +2244,11 @@ static USBBusOps ehci_bus_ops = { .register_companion = ehci_register_companion, }; +static const VMStateDescription vmstate_ehci = { + .name = "ehci", + .unmigratable = 1, +}; + static Property ehci_properties[] = { DEFINE_PROP_UINT32("freq", EHCIState, freq, FRAME_TIMER_FREQ), DEFINE_PROP_UINT32("maxframes", EHCIState, maxframes, 128), @@ -2254,6 +2259,7 @@ static PCIDeviceInfo ehci_info[] = { { .qdev.name = "usb-ehci", .qdev.size = sizeof(EHCIState), + .qdev.vmsd = &vmstate_ehci, .init = usb_ehci_initfn, .vendor_id = PCI_VENDOR_ID_INTEL, .device_id = PCI_DEVICE_ID_INTEL_82801D, /* ich4 */ @@ -2263,6 +2269,7 @@ static PCIDeviceInfo ehci_info[] = { },{ .qdev.name = "ich9-usb-ehci1", .qdev.size = sizeof(EHCIState), + .qdev.vmsd = &vmstate_ehci, .init = usb_ehci_initfn, .vendor_id = PCI_VENDOR_ID_INTEL, .device_id = PCI_DEVICE_ID_INTEL_82801I_EHCI1, -- cgit v1.1 From f54b65630385d7dc7cf3442eb459d1a5b3d1a9c6 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 10 Dec 2010 14:58:41 +0100 Subject: usb storage: first migration support bits. Tag vmstate as unmigratable for the time being, to be removed when mgration support is finished. Signed-off-by: Gerd Hoffmann --- hw/usb-msd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/usb-msd.c b/hw/usb-msd.c index 86582cc..8ed8594 100644 --- a/hw/usb-msd.c +++ b/hw/usb-msd.c @@ -623,11 +623,23 @@ static USBDevice *usb_msd_init(const char *filename) return dev; } +static const VMStateDescription vmstate_usb_msd = { + .name = "usb-storage", + .unmigratable = 1, /* FIXME: handle transactions which are in flight */ + .version_id = 1, + .minimum_version_id = 1, + .fields = (VMStateField []) { + VMSTATE_USB_DEVICE(dev, MSDState), + VMSTATE_END_OF_LIST() + } +}; + static struct USBDeviceInfo msd_info = { .product_desc = "QEMU USB MSD", .qdev.name = "usb-storage", .qdev.fw_name = "storage", .qdev.size = sizeof(MSDState), + .qdev.vmsd = &vmstate_usb_msd, .usb_desc = &desc, .init = usb_msd_initfn, .handle_packet = usb_generic_handle_packet, -- cgit v1.1 From ccce9fd205317f60dd30a986084eec39addbd09b Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 20 Jul 2011 10:00:51 +0200 Subject: usb-wacom doesn't support migration Signed-off-by: Gerd Hoffmann --- hw/usb-wacom.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/usb-wacom.c b/hw/usb-wacom.c index 9d348e1..d76ee97 100644 --- a/hw/usb-wacom.c +++ b/hw/usb-wacom.c @@ -349,6 +349,11 @@ static int usb_wacom_initfn(USBDevice *dev) return 0; } +static const VMStateDescription vmstate_usb_wacom = { + .name = "usb-wacom", + .unmigratable = 1, +}; + static struct USBDeviceInfo wacom_info = { .product_desc = "QEMU PenPartner Tablet", .qdev.name = "usb-wacom-tablet", @@ -356,6 +361,7 @@ static struct USBDeviceInfo wacom_info = { .usbdevice_name = "wacom-tablet", .usb_desc = &desc_wacom, .qdev.size = sizeof(USBWacomState), + .qdev.vmsd = &vmstate_usb_wacom, .init = usb_wacom_initfn, .handle_packet = usb_generic_handle_packet, .handle_reset = usb_wacom_handle_reset, -- cgit v1.1 From 2474e5052b3987cbd7f41f6a2992ce691dc8cc0c Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 20 Jul 2011 10:02:40 +0200 Subject: usb-bt doesn't support migration Signed-off-by: Gerd Hoffmann --- hw/usb-bt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/usb-bt.c b/hw/usb-bt.c index e364513..4557802 100644 --- a/hw/usb-bt.c +++ b/hw/usb-bt.c @@ -548,10 +548,16 @@ USBDevice *usb_bt_init(HCIInfo *hci) return dev; } +static const VMStateDescription vmstate_usb_bt = { + .name = "usb-bt", + .unmigratable = 1, +}; + static struct USBDeviceInfo bt_info = { .product_desc = "QEMU BT dongle", .qdev.name = "usb-bt-dongle", .qdev.size = sizeof(struct USBBtState), + .qdev.vmsd = &vmstate_usb_bt, .usb_desc = &desc_bluetooth, .init = usb_bt_initfn, .handle_packet = usb_generic_handle_packet, -- cgit v1.1 From 4ab0ba9e26d52a272cadd5635437a341a4e7ff36 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 20 Jul 2011 10:06:07 +0200 Subject: usb-net doesn't support migration Signed-off-by: Gerd Hoffmann --- hw/usb-net.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/usb-net.c b/hw/usb-net.c index 9be709f..4212e5b 100644 --- a/hw/usb-net.c +++ b/hw/usb-net.c @@ -1414,11 +1414,17 @@ static USBDevice *usb_net_init(const char *cmdline) return dev; } +static const VMStateDescription vmstate_usb_net = { + .name = "usb-net", + .unmigratable = 1, +}; + static struct USBDeviceInfo net_info = { .product_desc = "QEMU USB Network Interface", .qdev.name = "usb-net", .qdev.fw_name = "network", .qdev.size = sizeof(USBNetState), + .qdev.vmsd = &vmstate_usb_net, .usb_desc = &desc_net, .init = usb_net_initfn, .handle_packet = usb_generic_handle_packet, -- cgit v1.1 From 98e51ec92e678cf0e501b5ef013753ec8710e222 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 20 Jul 2011 10:06:18 +0200 Subject: usb-serial doesn't support migration Signed-off-by: Gerd Hoffmann --- hw/usb-serial.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/usb-serial.c b/hw/usb-serial.c index 59cb0fb..70d694d 100644 --- a/hw/usb-serial.c +++ b/hw/usb-serial.c @@ -566,10 +566,16 @@ static USBDevice *usb_braille_init(const char *unused) return dev; } +static const VMStateDescription vmstate_usb_serial = { + .name = "usb-serial", + .unmigratable = 1, +}; + static struct USBDeviceInfo serial_info = { .product_desc = "QEMU USB Serial", .qdev.name = "usb-serial", .qdev.size = sizeof(USBSerialState), + .qdev.vmsd = &vmstate_usb_serial, .usb_desc = &desc_serial, .init = usb_serial_initfn, .handle_packet = usb_generic_handle_packet, @@ -589,6 +595,7 @@ static struct USBDeviceInfo braille_info = { .product_desc = "QEMU USB Braille", .qdev.name = "usb-braille", .qdev.size = sizeof(USBSerialState), + .qdev.vmsd = &vmstate_usb_serial, .usb_desc = &desc_braille, .init = usb_serial_initfn, .handle_packet = usb_generic_handle_packet, -- cgit v1.1