* [Qemu-devel] [PATCH] vnc: use stubs for CONFIG_VNC=n dummy functions
@ 2018-02-01 8:45 Gerd Hoffmann
2018-02-01 10:27 ` Daniel P. Berrangé
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2018-02-01 8:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann, Markus Armbruster
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
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 *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/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..09a275aed1 100644
--- a/ui/Makefile.objs
+++ b/ui/Makefile.objs
@@ -6,6 +6,7 @@ vnc-obj-y += vnc-auth-vencrypt.o
vnc-obj-$(CONFIG_VNC_SASL) += vnc-auth-sasl.o
vnc-obj-y += vnc-ws.o
vnc-obj-y += vnc-jobs.o
+stub-obj-y += vnc-stubs.o
common-obj-y += keymaps.o console.o cursor.o qemu-pixman.o
common-obj-y += input.o input-keymap.o input-legacy.o
--
2.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] vnc: use stubs for CONFIG_VNC=n dummy functions
2018-02-01 8:45 [Qemu-devel] [PATCH] vnc: use stubs for CONFIG_VNC=n dummy functions Gerd Hoffmann
@ 2018-02-01 10:27 ` Daniel P. Berrangé
2018-02-01 11:14 ` Markus Armbruster
2018-02-01 17:20 ` Paolo Bonzini
2 siblings, 0 replies; 4+ messages in thread
From: Daniel P. Berrangé @ 2018-02-01 10:27 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel, Markus Armbruster
On Thu, Feb 01, 2018 at 09:45:35AM +0100, Gerd Hoffmann wrote:
> Cc: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
> 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
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
>
> 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/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..09a275aed1 100644
> --- a/ui/Makefile.objs
> +++ b/ui/Makefile.objs
> @@ -6,6 +6,7 @@ vnc-obj-y += vnc-auth-vencrypt.o
> vnc-obj-$(CONFIG_VNC_SASL) += vnc-auth-sasl.o
> vnc-obj-y += vnc-ws.o
> vnc-obj-y += vnc-jobs.o
> +stub-obj-y += vnc-stubs.o
>
> common-obj-y += keymaps.o console.o cursor.o qemu-pixman.o
> common-obj-y += input.o input-keymap.o input-legacy.o
> --
> 2.9.3
>
>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] vnc: use stubs for CONFIG_VNC=n dummy functions
2018-02-01 8:45 [Qemu-devel] [PATCH] vnc: use stubs for CONFIG_VNC=n dummy functions Gerd Hoffmann
2018-02-01 10:27 ` Daniel P. Berrangé
@ 2018-02-01 11:14 ` Markus Armbruster
2018-02-01 17:20 ` Paolo Bonzini
2 siblings, 0 replies; 4+ messages in thread
From: Markus Armbruster @ 2018-02-01 11:14 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
Gerd Hoffmann <kraxel@redhat.com> writes:
> Cc: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Cool!
Reviewed-by: Markus Armbruster <armbru@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] vnc: use stubs for CONFIG_VNC=n dummy functions
2018-02-01 8:45 [Qemu-devel] [PATCH] vnc: use stubs for CONFIG_VNC=n dummy functions Gerd Hoffmann
2018-02-01 10:27 ` Daniel P. Berrangé
2018-02-01 11:14 ` Markus Armbruster
@ 2018-02-01 17:20 ` Paolo Bonzini
2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2018-02-01 17:20 UTC (permalink / raw)
To: Gerd Hoffmann, qemu-devel; +Cc: Markus Armbruster
On 01/02/2018 03:45, Gerd Hoffmann wrote:
> Cc: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
> 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 *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/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..09a275aed1 100644
> --- a/ui/Makefile.objs
> +++ b/ui/Makefile.objs
> @@ -6,6 +6,7 @@ vnc-obj-y += vnc-auth-vencrypt.o
> vnc-obj-$(CONFIG_VNC_SASL) += vnc-auth-sasl.o
> vnc-obj-y += vnc-ws.o
> vnc-obj-y += vnc-jobs.o
> +stub-obj-y += vnc-stubs.o
Better, since vnc need not be linked into tools or user-mode emulation:
common-obj-$(CONFIG_VNC) += $(vnc-obj-y)
common-obj-$(call lnot,$(CONFIG_VNC)) += vnc-stubs.o
Paolo
> common-obj-y += keymaps.o console.o cursor.o qemu-pixman.o
> common-obj-y += input.o input-keymap.o input-legacy.o
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-02-01 17:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-01 8:45 [Qemu-devel] [PATCH] vnc: use stubs for CONFIG_VNC=n dummy functions Gerd Hoffmann
2018-02-01 10:27 ` Daniel P. Berrangé
2018-02-01 11:14 ` Markus Armbruster
2018-02-01 17:20 ` Paolo Bonzini
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).