If you have a connection is configured as 'host.domain', and open the VM details the dialog opens but a Python traceback is shown: Error launching details: 'host.domain' does not appear to be an IPv4 or IPv6 network Traceback (most recent call last): File "/usr/local/share/virt-manager/virtManager/engine.py", line 791, in _show_vm_helper details.show() File "/usr/local/share/virt-manager/virtManager/details.py", line 626, in show self.refresh_vm_state() File "/usr/local/share/virt-manager/virtManager/details.py", line 1358, in refresh_vm_state self.console.details_update_widget_states() File "/usr/local/share/virt-manager/virtManager/console.py", line 961, in details_update_widget_states return self._update_vm_widget_states() File "/usr/local/share/virt-manager/virtManager/console.py", line 526, in _update_vm_widget_states self._init_viewer() File "/usr/local/share/virt-manager/virtManager/console.py", line 634, in _init_viewer if ginfo.is_bad_localhost(): File "/usr/local/share/virt-manager/virtManager/sshtunnels.py", line 69, in is_bad_localhost return self.transport and self._is_listen_localhost(host) File "/usr/local/share/virt-manager/virtManager/sshtunnels.py", line 51, in _is_listen_localhost return ipaddr.IPNetwork(host or self.gaddr).is_loopback File "/usr/local/lib/python2.7/site-packages/ipaddr.py", line 119, in IPNetwork address) ValueError: 'host.domain' does not appear to be an IPv4 or IPv6 network The details can still be modified however. This is with: virt-manager 1.2.0 libvirt 1.2.15 This issue is 100% reproducible. Reverting this commit worksaround the issue: https://git.fedorahosted.org/cgit/virt-manager.git/commit/virtManager/sshtunnels.py?id=a2d453f3e20d103a4767394300c5183fde9a6bb4 It seems the 'host' is not resolved before it's passed to ipaddr.IPNetwork().
could you verify if this works for you? I am going to do more tests here and propose it upstream later today: diff --git a/virtManager/sshtunnels.py b/virtManager/sshtunnels.py index 25ed43a..263a6ed 100644 --- a/virtManager/sshtunnels.py +++ b/virtManager/sshtunnels.py @@ -49,8 +49,8 @@ class ConnectionInfo(object): def _is_listen_localhost(self, host=None): if host: - return host in ["127.0.0.1", "::1"] - return ipaddr.IPNetwork(self.gaddr).is_loopback + host = socket.gethostbyname(host) + return ipaddr.IPNetwork(host or self.gaddr).is_loopback def _is_listen_any(self): return ipaddr.IPNetwork(self.gaddr).is_unspecified
sorry, I meant.. diff --git a/virtManager/sshtunnels.py b/virtManager/sshtunnels.py index 53f43be..263a6ed 100644 --- a/virtManager/sshtunnels.py +++ b/virtManager/sshtunnels.py @@ -48,6 +48,8 @@ class ConnectionInfo(object): self._connhost = "127.0.0.1" def _is_listen_localhost(self, host=None): + if host: + host = socket.gethostbyname(host) return ipaddr.IPNetwork(host or self.gaddr).is_loopback def _is_listen_any(self):
Indeed that works for me, but shouldn't _is_listen_any() get the same treatment? Thanks.
is_listen_any() is accessing only self.gaddr, which is supposed to be already an IP address. The same thing is done in _is_listen_localhost in case host=None
patch proposed here: https://www.redhat.com/archives/virt-tools-list/2015-May/msg00016.html
Sorry, I have a setup to test this before the release, but I forgot :/
pushed: commit ebcb7c064ca5a3afd2ec3a0c8f59328a7f71b009 Author: Giuseppe Scrivano <gscrivan> Date: Wed May 6 12:52:40 2015 +0200 sshtunnels: fix exception when the address is not an IP bug introduced with commit a2d453f3e20d103a4767394300c5183fde9a6bb4 Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1218958 Signed-off-by: Giuseppe Scrivano <gscrivan>
Thank you for fixing this so promptly.