domain: Fix connecting to VNC on ESX servers

ESX libvirt URIs don't use have a 'transport' section (like the ssh in
qemu+ssh). If virt-manager didn't see a transport, we assumed the
host is localhost, and used 127.0.0.1 when connecting to VNC.

Fix this check to only use 127.0.0.1 if there is no hostname
specified in the libvirt URI.
This commit is contained in:
Cole Robinson 2010-02-12 16:37:14 -05:00
parent f243ce4f7e
commit 729c478401

View File

@ -354,7 +354,7 @@ class vmmDomainBase(gobject.GObject):
connhost = self.connection.get_uri_hostname()
transport, username = self.connection.get_transport()
if transport == None:
if connhost == 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