[virt-manager] Fix using spice as default graphics type Fix lockup as non-root (bz 692570)

Cole Robinson crobinso at fedoraproject.org
Thu Mar 31 16:06:02 UTC 2011


commit 0adbf0380ca42ef891b2652ce4484467dceb4c46
Author: Cole Robinson <crobinso at redhat.com>
Date:   Thu Mar 31 12:07:05 2011 -0400

    Fix using spice as default graphics type
    Fix lockup as non-root (bz 692570)

 virt-manager-fix-config-options.patch |   35 +++++++++++++++
 virt-manager-gconf-after-fork.patch   |   38 ++++++++++++++++
 virt-manager.spec                     |   77 ++++++++++++++++++++++++++++-----
 3 files changed, 139 insertions(+), 11 deletions(-)
---
diff --git a/virt-manager-fix-config-options.patch b/virt-manager-fix-config-options.patch
new file mode 100644
index 0000000..b045ab7
--- /dev/null
+++ b/virt-manager-fix-config-options.patch
@@ -0,0 +1,35 @@
+--- virt-manager-0.8.7/configure	2011-03-24 16:41:26.000000000 -0400
++++ /home/crobinso/sandbox/upstream/virt-manager/virt-manager.git/configure	2011-03-29 09:27:40.115612001 -0400
+@@ -718,7 +718,7 @@ with_libvirt_package_names
+ with_kvm_packages
+ enable_unsupported_rhel_options
+ with_preferred_distros
+-with___with_default_graphics
++with_default_graphics
+ '
+       ac_precious_vars='build_alias
+ host_alias
+@@ -6521,7 +6521,9 @@ fi
+ 
+ # Check whether --enable-unsupported-rhel-options was given.
+ if test "${enable_unsupported_rhel_options+set}" = set; then :
+-  enableval=$enable_unsupported_rhel_options; test "x$enableval" == "xno" && ENABLE_UNSUPPORTED_RHEL_OPTS=0
++  enableval=$enable_unsupported_rhel_options; test "x$enableval" == "xno" && \
++   ENABLE_UNSUPPORTED_RHEL_OPTS=0 ||
++   ENABLE_UNSUPPORTED_RHEL_OPTS=1
+ else
+   ENABLE_UNSUPPORTED_RHEL_OPTS=1
+ fi
+@@ -6537,9 +6539,9 @@ fi
+ 
+ 
+ 
+-# Check whether --with---with-default-graphics was given.
+-if test "${with___with_default_graphics+set}" = set; then :
+-  withval=$with___with_default_graphics; DEFAULT_GRAPHICS=$withval
++# Check whether --with-default-graphics was given.
++if test "${with_default_graphics+set}" = set; then :
++  withval=$with_default_graphics; DEFAULT_GRAPHICS=$withval
+ else
+   DEFAULT_GRAPHICS="vnc"
+ fi
diff --git a/virt-manager-gconf-after-fork.patch b/virt-manager-gconf-after-fork.patch
new file mode 100644
index 0000000..984875e
--- /dev/null
+++ b/virt-manager-gconf-after-fork.patch
@@ -0,0 +1,38 @@
+diff -rup virt-manager-0.8.7/src/virt-manager.py.in foobar/src/virt-manager.py.in
+--- virt-manager-0.8.7/src/virt-manager.py.in	2011-03-24 16:39:28.000000000 -0400
++++ foobar/src/virt-manager.py.in	2011-03-31 11:34:02.389991998 -0400
+@@ -393,9 +393,16 @@ def main():
+     dbus.glib.threads_init()
+     import dbus.service
+ 
+-    # Specifically init config/gconf before the fork, so that pam
+-    # doesn't think we closed the app, therefor robbing us of
+-    # display access
++    # Now we've got basic environment up & running we can fork
++    if not options.nofork and not options.debug:
++        drop_tty()
++        drop_stdio()
++
++        # Ignore SIGHUP, otherwise a serial console closing drops the whole app
++        signal.signal(signal.SIGHUP, signal.SIG_IGN)
++
++    # Initing gconf before forking makes the app lockup on f15/rawhide...
++    # https://bugzilla.redhat.com/show_bug.cgi?id=692570
+     import virtManager.config
+     config = virtManager.config.vmmConfig(appname, appversion,
+                                           gconf_dir, glade_dir,
+@@ -408,14 +415,6 @@ def main():
+     config.hv_packages = hv_packages
+     config.libvirt_packages = libvirt_packages
+ 
+-    # Now we've got basic environment up & running we can fork
+-    if not options.nofork and not options.debug:
+-        drop_tty()
+-        drop_stdio()
+-
+-        # Ignore SIGHUP, otherwise a serial console closing drops the whole app
+-        signal.signal(signal.SIGHUP, signal.SIG_IGN)
+-
+     from virtManager.engine import vmmEngine
+ 
+     gtk.window_set_default_icon_from_file(icon_dir + "/" +
diff --git a/virt-manager.spec b/virt-manager.spec
index 05329ed..8c1ed4e 100644
--- a/virt-manager.spec
+++ b/virt-manager.spec
@@ -1,20 +1,40 @@
 # -*- rpm-spec -*-
 
+%define _package virt-manager
+%define _version 0.8.7
+%define _release 2
+%define virtinst_version 0.500.6
+
+%define qemu_user                  "qemu"
+%define preferred_distros          "fedora,rhel"
+%define kvm_packages               "qemu-system-x86"
+%define libvirt_packages           "libvirt"
+%define disable_unsupported_rhel   0
+%define default_graphics           "spice"
+
+%define with_spice                 1
+
+# End local config
+
 # This macro is used for the continuous automated builds. It just
 # allows an extra fragment based on the timestamp to be appended
 # to the release. This distinguishes automated builds, from formal
 # Fedora RPM builds
 %define _extra_release %{?dist:%{dist}}%{!?dist:%{?extra_release:%{extra_release}}}
 
-Name: virt-manager
-Version: 0.8.7
-Release: 1%{_extra_release}
+Name: %{_package}
+Version: %{_version}
+Release: %{_release}%{_extra_release}
 Summary: Virtual Machine Manager
 
 Group: Applications/Emulators
 License: GPLv2+
 URL: http://virt-manager.org/
 Source0: http://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.gz
+# Fix using spice as default graphics type
+Patch1: %{name}-fix-config-options.patch
+# Fix lockup as non-root (bz 692570)
+Patch2: %{name}-gconf-after-fork.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch: noarch
 
@@ -37,7 +57,7 @@ Requires: gnome-python2-gnomekeyring >= 2.15.4
 # Minimum we've tested with
 Requires: libxml2-python >= 2.6.23
 # Absolutely require this version or later
-Requires: python-virtinst >= 0.500.6
+Requires: python-virtinst >= %{virtinst_version}
 # Required for loading the glade UI
 Requires: pygtk2-libglade
 # Required for our graphics which are currently SVG format
@@ -56,8 +76,9 @@ Requires: PolicyKit-authentication-agent
 %if 0%{?fedora} >= 9 && 0%{?fedora} < 11
 Requires: PolicyKit-gnome
 %endif
-# For spice widget
-Requires: spice-gtk-python
+%if %{with_spice}
+Requires: spice-gtk
+%endif
 
 BuildRequires: gettext
 BuildRequires: scrollkeeper
@@ -78,15 +99,45 @@ management API.
 
 %prep
 %setup -q
+%patch1 -p1
+%patch2 -p1
 
 %build
-%configure --without-tui \
-           --with-qemu-user=qemu \
-           --with-preferred-distros=fedora15 \
-           --with-libvirt-package-names=libvirt \
-           --with-kvm-packages=qemu-system-x86
+%if %{qemu_user}
+%define _qemu_user --with-qemu_user=%{qemu_user}
+%endif
+
+%if %{kvm_packages}
+%define _kvm_packages --with-kvm-packages=%{kvm_packages}
+%endif
+
+%if %{preferred_distros}
+%define _preferred_distros --with-preferred-distros=%{preferred_distros}
+%endif
+
+%if %{libvirt_packages}
+%define _libvirt_packages --with-libvirt-package-names=%{libvirt_packages}
+%endif
+
+%if %{disable_unsupported_rhel}
+%define _disable_unsupported_rhel --disable-unsupported-rhel-options
+%endif
+
+%if %{default_graphics}
+%define _default_graphics --with-default-graphics=%{default_graphics}
+%endif
+
+
+%configure  --without-tui \
+            %{?_qemu_user} \
+            %{?_kvm_packages} \
+            %{?_libvirt_packages} \
+            %{?_preferred_distros} \
+            %{?_enable_unsupported_rhel} \
+            %{?_default_graphics}
 make %{?_smp_mflags}
 
+
 %install
 rm -rf $RPM_BUILD_ROOT
 make install  DESTDIR=$RPM_BUILD_ROOT
@@ -158,6 +209,10 @@ fi
 %{_datadir}/dbus-1/services/%{name}.service
 
 %changelog
+* Thu Mar 31 2011 Cole Robinson <crobinso at redhat.com> - 0.8.7-2.fc16
+- Fix using spice as default graphics type
+- Fix lockup as non-root (bz 692570)
+
 * Mon Mar 28 2011 Cole Robinson <crobinso at redhat.com> - 0.8.7-1.fc16
 - Rebased to version 0.8.7
 - Allow renaming an offline VM


More information about the scm-commits mailing list