From patchwork Tue Sep 29 20:48:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 34459 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 6EE95B7BA8 for ; Wed, 30 Sep 2009 07:07:59 +1000 (EST) Received: from localhost ([127.0.0.1]:48234 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MsjvQ-0003Be-Ql for incoming@patchwork.ozlabs.org; Tue, 29 Sep 2009 17:07:56 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Msjdj-000525-9W for qemu-devel@nongnu.org; Tue, 29 Sep 2009 16:49:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Msjde-0004yN-E6 for qemu-devel@nongnu.org; Tue, 29 Sep 2009 16:49:38 -0400 Received: from [199.232.76.173] (port=55215 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Msjde-0004xz-4G for qemu-devel@nongnu.org; Tue, 29 Sep 2009 16:49:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56485) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Msjdd-0002Rr-J5 for qemu-devel@nongnu.org; Tue, 29 Sep 2009 16:49:33 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8TKnWma028540 for ; Tue, 29 Sep 2009 16:49:32 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8TKnHXk006885; Tue, 29 Sep 2009 16:49:32 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Tue, 29 Sep 2009 22:48:30 +0200 Message-Id: <5e8b0396ed3ce9d67eaa200865959963bc7a5eef.1254255997.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 11/49] vmstate: create VMSTATE_I2C_SLAVE 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/hw.h | 11 +++++++++++ hw/i2c.c | 2 +- 2 files changed, 12 insertions(+), 1 deletions(-) diff --git a/hw/hw.h b/hw/hw.h index 2d86389..3796457 100644 --- a/hw/hw.h +++ b/hw/hw.h @@ -440,6 +440,17 @@ extern const VMStateDescription vmstate_pci_device; + type_check(PCIDevice,typeof_field(_state, _field)) \ } +extern const VMStateDescription vmstate_i2c_slave; + +#define VMSTATE_I2C_SLAVE(_field, _state) { \ + .name = (stringify(_field)), \ + .size = sizeof(i2c_slave), \ + .vmsd = &vmstate_i2c_slave, \ + .flags = VMS_STRUCT, \ + .offset = offsetof(_state, _field) \ + + type_check(i2c_slave,typeof_field(_state, _field)) \ +} + /* _f : field name _f_n : num of elements field_name _n : num of elements diff --git a/hw/i2c.c b/hw/i2c.c index db9283d..e561e7f 100644 --- a/hw/i2c.c +++ b/hw/i2c.c @@ -153,7 +153,7 @@ static int i2c_slave_post_load(void *opaque, int version_id) return 0; } -static const VMStateDescription vmstate_i2c_slave = { +const VMStateDescription vmstate_i2c_slave = { .name = "i2c_slave", .version_id = 1, .minimum_version_id = 1,