From bc13c302de473c30faa19c0336272cd16cf64b24 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sun, 30 Jun 2013 11:44:58 -0400 Subject: [PATCH] console: Warn if qemu+tcp URI and listen == 127.0.0.1 --- virtManager/console.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/virtManager/console.py b/virtManager/console.py index 001318e30..26b8d4f6c 100644 --- a/virtManager/console.py +++ b/virtManager/console.py @@ -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"))