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

[virt-tools-list] Error connecting to remote console session

The current implementation of connecting to a VNC console on remote hypervisor via qemu+ssh where the VNC listen address is localhost doesn't work.

I think this was originally introduced in 422c0216d8 (which is what ubuntu packaged causing me to chase this down). However, the refactoring in a455ba72b6 changed the code leaving a new version of the bug in place.

The code (HEAD) is using the `is` operator (identity) to compare strings where equality is desired. This has the result of not setting up the tunnel over ssh to the remote server when required. The following patch fixes that.

Nathan Bird
>From a78f74cde37cdc00b68cd72f8965a3ad0ff2c9c0 Mon Sep 17 00:00:00 2001
From: Nathan Bird <nathan acceleration net>
Date: Wed, 4 Apr 2012 14:45:11 -0400
Subject: [PATCH] console: fix logic in need_tunnel for non-local connections.

 src/virtManager/console.py |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/virtManager/console.py b/src/virtManager/console.py
index b14b5c4..2ac68ff 100644
--- a/src/virtManager/console.py
+++ b/src/virtManager/console.py
@@ -73,10 +73,8 @@ class ConnectionInfo(object):
             self._connhost, self._connport = self._connhost.split(":", 1)
     def need_tunnel(self):
-        if self.gaddr is not "":
-            return False
-        return self.transport in ["ssh", "ext"]
+        return self.gaddr == "" and \
+          self.transport in ["ssh", "ext"]
     def get_conn_host(self):
         host = self._connhost

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