From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDWaS-0002e1-I4 for qemu-devel@nongnu.org; Fri, 30 Mar 2012 03:49:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDWaQ-0003ur-J0 for qemu-devel@nongnu.org; Fri, 30 Mar 2012 03:49:32 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:48871) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDWaQ-0003uV-A9 for qemu-devel@nongnu.org; Fri, 30 Mar 2012 03:49:30 -0400 Received: by pbcuo5 with SMTP id uo5so1558444pbc.4 for ; Fri, 30 Mar 2012 00:49:28 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4F756580.404@redhat.com> Date: Fri, 30 Mar 2012 09:49:20 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1333042003-15490-1-git-send-email-lcapitulino@redhat.com> <1333042003-15490-13-git-send-email-lcapitulino@redhat.com> <4F74A95A.7050403@us.ibm.com> <20120329192813.GA14158@illuin> <4F74BF8C.3070800@us.ibm.com> In-Reply-To: <4F74BF8C.3070800@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 12/13] qapi: support for keyworded variable-length argument list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Michael Roth , armbru@redhat.com, qemu-devel@nongnu.org, Luiz Capitulino , kraxel@redhat.com, stefanha@linux.vnet.ibm.com Il 29/03/2012 22:01, Anthony Liguori ha scritto: >> Then, we open-code the marshaller to process the QDict, rather than >> embedding >> it in the script or passing it through to qmp_device_add(). > > You could also just do gen=False... > > But I don't think open coding the marshaller is the right thing here. > You have to convert to strings and reparse anyway. device_add expects strings, you don't have to convert no? There is a single parse point. (Instead, a qom_add would accept the right types, but then it would also use a more QAPI-friendly syntax with lists insteads of varargs). Regarding device_add ? and device_add foo,? I would implement it as separate QMP commands hooking into QOM, such as qom_list_types (taking the superclass as an optional argument) and qom_properties. But the latter first needs static properties to move up from devices to objects. I'll take a look at that. Paolo