Merge remote-tracking branch 'kraxel/migration.2' into staging
This commit is contained in:
commit
e374560232
1
hw/hw.h
1
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;
|
||||
|
@ -72,6 +72,11 @@
|
||||
#include <hw/ide/pci.h>
|
||||
#include <hw/ide/ahci.h>
|
||||
|
||||
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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
12
hw/usb-msd.c
12
hw/usb-msd.c
@ -616,11 +616,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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
1
savevm.c
1
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);
|
||||
|
Loading…
Reference in New Issue
Block a user