projects
/
sdk
/
emulator
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5bf81c8
)
vmstate: add VMSTATE_VALIDATE
author
Michael S. Tsirkin
<mst@redhat.com>
Thu, 3 Apr 2014 16:50:35 +0000
(19:50 +0300)
committer
Juan Quintela
<quintela@redhat.com>
Mon, 5 May 2014 12:15:10 +0000
(14:15 +0200)
Validate state using VMS_ARRAY with num = 0 and VMS_MUST_EXIST
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
include/migration/vmstate.h
patch
|
blob
|
history
diff --git
a/include/migration/vmstate.h
b/include/migration/vmstate.h
index de970abedd243b22f59c9de92771ae6e523784f2..5b7137058d312812ba9609defb63101fe762e806 100644
(file)
--- a/
include/migration/vmstate.h
+++ b/
include/migration/vmstate.h
@@
-204,6
+204,14
@@
extern const VMStateInfo vmstate_info_bitmap;
.offset = vmstate_offset_value(_state, _field, _type), \
}
+/* Validate state using a boolean predicate. */
+#define VMSTATE_VALIDATE(_name, _test) { \
+ .name = (_name), \
+ .field_exists = (_test), \
+ .flags = VMS_ARRAY | VMS_MUST_EXIST, \
+ .num = 0, /* 0 elements: no data, only run _test */ \
+}
+
#define VMSTATE_POINTER(_field, _state, _version, _info, _type) { \
.name = (stringify(_field)), \
.version_id = (_version), \