From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSCwa-0003qq-Bo for qemu-devel@nongnu.org; Mon, 24 Mar 2014 18:02:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSCwU-0005Oy-Dz for qemu-devel@nongnu.org; Mon, 24 Mar 2014 18:02:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63831) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSCwU-0005Ou-78 for qemu-devel@nongnu.org; Mon, 24 Mar 2014 18:02:02 -0400 Date: Tue, 25 Mar 2014 00:02:04 +0200 From: "Michael S. Tsirkin" Message-ID: <1395698484-22562-3-git-send-email-mst@redhat.com> References: <1395698484-22562-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1395698484-22562-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PATCH RFC v3 2/3] vmstate: add VMSTATE_TEST List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , dgilbert@redhat.com Can validate state using VMS_NONE and VMS_MUST_EXIST Signed-off-by: Michael S. Tsirkin --- 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, \ +} + #define VMSTATE_POINTER(_field, _state, _version, _info, _type) { \ .name = (stringify(_field)), \ .version_id = (_version), \ -- MST