diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2013-12-17 19:42:37 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2013-12-17 20:12:51 +0000 |
commit | a1f05e79f2c207bded5efc23e8c6b1ca58161a8e (patch) | |
tree | 7538d8fd96cbfc96da536c173404ad20a4d75b87 /include/migration | |
parent | 9082f12173d407290bcec9f4ae84242972b2480c (diff) | |
download | qemu-a1f05e79f2c207bded5efc23e8c6b1ca58161a8e.tar.gz qemu-a1f05e79f2c207bded5efc23e8c6b1ca58161a8e.tar.bz2 qemu-a1f05e79f2c207bded5efc23e8c6b1ca58161a8e.zip |
vmstate: Add support for an array of ptimer_state *
Add support for defining a vmstate field which is an array
of pointers to structures, and use this to define a
VMSTATE_PTIMER_ARRAY() which allows an array of ptimer_state*
to be used by devices.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1387159292-10436-2-git-send-email-lig.fnst@cn.fujitsu.com
Diffstat (limited to 'include/migration')
-rw-r--r-- | include/migration/vmstate.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 9d09e60419..be193baba1 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -339,6 +339,16 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = vmstate_offset_array(_state, _field, _type, _num), \ } +#define VMSTATE_ARRAY_OF_POINTER_TO_STRUCT(_f, _s, _n, _v, _vmsd, _type) { \ + .name = (stringify(_f)), \ + .version_id = (_v), \ + .num = (_n), \ + .vmsd = &(_vmsd), \ + .size = sizeof(_type *), \ + .flags = VMS_ARRAY|VMS_STRUCT|VMS_ARRAY_OF_POINTER, \ + .offset = vmstate_offset_array(_s, _f, _type*, _n), \ +} + #define VMSTATE_STRUCT_ARRAY_TEST(_field, _state, _num, _test, _version, _vmsd, _type) { \ .name = (stringify(_field)), \ .num = (_num), \ |