From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvCqZ-0006bU-OA for qemu-devel@nongnu.org; Tue, 15 Jan 2013 15:11:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvCqW-0001XD-LQ for qemu-devel@nongnu.org; Tue, 15 Jan 2013 15:10:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36622) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvCqW-0001UQ-Dn for qemu-devel@nongnu.org; Tue, 15 Jan 2013 15:10:56 -0500 Message-ID: <50F5B82C.7030301@redhat.com> Date: Tue, 15 Jan 2013 21:12:28 +0100 From: Laszlo Ersek MIME-Version: 1.0 References: <50F58992.90005@redhat.com> <1358280254-16512-1-git-send-email-lersek@redhat.com> In-Reply-To: <1358280254-16512-1-git-send-email-lersek@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] v1->v2 diff (PIIX3: reset the VM when the Reset Control Register's RCPU bit gets set) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: blauwirbel@gmail.com, pbonzini@redhat.com, akong@redhat.com, qemu-devel@nongnu.org diff --git a/hw/piix_pci.c b/hw/piix_pci.c index 75dc9c4..38a1027 100644 --- a/hw/piix_pci.c +++ b/hw/piix_pci.c @@ -477,9 +477,26 @@ static void piix3_pre_save(void *opaque) } } +static bool piix3_rcr_needed(void *opaque) +{ + PIIX3State *piix3 = opaque; + + return (piix3->rcr != 0); +} + +static const VMStateDescription vmstate_piix3_rcr = { + .name = "PIIX3/rcr", + .version_id = 1, + .minimum_version_id = 1, + .fields = (VMStateField []) { + VMSTATE_UINT8(rcr, PIIX3State), + VMSTATE_END_OF_LIST() + } +}; + static const VMStateDescription vmstate_piix3 = { .name = "PIIX3", - .version_id = 4, + .version_id = 3, .minimum_version_id = 2, .minimum_version_id_old = 2, .post_load = piix3_post_load, @@ -488,8 +505,14 @@ static const VMStateDescription vmstate_piix3 = { VMSTATE_PCI_DEVICE(dev, PIIX3State), VMSTATE_INT32_ARRAY_V(pci_irq_levels_vmstate, PIIX3State, PIIX_NUM_PIRQS, 3), - VMSTATE_UINT8_V(rcr, PIIX3State, 4), VMSTATE_END_OF_LIST() + }, + .subsections = (VMStateSubsection []) { + { + .vmsd = &vmstate_piix3_rcr, + .needed = piix3_rcr_needed, + }, + { 0 } } };