From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmpTT-0003RC-59 for qemu-devel@nongnu.org; Tue, 20 May 2014 15:13:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WmpTO-0000B4-3f for qemu-devel@nongnu.org; Tue, 20 May 2014 15:13:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16354) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmpTN-0000Ad-Sx for qemu-devel@nongnu.org; Tue, 20 May 2014 15:13:14 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4KJDClE012911 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 May 2014 15:13:12 -0400 Message-ID: <537BA947.9090800@redhat.com> Date: Tue, 20 May 2014 13:13:11 -0600 From: Eric Blake MIME-Version: 1.0 References: <1400576881-6954-1-git-send-email-famz@redhat.com> In-Reply-To: <1400576881-6954-1-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="osIJaVtDKo2vins1qufCkhrCl7vEgrb7U" Subject: Re: [Qemu-devel] [RFC PATCH v2 0/7] qapi: Specify default value for optional argument in schema json List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --osIJaVtDKo2vins1qufCkhrCl7vEgrb7U Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/20/2014 03:07 AM, Fam Zheng wrote: > Please first take a look at patch 7 to see what is supported by this se= ries. >=20 > Patch 1 ~ 3 allows some useful basic types in schema. >=20 > Patch 4 ~ 6 implements the new syntax. >=20 > Note: The introduced '@arg' sigil, just like the preexisting '*arg', is= > reducing the cleanness of the syntax. We should get rid of both of them= in long > term. Here, this series compromises on this and introduces '@arg' becau= se: >=20 > - We have to distinguish the argument property dictionary from nested= struct: >=20 > I.e.: >=20 > 'data': { > 'arg1': { 'member1': 'int', 'member2': 'str' } > '@arg2': { 'type': 'int', 'default': 100 } > } >=20 > Until we completely drop and forbid the 'arg1' nested struct use ca= se. >=20 > - Forbidding 'arg1' it's doable, but doing it now means we pull in ma= ny > distractive patches to this series. Question - since we WANT to get rid of nested struct, why not reverse the sense? Mark all existing nested structs (weren't there just three that we found?) with the '@' sigil, and let the new syntax be sigil-free. Then when we clean up the nesting, we are also getting rid of the bad syntax, plus the sigil gives us something to search for in knowing how much to clean up. But if you stick the sigil on the new code, instead of the obsolete code, then as more and more places in the schema use defaults, it gets harder and harder to remove the use of the sigil even if the nested structs are eventually removed. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --osIJaVtDKo2vins1qufCkhrCl7vEgrb7U Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTe6lHAAoJEKeha0olJ0NqnRkIAIv4zYBSQhqOb5xz+ySahjc9 cUXoHEDBfjw7xk9hoBcPOIk2bFHk1jzaoKrTyRinfQrqwBp+PLEEnRDbLlr44o26 JL8ZhHtRr5nmwAs56P4MVSoIWvcp5dnZXeOwvlZhUNHB3eCNWEjnRydQslL1oIVJ wJAl23s0AoEANJPlkHpcIIk8L3SjIf7xlKPf5ywZ4qQbziYQI0ZHvMx0EmVKguyu brIkBWGtkPt5+lDI0he9VRgffcI2O8f1zYvbDXGrcVtSS7itfXfJOx/GWD7AiJY2 QEmMG5I7TlQrSSZsdleN4mq+ZmeNnGY7XdVXxIaZGY4BWMOAnmMPDI5O4RUeBXE= =dN0d -----END PGP SIGNATURE----- --osIJaVtDKo2vins1qufCkhrCl7vEgrb7U--