Signed-off-by: Michael Roth <mdr...@linux.vnet.ibm.com> --- hw/piix_pci.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
diff --git a/hw/piix_pci.c b/hw/piix_pci.c index 0242399..a867e3f 100644 --- a/hw/piix_pci.c +++ b/hw/piix_pci.c @@ -544,12 +544,37 @@ static const VMStateDescription vmstate_piix3 = { } }; +static void piix3_get_state(Object *obj, Visitor *v, void *opaque, + const char *name, Error **errp) +{ + PCIDevice *pci = PCI_DEVICE(obj); + PIIX3State *s = DO_UPCAST(PIIX3State, dev, pci); + + piix3_pre_save(s); + QIDL_VISIT_TYPE(PIIX3State, v, &s, name, errp); +} + +static void piix3_set_state(Object *obj, Visitor *v, void *opaque, + const char *name, Error **errp) +{ + PCIDevice *pci = PCI_DEVICE(obj); + PIIX3State *s = DO_UPCAST(PIIX3State, dev, pci); + + QIDL_VISIT_TYPE(PIIX3State, v, &s, name, errp); + piix3_post_load(s, -1); +} + static int piix3_initfn(PCIDevice *dev) { PIIX3State *d = DO_UPCAST(PIIX3State, dev, dev); isa_bus_new(&d->dev.qdev, pci_address_space_io(dev)); qemu_register_reset(piix3_reset, d); + + object_property_add(OBJECT(d), "state", "PIIX3State", + piix3_get_state, piix3_set_state, NULL, NULL, NULL); + QIDL_SCHEMA_ADD_LINK(PIIX3State, OBJECT(d), "state_schema", NULL); + return 0; } -- 1.7.9.5