From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=60408 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PpMIa-0005C4-1u for qemu-devel@nongnu.org; Tue, 15 Feb 2011 09:54:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PpMIX-0005hb-I6 for qemu-devel@nongnu.org; Tue, 15 Feb 2011 09:54:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PpMIX-0005hG-9N for qemu-devel@nongnu.org; Tue, 15 Feb 2011 09:54:37 -0500 From: Markus Armbruster Subject: Re: [Qemu-devel] Re: [RFC] qapi: events in QMP References: <4D581E04.1020901@codemonkey.ws> <4D58FADB.3010005@redhat.com> <4D591A01.4030105@codemonkey.ws> <4D5920ED.6020104@redhat.com> <20110214104517.32b77291@doriath> <4D593E8F.7050306@codemonkey.ws> <20110214163443.57ad8a37@doriath> <4D5983B3.5010902@codemonkey.ws> <20110214175800.060d4204@doriath> Date: Tue, 15 Feb 2011 15:54:23 +0100 In-Reply-To: <20110214175800.060d4204@doriath> (Luiz Capitulino's message of "Mon, 14 Feb 2011 17:58:00 -0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: Kevin Wolf , qemu-devel Luiz Capitulino writes: > On Mon, 14 Feb 2011 13:34:11 -0600 > Anthony Liguori wrote: > >> On 02/14/2011 12:34 PM, Luiz Capitulino wrote: >> > On Mon, 14 Feb 2011 08:39:11 -0600 >> > Anthony Liguori wrote: >> > >> > >> >> On 02/14/2011 06:45 AM, Luiz Capitulino wrote: >> >> >> >>> So the question is: how does the schema based design support extending >> >>> commands or events? Does it require adding new commands/events? >> >>> >> >>> >> >> Well, let me ask you, how do we do that today? >> >> >> >> Let's say that I want to add a new parameter to the `change' function so >> >> that I can include a salt parameter as part of the password. >> >> >> >> The way we'd do this today is by checking for the 'salt' parameter in >> >> qdict, and if it's not present, use a random salt or something like that. >> >> >> > You likely want to do what you did before. Of course that you have to >> > consider if what you're doing is extending an existing command or badly >> > overloading it (like change is today), in this case you'll want to add >> > a new command instead. >> > >> > But yes, the use-case here is extending an existing command. >> > >> > >> >> However, if I'm a QMP client, how can I tell whether you're going to >> >> ignore my salt parameter or actually use it? Nothing in QMP tells me >> >> this today. If I set the salt parameter in the `change' command, I'll >> >> just get a success message. >> >> >> > I'm sorry? >> > >> > { "execute": "change", "arguments": { "device": "vnc", "target": "password", "arg": "1234", "salt": "r1" } } >> > {"error": {"class": "InvalidParameter", "desc": "Invalid parameter 'salt'", "data": {"name": "salt"}}} >> > >> >> So I'm supposed to execute the command, and if execution fails, drop the >> new parameter? If we add a few optional parameters, does that mean I >> have to try every possible combination of parameters? > > No, of course not, our plan has always been to do this via an schema, Correct. > the only reason we don't do this today is lack of time/help. Disagree on "only". QMP didn't just suffer from lack of pushing power. On the contrary, it suffered from too much pushing in opposite directions. [...]