aboutsummaryrefslogtreecommitdiff
path: root/vmstate.h
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2012-10-30 07:45:12 +0000
committerPeter Maydell <peter.maydell@linaro.org>2012-10-30 07:45:12 +0000
commit08e99e296fbe695d13c8ac944867d9def7f7c5d0 (patch)
treefc266bd4dfbc4b0ad01a94656c052a0b338f9e35 /vmstate.h
parentf2d189d38436a8ccdedd94de01673b04aa008e11 (diff)
downloadqemu-08e99e296fbe695d13c8ac944867d9def7f7c5d0.zip
qemu-08e99e296fbe695d13c8ac944867d9def7f7c5d0.tar.gz
qemu-08e99e296fbe695d13c8ac944867d9def7f7c5d0.tar.bz2
vmstate: Add support for saving/loading bitmaps
Add support for saving/loading bitmap.h bitmaps in vmstate. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Igor Mitsyanko <i.mitsyanko@samsung.com> Reviewed-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'vmstate.h')
-rw-r--r--vmstate.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/vmstate.h b/vmstate.h
index c9c320e..623af0a 100644
--- a/vmstate.h
+++ b/vmstate.h
@@ -139,6 +139,7 @@ extern const VMStateInfo vmstate_info_uint64;
extern const VMStateInfo vmstate_info_timer;
extern const VMStateInfo vmstate_info_buffer;
extern const VMStateInfo vmstate_info_unused_buffer;
+extern const VMStateInfo vmstate_info_bitmap;
#define type_check_array(t1,t2,n) ((t1(*)[n])0 - (t2*)0)
#define type_check_pointer(t1,t2) ((t1**)0 - (t2*)0)
@@ -411,6 +412,18 @@ extern const VMStateInfo vmstate_info_unused_buffer;
.flags = VMS_BUFFER, \
}
+/* _field_size should be a int32_t field in the _state struct giving the
+ * size of the bitmap _field in bits.
+ */
+#define VMSTATE_BITMAP(_field, _state, _version, _field_size) { \
+ .name = (stringify(_field)), \
+ .version_id = (_version), \
+ .size_offset = vmstate_offset_value(_state, _field_size, int32_t),\
+ .info = &vmstate_info_bitmap, \
+ .flags = VMS_VBUFFER|VMS_POINTER, \
+ .offset = offsetof(_state, _field), \
+}
+
/* _f : field name
_f_n : num of elements field_name
_n : num of elements