qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 15/26] qom: Make object_property_set_qobject(


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 15/26] qom: Make object_property_set_qobject()'s input visitor strict
Date: Mon, 27 Feb 2017 13:25:51 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

On 02/26/2017 03:43 PM, Markus Armbruster wrote:
> Commit 240f64b made all qobject input visitors created outside tests
> strict, except for the one in object_property_set_qobject().  That one
> was left behind only because Eric couldn't spare the time to figure
> out whether making it strict would break anything, with a TODO
> comment.  Time to resolve it.
> 
> Strict makes a difference only for otherwise successful visits of QAPI
> structs or unions.  Let's examine what the callers of
> object_property_set_qobject() visit:
> 
> * object_property_set_str(), object_property_set_bool(),
>   object_property_set_int() visit a QString, QBool, QInt,
>   respectively.  Strictness can't matter.
> 
> * qmp_qom_set visits its @value argument.  Comes straight from QMP and
>   can be anything ('any' in the QAPI schema).  Strictness matters when
>   the property's set() method visits a struct or union QAPI type.
> 
>   No such methods exist, thus switching to strict can't break
>   anything.
> 
>   If we acquire such methods in the future, we'll *want* the visitor
>   to be strict, so that unexpected members get rejected as they should
>   be.
> 
> Switch to strict.
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  qom/qom-qobject.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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