qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Jamie Lokier <jamie@shareable.org>
Cc: aliguori@linux.vnet.ibm.com, avi@redhat.com,
	qemu-devel@nongnu.org, armbru@redhat.com
Subject: Re: [Qemu-devel] QMP's success response
Date: Thu, 17 Dec 2009 17:19:27 -0200	[thread overview]
Message-ID: <20091217171927.0aa4d242@doriath> (raw)
In-Reply-To: <20091217190918.GB362@shareable.org>

On Thu, 17 Dec 2009 19:09:18 +0000
Jamie Lokier <jamie@shareable.org> wrote:

> Luiz Capitulino wrote:
> > 
> >  Hi there,
> > 
> >  Currently, when a regular command doesn't have any data to output,
> > QMP will emit:
> > 
> > { "return": "OK" }
> > 
> >  I thought this was a good idea because it has a clear meaning. Silly me,
> > this is optimized for humans, but for machines it introduces the problem
> > that such commands can't be changed to return values.
> > 
> >  I'm not sure this is will ever happen, but to stay safe a better way
> > would be to return an empty dict, like this:
> > 
> > { "return": {} }
> 
> Logically, it would be { "return": null }. 

 In practice it brings the same problem.

> What if future return value is actually an empty dict? ;-)

 This is compatible and has the same end result.

>  E.g. from an enumeration command,  where the enumerated set is empty.

 Either, the command could return the empty dict or a dict
containing a "enum" key, which would be emitted like:

{ "result": { "enum": {} } }

      reply	other threads:[~2009-12-17 19:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-17 17:41 [Qemu-devel] QMP's success response Luiz Capitulino
2009-12-17 17:46 ` [Qemu-devel] " Daniel P. Berrange
2009-12-17 18:32 ` [Qemu-devel] " Markus Armbruster
2009-12-17 19:09 ` Jamie Lokier
2009-12-17 19:19   ` Luiz Capitulino [this message]

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=20091217171927.0aa4d242@doriath \
    --to=lcapitulino@redhat.com \
    --cc=aliguori@linux.vnet.ibm.com \
    --cc=armbru@redhat.com \
    --cc=avi@redhat.com \
    --cc=jamie@shareable.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).