]> git.proxmox.com Git - mirror_qemu.git/commit
qom: Make object_property_set_qobject()'s input visitor strict
authorMarkus Armbruster <armbru@redhat.com>
Fri, 3 Mar 2017 12:32:37 +0000 (13:32 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Sun, 5 Mar 2017 08:14:19 +0000 (09:14 +0100)
commit05601ed2de60df0e344d6b783a6bc0c1ff2b5d1f
tree6347feb9b5f8f1ba7a7de19f16acfc046b2f3515
parentf332e830e38b3ff3953ef02ac04e409ae53769c5
qom: Make object_property_set_qobject()'s input visitor strict

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 <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <1488544368-30622-18-git-send-email-armbru@redhat.com>
qom/qom-qobject.c