From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8rLV-0000Yy-0D for qemu-devel@nongnu.org; Wed, 07 Jan 2015 09:12:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y8rLR-0008Cb-Or for qemu-devel@nongnu.org; Wed, 07 Jan 2015 09:12:24 -0500 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:45223) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8rLR-0008CV-HP for qemu-devel@nongnu.org; Wed, 07 Jan 2015 09:12:21 -0500 Received: by mail-wi0-f182.google.com with SMTP id h11so1688814wiw.9 for ; Wed, 07 Jan 2015 06:12:21 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Wed, 7 Jan 2015 15:12:13 +0100 Message-Id: <1420639933-12338-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH] vmstate: type-check sub-arrays List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Amit Shah , Juan Quintela While we cannot check against the type of the full array, we can check against the type of the fields. Signed-off-by: Paolo Bonzini --- include/migration/vmstate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 3b9e0de..6097b94 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -189,7 +189,7 @@ extern const VMStateInfo vmstate_info_bitmap; type_check_2darray(_type, typeof_field(_state, _field), _n1, _n2)) #define vmstate_offset_sub_array(_state, _field, _type, _start) \ - (offsetof(_state, _field[_start])) + vmstate_offset_value(_state, _field[_start], _type) #define vmstate_offset_buffer(_state, _field) \ vmstate_offset_array(_state, _field, uint8_t, \ -- 1.8.3.1