[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 20/23] Add version_id to PCIDevice.
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 20/23] Add version_id to PCIDevice. |
Date: |
Thu, 20 Aug 2009 19:42:38 +0200 |
It is needed for VMState
Signed-off-by: Juan Quintela <address@hidden>
---
hw/pci.c | 3 ++-
hw/pci.h | 2 ++
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index 681b9d2..7644dee 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;
}
diff --git a/hw/pci.h b/hw/pci.h
index a2ec16a..32e98d4 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -209,6 +209,8 @@ struct PCIDevice {
unsigned *msix_entry_used;
/* Region including the MSI-X table */
uint32_t msix_bar_size;
+ /* Version id needed for VMState */
+ int32_t version_id;
};
PCIDevice *pci_register_device(PCIBus *bus, const char *name,
--
1.6.2.5
- [Qemu-devel] [PATCH 18/23] Port PS2 devices to VMState design, (continued)
- [Qemu-devel] [PATCH 18/23] Port PS2 devices to VMState design, Juan Quintela, 2009/08/20
- [Qemu-devel] [PATCH 17/23] Add VMState support for static sized buffers (uint_8), Juan Quintela, 2009/08/20
- [Qemu-devel] [PATCH 19/23] Add VMState support for int32_t check value, Juan Quintela, 2009/08/20
- [Qemu-devel] [PATCH 22/23] Add VMState support to run a function after load, Juan Quintela, 2009/08/20
- [Qemu-devel] [PATCH 21/23] Port PCIDevice state to VMState, Juan Quintela, 2009/08/20
[Qemu-devel] [PATCH 20/23] Add version_id to PCIDevice.,
Juan Quintela <=
[Qemu-devel] [PATCH 23/23] Port ACPI to VMState, Juan Quintela, 2009/08/20
Re: [Qemu-devel] [PATCH 00/23] New VMState table based load/save infrastructure, Gerd Hoffmann, 2009/08/21