From patchwork Thu Jun 23 00:08:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 9194281 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B71A5601C0 for ; Thu, 23 Jun 2016 00:21:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A762828418 for ; Thu, 23 Jun 2016 00:21:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A5812841D; Thu, 23 Jun 2016 00:21:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4D88628418 for ; Thu, 23 Jun 2016 00:21:06 +0000 (UTC) Received: from localhost ([::1]:33269 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFsOH-00016D-CB for patchwork-qemu-devel@patchwork.kernel.org; Wed, 22 Jun 2016 20:21:05 -0400 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) Received: from localhost (ovpn-116-150.phx2.redhat.com [10.3.116.150]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5N08UNV024556; Wed, 22 Jun 2016 20:08:31 -0400 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org 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 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 23 Jun 2016 00:08:31 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 11/12] qmp: update qmp_query_spice fallback X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , armbru@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Marc-André 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é 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 = { }, }; +/* + * 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 -#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 = NULL;