Commit 20daa90a authored by Dr. David Alan Gilbert's avatar Dr. David Alan Gilbert
Browse files

PCI/migration merge vmstate_pci_device and vmstate_pcie_device



The vmstate_pci_device and vmstate_pcie_devices differ
just in the size of one buffer; combine the two using a _TEST
macro.

I think this is safe as long as everywhere which currently
uses either of these two uses the right type.

One thing that concerns me is that some places use pci_device_load/save
which does some irq mangling, but others just use the VMSTATE_PCI_DEVICE
macro - how are they getting the same irq mangling?

This passes a smoke test migrate of:
./x86_64-softmmu/qemu-system-x86_64 -M pc,accel=kvm -m 1024
./littlefed20.img -device e1000e -device virtio-net -device
e1000 -device virtio-rng -device megasas -device megasas-gen2 -device
ioh3420 -device nec-usb-xhci

to an unmodified qemu.

Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20161214195829.18241-1-dgilbert@redhat.com>
Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
parent 009fad7f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -593,7 +593,7 @@ static const VMStateDescription e1000e_vmstate = {
    .pre_save = e1000e_pre_save,
    .post_load = e1000e_post_load,
    .fields = (VMStateField[]) {
        VMSTATE_PCIE_DEVICE(parent_obj, E1000EState),
        VMSTATE_PCI_DEVICE(parent_obj, E1000EState),
        VMSTATE_MSIX(parent_obj, E1000EState),

        VMSTATE_UINT32(ioaddr, E1000EState),
+1 −1
Original line number Diff line number Diff line
@@ -2631,7 +2631,7 @@ static const VMStateDescription vmstate_vmxnet3_pcie_device = {
    .minimum_version_id = 1,
    .needed = vmxnet3_vmstate_need_pcie_device,
    .fields = (VMStateField[]) {
        VMSTATE_PCIE_DEVICE(parent_obj, VMXNET3State),
        VMSTATE_PCI_DEVICE(parent_obj, VMXNET3State),
        VMSTATE_END_OF_LIST()
    }
};
+1 −1
Original line number Diff line number Diff line
@@ -180,7 +180,7 @@ static const VMStateDescription vmstate_ioh3420 = {
    .minimum_version_id = 1,
    .post_load = pcie_cap_slot_post_load,
    .fields = (VMStateField[]) {
        VMSTATE_PCIE_DEVICE(parent_obj.parent_obj.parent_obj, PCIESlot),
        VMSTATE_PCI_DEVICE(parent_obj.parent_obj.parent_obj, PCIESlot),
        VMSTATE_STRUCT(parent_obj.parent_obj.parent_obj.exp.aer_log,
                       PCIESlot, 0, vmstate_pcie_aer_log, PCIEAERLog),
        VMSTATE_END_OF_LIST()
+1 −1
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ static const VMStateDescription vmstate_xio3130_downstream = {
    .minimum_version_id = 1,
    .post_load = pcie_cap_slot_post_load,
    .fields = (VMStateField[]) {
        VMSTATE_PCIE_DEVICE(parent_obj.parent_obj.parent_obj, PCIESlot),
        VMSTATE_PCI_DEVICE(parent_obj.parent_obj.parent_obj, PCIESlot),
        VMSTATE_STRUCT(parent_obj.parent_obj.parent_obj.exp.aer_log,
                       PCIESlot, 0, vmstate_pcie_aer_log, PCIEAERLog),
        VMSTATE_END_OF_LIST()
+1 −1
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ static const VMStateDescription vmstate_xio3130_upstream = {
    .version_id = 1,
    .minimum_version_id = 1,
    .fields = (VMStateField[]) {
        VMSTATE_PCIE_DEVICE(parent_obj.parent_obj, PCIEPort),
        VMSTATE_PCI_DEVICE(parent_obj.parent_obj, PCIEPort),
        VMSTATE_STRUCT(parent_obj.parent_obj.exp.aer_log, PCIEPort, 0,
                       vmstate_pcie_aer_log, PCIEAERLog),
        VMSTATE_END_OF_LIST()
Loading