qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] [PULL 01/20] vnc: use stubs for CONFIG_VNC=n dummy functions
Date: Wed,  7 Feb 2018 13:39:50 +0100	[thread overview]
Message-ID: <20180207124009.12376-2-armbru@redhat.com> (raw)
In-Reply-To: <20180207124009.12376-1-armbru@redhat.com>

From: Gerd Hoffmann <kraxel@redhat.com>

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-Id: <20180202064546.21746-1-kraxel@redhat.com>
---
 include/ui/console.h | 21 ---------------------
 ui/Makefile.objs     |  1 +
 ui/vnc-stubs.c       | 21 +++++++++++++++++++++
 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 *ds, 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 *password)
-{
-    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
 
 /* curses.c */
 #ifdef CONFIG_CURSES
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) += sdl.mo
 common-obj-$(CONFIG_COCOA) += cocoa.o
 common-obj-$(CONFIG_CURSES) += curses.o
 common-obj-$(CONFIG_VNC) += $(vnc-obj-y)
+common-obj-$(call lnot,$(CONFIG_VNC)) += vnc-stubs.o
 common-obj-$(CONFIG_GTK) += gtk.o
 common-obj-$(if $(CONFIG_WIN32),n,$(if $(CONFIG_SDL),y,$(CONFIG_GTK))) += x_keymap.o
 
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;
+}
-- 
2.13.6

  reply	other threads:[~2018-02-07 12:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-07 12:39 [Qemu-devel] [PULL 00/20] Miscellaneous patches for 2018-02-07 Markus Armbruster
2018-02-07 12:39 ` Markus Armbruster [this message]
2018-02-07 12:39 ` [Qemu-devel] [PULL 02/20] Use #include "..." for our own headers, <...> for others Markus Armbruster
2018-02-07 12:39 ` [Qemu-devel] [PULL 03/20] Clean up includes Markus Armbruster
2018-02-07 12:39 ` [Qemu-devel] [PULL 04/20] Drop superfluous includes of qapi-types.h and test-qapi-types.h Markus Armbruster
2018-02-07 12:39 ` [Qemu-devel] [PULL 05/20] Include qapi/error.h exactly where needed Markus Armbruster
2018-02-07 12:39 ` [Qemu-devel] [PULL 06/20] Drop superfluous includes of qapi/qmp/qerror.h Markus Armbruster
2018-02-07 12:39 ` [Qemu-devel] [PULL 07/20] Include qmp-commands.h exactly where needed Markus Armbruster
2018-02-07 12:39 ` [Qemu-devel] [PULL 08/20] Typedef the subtypes of QObject in qemu/typedefs.h, too Markus Armbruster
2018-02-07 12:39 ` [Qemu-devel] [PULL 09/20] Eliminate qapi/qmp/types.h Markus Armbruster
2018-02-07 12:39 ` [Qemu-devel] [PULL 10/20] qdict qlist: Make most helper macros functions Markus Armbruster
2018-02-07 12:40 ` [Qemu-devel] [PULL 11/20] Include qapi/qmp/qobject.h exactly where needed Markus Armbruster
2018-02-07 12:40 ` [Qemu-devel] [PULL 12/20] Include qapi/qmp/qlist.h " Markus Armbruster
2018-02-07 12:40 ` [Qemu-devel] [PULL 13/20] Include qapi/qmp/qdict.h " Markus Armbruster
2018-02-07 12:40 ` [Qemu-devel] [PULL 14/20] Include qapi/qmp/qstring.h " Markus Armbruster
2018-02-07 12:40 ` [Qemu-devel] [PULL 15/20] Include qapi/qmp/qbool.h " Markus Armbruster
2018-02-07 12:40 ` [Qemu-devel] [PULL 16/20] Include qapi/qmp/qnum.h " Markus Armbruster
2018-02-07 12:40 ` [Qemu-devel] [PULL 17/20] Include qapi/qmp/qnull.h " Markus Armbruster
2018-02-07 12:40 ` [Qemu-devel] [PULL 18/20] Drop superfluous includes of qapi/qmp/dispatch.h Markus Armbruster
2018-02-07 12:40 ` [Qemu-devel] [PULL 19/20] Drop superfluous includes of qapi/qmp/qjson.h Markus Armbruster
2018-02-07 12:40 ` [Qemu-devel] [PULL 20/20] Move include qemu/option.h from qemu-common.h to actual users Markus Armbruster
2018-02-07 19:53 ` [Qemu-devel] [PULL 00/20] Miscellaneous patches for 2018-02-07 Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180207124009.12376-2-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).