From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVfPA-0002Km-0L for qemu-devel@nongnu.org; Fri, 05 Aug 2016 09:43:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVfP4-0003oI-39 for qemu-devel@nongnu.org; Fri, 05 Aug 2016 09:43:15 -0400 Received: from mx5-phx2.redhat.com ([209.132.183.37]:50568) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVfP3-0003oD-PR for qemu-devel@nongnu.org; Fri, 05 Aug 2016 09:43:10 -0400 Date: Fri, 5 Aug 2016 09:43:08 -0400 (EDT) From: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Message-ID: <311369298.1355161.1470404588801.JavaMail.zimbra@redhat.com> In-Reply-To: <87eg63tju2.fsf@dusky.pond.sub.org> References: <20160721140030.28383-1-marcandre.lureau@redhat.com> <20160721140030.28383-12-marcandre.lureau@redhat.com> <87eg63tju2.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 v2 11/12] qmp: update qmp_query_spice fallback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: marcandre lureau , qemu-devel@nongnu.org ----- Original Message ----- > marcandre.lureau@redhat.com writes: >=20 > > From: Marc-Andr=C3=A9 Lureau > > > > There are a few commands that are undef #ifdef conditions in >=20 > under #ifdef >=20 > > qmp-commands.hx. Move all the qmp_query_spice fallback in the same > > location, return an error 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 c87089f..46966d5 100644 > > --- a/monitor.c > > +++ b/monitor.c > > @@ -4048,6 +4048,20 @@ QemuOptsList qemu_mon_opts =3D { > > }, > > }; > > =20 > > +/* > > + * the QAPI schema is blissfully unaware #ifdef FOO commands, and the > > + * QAPI code generator happily generates a dead qmp_marshal_foo_cmd() > > + * that calls qmp_foo_cmd(). Provide it one, or else linking fails. > > + * FIXME Educate the QAPI schema on #ifdef commands. > > + */ > > +#ifndef CONFIG_SPICE > > +SpiceInfo *qmp_query_spice(Error **errp) > > +{ > > + error_setg(errp, QERR_FEATURE_DISABLED, "spice"); > > + return NULL; >=20 > Why do you change from abort() to error_setg()? The rest of the commands do not abort. It sounds to easy to trigger, and it= 's quite harmless to return an error instead. > > +}; > > +#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 > > -#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; >=20