vnc: use stubs for CONFIG_VNC=n dummy functions

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>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
Gerd Hoffmann 2018-02-02 07:45:46 +01:00 committed by Markus Armbruster
parent 008a51bbb3
commit 637b047717
3 changed files with 22 additions and 21 deletions

View File

@ -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

View File

@ -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

21
ui/vnc-stubs.c Normal file
View File

@ -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;
}