From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56240 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PgYGR-0002Y7-Vg for qemu-devel@nongnu.org; Sat, 22 Jan 2011 02:52:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PgYGQ-0002zG-Is for qemu-devel@nongnu.org; Sat, 22 Jan 2011 02:52:03 -0500 Received: from mail-bw0-f45.google.com ([209.85.214.45]:40100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PgYGQ-0002zB-B7 for qemu-devel@nongnu.org; Sat, 22 Jan 2011 02:52:02 -0500 Received: by bwz16 with SMTP id 16so2222290bwz.4 for ; Fri, 21 Jan 2011 23:52:01 -0800 (PST) From: Dmitry Eremin-Solenikov Date: Sat, 22 Jan 2011 10:52:00 +0300 Message-Id: <1295682720-13600-1-git-send-email-dbaryshkov@gmail.com> Subject: [Qemu-devel] [PATCH/RFC] vmstate: add VMSTATE_ macro for pointer to array of structures List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org While working on cleaning up pxa2xx_timer, I stumbled upon storing array of structures, which is referenced via a pointer. Thus I had to add this macro. Signed-off-by: Dmitry Eremin-Solenikov --- hw/hw.h | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/hw/hw.h b/hw/hw.h index 163a683..acdeb6a 100644 --- a/hw/hw.h +++ b/hw/hw.h @@ -456,6 +456,16 @@ extern const VMStateInfo vmstate_info_unused_buffer; .offset = vmstate_offset_value(_state, _field, _type), \ } +#define VMSTATE_STRUCT_POINTER_ARRAY_TEST(_field, _state, _num, _test, _vmsd, _type) { \ + .name = (stringify(_field)), \ + .field_exists = (_test), \ + .num = (_num), \ + .vmsd = &(_vmsd), \ + .size = sizeof(_type), \ + .flags = VMS_STRUCT|VMS_POINTER|VMS_ARRAY, \ + .offset = vmstate_offset_pointer(_state, _field, _type), \ +} + #define VMSTATE_STRUCT_POINTER_TEST(_field, _state, _test, _vmsd, _type) { \ .name = (stringify(_field)), \ .field_exists = (_test), \ -- 1.7.2.3