Received: from eggs.gnu.org ([2001:4830:134:3::10]:57093) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgUm9-0001n6-PV for qemu-devel@nongnu.org; Mon, 28 Sep 2015 05:31:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgUm5-0003JU-CB for qemu-devel@nongnu.org; Mon, 28 Sep 2015 05:31:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50515) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgUm5-0003JQ-73 for qemu-devel@nongnu.org; Mon, 28 Sep 2015 05:31:09 -0400 From: Markus Armbruster References: <1442872682-6523-1-git-send-email-eblake@redhat.com> <1442872682-6523-46-git-send-email-eblake@redhat.com> <5602C7DE.10701@redhat.com> <5602D545.3050405@redhat.com> <56057AF8.2010008@redhat.com> Date: Mon, 28 Sep 2015 11:31:06 +0200 In-Reply-To: <56057AF8.2010008@redhat.com> (Paolo Bonzini's message of "Fri, 25 Sep 2015 18:48:56 +0200") Message-ID: <87mvw6ki05.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v5 45/46] net: Complete qapi-fication of netdev_add List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: ehabkost@redhat.com, Jason Wang , qemu-devel@nongnu.org, DirtY.iCE.hu@gmail.com, marcandre.lureau@redhat.com Paolo Bonzini writes: > On 23/09/2015 18:37, Eric Blake wrote: >>>> >>>> Is this still type-unsafe like the old netdev_add (e.g. accepts >>>> a string for an integer)? >> I did not address that yet; it still needs further patches to >> accept an integer as a port number. I can investigate what >> additional patches are needed along those lines, while still >> preserving back-compat to previously-accepted QMP command lines (it >> may require the use of an 'alternate' type that accepts both int >> and string). The main goal here was that the command line is >> unchanged, and that now the QMP command is introspectable, even if >> what introspection shows is ugly types. > > This in fact is a laudable goal. However, while changing the command to > > { 'command': 'netdev_add', 'data': 'Netdev', 'box': true, 'gen': false } > > for better introspection, you should keep 'gen':'false' and the manual > implementation based on qemu_opts_from_qdict, otherwise you break > backwards-compatibility. Non sequitur :) We need to stay sufficiently backwards compatible somehow. 'gen' false is one possible solution. Liberal use of alternate types could be another. A special input visitor mode could be a third. Since my review cursor is >30 patches behind this one, I don't have an opinion, yet.