diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2014-04-03 19:50:35 +0300 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-07-28 10:02:43 +0900 |
commit | a5381edaa97703b46ae6b5865175c908188f735e (patch) | |
tree | cb9d5c8b437a387cea8b43585e3b12d563d9a8ab | |
parent | ca417804bcb73d451a50bdc5ef9a26b607b6ba51 (diff) | |
download | qemu-a5381edaa97703b46ae6b5865175c908188f735e.tar.gz qemu-a5381edaa97703b46ae6b5865175c908188f735e.tar.bz2 qemu-a5381edaa97703b46ae6b5865175c908188f735e.zip |
vmstate: add VMSTATE_VALIDATE
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>
(cherry picked from commit 4082f0889ba04678fc14816c53e1b9251ea9207e)
Signed-off-by: Andreas Färber <afaerber@suse.de>
-rw-r--r-- | include/migration/vmstate.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index de970abed..5b7137058 100644 --- 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), \ |