From patchwork Mon Jun 14 20:28:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 55580 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A275CB6EEB for ; Tue, 15 Jun 2010 06:29:20 +1000 (EST) Received: from localhost ([127.0.0.1]:51098 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOGHU-0006oA-8h for incoming@patchwork.ozlabs.org; Mon, 14 Jun 2010 16:29:16 -0400 Received: from [140.186.70.92] (port=46637 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOGGd-0006lH-1V for qemu-devel@nongnu.org; Mon, 14 Jun 2010 16:28:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OOGGc-0003VJ-45 for qemu-devel@nongnu.org; Mon, 14 Jun 2010 16:28:22 -0400 Received: from qmta12.emeryville.ca.mail.comcast.net ([76.96.27.227]:39192) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OOGGb-0003V9-R7 for qemu-devel@nongnu.org; Mon, 14 Jun 2010 16:28:22 -0400 Received: from omta22.emeryville.ca.mail.comcast.net ([76.96.30.89]) by qmta12.emeryville.ca.mail.comcast.net with comcast id VtSM1e0041vN32cACwUMVD; Mon, 14 Jun 2010 20:28:21 +0000 Received: from localhost.localdomain ([75.71.122.219]) by omta22.emeryville.ca.mail.comcast.net with comcast id VwUK1e00S4k7Kz78iwUL7B; Mon, 14 Jun 2010 20:28:20 +0000 From: Alex Williamson To: qemu-devel@nongnu.org, anthony@codemonkey.ws, blauwirbel@gmail.com Date: Mon, 14 Jun 2010 14:28:19 -0600 Message-ID: <20100614202803.5259.85808.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: alex.williamson@redhat.com, kvm@vger.kernel.org, quintela@redhat.com Subject: [Qemu-devel] [RESEND PATCH] acpi_piix4: save gpe and pci hotplug slot status X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org PCI hotplug currently doesn't work after a migration because we don't migrate the enable bits of the GPE state. Pull hotplug structs into vmstate. Signed-off-by: Alex Williamson --- hw/acpi_piix4.c | 29 ++++++++++++++++++++++++++++- 1 files changed, 28 insertions(+), 1 deletions(-) diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c index a87286b..8d1a628 100644 --- a/hw/acpi_piix4.c +++ b/hw/acpi_piix4.c @@ -283,9 +283,33 @@ static int vmstate_acpi_post_load(void *opaque, int version_id) return 0; } +static const VMStateDescription vmstate_gpe = { + .name = "gpe", + .version_id = 1, + .minimum_version_id = 1, + .minimum_version_id_old = 1, + .fields = (VMStateField []) { + VMSTATE_UINT16(sts, struct gpe_regs), + VMSTATE_UINT16(en, struct gpe_regs), + VMSTATE_END_OF_LIST() + } +}; + +static const VMStateDescription vmstate_pci_status = { + .name = "pci_status", + .version_id = 1, + .minimum_version_id = 1, + .minimum_version_id_old = 1, + .fields = (VMStateField []) { + VMSTATE_UINT32(up, struct pci_status), + VMSTATE_UINT32(down, struct pci_status), + VMSTATE_END_OF_LIST() + } +}; + static const VMStateDescription vmstate_acpi = { .name = "piix4_pm", - .version_id = 1, + .version_id = 2, .minimum_version_id = 1, .minimum_version_id_old = 1, .post_load = vmstate_acpi_post_load, @@ -297,6 +321,9 @@ static const VMStateDescription vmstate_acpi = { VMSTATE_STRUCT(apm, PIIX4PMState, 0, vmstate_apm, APMState), VMSTATE_TIMER(tmr_timer, PIIX4PMState), VMSTATE_INT64(tmr_overflow_time, PIIX4PMState), + VMSTATE_STRUCT(gpe, PIIX4PMState, 2, vmstate_gpe, struct gpe_regs), + VMSTATE_STRUCT(pci0_status, PIIX4PMState, 2, vmstate_pci_status, + struct pci_status), VMSTATE_END_OF_LIST() } };