From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGlOJ-0005Zh-RM for qemu-devel@nongnu.org; Thu, 29 Jan 2015 04:28:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGlO2-0004ER-Bm for qemu-devel@nongnu.org; Thu, 29 Jan 2015 04:27:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGlO2-0004E6-4F for qemu-devel@nongnu.org; Thu, 29 Jan 2015 04:27:42 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0T9RfHK022208 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 29 Jan 2015 04:27:41 -0500 From: Markus Armbruster Date: Thu, 29 Jan 2015 10:27:32 +0100 Message-Id: <1422523658-3503-4-git-send-email-armbru@redhat.com> In-Reply-To: <1422523658-3503-1-git-send-email-armbru@redhat.com> References: <1422523658-3503-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH v2 3/9] hmp: Compile hmp_info_spice() only with CONFIG_SPICE List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, lcapitulino@redhat.com It's dead code when CONFIG_SPICE is off. If it wasn't, it would crash dereferencing the null pointer returned by the qmp_query_spice() dummy in qmp.c. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Gerd Hoffmann --- hmp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hmp.c b/hmp.c index 481be80..a42c5c0 100644 --- a/hmp.c +++ b/hmp.c @@ -535,6 +535,7 @@ out: qapi_free_VncInfo(info); } +#ifdef CONFIG_SPICE void hmp_info_spice(Monitor *mon, const QDict *qdict) { SpiceChannelList *chan; @@ -581,6 +582,7 @@ void hmp_info_spice(Monitor *mon, const QDict *qdict) out: qapi_free_SpiceInfo(info); } +#endif void hmp_info_balloon(Monitor *mon, const QDict *qdict) { -- 1.9.3