mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-07 14:43:01 -06:00
console: Warn if qemu+tcp URI and listen == 127.0.0.1
This commit is contained in:
parent
a6d3b0ca14
commit
bc13c302de
@ -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"))
|
||||
|
Loading…
Reference in New Issue
Block a user