Received: from eggs.gnu.org ([2001:4830:134:3::10]:51463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUcfe-00042Q-FM for qemu-devel@nongnu.org; Wed, 26 Aug 2015 11:31:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUcfY-0006gp-G5 for qemu-devel@nongnu.org; Wed, 26 Aug 2015 11:31:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49897) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUcfY-0006gl-AV for qemu-devel@nongnu.org; Wed, 26 Aug 2015 11:31:20 -0400 Date: Wed, 26 Aug 2015 12:31:17 -0300 From: Eduardo Habkost Message-ID: <20150826153117.GF4230@thinpad.lan.raisama.net> References: <7dcbdc8169de6b0090aa1ba89e7426fb3cd0e6cf.1440171025.git.DirtY.iCE.hu@gmail.com> <20150821231307.GD5816@thinpad.lan.raisama.net> <55D89BB8.4090201@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <55D89BB8.4090201@gmail.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 03/49] qapi: convert NumaOptions into a flat union List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?B?S8WRdsOhZ8OzIFpvbHTDoW4=?= Cc: Markus Armbruster , qemu-devel@nongnu.org, Gerd Hoffmann On Sat, Aug 22, 2015 at 05:56:40PM +0200, K=C5=91v=C3=A1g=C3=B3 Zolt=C3=A1= n wrote: > 2015-08-22 01:13 keltez=C3=A9ssel, Eduardo Habkost =C3=ADrta: > >On Fri, Aug 21, 2015 at 05:36:59PM +0200, K=C5=91v=C3=A1g=C3=B3, Zolt=C3= =A1n wrote: > >>Signed-off-by: K=C5=91v=C3=A1g=C3=B3, Zolt=C3=A1n > > > >I don't understand QAPI enough to understand why exactly this is neede= d > >(so I would like to get feedback from somebody who actually understand= s > >QAPI unions), but I have one comment below. >=20 > It's needed so the option visitor can support nested structures properl= y > without flattening them (or breaking backward compatibility). >=20 > There is some discussion here: > http://lists.nongnu.org/archive/html/qemu-devel/2015-06/msg04438.html >=20 > But basically the thing is that with new new opts visitor, unless we co= nvert > NumaOptions into a flat union, the user would have to type -numa > node,node.nodeid=3Dfoo instead of -numa node,nodeid=3Dfoo which would b= reak > backward compatibility. As long as somebody who understands QAPI says the changes make sense and should work, I am OK with them if the following is changed: > >[...] > >> ## > >>+# @NumaDriver > >>+# > >>+# List of possible numa drivers. > >>+# > >>+# Since: 2.5 > >>+## > >>+{ 'enum': 'NumaDriver', > >>+ 'data': [ 'node' ] } > > > >Why is the name "NumaDriver"? Below, the field is called "type", so wh= y > >not something like "NumaOptionType"? >=20 > No particular reason other than the example in docs/qapi-code-gen.txt u= sed > driver. The field is called type because in the non-flat union the > discriminator is called type. In the docs/qapi-code-gen.txt example, the option is about an actual blockdev driver, and the discriminator is really called "driver". In this case, the field is called "type" and has nothing to do with drivers, so something like NumaOptionType makes more sense. --=20 Eduardo