From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NLLj3-0000Ib-NQ for qemu-devel@nongnu.org; Thu, 17 Dec 2009 14:09:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NLLiz-0000E6-R7 for qemu-devel@nongnu.org; Thu, 17 Dec 2009 14:09:25 -0500 Received: from [199.232.76.173] (port=44772 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLLiz-0000E3-Of for qemu-devel@nongnu.org; Thu, 17 Dec 2009 14:09:21 -0500 Received: from mail2.shareable.org ([80.68.89.115]:52426) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NLLiz-0000JZ-N3 for qemu-devel@nongnu.org; Thu, 17 Dec 2009 14:09:21 -0500 Date: Thu, 17 Dec 2009 19:09:18 +0000 From: Jamie Lokier Subject: Re: [Qemu-devel] QMP's success response Message-ID: <20091217190918.GB362@shareable.org> References: <20091217154147.22845395@doriath> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091217154147.22845395@doriath> 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 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 }. What if future return value is actually an empty dict? ;-) E.g. from an enumeration command, where the enumerated set is empty. -- Jamie