From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MnI04-0004pt-PF for qemu-devel@nongnu.org; Mon, 14 Sep 2009 16:18:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MnHzz-0004fi-DA for qemu-devel@nongnu.org; Mon, 14 Sep 2009 16:18:11 -0400 Received: from [199.232.76.173] (port=40840 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnHzz-0004fO-8N for qemu-devel@nongnu.org; Mon, 14 Sep 2009 16:18:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23406) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MnHzy-0005m8-QO for qemu-devel@nongnu.org; Mon, 14 Sep 2009 16:18:07 -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 n8EKI6jM018468 for ; Mon, 14 Sep 2009 16:18:06 -0400 From: Juan Quintela Date: Mon, 14 Sep 2009 22:15:21 +0200 Message-Id: <951c82c161d4fde5586f8a830e543df0f0b1f4be.1252959221.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: Subject: [Qemu-devel] [PATCH 4/4] vmstate: Add support for sending partial arrays List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This one is needed for changees happening on fdc. It allows you to send arrays of structs whose size we want to send it is another field with type uint8_t. (If you have been able to read the whole sentence without stoping for breathing, you can use it. Signed-off-by: Juan Quintela --- hw/hw.h | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/hw/hw.h b/hw/hw.h index 6f60493..823c132 100644 --- a/hw/hw.h +++ b/hw/hw.h @@ -398,6 +398,18 @@ extern const VMStateInfo vmstate_info_buffer; + type_check_array(_type,typeof_field(_state, _field),_num) \ } +#define VMSTATE_STRUCT_ARRAY_SIZE_UINT8(_field, _state, _field__num, _version, _vmsd, _type) { \ + .name = (stringify(_field)), \ + .num_offset = offsetof(_state, _field_num) \ + + type_check(uint8_t,typeof_field(_state, _field_num)), \ + .version_id = (_version), \ + .vmsd = &(_vmsd), \ + .size = sizeof(_type), \ + .flags = VMS_STRUCT|VMS_ARRAY, \ + .offset = offsetof(_state, _field) \ + + type_check_array(_type,typeof_field(_state, _field),_num) \ +} + #define VMSTATE_STATIC_BUFFER(_field, _state, _version) { \ .name = (stringify(_field)), \ .version_id = (_version), \ -- 1.6.2.5