[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 06/23] qemu-options: define -vnc only #ifdef CONFIG_VNC
From: |
marcandre . lureau |
Subject: |
[PATCH v6 06/23] qemu-options: define -vnc only #ifdef CONFIG_VNC |
Date: |
Wed, 25 Oct 2023 23:08:00 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
system/vl.c | 13 +++++++++----
ui/vnc-stubs.c | 12 ------------
qemu-options.hx | 2 ++
3 files changed, 11 insertions(+), 16 deletions(-)
diff --git a/system/vl.c b/system/vl.c
index 3be1a78a9d..de6df188da 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -1095,13 +1095,14 @@ DisplayOptions *qmp_query_display_options(Error **errp)
static void parse_display(const char *p)
{
- const char *opts;
-
if (is_help_option(p)) {
qemu_display_help();
exit(0);
}
+#ifdef CONFIG_VNC
+ const char *opts;
+
if (strstart(p, "vnc", &opts)) {
/*
* vnc isn't a (local) DisplayType but a protocol for remote
@@ -1113,9 +1114,11 @@ static void parse_display(const char *p)
error_report("VNC requires a display argument vnc=<display>");
exit(1);
}
- } else {
- parse_display_qapi(p);
+ return;
}
+#endif
+
+ parse_display_qapi(p);
}
static inline bool nonempty_str(const char *str)
@@ -3344,9 +3347,11 @@ void qemu_init(int argc, char **argv)
machine_parse_property_opt(qemu_find_opts("smp-opts"),
"smp", optarg);
break;
+#ifdef CONFIG_VNC
case QEMU_OPTION_vnc:
vnc_parse(optarg);
break;
+#endif
case QEMU_OPTION_no_acpi:
warn_report("-no-acpi is deprecated, use '-machine acpi=off'
instead");
qdict_put_str(machine_opts_dict, "acpi", "off");
diff --git a/ui/vnc-stubs.c b/ui/vnc-stubs.c
index b4eb3ce718..a96bc86236 100644
--- a/ui/vnc-stubs.c
+++ b/ui/vnc-stubs.c
@@ -10,15 +10,3 @@ int vnc_display_pw_expire(const char *id, time_t expires)
{
return -ENODEV;
};
-void vnc_parse(const char *str)
-{
- if (strcmp(str, "none") == 0) {
- return;
- }
- error_setg(&error_fatal, "VNC support is disabled");
-}
-int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp)
-{
- error_setg(errp, "VNC support is disabled");
- return -1;
-}
diff --git a/qemu-options.hx b/qemu-options.hx
index e26230bac5..edc8ca6e30 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2424,8 +2424,10 @@ SRST
OBP.
ERST
+#ifdef CONFIG_VNC
DEF("vnc", HAS_ARG, QEMU_OPTION_vnc ,
"-vnc <display> shorthand for -display vnc=<display>\n", QEMU_ARCH_ALL)
+#endif
SRST
``-vnc display[,option[,option[,...]]]``
Normally, if QEMU is compiled with graphical window support, it
--
2.41.0
- [PATCH v6 00/23] Make Pixman an optional dependency, marcandre . lureau, 2023/10/25
- [PATCH v6 01/23] build-sys: add a "pixman" feature, marcandre . lureau, 2023/10/25
- [PATCH v6 03/23] ui: compile out some qemu-pixman functions when !PIXMAN, marcandre . lureau, 2023/10/25
- [PATCH v6 02/23] build-sys: drop needless warning pragmas for old pixman, marcandre . lureau, 2023/10/25
- [PATCH v6 04/23] ui: add pixman-minimal.h, marcandre . lureau, 2023/10/25
- [PATCH v6 05/23] vl: drop needless -spice checks, marcandre . lureau, 2023/10/25
- [PATCH v6 06/23] qemu-options: define -vnc only #ifdef CONFIG_VNC,
marcandre . lureau <=
- [PATCH v6 07/23] vl: simplify display_remote logic, marcandre . lureau, 2023/10/25
- [PATCH v6 11/23] qmp/hmp: disable screendump if PIXMAN is missing, marcandre . lureau, 2023/10/25
- [PATCH v6 09/23] ui/console: allow to override the default VC, marcandre . lureau, 2023/10/25
- [PATCH v6 10/23] ui/vc: console-vc requires PIXMAN, marcandre . lureau, 2023/10/25
- [PATCH v6 08/23] vl: move display early init before default devices, marcandre . lureau, 2023/10/25