[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] QMP's success response
From: |
Luiz Capitulino |
Subject: |
Re: [Qemu-devel] QMP's success response |
Date: |
Thu, 17 Dec 2009 17:19:27 -0200 |
On Thu, 17 Dec 2009 19:09:18 +0000
Jamie Lokier <address@hidden> 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": {} } }