Received: from eggs.gnu.org ([2001:4830:134:3::10]:56548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VORLB-0003ot-Tc for qemu-devel@nongnu.org; Tue, 24 Sep 2013 08:03:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VORL7-0007ds-FD for qemu-devel@nongnu.org; Tue, 24 Sep 2013 08:03:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VORL7-0007dm-5k for qemu-devel@nongnu.org; Tue, 24 Sep 2013 08:03:37 -0400 From: Juan Quintela Date: Tue, 24 Sep 2013 14:03:20 +0200 Message-Id: <1380024203-25897-7-git-send-email-quintela@redhat.com> In-Reply-To: <1380024203-25897-1-git-send-email-quintela@redhat.com> References: <1380024203-25897-1-git-send-email-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 6/9] migration: add version supporting macros for struct pointer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , =?UTF-8?q?Andreas=20F=C3=A4rber?= , anthony@codemonkey.ws From: Alexey Kardashevskiy This adds version supporting macros VMSTATE_STRUCT_POINTER_TEST_V and VMSTATE_STRUCT_POINTER_V in addition to the already existing VMSTATE_STRUCT_POINTER and VMSTATE_STRUCT_POINTER_TEST macros. Cc: Andreas F=C3=A4rber Signed-off-by: Alexey Kardashevskiy Signed-off-by: Juan Quintela --- include/migration/vmstate.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 1c31b5d..9d09e60 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -310,8 +310,18 @@ extern const VMStateInfo vmstate_info_bitmap; .offset =3D vmstate_offset_value(_state, _field, _type), \ } -#define VMSTATE_STRUCT_POINTER_TEST(_field, _state, _test, _vmsd, _type)= { \ +#define VMSTATE_STRUCT_POINTER_V(_field, _state, _version, _vmsd, _type)= { \ .name =3D (stringify(_field)), \ + .version_id =3D (_version), = \ + .vmsd =3D &(_vmsd), \ + .size =3D sizeof(_type), \ + .flags =3D VMS_STRUCT|VMS_POINTER, \ + .offset =3D vmstate_offset_value(_state, _field, _type), \ +} + +#define VMSTATE_STRUCT_POINTER_TEST_V(_field, _state, _test, _version, _= vmsd, _type) { \ + .name =3D (stringify(_field)), \ + .version_id =3D (_version), = \ .field_exists =3D (_test), \ .vmsd =3D &(_vmsd), \ .size =3D sizeof(_type), \ @@ -497,7 +507,10 @@ extern const VMStateInfo vmstate_info_bitmap; VMSTATE_STRUCT_TEST(_field, _state, NULL, _version, _vmsd, _type) #define VMSTATE_STRUCT_POINTER(_field, _state, _vmsd, _type) \ - VMSTATE_STRUCT_POINTER_TEST(_field, _state, NULL, _vmsd, _type) + VMSTATE_STRUCT_POINTER_V(_field, _state, 0, _vmsd, _type) + +#define VMSTATE_STRUCT_POINTER_TEST(_field, _state, _test, _vmsd, _type)= \ + VMSTATE_STRUCT_POINTER_TEST_V(_field, _state, _test, 0, _vmsd, _type= ) #define VMSTATE_STRUCT_ARRAY(_field, _state, _num, _version, _vmsd, _typ= e) \ VMSTATE_STRUCT_ARRAY_TEST(_field, _state, _num, NULL, _version, \ --=20 1.8.3.1