From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX6Ij-0008R4-SQ for qemu-devel@nongnu.org; Tue, 09 Aug 2016 08:38:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bX6If-0006Gc-RC for qemu-devel@nongnu.org; Tue, 09 Aug 2016 08:38:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55416) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX6If-0006GX-LH for qemu-devel@nongnu.org; Tue, 09 Aug 2016 08:38:29 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 0762C3D9 for ; Tue, 9 Aug 2016 12:38:29 +0000 (UTC) From: Markus Armbruster References: <20160808141439.16908-1-marcandre.lureau@redhat.com> <20160808141439.16908-12-marcandre.lureau@redhat.com> Date: Tue, 09 Aug 2016 14:38:26 +0200 In-Reply-To: <20160808141439.16908-12-marcandre.lureau@redhat.com> (marcandre lureau's message of "Mon, 8 Aug 2016 18:14:35 +0400") Message-ID: <87bn12glrx.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 11/15] qmp: update qmp_query_spice fallback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: marcandre.lureau@redhat.com Cc: qemu-devel@nongnu.org marcandre.lureau@redhat.com writes: > From: Marc-Andr=C3=A9 Lureau > > The following "use qmp_dispatch()" commit will use the generated > dispatch command table that is unaware of compile time conditionals. > > There are a few commands that are under #ifdef conditions in > qmp-commands.hx. Move the qmp_query_spice fallback in the same location > as the other fallbacks, return an error instead of abort() and update > the comment. > > Signed-off-by: Marc-Andr=C3=A9 Lureau > --- > monitor.c | 14 ++++++++++++++ > qmp.c | 16 ---------------- > 2 files changed, 14 insertions(+), 16 deletions(-) > > diff --git a/monitor.c b/monitor.c > index e7549b1..5e7ae21 100644 > --- a/monitor.c > +++ b/monitor.c > @@ -4303,6 +4303,20 @@ QemuOptsList qemu_mon_opts =3D { > }, > }; >=20=20 > +/* > + * the QAPI schema is blissfully unaware #ifdef FOO commands, and the > + * QAPI code generator happily generates a qmp_marshal_foo_cmd() that > + * calls qmp_foo_cmd(). Provide it one, or else linking fails. FIXME > + * Educate the QAPI schema on #ifdef commands. Let's keep the FIXME on the same line as its text. Can touch up on commit. > + */ > +#ifndef CONFIG_SPICE > +SpiceInfo *qmp_query_spice(Error **errp) > +{ > + error_setg(errp, QERR_FEATURE_DISABLED, "spice"); > + return NULL; > +}; > +#endif > + > #ifndef TARGET_I386 > void qmp_rtc_reset_reinjection(Error **errp) > { > diff --git a/qmp.c b/qmp.c > index b6d531e..884d1ab 100644 > --- a/qmp.c > +++ b/qmp.c > @@ -161,22 +161,6 @@ VncInfo2List *qmp_query_vnc_servers(Error **errp) > }; > #endif >=20=20 > -#ifndef CONFIG_SPICE > -/* > - * qmp-commands.hx ensures that QMP command query-spice exists only > - * #ifdef CONFIG_SPICE. Necessary for an accurate query-commands > - * result. However, the QAPI schema is blissfully unaware of that, > - * and the QAPI code generator happily generates a dead > - * qmp_marshal_query_spice() that calls qmp_query_spice(). Provide it > - * one, or else linking fails. FIXME Educate the QAPI schema on > - * CONFIG_SPICE. > - */ > -SpiceInfo *qmp_query_spice(Error **errp) > -{ > - abort(); > -}; > -#endif > - > void qmp_cont(Error **errp) > { > Error *local_err =3D NULL;