From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUw6Q-00037M-SL for qemu-devel@nongnu.org; Tue, 01 Apr 2014 06:39:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WUw6K-0005ld-NH for qemu-devel@nongnu.org; Tue, 01 Apr 2014 06:39:34 -0400 Date: Tue, 1 Apr 2014 11:39:19 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20140401103918.GG2411@work-vm> References: <1396275242-10810-1-git-send-email-mst@redhat.com> <1396275242-10810-4-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1396275242-10810-4-git-send-email-mst@redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 03/30] vmstate: add VMSTATE_VALIDATE List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Peter Maydell , Fam Zheng , mdroth@linux.vnet.ibm.com, Juan Quintela , Igor Mitsyanko , qemu-stable@nongnu.org, qemu-devel@nongnu.org * Michael S. Tsirkin (mst@redhat.com) wrote: > Validate state using VMS_ARRAY with num = 0 and VMS_MUST_EXIST > > Signed-off-by: Michael S. Tsirkin Reviewed-by: Dr. David Alan Gilbert > --- > include/migration/vmstate.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h > index de970ab..5b71370 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), \ > -- > MST > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK