Add version_id to PCIDevice.
It is needed for VMState Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
0a031e0ac6
commit
f16c4abfad
3
hw/pci.c
3
hw/pci.c
@ -144,7 +144,7 @@ void pci_device_save(PCIDevice *s, QEMUFile *f)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
qemu_put_be32(f, 2); /* PCI device version */
|
qemu_put_be32(f, s->version_id); /* PCI device version */
|
||||||
qemu_put_buffer(f, s->config, 256);
|
qemu_put_buffer(f, s->config, 256);
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
qemu_put_be32(f, s->irq_state[i]);
|
qemu_put_be32(f, s->irq_state[i]);
|
||||||
@ -319,6 +319,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
|
|||||||
pci_dev->config_write = config_write;
|
pci_dev->config_write = config_write;
|
||||||
bus->devices[devfn] = pci_dev;
|
bus->devices[devfn] = pci_dev;
|
||||||
pci_dev->irq = qemu_allocate_irqs(pci_set_irq, pci_dev, 4);
|
pci_dev->irq = qemu_allocate_irqs(pci_set_irq, pci_dev, 4);
|
||||||
|
pci_dev->version_id = 2; /* Current pci device vmstate version */
|
||||||
return pci_dev;
|
return pci_dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
hw/pci.h
2
hw/pci.h
@ -209,6 +209,8 @@ struct PCIDevice {
|
|||||||
unsigned *msix_entry_used;
|
unsigned *msix_entry_used;
|
||||||
/* Region including the MSI-X table */
|
/* Region including the MSI-X table */
|
||||||
uint32_t msix_bar_size;
|
uint32_t msix_bar_size;
|
||||||
|
/* Version id needed for VMState */
|
||||||
|
int32_t version_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
PCIDevice *pci_register_device(PCIBus *bus, const char *name,
|
PCIDevice *pci_register_device(PCIBus *bus, const char *name,
|
||||||
|
Loading…
Reference in New Issue
Block a user