Received: from eggs.gnu.org ([2001:4830:134:3::10]:53236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFsCA-0003g8-CN for qemu-devel@nongnu.org; Wed, 22 Jun 2016 20:08:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFsC8-0004Re-2V for qemu-devel@nongnu.org; Wed, 22 Jun 2016 20:08:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34955) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFsC7-0004RV-Sk for qemu-devel@nongnu.org; Wed, 22 Jun 2016 20:08:31 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (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 91E0F63175 for ; Thu, 23 Jun 2016 00:08:31 +0000 (UTC) From: marcandre.lureau@redhat.com Date: Thu, 23 Jun 2016 02:08:08 +0200 Message-Id: <20160623000809.4522-12-marcandre.lureau@redhat.com> In-Reply-To: <20160623000809.4522-1-marcandre.lureau@redhat.com> References: <20160623000809.4522-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 11/12] qmp: update qmp_query_spice fallback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: eblake@redhat.com, armbru@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-Andr=C3=A9 Lureau There are a few commands that are undef #ifdef conditions in 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 dd77701..bddf2ca 100644 --- a/monitor.c +++ b/monitor.c @@ -4006,6 +4006,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; +}; +#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 2.9.0