]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: add qemu-vnc configuration
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 22 Apr 2026 14:14:33 +0000 (18:14 +0400)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 4 Jun 2026 12:20:46 +0000 (14:20 +0200)
Add qemu_vnc configuration entry to specify the path to the
standalone qemu-vnc binary.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/libvirtd_qemu.aug
src/qemu/qemu.conf.in
src/qemu/qemu_conf.c
src/qemu/qemu_conf.h
src/qemu/test_libvirtd_qemu.aug.in

index eb790d48bed78e279076d6fc9609de0b538c4937..311992e4414e8060f5414e578e32addfd5f278d3 100644 (file)
@@ -123,6 +123,7 @@ module Libvirtd_qemu =
                  | str_entry "pr_helper"
                  | str_entry "slirp_helper"
                  | str_entry "qemu_rdp"
+                 | str_entry "qemu_vnc"
                  | str_entry "dbus_daemon"
                  | bool_entry "set_process_name"
                  | int_entry "max_processes"
index 5eacd700221db58f6353a8dc8a80ff1738dd56bb..97b0141cf66aa1f50db2b6f2dddc2da633936782 100644 (file)
 #qemu_rdp = "qemu-rdp"
 
 
+# Path to the standalone qemu-vnc VNC server.
+# When available and both <graphics type='dbus'/> and <graphics type='vnc'/>
+# are configured, libvirt will use qemu-vnc instead of QEMU's built-in VNC.
+# If this is not an absolute path, the program will be searched for
+# in $PATH.
+#qemu_vnc = "qemu-vnc"
+
+
 # Path to the dbus-daemon
 # If this is not an absolute path, the program will be searched for
 # in $PATH.
index 5d28ad17af0422926b82b50fe9539b45fcb00adf..e30b146634b89860b8553404b870a00a716df746 100644 (file)
@@ -116,6 +116,7 @@ VIR_ONCE_GLOBAL_INIT(virQEMUConfig);
 #define QEMU_BRIDGE_HELPER "qemu-bridge-helper"
 #define QEMU_PR_HELPER "qemu-pr-helper"
 #define QEMU_RDP "qemu-rdp"
+#define QEMU_VNC "qemu-vnc"
 #define QEMU_DBUS_DAEMON "dbus-daemon"
 
 
@@ -290,6 +291,7 @@ virQEMUDriverConfig *virQEMUDriverConfigNew(bool privileged,
     cfg->slirpHelperName = g_strdup(QEMU_SLIRP_HELPER);
     cfg->dbusDaemonName = g_strdup(QEMU_DBUS_DAEMON);
     cfg->qemuRdpName = g_strdup(QEMU_RDP);
+    cfg->qemuVncName = g_strdup(QEMU_VNC);
 
     cfg->securityDefaultConfined = true;
     cfg->securityRequireConfined = false;
@@ -421,6 +423,7 @@ static void virQEMUDriverConfigDispose(void *obj)
     g_free(cfg->slirpHelperName);
     g_free(cfg->dbusDaemonName);
     g_free(cfg->qemuRdpName);
+    g_free(cfg->qemuVncName);
 
     g_free(cfg->autoDumpPath);
 
@@ -858,6 +861,9 @@ virQEMUDriverConfigLoadProcessEntry(virQEMUDriverConfig *cfg,
     if (virConfGetValueString(conf, "qemu_rdp", &cfg->qemuRdpName) < 0)
         return -1;
 
+    if (virConfGetValueString(conf, "qemu_vnc", &cfg->qemuVncName) < 0)
+        return -1;
+
     if (virConfGetValueBool(conf, "set_process_name", &cfg->setProcessName) < 0)
         return -1;
     if (virConfGetValueUInt(conf, "max_processes", &cfg->maxProcesses) < 0)
index 7b692f7306072b68073112b0a05fbfa7c61c0d87..1d29f35c5da601c05d92f762efe0a935db275a3d 100644 (file)
@@ -199,6 +199,7 @@ struct _virQEMUDriverConfig {
     char *slirpHelperName;
     char *dbusDaemonName;
     char *qemuRdpName;
+    char *qemuVncName;
 
     bool macFilter;
 
index 2582c6a09c762cf60e397204a2c69e3527053a38..c4cf9cf63499e99b7271e326b29db0111abfd007 100644 (file)
@@ -129,6 +129,7 @@ module Test_libvirtd_qemu =
 { "pr_helper" = "qemu-pr-helper" }
 { "slirp_helper" = "/usr/bin/slirp-helper" }
 { "qemu_rdp" = "qemu-rdp" }
+{ "qemu_vnc" = "qemu-vnc" }
 { "dbus_daemon" = "dbus-daemon" }
 { "swtpm_user" = "tss" }
 { "swtpm_group" = "tss" }