From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mm38L-0004Qs-8f for qemu-devel@nongnu.org; Fri, 11 Sep 2009 06:13:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mm38G-0004OF-0f for qemu-devel@nongnu.org; Fri, 11 Sep 2009 06:13:36 -0400 Received: from [199.232.76.173] (port=36107 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mm38F-0004O5-Kz for qemu-devel@nongnu.org; Fri, 11 Sep 2009 06:13:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43989) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mm38C-0000vl-2q for qemu-devel@nongnu.org; Fri, 11 Sep 2009 06:13:29 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8BADROQ025256 for ; Fri, 11 Sep 2009 06:13:27 -0400 From: Juan Quintela Date: Fri, 11 Sep 2009 12:10:26 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: Subject: [Qemu-devel] [PATCH 06/20] vmstate: create VMSTATE_I2C_SLAVE List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@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 ac9d21d..b967670 100644 --- a/hw/hw.h +++ b/hw/hw.h @@ -428,6 +428,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 bdfe009..6e422a7 100644 --- a/hw/i2c.c +++ b/hw/i2c.c @@ -153,7 +153,7 @@ static int i2c_slave_post_load(void *opaque) return 0; } -static const VMStateDescription vmstate_i2c_slave = { +const VMStateDescription vmstate_i2c_slave = { .name = "i2c_slave", .version_id = 1, .minimum_version_id = 1, -- 1.6.2.5