[virt-tools-list] [virt-manager PATCH 4/4] sshtunnels: use <listen> element to get UNIX socket for graphics

Pavel Hrdina phrdina at redhat.com
Wed Sep 6 08:36:01 UTC 2017


Graphics devices has a new XML element to configure UNIX socket path:

  <graphics type='vnc' socket='/path/to/socket'>
    <listen type='socket' socket='/path/to/socket'/>
  </graphics>

  <graphics type='spice'>
    <listen type='socket' socket='/path/to/socket'/>
  </graphics>

and as you can see SPICE uses only the new XML element.  For VNC the
old 'socket' attribute is for backward compatibility.

In order to connect to SPICE graphics on remote host using SSH tunnel
we need to get the UNIX socket path from <listen> element.

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

Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 virtManager/sshtunnels.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/virtManager/sshtunnels.py b/virtManager/sshtunnels.py
index 12390a32..7f825b86 100644
--- a/virtManager/sshtunnels.py
+++ b/virtManager/sshtunnels.py
@@ -35,7 +35,7 @@ class ConnectionInfo(object):
     def __init__(self, conn, gdev):
         self.gtype = gdev.type
         self.gport = gdev.port and str(gdev.port) or None
-        self.gsocket = gdev.socket
+        self.gsocket = (gdev.listens and gdev.listens[0].socket) or gdev.socket
         self.gaddr = gdev.listen or "127.0.0.1"
         self.gtlsport = gdev.tlsPort or None
         self.glistentype = gdev.get_first_listen_type()
-- 
2.13.5




More information about the virt-tools-list mailing list