From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NLKR0-0005kj-7C for qemu-devel@nongnu.org; Thu, 17 Dec 2009 12:46:42 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NLKQv-0005ep-R9 for qemu-devel@nongnu.org; Thu, 17 Dec 2009 12:46:41 -0500 Received: from [199.232.76.173] (port=40720 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLKQv-0005eT-KD for qemu-devel@nongnu.org; Thu, 17 Dec 2009 12:46:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21176) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NLKQv-00084R-7h for qemu-devel@nongnu.org; Thu, 17 Dec 2009 12:46:37 -0500 Date: Thu, 17 Dec 2009 17:46:32 +0000 From: "Daniel P. Berrange" Message-ID: <20091217174632.GT23134@redhat.com> References: <20091217154147.22845395@doriath> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091217154147.22845395@doriath> Subject: [Qemu-devel] Re: QMP's success response Reply-To: "Daniel P. Berrange" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: aliguori@linux.vnet.ibm.com, avi@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com 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 :|