From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDxjE-0002HW-5K for qemu-devel@nongnu.org; Wed, 21 Jan 2015 11:02:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YDxj7-0005Vi-Ss for qemu-devel@nongnu.org; Wed, 21 Jan 2015 11:02:00 -0500 From: Mark Cave-Ayland Date: Wed, 21 Jan 2015 16:01:06 +0000 Message-Id: <1421856072-25026-2-git-send-email-mark.cave-ayland@ilande.co.uk> In-Reply-To: <1421856072-25026-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1421856072-25026-1-git-send-email-mark.cave-ayland@ilande.co.uk> Subject: [Qemu-devel] [PATCHv2 1/7] macio.c: include parent PCIDevice state in VMStateDescription List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, agraf@suse.de This ensures that the macio PCI device is correctly configured when restoring from a VM snapshot. Signed-off-by: Mark Cave-Ayland --- hw/misc/macio/macio.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index e0f1e88..9bc3f2d 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -336,20 +336,44 @@ static void macio_instance_init(Object *obj) memory_region_add_subregion(&s->bar, 0x08000, dbdma_mem); } +static const VMStateDescription vmstate_macio_oldworld = { + .name = "macio-oldworld", + .version_id = 0, + .minimum_version_id = 0, + .fields = (VMStateField[]) { + VMSTATE_PCI_DEVICE(parent_obj.parent, OldWorldMacIOState), + VMSTATE_END_OF_LIST() + } +}; + static void macio_oldworld_class_init(ObjectClass *oc, void *data) { PCIDeviceClass *pdc = PCI_DEVICE_CLASS(oc); + DeviceClass *dc = DEVICE_CLASS(oc); pdc->init = macio_oldworld_initfn; pdc->device_id = PCI_DEVICE_ID_APPLE_343S1201; + dc->vmsd = &vmstate_macio_oldworld; } +static const VMStateDescription vmstate_macio_newworld = { + .name = "macio-newworld", + .version_id = 0, + .minimum_version_id = 0, + .fields = (VMStateField[]) { + VMSTATE_PCI_DEVICE(parent_obj.parent, NewWorldMacIOState), + VMSTATE_END_OF_LIST() + } +}; + static void macio_newworld_class_init(ObjectClass *oc, void *data) { PCIDeviceClass *pdc = PCI_DEVICE_CLASS(oc); + DeviceClass *dc = DEVICE_CLASS(oc); pdc->init = macio_newworld_initfn; pdc->device_id = PCI_DEVICE_ID_APPLE_UNI_N_KEYL; + dc->vmsd = &vmstate_macio_newworld; } static Property macio_properties[] = { -- 1.7.10.4