qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/2] vmstate: add VMSTATE_ARRAY_UNSAFE


From: Glauber Costa
Subject: Re: [Qemu-devel] [PATCH 2/2] vmstate: add VMSTATE_ARRAY_UNSAFE
Date: Tue, 20 Oct 2009 00:46:40 -0200

On Mon, Oct 19, 2009 at 5:07 PM, Juan Quintela <address@hidden> wrote:
> Use offset given as an array of type given, without doing typechecking.
>
> +#define VMSTATE_ARRAY_UNSAFE(_field, _state, _num, _version, _info, _type) {\
> +    .name       = (stringify(_field)),                               \
> +    .version_id = (_version),                                        \
> +    .num        = (_num),                                            \
> +    .info       = &(_info),                                          \
> +    .size       = sizeof(_type),                                     \
> +    .flags      = VMS_ARRAY,                                         \
> +    .offset     = offsetof(_state, _field)                           \
> +}
> +
Since we are already being unsafe, can't we pass the size directly,
instead of a type?

-- 
Glauber  Costa.
"Free as in Freedom"
http://glommer.net

"The less confident you are, the more serious you have to act."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]