[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 13/17] qemu.conf: remove vnc_auto_unix_socket



This config option is broken, it will generate unix socket even if
attribute 'listen' or listen element is specified.

Also following commit will makes this option obsolete.

Signed-off-by: Pavel Hrdina <phrdina redhat com>
---
 src/qemu/libvirtd_qemu.aug                         |  1 -
 src/qemu/qemu.conf                                 | 10 ------
 src/qemu/qemu_command.c                            | 22 +++---------
 src/qemu/qemu_conf.c                               |  1 -
 src/qemu/qemu_conf.h                               |  1 -
 src/qemu/test_libvirtd_qemu.aug.in                 |  1 -
 .../qemuxml2argv-graphics-vnc-autosocket.args      | 22 ------------
 .../qemuxml2argv-graphics-vnc-autosocket.xml       | 34 -------------------
 .../qemuxml2xmlout-graphics-vnc-autosocket.xml     | 39 ----------------------
 tests/qemuxml2xmltest.c                            |  7 ----
 10 files changed, 5 insertions(+), 133 deletions(-)
 delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-autosocket.args
 delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-autosocket.xml
 delete mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-vnc-autosocket.xml

diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug
index b6f6dc4..c18c7fd 100644
--- a/src/qemu/libvirtd_qemu.aug
+++ b/src/qemu/libvirtd_qemu.aug
@@ -25,7 +25,6 @@ module Libvirtd_qemu =
 
    (* Config entry grouped by function - same order as example config *)
    let vnc_entry = str_entry "vnc_listen"
-                 | bool_entry "vnc_auto_unix_socket"
                  | bool_entry "vnc_tls"
                  | str_entry "vnc_tls_x509_cert_dir"
                  | bool_entry "vnc_tls_x509_verify"
diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf
index 4fa5e8a..bb209a5 100644
--- a/src/qemu/qemu.conf
+++ b/src/qemu/qemu.conf
@@ -11,16 +11,6 @@
 #
 #vnc_listen = "0.0.0.0"
 
-# Enable this option to have VNC served over an automatically created
-# unix socket. This prevents unprivileged access from users on the
-# host machine, though most VNC clients do not support it.
-#
-# This will only be enabled for VNC configurations that do not have
-# a hardcoded 'listen' or 'socket' value. This setting takes preference
-# over vnc_listen.
-#
-#vnc_auto_unix_socket = 1
-
 # Enable use of TLS encryption on the VNC server. This requires
 # a VNC client which supports the VeNCrypt protocol extension.
 # Examples include vinagre, virt-viewer, virt-manager and vencrypt
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 7f7ce60..67f781e 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7318,8 +7318,7 @@ static int
 qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg,
                                 virCommandPtr cmd,
                                 virQEMUCapsPtr qemuCaps,
-                                virDomainGraphicsDefPtr graphics,
-                                const char *domainLibDir)
+                                virDomainGraphicsDefPtr graphics)
 {
     virBuffer opt = VIR_BUFFER_INITIALIZER;
     virDomainGraphicsListenDefPtr glisten = NULL;
@@ -7334,17 +7333,8 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg,
         goto error;
     }
 
