All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, kwolf@redhat.com, eblake@redhat.com
Subject: [Qemu-devel] [PATCH for-2.9 4/5] keyval: Document issues with 'any' and alternate types
Date: Mon, 20 Mar 2017 13:55:47 +0100	[thread overview]
Message-ID: <1490014548-15083-5-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1490014548-15083-1-git-send-email-armbru@redhat.com>

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 util/keyval.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/util/keyval.c b/util/keyval.c
index 46cd540..93d5db6 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 ]
-- 
2.7.4

  parent reply	other threads:[~2017-03-20 12:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-20 12:55 [Qemu-devel] [PATCH for-2.9 0/5] keyval: Doc improvements and additional tests Markus Armbruster
2017-03-20 12:55 ` [Qemu-devel] [PATCH for-2.9 1/5] test-keyval: Tweaks to improve list coverage Markus Armbruster
2017-03-20 19:50   ` Eric Blake
2017-03-20 12:55 ` [Qemu-devel] [PATCH for-2.9 2/5] keyval: Improve some comments Markus Armbruster
2017-03-20 19:54   ` Eric Blake
2017-03-20 12:55 ` [Qemu-devel] [PATCH for-2.9 3/5] test-keyval: Cover alternate and 'any' type Markus Armbruster
2017-03-20 19:59   ` Eric Blake
2017-03-20 12:55 ` Markus Armbruster [this message]
2017-03-20 20:02   ` [Qemu-devel] [PATCH for-2.9 4/5] keyval: Document issues with 'any' and alternate types Eric Blake
2017-03-21  7:14     ` Markus Armbruster
2017-03-20 12:55 ` [Qemu-devel] [PATCH for-2.9 5/5] MAINTAINERS: Add myself for files I touched recently Markus Armbruster
2017-03-20 20:03   ` Eric Blake
2017-03-21  7:17     ` Markus Armbruster
2017-03-21  7:58       ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1490014548-15083-5-git-send-email-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.