[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 15/16] i440fx: use new vmstate infrastructure
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 15/16] i440fx: use new vmstate infrastructure |
Date: |
Fri, 28 Aug 2009 15:28:26 +0200 |
Signed-off-by: Juan Quintela <address@hidden>
---
hw/piix_pci.c | 36 ++++++++++++++++++++++++------------
1 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/hw/piix_pci.c b/hw/piix_pci.c
index a044883..5c33741 100644
--- a/hw/piix_pci.c
+++ b/hw/piix_pci.c
@@ -154,21 +154,11 @@ static void i440fx_write_config(PCIDevice *dev,
i440fx_update_memory_mappings(d);
}
-static void i440fx_save(QEMUFile* f, void *opaque)
-{
- PCII440FXState *d = opaque;
-
- pci_device_save(&d->dev, f);
- qemu_put_8s(f, &d->smm_enabled);
-}
-
-static int i440fx_load(QEMUFile* f, void *opaque, int version_id)
+static int i440fx_load_old(QEMUFile* f, void *opaque, int version_id)
{
PCII440FXState *d = opaque;
int ret, i;
- if (version_id > 3)
- return -EINVAL;
ret = pci_device_load(&d->dev, f);
if (ret < 0)
return ret;
@@ -182,6 +172,28 @@ static int i440fx_load(QEMUFile* f, void *opaque, int
version_id)
return 0;
}
+static int i440fx_after_load(void *opaque)
+{
+ PCII440FXState *d = opaque;
+
+ i440fx_update_memory_mappings(d);
+ return 0;
+}
+
+static const VMStateDescription vmstate_i440fx = {
+ .name = "I440FX",
+ .version_id = 3,
+ .minimum_version_id = 3,
+ .minimum_version_id_old = 1,
+ .load_state_old = i440fx_load_old,
+ .run_after_load = i440fx_after_load,
+ .fields = (VMStateField []) {
+ VMSTATE_PCI_DEVICE(dev, PCII440FXState),
+ VMSTATE_UINT8(smm_enabled, PCII440FXState),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
static int i440fx_pcihost_initfn(SysBusDevice *dev)
{
I440FXState *s = FROM_SYSBUS(I440FXState, dev);
@@ -210,7 +222,7 @@ static int i440fx_initfn(PCIDevice *dev)
d->dev.config[0x72] = 0x02; /* SMRAM */
- register_savevm("I440FX", 0, 3, i440fx_save, i440fx_load, d);
+ vmstate_register(0, &vmstate_i440fx, d);
return 0;
}
--
1.6.2.5
- [Qemu-devel] [PATCH 05/16] Move smm_enabled and isa_memory_mappings to PCII440FXState, (continued)
- [Qemu-devel] [PATCH 05/16] Move smm_enabled and isa_memory_mappings to PCII440FXState, Juan Quintela, 2009/08/28
- [Qemu-devel] [PATCH 06/16] We want the argument pass to set_irq to be opaque, Juan Quintela, 2009/08/28
- [Qemu-devel] [PATCH 07/16] Create PIIX3State instead of using PCIDevice for PIIX3, Juan Quintela, 2009/08/28
- [Qemu-devel] [PATCH 08/16] Introduce PIIX3IrqState for piix3 irq's state, Juan Quintela, 2009/08/28
- [Qemu-devel] [PATCH 09/16] Fold piix3_init() intto i440fx_init, Juan Quintela, 2009/08/28
- [Qemu-devel] [PATCH 10/16] We can add piix3_dev now to PIIX3IrqState, Juan Quintela, 2009/08/28
- [Qemu-devel] [PATCH 12/16] pci_irq_levels[] belong to PIIX3State, Juan Quintela, 2009/08/28
- [Qemu-devel] [PATCH 11/16] Save irq_state into PCII440FXState, Juan Quintela, 2009/08/28
- [Qemu-devel] [PATCH 13/16] Update SaveVM versions, Juan Quintela, 2009/08/28
- [Qemu-devel] [PATCH 14/16] VMState: Fix sub-structs versioning, Juan Quintela, 2009/08/28
- [Qemu-devel] [PATCH 15/16] i440fx: use new vmstate infrastructure,
Juan Quintela <=
- [Qemu-devel] [PATCH 16/16] piix3: use new vmstate infrastructure, Juan Quintela, 2009/08/28
- [Qemu-devel] Re: [PATCH 00/16] *** SUBJECT HERE ***, Juan Quintela, 2009/08/28