From 4d8e186c7509b346b93d3f62fb5531fbbecab242 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 24 Oct 2012 08:41:13 -0400 Subject: [PATCH] Fix KVM package install on app first run Fix listing domain with 'suspended' state (bz #850954) Fix 'browse local' behavior when choosing directory (bz #855335) Fix libgnome-keyring dep (bz #811921) --- ...x-KVM_PACKAGES-substitution-variable.patch | 44 +++++++++++++ 0002-domain-Handle-PMSUSPENDED-status.patch | 54 ++++++++++++++++ ..._local-Fix-choosing-directory-of-F17.patch | 61 +++++++++++++++++++ virt-manager.spec | 19 +++++- 4 files changed, 176 insertions(+), 2 deletions(-) create mode 100644 0001-virt-manager-Fix-KVM_PACKAGES-substitution-variable.patch create mode 100644 0002-domain-Handle-PMSUSPENDED-status.patch create mode 100644 0003-browse_local-Fix-choosing-directory-of-F17.patch diff --git a/0001-virt-manager-Fix-KVM_PACKAGES-substitution-variable.patch b/0001-virt-manager-Fix-KVM_PACKAGES-substitution-variable.patch new file mode 100644 index 0000000..f7374e5 --- /dev/null +++ b/0001-virt-manager-Fix-KVM_PACKAGES-substitution-variable.patch @@ -0,0 +1,44 @@ +From 6f95a37c1dd600f05b6678d1c142d38050eddf73 Mon Sep 17 00:00:00 2001 +Message-Id: <6f95a37c1dd600f05b6678d1c142d38050eddf73.1351081950.git.crobinso@redhat.com> +From: Marc Deslauriers +Date: Wed, 22 Aug 2012 13:25:25 -0400 +Subject: [PATCH 1/3] virt-manager: Fix KVM_PACKAGES substitution variable + +Hello, + +Commit 68e78244e851f1f3829f711249d1f375103a2a4d changed the HV_PACKAGES +variable to KVM_PACKAGES in src/virt-manager.py.in, but the +corresponding change was never made to src/Makefile.am. + +Here is a patch to correct the issue. + +Thanks, + +Marc. + +commit 93ba787355736733c189e6809b9108a70f0e02d4 +Author: Marc Deslauriers +Date: Wed Aug 22 13:21:48 2012 -0400 + + Fix incorrect substitution variable +(cherry picked from commit 2f2ba0acc0a3a3c1a45cd581495f185983f87772) +--- + src/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index e51d7b2..3f4ee8f 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -65,7 +65,7 @@ endif + -e "s,::DEFAULT_QEMU_USER::,$(DEFAULT_QEMU_USER)," \ + -e "s,::ENABLE_UNSUPPORTED_RHEL_OPTS::,$(ENABLE_UNSUPPORTED_RHEL_OPTS)," \ + -e "s|::PREFERRED_DISTROS::|$(PREFERRED_DISTROS)|" \ +- -e "s|::HV_PACKAGES::|$(KVM_PACKAGES)|" \ ++ -e "s|::KVM_PACKAGES::|$(KVM_PACKAGES)|" \ + -e "s|::ASKPASS_PACKAGE::|$(ASKPASS_PACKAGE)|" \ + -e "s|::LIBVIRT_PACKAGES::|$(LIBVIRT_PACKAGES)|" \ + < $< > $@ +-- +1.7.11.7 + diff --git a/0002-domain-Handle-PMSUSPENDED-status.patch b/0002-domain-Handle-PMSUSPENDED-status.patch new file mode 100644 index 0000000..d9c6ad3 --- /dev/null +++ b/0002-domain-Handle-PMSUSPENDED-status.patch @@ -0,0 +1,54 @@ +From 04ba35a12bc5065bfa6f8b3257abf1578707ac56 Mon Sep 17 00:00:00 2001 +Message-Id: <04ba35a12bc5065bfa6f8b3257abf1578707ac56.1351081950.git.crobinso@redhat.com> +In-Reply-To: <6f95a37c1dd600f05b6678d1c142d38050eddf73.1351081950.git.crobinso@redhat.com> +References: <6f95a37c1dd600f05b6678d1c142d38050eddf73.1351081950.git.crobinso@redhat.com> +From: Cole Robinson +Date: Sun, 14 Oct 2012 00:00:38 -0400 +Subject: [PATCH 2/3] domain: Handle PMSUSPENDED status + +And add a catchall + +https://bugzilla.redhat.com/show_bug.cgi?id=850954 +(cherry picked from commit 63ba65d374d0cb46d02093d96580f5b53b947005) +--- + src/virtManager/domain.py | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +diff --git a/src/virtManager/domain.py b/src/virtManager/domain.py +index 82680b8..d536f77 100644 +--- a/src/virtManager/domain.py ++++ b/src/virtManager/domain.py +@@ -1371,19 +1371,25 @@ class vmmDomain(vmmLibvirtObject): + self.vcpu_max_count() + + def run_status(self): +- if self.status() == libvirt.VIR_DOMAIN_RUNNING: ++ status = self.status() ++ ++ if status == libvirt.VIR_DOMAIN_RUNNING: + return _("Running") +- elif self.status() == libvirt.VIR_DOMAIN_PAUSED: ++ elif status == libvirt.VIR_DOMAIN_PAUSED: + return _("Paused") +- elif self.status() == libvirt.VIR_DOMAIN_SHUTDOWN: ++ elif status == libvirt.VIR_DOMAIN_SHUTDOWN: + return _("Shutting Down") +- elif self.status() == libvirt.VIR_DOMAIN_SHUTOFF: ++ elif status == libvirt.VIR_DOMAIN_SHUTOFF: + if self.hasSavedImage(): + return _("Saved") + else: + return _("Shutoff") +- elif self.status() == libvirt.VIR_DOMAIN_CRASHED: ++ elif status == libvirt.VIR_DOMAIN_CRASHED: + return _("Crashed") ++ elif (hasattr(libvirt, "VIR_DOMAIN_PMSUSPENDED") and ++ status == libvirt.VIR_DOMAIN_PMSUSPENDED): ++ return _("Suspended") ++ return _("Unknown") + + def _normalize_status(self, status): + if status == libvirt.VIR_DOMAIN_NOSTATE: +-- +1.7.11.7 + diff --git a/0003-browse_local-Fix-choosing-directory-of-F17.patch b/0003-browse_local-Fix-choosing-directory-of-F17.patch new file mode 100644 index 0000000..3770c67 --- /dev/null +++ b/0003-browse_local-Fix-choosing-directory-of-F17.patch @@ -0,0 +1,61 @@ +From 7eab29ff1d2fb9d26db3102b7ffd6e3dcde640af Mon Sep 17 00:00:00 2001 +Message-Id: <7eab29ff1d2fb9d26db3102b7ffd6e3dcde640af.1351081950.git.crobinso@redhat.com> +In-Reply-To: <6f95a37c1dd600f05b6678d1c142d38050eddf73.1351081950.git.crobinso@redhat.com> +References: <6f95a37c1dd600f05b6678d1c142d38050eddf73.1351081950.git.crobinso@redhat.com> +From: Cole Robinson +Date: Sun, 14 Oct 2012 00:15:04 -0400 +Subject: [PATCH 3/3] browse_local: Fix choosing directory of F17 + +Seems hiding the dialog before retrieving the directory path stopped +working. Remove the needlessness anyways + +https://bugzilla.redhat.com/show_bug.cgi?id=849450 +(cherry picked from commit 71e5ac2a0a8578f466c74d5100943d44815ab8bd) +--- + src/virtManager/util.py | 23 +++++++++-------------- + 1 file changed, 9 insertions(+), 14 deletions(-) + +diff --git a/src/virtManager/util.py b/src/virtManager/util.py +index 6b8a953..b75541c 100644 +--- a/src/virtManager/util.py ++++ b/src/virtManager/util.py +@@ -208,11 +208,11 @@ def browse_local(parent, dialog_name, conn, start_folder=None, + if choose_button is None: + choose_button = gtk.STOCK_OPEN + +- fcdialog = gtk.FileChooserDialog(dialog_name, parent, +- dialog_type, +- (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, +- choose_button, gtk.RESPONSE_ACCEPT), +- None) ++ fcdialog = gtk.FileChooserDialog(title=dialog_name, ++ parent=parent, ++ action=dialog_type, ++ buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, ++ choose_button, gtk.RESPONSE_ACCEPT)) + fcdialog.set_default_response(gtk.RESPONSE_ACCEPT) + + # If confirm is set, warn about a file overwrite +@@ -245,15 +245,10 @@ def browse_local(parent, dialog_name, conn, start_folder=None, + fcdialog.set_current_folder(start_folder) + + # Run the dialog and parse the response +- response = fcdialog.run() +- fcdialog.hide() +- if (response == gtk.RESPONSE_ACCEPT): +- filename = fcdialog.get_filename() +- fcdialog.destroy() +- ret = filename +- else: +- fcdialog.destroy() +- ret = None ++ ret = None ++ if fcdialog.run() == gtk.RESPONSE_ACCEPT: ++ ret = fcdialog.get_filename() ++ fcdialog.destroy() + + # Store the chosen directory in gconf if necessary + if ret and browse_reason and not ret.startswith("/dev"): +-- +1.7.11.7 + diff --git a/virt-manager.spec b/virt-manager.spec index 1d968c4..b098708 100644 --- a/virt-manager.spec +++ b/virt-manager.spec @@ -2,7 +2,7 @@ %define _package virt-manager %define _version 0.9.4 -%define _release 1 +%define _release 2 %define virtinst_version 0.600.3 %define qemu_user "qemu" @@ -41,6 +41,12 @@ Group: Applications/Emulators License: GPLv2+ URL: http://virt-manager.org/ Source0: http://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.gz +# Fix KVM package install on app first run +Patch1: 0001-virt-manager-Fix-KVM_PACKAGES-substitution-variable.patch +# Fix listing domain with 'suspended' state (bz #850954) +Patch2: 0002-domain-Handle-PMSUSPENDED-status.patch +# Fix 'browse local' behavior when choosing directory (bz #855335) +Patch3: 0003-browse_local-Fix-choosing-directory-of-F17.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -53,7 +59,7 @@ Requires: libvirt-python >= 0.7.0 # Definitely does not work with earlier due to python API changes Requires: dbus-python >= 0.61 Requires: dbus-x11 -%if !0%{?rhel} || 0%{?rhel} > 6 +%if 0%{?rhel} > 6 # Might work with earlier, but this is what we've tested Requires: gnome-keyring >= 0.4.9 %else @@ -139,6 +145,9 @@ Common files used by the different Virtual Machine Manager interfaces. %prep %setup -q +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build %if %{qemu_user} @@ -261,6 +270,12 @@ update-desktop-database -q %{_datadir}/applications %endif %changelog +* Wed Oct 24 2012 Cole Robinson - 0.9.4-2 +- Fix KVM package install on app first run +- Fix listing domain with 'suspended' state (bz #850954) +- Fix 'browse local' behavior when choosing directory (bz #855335) +- Fix libgnome-keyring dep (bz #811921) + * Sun Jul 29 2012 Cole Robinson - 0.9.4-1 - Rebased to version 0.9.4 - Fix VNC keygrab issues (bz 840240)