mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-10 23:45:49 -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"]
|
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):
|
def get_conn_host(self):
|
||||||
host = self._connhost
|
host = self._connhost
|
||||||
port = self._connport
|
port = self._connport
|
||||||
@ -1125,6 +1131,14 @@ class vmmConsolePages(vmmGObjectUI):
|
|||||||
self.activate_unavailable_page(msg)
|
self.activate_unavailable_page(msg)
|
||||||
return
|
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():
|
if ginfo.console_active():
|
||||||
self.activate_unavailable_page(
|
self.activate_unavailable_page(
|
||||||
_("Graphical console is not yet active for guest"))
|
_("Graphical console is not yet active for guest"))
|
||||||
|
Loading…
Reference in New Issue
Block a user