[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC v3 2/3] vmstate: add VMSTATE_TEST
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-devel] [PATCH RFC v3 2/3] vmstate: add VMSTATE_TEST |
Date: |
Tue, 25 Mar 2014 10:49:24 +0000 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
* Michael S. Tsirkin (address@hidden) wrote:
> Can validate state using VMS_NONE and VMS_MUST_EXIST
Old comment, VMS_NONE being dead.
> Signed-off-by: Michael S. Tsirkin <address@hidden>
> ---
> 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 / address@hidden / Manchester, UK