diff options
author | Michael S. Tsirkin | 2014-04-03 18:50:35 +0200 |
---|---|---|
committer | Juan Quintela | 2014-05-05 14:15:10 +0200 |
commit | 4082f0889ba04678fc14816c53e1b9251ea9207e (patch) | |
tree | a27410d024b44ef38d183f5f02ab132752a7e0b6 /include/migration/vmstate.h | |
parent | vmstate: add VMS_MUST_EXIST (diff) | |
download | qemu-4082f0889ba04678fc14816c53e1b9251ea9207e.tar.gz qemu-4082f0889ba04678fc14816c53e1b9251ea9207e.tar.xz qemu-4082f0889ba04678fc14816c53e1b9251ea9207e.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>
Diffstat (limited to 'include/migration/vmstate.h')
-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 de970abedd..5b7137058d 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), \ |