vmstate: port piix4
Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
parent
1fc7cee0b4
commit
9039d78e64
25
hw/piix4.c
25
hw/piix4.c
|
@ -72,19 +72,16 @@ static void piix4_reset(void *opaque)
|
||||||
pci_conf[0xae] = 0x00;
|
pci_conf[0xae] = 0x00;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void piix_save(QEMUFile* f, void *opaque)
|
static const VMStateDescription vmstate_piix4 = {
|
||||||
{
|
.name = "PIIX4",
|
||||||
PIIX4State *d = opaque;
|
.version_id = 2,
|
||||||
pci_device_save(&d->dev, f);
|
.minimum_version_id = 2,
|
||||||
}
|
.minimum_version_id_old = 2,
|
||||||
|
.fields = (VMStateField[]) {
|
||||||
static int piix_load(QEMUFile* f, void *opaque, int version_id)
|
VMSTATE_PCI_DEVICE(dev, PIIX4State),
|
||||||
{
|
VMSTATE_END_OF_LIST()
|
||||||
PIIX4State *d = opaque;
|
}
|
||||||
if (version_id != 2)
|
};
|
||||||
return -EINVAL;
|
|
||||||
return pci_device_load(&d->dev, f);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int piix4_initfn(PCIDevice *dev)
|
static int piix4_initfn(PCIDevice *dev)
|
||||||
{
|
{
|
||||||
|
@ -92,7 +89,6 @@ static int piix4_initfn(PCIDevice *dev)
|
||||||
uint8_t *pci_conf;
|
uint8_t *pci_conf;
|
||||||
|
|
||||||
isa_bus_new(&d->dev.qdev);
|
isa_bus_new(&d->dev.qdev);
|
||||||
register_savevm(&d->dev.qdev, "PIIX4", 0, 2, piix_save, piix_load, d);
|
|
||||||
|
|
||||||
pci_conf = d->dev.config;
|
pci_conf = d->dev.config;
|
||||||
pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_INTEL);
|
pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_INTEL);
|
||||||
|
@ -117,6 +113,7 @@ static PCIDeviceInfo piix4_info[] = {
|
||||||
.qdev.name = "PIIX4",
|
.qdev.name = "PIIX4",
|
||||||
.qdev.desc = "ISA bridge",
|
.qdev.desc = "ISA bridge",
|
||||||
.qdev.size = sizeof(PIIX4State),
|
.qdev.size = sizeof(PIIX4State),
|
||||||
|
.qdev.vmsd = &vmstate_piix4,
|
||||||
.qdev.no_user = 1,
|
.qdev.no_user = 1,
|
||||||
.no_hotplug = 1,
|
.no_hotplug = 1,
|
||||||
.init = piix4_initfn,
|
.init = piix4_initfn,
|
||||||
|
|
Loading…
Reference in a new issue