[virt-manager/f17] Fix connecting to console with specific listen address Fix regression that dropped spice dependency

Cole Robinson crobinso at fedoraproject.org
Wed Jun 6 21:39:40 UTC 2012


commit 08a360a6e8bf5b6e757105c3ad3523fae28f5838
Author: Cole Robinson <crobinso at redhat.com>
Date:   Wed Jun 6 17:39:37 2012 -0400

    Fix connecting to console with specific listen address
    Fix regression that dropped spice dependency (bz 819270)

 virt-manager-fix-listen-address.patch |   53 +++++++++++++++++++++++++++++++++
 virt-manager.spec                     |   21 ++++++++-----
 2 files changed, 66 insertions(+), 8 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 fda9d49..85db610 100644
--- a/virt-manager.spec
+++ b/virt-manager.spec
@@ -2,7 +2,7 @@
 
 %define _package virt-manager
 %define _version 0.9.1
-%define _release 3
+%define _release 4
 %define virtinst_version 0.600.1
 
 %define qemu_user                  "qemu"
@@ -14,10 +14,11 @@
 %define with_guestfs               0
 %define with_tui                   1
 
-%ifarch %{ix86} x86_64
 %define with_spice                 1
-%else
-%define with_spice                 0
+%define default_graphics           ""
+
+%if %{with_spice} && %{default_graphics} == ""
+%define default_graphics "spice"
 %endif
 
 # End local config
@@ -52,6 +53,8 @@ Patch5: %{name}-create-reshow.patch
 Patch6: %{name}-console-shortcut-explanation.patch
 # Actually make spice the default (bz 757874)
 Patch7: %{name}-fix-spice-default.patch
+# Fix connecting to console with specific listen address
+Patch8: %{name}-fix-listen-address.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch: noarch
 
@@ -112,9 +115,6 @@ Requires(preun): GConf2
 Requires(post): desktop-file-utils
 Requires(postun): desktop-file-utils
 
-%if %{with_spice}
-%define default_graphics "spice"
-%endif
 
 %description
 Virtual Machine Manager provides a graphical tool for administering virtual
@@ -163,6 +163,7 @@ Common files used by the different Virtual Machine Manager interfaces.
 %patch5 -p1
 %patch6 -p1
 %patch7 -p1
+%patch8 -p1
 
 %build
 %if %{qemu_user}
@@ -185,7 +186,7 @@ Common files used by the different Virtual Machine Manager interfaces.
 %define _disable_unsupported_rhel --disable-unsupported-rhel-options
 %endif
 
-%if 0%{?default_graphics}
+%if %{default_graphics}
 %define _default_graphics --with-default-graphics=%{default_graphics}
 %endif
 
@@ -280,6 +281,10 @@ update-desktop-database -q %{_datadir}/applications
 %endif
 
 %changelog
+* Wed Jun 06 2012 Cole Robinson <crobinso at redhat.com> - 0.9.1-4
+- Fix connecting to console with specific listen address
+- Fix regression that dropped spice dependency (bz 819270)
+
 * Wed Apr 25 2012 Cole Robinson <crobinso at redhat.com> - 0.9.1-3
 - Actually make spice the default (bz 757874)
 - Only depend on spice on arch it is available (bz 811030)


More information about the scm-commits mailing list