console: Warn if qemu+tcp URI and listen == 127.0.0.1

This commit is contained in:
Cole Robinson 2013-06-30 11:44:58 -04:00
parent a6d3b0ca14
commit bc13c302de

View File

@ -77,6 +77,12 @@ class ConnectionInfo(object):
return self.transport in ["ssh", "ext"]
def is_bad_localhost(self):
host, port = self.get_conn_host()
if self.need_tunnel():
return False
return self.transport and host == "127.0.0.1"
def get_conn_host(self):
host = self._connhost
port = self._connport
@ -1125,6 +1131,14 @@ class vmmConsolePages(vmmGObjectUI):
self.activate_unavailable_page(msg)
return
if ginfo.is_bad_localhost():
self.activate_unavailable_page(
_("Guest is on a remote host with transport '%s'\n"
"but is only configured to listen on 127.0.0.1.\n"
"Connect using 'ssh' transport or change the\n"
"guest's listen address." % ginfo.transport))
return
if ginfo.console_active():
self.activate_unavailable_page(
_("Graphical console is not yet active for guest"))