qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: QMP's success response


From: Daniel P. Berrange
Subject: [Qemu-devel] Re: QMP's success response
Date: Thu, 17 Dec 2009 17:46:32 +0000
User-agent: Mutt/1.4.1i

On Thu, Dec 17, 2009 at 03:41:47PM -0200, 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": {} }
> 
>  Which can be read as 'command succeeded, but didn't return any data'.
> 
>  As the release is not done yet we still can change it, is anyone against?

That's fine by me. libvirt merely checks for whether 'error' vs 'return'
exist when first deciding whether it has been successful. We only look at 
the contents of the 'return' key for commands expecting actual data back.

Regards,
Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




reply via email to

[Prev in Thread] Current Thread [Next in Thread]