From nobody Tue Feb 10 07:44:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517592578752783.3427342040578; Fri, 2 Feb 2018 09:29:38 -0800 (PST) Received: from localhost ([::1]:41870 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehf9d-0003G8-Vq for importer@patchew.org; Fri, 02 Feb 2018 12:29:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehe0U-00067d-NK for qemu-devel@nongnu.org; Fri, 02 Feb 2018 11:17:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehdzQ-00077K-Kt for qemu-devel@nongnu.org; Fri, 02 Feb 2018 11:16:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58646) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ehdzQ-00075s-5J for qemu-devel@nongnu.org; Fri, 02 Feb 2018 11:15:00 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 980CF4E4C0 for ; Fri, 2 Feb 2018 06:45:50 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-227.ams2.redhat.com [10.36.116.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1388862662; Fri, 2 Feb 2018 06:45:46 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 310B9960; Fri, 2 Feb 2018 07:45:46 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 2 Feb 2018 07:45:46 +0100 Message-Id: <20180202064546.21746-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 02 Feb 2018 06:45:50 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2] vnc: use stubs for CONFIG_VNC=n dummy functions 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: Paolo Bonzini , Gerd Hoffmann , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Cc: Paolo Bonzini Cc: Markus Armbruster Signed-off-by: Gerd Hoffmann --- include/ui/console.h | 21 --------------------- ui/vnc-stubs.c | 21 +++++++++++++++++++++ ui/Makefile.objs | 1 + 3 files changed, 22 insertions(+), 21 deletions(-) create mode 100644 ui/vnc-stubs.c diff --git a/include/ui/console.h b/include/ui/console.h index 7b35778444..de57e8363a 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -468,31 +468,10 @@ static inline void cocoa_display_init(DisplayState *d= s, int full_screen) void vnc_display_init(const char *id); void vnc_display_open(const char *id, Error **errp); void vnc_display_add_client(const char *id, int csock, bool skipauth); -#ifdef CONFIG_VNC int vnc_display_password(const char *id, const char *password); int vnc_display_pw_expire(const char *id, time_t expires); QemuOpts *vnc_parse(const char *str, Error **errp); int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp); -#else -static inline int vnc_display_password(const char *id, const char *passwor= d) -{ - return -ENODEV; -} -static inline int vnc_display_pw_expire(const char *id, time_t expires) -{ - return -ENODEV; -}; -static inline QemuOpts *vnc_parse(const char *str, Error **errp) -{ - error_setg(errp, "VNC support is disabled"); - return NULL; -} -static inline int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp) -{ - error_setg(errp, "VNC support is disabled"); - return -1; -} -#endif =20 /* curses.c */ #ifdef CONFIG_CURSES diff --git a/ui/vnc-stubs.c b/ui/vnc-stubs.c new file mode 100644 index 0000000000..f51280549a --- /dev/null +++ b/ui/vnc-stubs.c @@ -0,0 +1,21 @@ +#include "qemu/osdep.h" +#include "ui/console.h" + +int vnc_display_password(const char *id, const char *password) +{ + return -ENODEV; +} +int vnc_display_pw_expire(const char *id, time_t expires) +{ + return -ENODEV; +}; +QemuOpts *vnc_parse(const char *str, Error **errp) +{ + error_setg(errp, "VNC support is disabled"); + return NULL; +} +int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp) +{ + error_setg(errp, "VNC support is disabled"); + return -1; +} diff --git a/ui/Makefile.objs b/ui/Makefile.objs index 99195884b0..ced7d91a63 100644 --- a/ui/Makefile.objs +++ b/ui/Makefile.objs @@ -15,6 +15,7 @@ common-obj-$(CONFIG_SDL) +=3D sdl.mo common-obj-$(CONFIG_COCOA) +=3D cocoa.o common-obj-$(CONFIG_CURSES) +=3D curses.o common-obj-$(CONFIG_VNC) +=3D $(vnc-obj-y) +common-obj-$(call lnot,$(CONFIG_VNC)) +=3D vnc-stubs.o common-obj-$(CONFIG_GTK) +=3D gtk.o common-obj-$(if $(CONFIG_WIN32),n,$(if $(CONFIG_SDL),y,$(CONFIG_GTK))) += =3D x_keymap.o =20 --=20 2.9.3