aboutsummaryrefslogtreecommitdiff
path: root/util/keyval.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2017-03-20 13:55:47 +0100
committerMarkus Armbruster <armbru@redhat.com>2017-03-21 10:42:09 +0100
commit0ee9ae7c8cda8b371b6b414c0d895feaec04f79e (patch)
treeb6b8aa016cdb885f3603756cc86f437bf1acae1d /util/keyval.c
parent599c156bac7fd7f80be9d0e958e1aa19ad3dab57 (diff)
keyval: Document issues with 'any' and alternate types
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1490014548-15083-5-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'util/keyval.c')
-rw-r--r--util/keyval.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/util/keyval.c b/util/keyval.c
index 46cd540c5a..93d5db6b59 100644
--- a/util/keyval.c
+++ b/util/keyval.c
@@ -61,6 +61,16 @@
* "key absent" already means "optional object/array absent", which
* isn't the same as "empty object/array present".
*
+ * Design flaw: scalar values can only be strings; there is no way to
+ * denote numbers, true, false or null. The special QObject input
+ * visitor returned by qobject_input_visitor_new_keyval() mostly hides
+ * this by automatically converting strings to the type the visitor
+ * expects. Breaks down for alternate types and type 'any', where the
+ * visitor's expectation isn't clear. Code visiting such types needs
+ * to do the conversion itself, but only when using this keyval
+ * visitor. Awkward. Alternate types without a string member don't
+ * work at all.
+ *
* Additional syntax for use with an implied key:
*
* key-vals-ik = val-no-key [ ',' key-vals ]