[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 16/27] qom: Make object_property_set_qobject()'s i
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PULL v2 16/27] qom: Make object_property_set_qobject()'s input visitor strict |
Date: |
Sun, 5 Mar 2017 09:35:47 +0100 |
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>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
---
qom/qom-qobject.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/qom/qom-qobject.c b/qom/qom-qobject.c
index 447e4a0..bbdedda 100644
--- a/qom/qom-qobject.c
+++ b/qom/qom-qobject.c
@@ -22,8 +22,8 @@ void object_property_set_qobject(Object *obj, QObject *value,
const char *name, Error **errp)
{
Visitor *v;
- /* TODO: Should we reject, rather than ignore, excess input? */
- v = qobject_input_visitor_new(value, false);
+
+ v = qobject_input_visitor_new(value, true);
object_property_set(obj, v, name, errp);
visit_free(v);
}
--
2.7.4
- Re: [Qemu-devel] [PULL v2 03/27] qmp-test: New, covering basic QMP protocol, (continued)
- [Qemu-devel] [PULL v2 02/27] libqtest: Work around a "QMP wants a newline" bug, Markus Armbruster, 2017/03/05
- [Qemu-devel] [PULL v2 09/27] qmp: Eliminate silly QERR_QMP_* macros, Markus Armbruster, 2017/03/05
- [Qemu-devel] [PULL v2 01/27] qga: Fix crash on non-dictionary QMP argument, Markus Armbruster, 2017/03/05
- [Qemu-devel] [PULL v2 23/27] test-qobject-input-visitor: Cover missing nested struct member, Markus Armbruster, 2017/03/05
- [Qemu-devel] [PULL v2 17/27] test-qobject-input-visitor: Use strict visitor, Markus Armbruster, 2017/03/05
- [Qemu-devel] [PULL v2 26/27] qapi: Fix object input visit beyond end of list, Markus Armbruster, 2017/03/05
- [Qemu-devel] [PULL v2 10/27] qapi: Improve a QObject input visitor error message, Markus Armbruster, 2017/03/05
- [Qemu-devel] [PULL v2 04/27] qmp: Dumb down how we run QMP command registration, Markus Armbruster, 2017/03/05
- [Qemu-devel] [PULL v2 16/27] qom: Make object_property_set_qobject()'s input visitor strict,
Markus Armbruster <=
- [Qemu-devel] [PULL v2 13/27] qapi: Improve qobject input visitor error reporting, Markus Armbruster, 2017/03/05
- [Qemu-devel] [PULL v2 14/27] qapi: Drop string input visitor method optional(), Markus Armbruster, 2017/03/05
- [Qemu-devel] [PULL v2 07/27] qmp: Clean up how we enforce capability negotiation, Markus Armbruster, 2017/03/05
- [Qemu-devel] [PULL v2 08/27] qmp: Drop duplicated QMP command object checks, Markus Armbruster, 2017/03/05
- [Qemu-devel] [PULL v2 25/27] tests: Cover input visit beyond end of list, Markus Armbruster, 2017/03/05
- [Qemu-devel] [PULL v2 22/27] tests: Cover partial input visit of list, Markus Armbruster, 2017/03/05
- [Qemu-devel] [PULL v2 15/27] qapi: Make string input and opts visitor require non-null input, Markus Armbruster, 2017/03/05
- [Qemu-devel] [PULL v2 24/27] qapi: Make input visitors detect unvisited list tails, Markus Armbruster, 2017/03/05
- [Qemu-devel] [PULL v2 05/27] qapi: Support multiple command registries per program, Markus Armbruster, 2017/03/05
- [Qemu-devel] [PULL v2 21/27] test-string-input-visitor: Improve list coverage, Markus Armbruster, 2017/03/05