From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=60376 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJrH5-0001D2-UC for qemu-devel@nongnu.org; Wed, 02 Jun 2010 12:58:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJrGy-0006Dd-5b for qemu-devel@nongnu.org; Wed, 02 Jun 2010 12:58:33 -0400 Received: from qmta09.emeryville.ca.mail.comcast.net ([76.96.30.96]:58583) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJrGx-0006DV-VW for qemu-devel@nongnu.org; Wed, 02 Jun 2010 12:58:32 -0400 From: Alex Williamson Date: Wed, 02 Jun 2010 10:58:29 -0600 Message-ID: <20100602165806.9089.28740.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] acpi_piix4: save gpe and pci hotplug slot status List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: alex.williamson@redhat.com, kvm@vger.kernel.org, quintela@redhat.com 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 0fce958..091cdcd 100644 --- a/hw/acpi_piix4.c +++ b/hw/acpi_piix4.c @@ -282,9 +282,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, @@ -296,6 +320,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() } };