diff options
author | Yuri Benditovich <yuri.benditovich@daynix.com> | 2020-05-08 15:59:32 +0300 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2020-06-18 21:05:50 +0800 |
commit | ff4e6d545d924ad9bfe135a90c05b4f9960773d6 (patch) | |
tree | 3a6f5b01bdffe0761c3a5d82560abb10b8ed38c2 /include | |
parent | e22f0603fb2fc274920a9e3a1d1306260b9a4cc4 (diff) |
vmstate.h: provide VMSTATE_VARRAY_UINT16_ALLOC macro
Similar to VMSTATE_VARRAY_UINT32_ALLOC, but the size is
16-bit field.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'include')
-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 eafa39f560..f68ed7db13 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -432,6 +432,16 @@ extern const VMStateInfo vmstate_info_qlist; .offset = vmstate_offset_pointer(_state, _field, _type), \ } +#define VMSTATE_VARRAY_UINT16_ALLOC(_field, _state, _field_num, _version, _info, _type) {\ + .name = (stringify(_field)), \ + .version_id = (_version), \ + .num_offset = vmstate_offset_value(_state, _field_num, uint16_t),\ + .info = &(_info), \ + .size = sizeof(_type), \ + .flags = VMS_VARRAY_UINT16 | VMS_POINTER | VMS_ALLOC, \ + .offset = vmstate_offset_pointer(_state, _field, _type), \ +} + #define VMSTATE_VARRAY_UINT16_UNSAFE(_field, _state, _field_num, _version, _info, _type) {\ .name = (stringify(_field)), \ .version_id = (_version), \ |