* Michael S. Tsirkin (m...@redhat.com) wrote: > Can validate state using VMS_NONE and VMS_MUST_EXIST
Old comment, VMS_NONE being dead. > Signed-off-by: Michael S. Tsirkin <m...@redhat.com> > --- > include/migration/vmstate.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h > index de970ab..97629b7 100644 > --- a/include/migration/vmstate.h > +++ b/include/migration/vmstate.h > @@ -204,6 +204,12 @@ extern const VMStateInfo vmstate_info_bitmap; > .offset = vmstate_offset_value(_state, _field, _type), \ > } > > +#define VMSTATE_TEST(_name, _test) { \ > + .name = (_name), \ > + .field_exists = (_test), \ > + .flags = VMS_ARRAY | VMS_MUST_EXIST, \ Please comment this to say it's using the 0 sized array trick, (personally I'd explicitly set .num = 0 as well). Dave > +} > + > #define VMSTATE_POINTER(_field, _state, _version, _info, _type) { \ > .name = (stringify(_field)), \ > .version_id = (_version), \ > -- > MST > -- Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK