From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNjVb-0005sI-KN for qemu-devel@nongnu.org; Thu, 14 Jul 2016 12:29:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNjVW-000249-5S for qemu-devel@nongnu.org; Thu, 14 Jul 2016 12:29:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNjVV-000245-Tp for qemu-devel@nongnu.org; Thu, 14 Jul 2016 12:29:02 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D1E7C7F415 for ; Thu, 14 Jul 2016 16:29:00 +0000 (UTC) References: <1468505770-20694-1-git-send-email-berrange@redhat.com> <5787A056.5090705@redhat.com> <20160714143922.GJ18778@redhat.com> From: Eric Blake Message-ID: <5787BDCB.9070205@redhat.com> Date: Thu, 14 Jul 2016 10:28:59 -0600 MIME-Version: 1.0 In-Reply-To: <20160714143922.GJ18778@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="JVJkaidc69tMlhj7QqgI9rpXoB8kn8ipE" Subject: Re: [Qemu-devel] [PATCH] qmp: add support for mixed typed input visitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --JVJkaidc69tMlhj7QqgI9rpXoB8kn8ipE From: Eric Blake To: "Daniel P. Berrange" Cc: qemu-devel@nongnu.org Message-ID: <5787BDCB.9070205@redhat.com> Subject: Re: [PATCH] qmp: add support for mixed typed input visitor References: <1468505770-20694-1-git-send-email-berrange@redhat.com> <5787A056.5090705@redhat.com> <20160714143922.GJ18778@redhat.com> In-Reply-To: <20160714143922.GJ18778@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/14/2016 08:39 AM, Daniel P. Berrange wrote: > On Thu, Jul 14, 2016 at 08:23:18AM -0600, Eric Blake wrote: >> On 07/14/2016 08:16 AM, Daniel P. Berrange wrote: >>> Add a qmp_mixed_input_visitor_new() method which returns >>> a QMP input visitor that accepts either strings or the >>> native data types. Question: do we want to allow: "key":1 when the QAPI is written 'key':'str'? Your current patches allow the converse (allowing "key":"1" when the QAPI is written 'key':'int'). To allow native types to be consumed in mixed-mode where string is expected would require yet another method for deciding how to handle non-strings in v->visitor.type_str. Where it might be useful is in SocketAddress parsing, in particular where InetSocketAddress.port is currently 'str' but where it often takes an integer port number in addition to a string for a named port alias; callers currently have to pass a stringized integer, where mixed mode might make it easier to fudge things. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --JVJkaidc69tMlhj7QqgI9rpXoB8kn8ipE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXh73MAAoJEKeha0olJ0Nq2NIIAKLNAs3HrfFGGceosUpdACvR SJVx572ahWhLoeM/S5x1cjmkzDubo+YYhGvuFCJYxOkMDiGmgNWNKIH6AcD2DdZM BVES07HyzFTfdNRf+GULg4CevHrsNuJ8XFdm6iMQ1VFY1IhubYP9FtpsLHI66s4Z JWqqxQS6MOlOfMx1A0ndhjCV2lH6wHCiaaGAvfML8Soh6m/X1jesTt0dv6dnAdc2 M/ExfQMmW8xWhV+qa2+qh0HdqC5NL7BD+ElDjl8JclOuEZ6yaNWohnlczD1FJ4RX 9Ov6xGoKjpGSM9XS6S+3V9AHg6g3izukXe9wO+xUV82lgaGxc9H+tCqFbUxXWCA= =O1OI -----END PGP SIGNATURE----- --JVJkaidc69tMlhj7QqgI9rpXoB8kn8ipE--