File virtman-viewer.diff of Package virt-manager

diff -Nuar virt-manager-0.5.3.orig//src/virtManager/domain.py virt-manager-0.5.3//src/virtManager/domain.py
--- virt-manager-0.5.3.orig//src/virtManager/domain.py	2008-01-10 18:17:51.000000000 -0700
+++ virt-manager-0.5.3//src/virtManager/domain.py	2009-05-13 11:29:36.000000000 -0600
@@ -450,23 +450,17 @@
     def get_graphics_console(self):
         self.xml = None
         type = self.get_xml_string("/domain/devices/graphics/@type")
+        lhost = self.get_xml_string("/domain/devices/graphics[@type='vnc']/@listen")
+        if lhost is None or lhost == "localhost":
+            lhost = "127.0.0.1"
         port = None
         if type == "vnc":
             port = self.get_xml_string("/domain/devices/graphics[@type='vnc']/@port")
             if port is not None:
                 port = int(port)
-
         transport, username = self.connection.get_transport()
-        if transport is None:
-            # Force use of 127.0.0.1, because some (broken) systems don't 
-            # reliably resolve 'localhost' into 127.0.0.1, either returning
-            # the public IP, or an IPv6 addr. Neither work since QEMU only
-            # listens on 127.0.0.1 for VNC.
-            return [type, "127.0.0.1", port, None]
-        else:
-            return [type, self.connection.get_hostname(), port, transport]
-
-
+        return [type, lhost, port, transport]
+           
     def get_disk_devices(self):
         xml = self.get_xml()
         doc = None
openSUSE Build Service is sponsored by