[virt-manager PATCH] cli: append "--attach" to virt-viewer if graphics has listen type none

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

 



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

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 virtinst/cli.py   | 4 ++--
 virtinst/guest.py | 7 +++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/virtinst/cli.py b/virtinst/cli.py
index cfe5ff07..b0e4fab5 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -442,8 +442,8 @@ def _gfx_console(guest):
             "--wait", guest.name]
 
     # Currently virt-viewer needs attaching to the local display while
-    # spice gl is enabled.
-    if guest.has_gl():
+    # spice gl is enabled or listen type none is used.
+    if guest.has_gl() or guest.has_listen_none():
         args.append("--attach")
 
     logging.debug("Launching virt-viewer for graphics type '%s'",
diff --git a/virtinst/guest.py b/virtinst/guest.py
index 5b3b9d1f..903ee188 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -1243,6 +1243,13 @@ class Guest(XMLBuilder):
             if gfx.gl:
                 return True
 
+    def has_listen_none(self):
+        for gfx in self.get_devices("graphics"):
+            listen = gfx.get_first_listen_type()
+            if listen and listen == "none":
+                return True
+        return False
+
     def _set_video_defaults(self):
         if self.has_spice():
             self._add_spice_channels()
-- 
2.14.3

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux