* [Qemu-devel] [PATCH] vmstate: type-check sub-arrays
@ 2015-01-07 14:12 Paolo Bonzini
2015-01-08 11:57 ` Amit Shah
0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2015-01-07 14:12 UTC (permalink / raw)
To: qemu-devel; +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 <pbonzini@redhat.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-08 11:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-07 14:12 [Qemu-devel] [PATCH] vmstate: type-check sub-arrays Paolo Bonzini
2015-01-08 11:57 ` Amit Shah
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).