From patchwork Wed Oct 14 11:37:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 35944 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 489DBB7B72 for ; Wed, 14 Oct 2009 22:40:33 +1100 (EST) Received: from localhost ([127.0.0.1]:60950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1My2DV-00033D-UF for incoming@patchwork.ozlabs.org; Wed, 14 Oct 2009 07:40:29 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1My2BX-0002Dp-GR for qemu-devel@nongnu.org; Wed, 14 Oct 2009 07:38:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1My2BS-000292-H5 for qemu-devel@nongnu.org; Wed, 14 Oct 2009 07:38:26 -0400 Received: from [199.232.76.173] (port=41232 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1My2BS-00028f-Am for qemu-devel@nongnu.org; Wed, 14 Oct 2009 07:38:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61274) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1My2BR-0006BA-PL for qemu-devel@nongnu.org; Wed, 14 Oct 2009 07:38:22 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9EBcLwT026239 for ; Wed, 14 Oct 2009 07:38:21 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9EBcIEq006321; Wed, 14 Oct 2009 07:38:20 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 14 Oct 2009 13:37:41 +0200 Message-Id: <35fd87a03bf08c93e0ff13d9aed406e6b1154211.1255520033.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 01/13] ide: port idebus to vmstate 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 Signed-off-by: Juan Quintela --- hw/ide/core.c | 18 ++++++++++++++---- 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index 0b6de6c..e1433b2 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -2654,16 +2654,26 @@ void ide_load(QEMUFile* f, IDEState *s, int version_id) /* XXX: if a transfer is pending, we do not save it yet */ } +const VMStateDescription vmstate_ide_bus = { + .name = "ide_bus", + .version_id = 1, + .minimum_version_id = 1, + .minimum_version_id_old = 1, + .fields = (VMStateField []) { + VMSTATE_UINT8(cmd, IDEBus), + VMSTATE_UINT8(unit, IDEBus), + VMSTATE_END_OF_LIST() + } +}; + void idebus_save(QEMUFile* f, IDEBus *bus) { - qemu_put_8s(f, &bus->cmd); - qemu_put_8s(f, &bus->unit); + vmstate_save_state(f, &vmstate_ide_bus, bus); } void idebus_load(QEMUFile* f, IDEBus *bus, int version_id) { - qemu_get_8s(f, &bus->cmd); - qemu_get_8s(f, &bus->unit); + vmstate_load_state(f, &vmstate_ide_bus, bus, vmstate_ide_bus.version_id); } /***********************************************************/