From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS60z-0002RB-S0 for qemu-devel@nongnu.org; Mon, 24 Mar 2014 10:38:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WS60s-0000AJ-HX for qemu-devel@nongnu.org; Mon, 24 Mar 2014 10:38:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32176) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS60s-0000AA-9V for qemu-devel@nongnu.org; Mon, 24 Mar 2014 10:38:06 -0400 Date: Mon, 24 Mar 2014 16:38:08 +0200 From: "Michael S. Tsirkin" Message-ID: <1395671853-2685-5-git-send-email-mst@redhat.com> References: <1395671853-2685-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1395671853-2685-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [RFC v2 4/5] vmstate: add VMSTATE_TEST List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell 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 eb90cef..e220f09 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -205,6 +205,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_NONE | VMS_MUST_EXIST, \ +} + #define VMSTATE_POINTER(_field, _state, _version, _info, _type) { \ .name = (stringify(_field)), \ .version_id = (_version), \ -- MST