-    if (graphics->data.vnc.socket || cfg->vncAutoUnixSocket) {
-        if (!graphics->data.vnc.socket) {
-            if (virAsprintf(&graphics->data.vnc.socket,
-                            "%s/vnc.sock", domainLibDir) < 0)
-                goto error;
-
-            graphics->data.vnc.socketAutogenerated = true;
-        }
-
+    if (graphics->data.vnc.socket) {
         virBufferAsprintf(&opt, "unix:%s", graphics->data.vnc.socket);
-
     } else {
         if (!(glisten = virDomainGraphicsGetListen(graphics, 0))) {
             virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@@ -7726,8 +7716,7 @@ qemuBuildGraphicsCommandLine(virQEMUDriverConfigPtr cfg,
                              virCommandPtr cmd,
                              virDomainDefPtr def,
                              virQEMUCapsPtr qemuCaps,
-                             virDomainGraphicsDefPtr graphics,
-                             const char *domainLibDir)
+                             virDomainGraphicsDefPtr graphics)
 {
     switch ((virDomainGraphicsType) graphics->type) {
     case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
@@ -7759,8 +7748,7 @@ qemuBuildGraphicsCommandLine(virQEMUDriverConfigPtr cfg,
         break;
 
     case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
-        return qemuBuildGraphicsVNCCommandLine(cfg, cmd, qemuCaps,
-                                               graphics, domainLibDir);
+        return qemuBuildGraphicsVNCCommandLine(cfg, cmd, qemuCaps, graphics);
 
     case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
         return qemuBuildGraphicsSPICECommandLine(cfg, cmd, qemuCaps, graphics);
@@ -9488,7 +9476,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
 
     for (i = 0; i < def->ngraphics; ++i) {
         if (qemuBuildGraphicsCommandLine(cfg, cmd, def, qemuCaps,
-                                         def->graphics[i], domainLibDir) < 0)
+                                         def->graphics[i]) < 0)
             goto error;
     }
 
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 5ed5776..b5cc4b7 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -527,7 +527,6 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
             goto cleanup;                  \
     }
 
-    GET_VALUE_BOOL("vnc_auto_unix_socket", cfg->vncAutoUnixSocket);
     GET_VALUE_BOOL("vnc_tls", cfg->vncTLS);
     GET_VALUE_BOOL("vnc_tls_x509_verify", cfg->vncTLSx509verify);
     GET_VALUE_STR("vnc_tls_x509_cert_dir", cfg->vncTLSx509certdir);
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index a714b84..a17110f 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -108,7 +108,6 @@ struct _virQEMUDriverConfig {
     char *channelTargetDir;
     char *nvramDir;
 
-    bool vncAutoUnixSocket;
     bool vncTLS;
     bool vncTLSx509verify;
     bool vncSASL;
diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qemu.aug.in
index 8bec743..e04208b 100644
--- a/src/qemu/test_libvirtd_qemu.aug.in
+++ b/src/qemu/test_libvirtd_qemu.aug.in
@@ -3,7 +3,6 @@ module Test_libvirtd_qemu =
 
    test Libvirtd_qemu.lns get conf =
 { "vnc_listen" = "0.0.0.0" }
-{ "vnc_auto_unix_socket" = "1" }
 { "vnc_tls" = "1" }
 { "vnc_tls_x509_cert_dir" = "/etc/pki/libvirt-vnc" }
 { "vnc_tls_x509_verify" = "1" }
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-autosocket.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-autosocket.args
deleted file mode 100644
index 7e1fb6b..0000000
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-autosocket.args
+++ /dev/null
@@ -1,22 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu \
--name QEMUGuest1 \
--S \
--M pc \
--m 214 \
--smp 1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--nodefaults \
--monitor unix:/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server,nowait \
--no-acpi \
--boot c \
--usb \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
--device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
--vnc unix:/tmp/lib/domain--1-QEMUGuest1/vnc.socket \
--vga cirrus
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-autosocket.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-autosocket.xml
deleted file mode 100644
index fa59c39..0000000
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-autosocket.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<domain type='qemu'>
-  <name>QEMUGuest1</name>
-  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
-  <memory unit='KiB'>219100</memory>
-  <currentMemory unit='KiB'>219100</currentMemory>
-  <vcpu placement='static'>1</vcpu>
-  <os>
-    <type arch='i686' machine='pc'>hvm</type>
-    <boot dev='hd'/>
-  </os>
-  <clock offset='utc'/>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>destroy</on_crash>
-  <devices>
-    <emulator>/usr/bin/qemu</emulator>
-    <disk type='block' device='disk'>
-      <driver name='qemu' type='raw'/>
-      <source dev='/dev/HostVG/QEMUGuest1'/>
-      <target dev='hda' bus='ide'/>
-      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
-    </disk>
-    <controller type='usb' index='0'/>
-    <controller type='ide' index='0'/>
-    <controller type='pci' index='0' model='pci-root'/>
-    <input type='mouse' bus='ps2'/>
-    <input type='keyboard' bus='ps2'/>
-    <graphics type='vnc' socket='/tmp/lib/domain-99-QEMUGuest1/delete.this.socket'/>
-    <video>
-      <model type='cirrus' vram='16384' heads='1'/>
-    </video>
-    <memballoon model='none'/>
-  </devices>
-</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-vnc-autosocket.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-vnc-autosocket.xml
deleted file mode 100644
index 7450566..0000000
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-vnc-autosocket.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<domain type='qemu'>
-  <name>QEMUGuest1</name>
-  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
-  <memory unit='KiB'>219100</memory>
-  <currentMemory unit='KiB'>219100</currentMemory>
-  <vcpu placement='static'>1</vcpu>
-  <os>
-    <type arch='i686' machine='pc'>hvm</type>
-    <boot dev='hd'/>
-  </os>
-  <clock offset='utc'/>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>destroy</on_crash>
-  <devices>
-    <emulator>/usr/bin/qemu</emulator>
-    <disk type='block' device='disk'>
-      <driver name='qemu' type='raw'/>
-      <source dev='/dev/HostVG/QEMUGuest1'/>
-      <target dev='hda' bus='ide'/>
-      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
-    </disk>
-    <controller type='usb' index='0'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
-    </controller>
-    <controller type='ide' index='0'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
-    </controller>
-    <controller type='pci' index='0' model='pci-root'/>
-    <input type='mouse' bus='ps2'/>
-    <input type='keyboard' bus='ps2'/>
-    <graphics type='vnc'/>
-    <video>
-      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
-    </video>
-    <memballoon model='none'/>
-  </devices>
-</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 5a43fa9..6821895 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -263,7 +263,6 @@ mymain(void)
 {
     int ret = 0;
     struct testInfo info;
-    virQEMUDriverConfigPtr cfg = NULL;
 
     if (qemuTestDriverInit(&driver) < 0)
         return EXIT_FAILURE;
@@ -788,12 +787,6 @@ mymain(void)
     DO_TEST("virtio-input");
     DO_TEST("virtio-input-passthrough");
 
-    cfg = virQEMUDriverGetConfig(&driver);
-    cfg->vncAutoUnixSocket = true;
-    DO_TEST_FULL("graphics-vnc-autosocket", WHEN_INACTIVE, NONE);
-    cfg->vncAutoUnixSocket = false;
-
-    virObjectUnref(cfg);
     qemuTestDriverFree(&driver);
 
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
-- 
2.8.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]