From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX8Dr-0007QA-B7 for qemu-devel@nongnu.org; Tue, 09 Aug 2016 10:41:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bX8Dk-00007t-5w for qemu-devel@nongnu.org; Tue, 09 Aug 2016 10:41:38 -0400 Received: from mx6-phx2.redhat.com ([209.132.183.39]:58464) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX8Dj-00007g-U0 for qemu-devel@nongnu.org; Tue, 09 Aug 2016 10:41:32 -0400 Date: Tue, 9 Aug 2016 10:41:30 -0400 (EDT) From: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Message-ID: <1611724015.610129.1470753690860.JavaMail.zimbra@redhat.com> In-Reply-To: <87h9audnik.fsf@dusky.pond.sub.org> References: <20160808141439.16908-1-marcandre.lureau@redhat.com> <20160808141439.16908-13-marcandre.lureau@redhat.com> <877fbqglj6.fsf@dusky.pond.sub.org> <393082343.564767.1470747025500.JavaMail.zimbra@redhat.com> <87h9audnik.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 12/15] monitor: use qmp_dispatch() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: marcandre lureau , qemu-devel@nongnu.org Hi ----- Original Message ----- > Marc-Andr=C3=A9 Lureau writes: >=20 > > Hi > > > > ----- Original Message ----- > >> marcandre.lureau@redhat.com writes: > >>=20 > >> > From: Marc-Andr=C3=A9 Lureau > >> > > >> > Replace the old manual dispatch and validation code by the generic o= ne > >> > provided by qapi common code. > >> > > >> > Note that it is now possible to call the following commands that use= d to > >> > be disabled by compile-time conditionals: > >> > - dump-skeys > >> > - query-spice > >> > - rtc-reset-reinjection > >> > - query-gic-capabilities > >> > > >> > Their fallback functions return an appropriate "feature disabled" er= ror. > >> > > >> > Signed-off-by: Marc-Andr=C3=A9 Lureau > >>=20 > >> Means query-qmp-schema no longer shows whether these commands are > >> supported, doesn't it? > >>=20 > >> Eric, could this create difficulties for libvirt or other introspectio= n > >> users? > > > > Thinking a bit about this, I guess it would be fairly straightforward > > to have a new key "c-conditional" : "#ifdef CONFIG_SPICE" that would > > prepend it in C generated files, with a corresponding "#endif". Would > > that be acceptable? >=20 > Not exactly pretty, but the only alternative I can think of right now > would be conditional qapi generation, i.e. something like >=20 > { 'if': 'CONFIG_SPICE' > 'then': { 'command': 'query-spice', 'returns': 'SpiceInfo' } } >=20 > More general, but *much* more work. Let's not go there now. That looks quite unnecessarily complicated to me, and not so declarative. >=20 > The value of key 'c-conditional' must be a preprocessing directive that > pairs with #endif. Hmm. >=20 > Could make it an expression instead, and call the key just > 'conditional'. If given, wrap the code generated for the QAPI > definition in >=20 > #if > ... > #endif >=20 Sure, we could make it a preprocessor expression instead, so it would have = to match with the automatically appened "#endif". > Feels cleaner, but to avoid -Wundef warnings, we'd have to say > 'defined(CONFIG_SPICE)'. Yes, why not? I can work on a patch see how well it fits.