]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
vmstate: type-check sub-arrays
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 7 Jan 2015 14:12:13 +0000 (15:12 +0100)
committerAmit Shah <amit.shah@redhat.com>
Fri, 16 Jan 2015 07:36:17 +0000 (13:06 +0530)
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 <pbonzini@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
include/migration/vmstate.h

index e45fc49cb1f645cb3460a63f82cf768068da0880..d712a651ca6cd181dcb102bef787ca5b3b52a59b 100644 (file)
@@ -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,                    \