[virt-tools-list] [virt-manager PATCH] graphics: skip authentication only for VNC with listen type none

Pavel Hrdina phrdina at redhat.com
Thu Mar 23 14:28:50 UTC 2017


This is in fact a bug in QEMU so we have to workaround this issue
to allow to connect to guest with VNC and listen type none.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1434551

Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 virtManager/domain.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/virtManager/domain.py b/virtManager/domain.py
index 3478cc58..fc5f54a6 100644
--- a/virtManager/domain.py
+++ b/virtManager/domain.py
@@ -1190,8 +1190,17 @@ class vmmDomain(vmmLibvirtObject):
         return self._backend.openConsole(devname, stream, flags)
 
     def open_graphics_fd(self):
-        return self._backend.openGraphicsFD(0,
-                libvirt.VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH)
+        flags = 0
+
+        # Ugly workaround for VNC bug where the display cannot be opened
+        # if the listen type is "none".  When this gets fixed in QEMU
+        # we should skip auth only for broken QEMUs.
+        graphics = self.get_graphics_devices()[0]
+        if (graphics.type == "vnc" and
+            graphics.get_first_listen_type() == "none"):
+            flags = libvirt.VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH
+
+        return self._backend.openGraphicsFD(0, flags)
 
     def refresh_snapshots(self):
         self._snapshot_list = None
-- 
2.12.1




More information about the virt-tools-list mailing list