aboutsummaryrefslogtreecommitdiff
path: root/hw/pci.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-08-20 19:42:38 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-27 20:30:22 -0500
commitf16c4abfadf9ae63bd22fb793484912542be0da7 (patch)
tree78f00e2f6400ad22e4cab9d765407f4af7aeabf7 /hw/pci.c
parent0a031e0ac6218fa1b8478ebac3eddb912d2a236a (diff)
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>
Diffstat (limited to 'hw/pci.c')
-rw-r--r--hw/pci.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/pci.c b/hw/pci.c
index 681b9d2633..7644dee90e 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -144,7 +144,7 @@ void pci_device_save(PCIDevice *s, QEMUFile *f)
{
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);
for (i = 0; i < 4; 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;
bus->devices[devfn] = pci_dev;
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;
}