From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NZjzJ-0001WJ-7R for qemu-devel@nongnu.org; Tue, 26 Jan 2010 06:53:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZjzE-0001U0-JV for qemu-devel@nongnu.org; Tue, 26 Jan 2010 06:53:40 -0500 Received: from [199.232.76.173] (port=37247 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZjzE-0001Tq-D8 for qemu-devel@nongnu.org; Tue, 26 Jan 2010 06:53:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:16122) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NZjzD-0005sF-O8 for qemu-devel@nongnu.org; Tue, 26 Jan 2010 06:53:36 -0500 Date: Tue, 26 Jan 2010 09:53:25 -0200 From: Luiz Capitulino Subject: Re: [Qemu-devel] [RFC 00/11]: QMP feature negotiation support Message-ID: <20100126095325.23011823@doriath> In-Reply-To: References: <1264108180-3666-1-git-send-email-lcapitulino@redhat.com> <4B59E7C4.2050201@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: aliguori@us.ibm.com, avi@redhat.com, qemu-devel@nongnu.org On Mon, 25 Jan 2010 15:33:40 +0100 Markus Armbruster wrote: > Anthony Liguori writes: > > > On 01/21/2010 03:09 PM, Luiz Capitulino wrote: > >> """ > >> {"QMP": {"capabilities": ["async messages"]}} > >> > >> { "execute": "query-qmp-mode" } > >> {"return": {"mode": "handshake"}} > >> > >> { "execute": "change", "arguments": { "device": "vnc", "target": "password", "arg": "1234" } } > >> {"error": {"class": "QMPInvalidModeCommad", "desc": "The issued command is invalid in this mode", "data": {}}} > >> > >> { "execute": "async_msg_enable", "arguments": { "name": "STOP" } } > >> {"return": {}} > >> > > > > Maybe: > > > > enable-capability "async messages" > > disable-capability "async messages" > > > > I think that's a bit more obvious and it means that a client doesn't > > have to maintain a mapping of features -> enable functions. It's also > > strange to use an enable command to disable something. > > Agree on both counts. But why two commands? Why not simply "capability > NAME VALUE"? Works even for non-boolean capabilities. I'm not > predicting we'll need such capabilities. I slightly prefer two commands because that's probably how I'd write it in a program (ie. two functions), also enabling/disabling a group of features is a bit easier too, as we can use an array: capability_enable [ "foo", "bar" ] Now, only one command is not terrible difficult, but we would have to accept an array of objects, like: [ { "name": "foo", "enabled": true }, { "name": "bar", "enabled": true } ]