[virt-manager/f16] Fix connecting to console with specific listen address
Cole Robinson
crobinso at fedoraproject.org
Wed Jun 6 21:48:16 UTC 2012
commit 48094af4c4d50a3cfb78f2dfc4ddab5b20cd2f4c
Author: Cole Robinson <crobinso at redhat.com>
Date: Wed Jun 6 17:48:13 2012 -0400
Fix connecting to console with specific listen address
virt-manager-fix-listen-address.patch | 53 +++++++++++++++++++++++++++++++++
virt-manager.spec | 8 ++++-
2 files changed, 60 insertions(+), 1 deletions(-)
---
diff --git a/virt-manager-fix-listen-address.patch b/virt-manager-fix-listen-address.patch
new file mode 100644
index 0000000..4c781a9
--- /dev/null
+++ b/virt-manager-fix-listen-address.patch
@@ -0,0 +1,53 @@
+diff -rup virt-manager-0.9.1/src/virtManager/console.py foo/src/virtManager/console.py
+--- virt-manager-0.9.1/src/virtManager/console.py 2012-06-06 17:05:12.762334674 -0400
++++ foo/src/virtManager/console.py 2012-06-06 17:04:59.383045040 -0400
+@@ -370,6 +370,7 @@ class VNCViewer(Viewer):
+ ignore = user
+
+ if not socketpath:
++ logging.debug("VNC connecting to %s:%s" % (host, port))
+ self.display.open_host(host, port)
+ return
+
+@@ -485,7 +486,6 @@ class SpiceViewer(Viewer):
+ ignore = socketpath
+
+ uri = "spice://"
+- uri += (user and str(user) or "")
+ uri += str(host) + "?port=" + str(port)
+ logging.debug("spice uri: %s", uri)
+
+@@ -1084,7 +1084,7 @@ class vmmConsolePages(vmmGObjectUI):
+
+ self.set_enable_accel()
+
+- if transport in ("ssh", "ext"):
++ if (transport in ("ssh", "ext")) and gaddr == "127.0.0.1":
+ if self.tunnels:
+ # Tunnel already open, no need to continue
+ return
+@@ -1096,8 +1096,10 @@ class vmmConsolePages(vmmGObjectUI):
+ self.viewer.open_fd(fd)
+
+ else:
+- self.viewer.open_host(connhost, connuser,
+- str(gport), gsocket)
++ host = gaddr
++ if gaddr == "127.0.0.1" or gaddr == "0.0.0.0":
++ host = connhost
++ self.viewer.open_host(host, connuser, str(gport), gsocket)
+
+ except Exception, e:
+ logging.exception("Error connection to graphical console")
+diff -rup virt-manager-0.9.1/src/virtManager/domain.py foo/src/virtManager/domain.py
+--- virt-manager-0.9.1/src/virtManager/domain.py 2012-01-29 15:40:49.000000000 -0500
++++ foo/src/virtManager/domain.py 2012-06-06 17:04:59.384044912 -0400
+@@ -952,7 +952,7 @@ class vmmDomain(vmmLibvirtObject):
+ if gport != None:
+ gport = int(gport)
+ gtype = gdev.type
+- gaddr = "127.0.0.1"
++ gaddr = gdev.listen or "127.0.0.1"
+ gsocket = gdev.socket
+
+ if connhost == None:
diff --git a/virt-manager.spec b/virt-manager.spec
index 1fc59b6..da3fd93 100644
--- a/virt-manager.spec
+++ b/virt-manager.spec
@@ -2,7 +2,7 @@
%define _package virt-manager
%define _version 0.9.1
-%define _release 2
+%define _release 3
%define virtinst_version 0.600.1
%define qemu_user "qemu"
@@ -46,6 +46,8 @@ Patch4: %{name}-conn-hang-app.patch
Patch5: %{name}-create-reshow.patch
# Improve tooltip for 'force console shortcuts' (bz 788448)
Patch6: %{name}-console-shortcut-explanation.patch
+# Fix connecting to console with specific listen address
+Patch7: %{name}-fix-listen-address.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -160,6 +162,7 @@ Common files used by the different Virtual Machine Manager interfaces.
%patch4 -p1
%patch5 -p1
%patch6 -p1
+%patch7 -p1
%build
%if %{qemu_user}
@@ -277,6 +280,9 @@ update-desktop-database -q %{_datadir}/applications
%endif
%changelog
+* Wed Jun 06 2012 Cole Robinson <crobinso at redhat.com> - 0.9.1-3
+- Fix connecting to console with specific listen address
+
* Mon Feb 13 2012 Cole Robinson <crobinso at redhat.com> - 0.9.1-2
- Fix error reporting for failed remote connections (bz 787011)
- Fix setting window title when VNC mouse is grabbed (bz 788443)
More information about the scm-commits
mailing list