From 30807dc1baa5d2e823cf376f92fce060bf5c4ce6 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sep 27 2011 18:14:41 +0000 Subject: Fix 'Resize to VM' graphical option (bz 738806) Fix deleting guest with managed save data Fix error when adding default storage Don't flush XML cache on every tick Use labels for non-editable network info fields (bz 738751) Properly update icon cache (bz 733836) --- diff --git a/virt-manager-cache-xml-fix.patch b/virt-manager-cache-xml-fix.patch new file mode 100644 index 0000000..b96e1f0 --- /dev/null +++ b/virt-manager-cache-xml-fix.patch @@ -0,0 +1,25 @@ +commit 9dc799af9c3d4fab926ee41685d68642c95593fe +Author: Cole Robinson +Date: Tue Aug 23 15:47:31 2011 -0400 + + domain: Don't fetch XML on tick to get vcpu count + + It's available in the domain info structure. Saves us from hammering + xenstored and just plain doing to much work on every tick. + +diff --git a/src/virtManager/domain.py b/src/virtManager/domain.py +index bccf75f..2e4ad4f 100644 +--- a/src/virtManager/domain.py ++++ b/src/virtManager/domain.py +@@ -1152,10 +1152,10 @@ class vmmDomain(vmmLibvirtObject): + + if not (info[0] in [libvirt.VIR_DOMAIN_SHUTOFF, + libvirt.VIR_DOMAIN_CRASHED]): ++ guestcpus = info[3] + cpuTime = info[4] - prevCpuTime + cpuTimeAbs = info[4] + hostcpus = self.conn.host_active_processor_count() +- guestcpus = self.vcpu_count() + + pcentbase = (((cpuTime) * 100.0) / + ((now - prevTimestamp) * 1000.0 * 1000.0 * 1000.0)) diff --git a/virt-manager-default-storage-error.patch b/virt-manager-default-storage-error.patch new file mode 100644 index 0000000..33a5363 --- /dev/null +++ b/virt-manager-default-storage-error.patch @@ -0,0 +1,30 @@ +commit 9a46aa41e092e73ed1596c361acbca65ac3cbe95 +Author: Cole Robinson +Date: Tue Aug 30 14:29:08 2011 -0400 + + util: get_default_path: Handle 'None' in collidelist + +diff --git a/src/virtManager/util.py b/src/virtManager/util.py +index d351cb3..0cba349 100644 +--- a/src/virtManager/util.py ++++ b/src/virtManager/util.py +@@ -126,14 +126,14 @@ def get_default_path(conn, name, collidelist=None): + target, ignore, suffix = get_ideal_path_info(conn, name) + + # Sanitize collidelist to work with the collision checker +- for c in collidelist[:]: +- collidelist.remove(c) +- if os.path.dirname(c) == pool.get_target_path(): +- collidelist.append(os.path.basename(c)) ++ newcollidelist = [] ++ for c in collidelist: ++ if c and os.path.dirname(c) == pool.get_target_path(): ++ newcollidelist.append(os.path.basename(c)) + + path = virtinst.Storage.StorageVolume.find_free_name(name, + pool_object=pool.pool, suffix=suffix, +- collidelist=collidelist) ++ collidelist=newcollidelist) + + path = os.path.join(target, path) + diff --git a/virt-manager-fix-resize-to-vm.patch b/virt-manager-fix-resize-to-vm.patch new file mode 100644 index 0000000..91b56a3 --- /dev/null +++ b/virt-manager-fix-resize-to-vm.patch @@ -0,0 +1,38 @@ +commit a815fa17a7c643ddde8ea326399e2bee449dff98 +Author: Marc Deslauriers +Date: Fri Aug 19 11:50:11 2011 -0400 + + virt-manager: Fix "Resize to VM" menu option + + Hello, + + This patch fixes the "Resize to VM" menu option by correcting inverted return + values in autodrawer.py. + + Thanks, + + Marc. + + commit 8e666f4b87926c866ed35e58eb82213d2c514e89 + Author: Marc Deslauriers + Date: Fri Aug 19 11:46:48 2011 -0400 + + Fix inverted width and height + +diff --git a/src/virtManager/autodrawer.py b/src/virtManager/autodrawer.py +index a0ddec6..9682aa9 100644 +--- a/src/virtManager/autodrawer.py ++++ b/src/virtManager/autodrawer.py +@@ -271,10 +271,10 @@ class OverBox(parentclass): + self.underWin = None + + def do_size_request(self, req): +- height, width = self._size_request() ++ width, height = self._size_request() + +- req.height = height + req.width = width ++ req.height = height + + def do_size_allocate(self, newalloc): + self.allocation = newalloc diff --git a/virt-manager-host-net-labels.patch b/virt-manager-host-net-labels.patch new file mode 100644 index 0000000..64781a8 --- /dev/null +++ b/virt-manager-host-net-labels.patch @@ -0,0 +1,285 @@ +commit 3d3ac635e1ba33e13961c0d9663f23a2387fa3c4 +Author: Cole Robinson +Date: Thu Sep 22 10:43:55 2011 -0400 + + host: Don't use text entries for fields that aren't editable + + Also make some interface labels selectable. + +diff --git a/src/vmm-host.glade b/src/vmm-host.glade +index 2a6fde6..532d7c6 100644 +--- a/src/vmm-host.glade ++++ b/src/vmm-host.glade +@@ -511,8 +511,8 @@ + 6 + 4 + 2 +- 3 +- 3 ++ 6 ++ 5 + + + True +@@ -525,19 +525,6 @@ + + + +- +- True +- True +- False +- +- +- +- 1 +- 2 +- +- +- +- + + True + 0 +@@ -551,21 +538,6 @@ + + + +- +- True +- True +- False +- +- +- +- 1 +- 2 +- 1 +- 2 +- +- +- +- + + True + 0 +@@ -646,6 +618,32 @@ + + + ++ ++ ++ True ++ 0 ++ label ++ True ++ ++ ++ 1 ++ 2 ++ ++ ++ ++ ++ True ++ 0 ++ label ++ True ++ ++ ++ 1 ++ 2 ++ 1 ++ 2 ++ ++ + + + +@@ -676,8 +674,8 @@ + 6 + 4 + 2 +- 3 +- 3 ++ 6 ++ 5 + + + True +@@ -716,49 +714,6 @@ + + + +- +- True +- True +- False +- +- +- +- 1 +- 2 +- +- +- +- +- +- True +- True +- False +- +- +- +- 1 +- 2 +- 1 +- 2 +- +- +- +- +- +- True +- True +- False +- +- +- +- 1 +- 2 +- 2 +- 3 +- +- +- +- + + True + 0 +@@ -808,6 +763,49 @@ + GTK_FILL + + ++ ++ ++ True ++ 0 ++ label ++ True ++ ++ ++ 1 ++ 2 ++ GTK_FILL ++ ++ ++ ++ ++ True ++ 0 ++ label ++ True ++ ++ ++ 1 ++ 2 ++ 1 ++ 2 ++ GTK_FILL ++ ++ ++ ++ ++ True ++ 0 ++ label ++ True ++ ++ ++ 1 ++ 2 ++ 2 ++ 3 ++ GTK_FILL ++ ++ + + + +@@ -1070,7 +1068,7 @@ + 5 + 2 + 8 +- 3 ++ 5 + + + True +@@ -1140,21 +1138,6 @@ + + + +- +- True +- True +- False +- +- +- +- 1 +- 2 +- 2 +- 3 +- +- +- +- + + True + 0 +@@ -1237,6 +1220,20 @@ + + + ++ ++ ++ True ++ 0 ++ label ++ True ++ ++ ++ 1 ++ 2 ++ 2 ++ 3 ++ ++ + + + False +@@ -1611,6 +1608,7 @@ + 0 + 0 + insert mac ++ True + + + 1 +@@ -1792,6 +1790,7 @@ + True + 0 + label ++ True + + + 1 +@@ -1869,6 +1868,7 @@ + 0 + 0 + label ++ True + + + 1 diff --git a/virt-manager-managed-save-delete.patch b/virt-manager-managed-save-delete.patch new file mode 100644 index 0000000..c577d6a --- /dev/null +++ b/virt-manager-managed-save-delete.patch @@ -0,0 +1,43 @@ +commit db21a2a8331c8518f27b136d0013a56cf84df7e6 +Author: Cole Robinson +Date: Mon Aug 29 14:01:40 2011 -0400 + + delete: Properly raise 'undefine' errors + +diff --git a/src/virtManager/delete.py b/src/virtManager/delete.py +index 79d267e..22f3b23 100644 +--- a/src/virtManager/delete.py ++++ b/src/virtManager/delete.py +@@ -183,7 +183,7 @@ class vmmDeleteDialog(vmmGObjectUI): + for errinfo in storage_errors: + storage_errstr += "%s\n%s\n" % (errinfo[0], errinfo[1]) + +- if not storage_errstr: ++ if not storage_errstr and not details: + return + + # We had extra storage errors. If there was another error message, +commit b36ec4b8c2ec7ed72404db7f71cadfaecfea719e +Author: Cole Robinson +Date: Mon Aug 29 14:03:50 2011 -0400 + + domain: Remove managed save state before delete + + Newer libvirt forbids 'undefine' in this case + +diff --git a/src/virtManager/domain.py b/src/virtManager/domain.py +index 2e4ad4f..679dfc4 100644 +--- a/src/virtManager/domain.py ++++ b/src/virtManager/domain.py +@@ -1055,6 +1055,11 @@ class vmmDomain(vmmLibvirtObject): + self.force_update_status() + + def delete(self): ++ if self.hasSavedImage(): ++ try: ++ self._backend.managedSaveRemove(0) ++ except: ++ logging.exception("Failed to remove managed save state") + self._backend.undefine() + + def resume(self): diff --git a/virt-manager.spec b/virt-manager.spec index 442576c..402a9b4 100644 --- a/virt-manager.spec +++ b/virt-manager.spec @@ -2,7 +2,7 @@ %define _package virt-manager %define _version 0.9.0 -%define _release 5 +%define _release 6 %define virtinst_version 0.600.0 %define qemu_user "qemu" @@ -36,6 +36,16 @@ URL: http://virt-manager.org/ Source0: http://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.gz # Fix typo that broke net stats reporting Patch1: %{name}-fix-net-stats.patch +# Fix 'Resize to VM' graphical option (bz 738806) +Patch2: %{name}-fix-resize-to-vm.patch +# Fix deleting guest with managed save data +Patch3: %{name}-managed-save-delete.patch +# Fix error when adding default storage +Patch4: %{name}-default-storage-error.patch +# Don't flush XML cache on every tick +Patch5: %{name}-cache-xml-fix.patch +# Use labels for non-editable network info fields (bz 738751) +Patch6: %{name}-host-net-labels.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -100,6 +110,10 @@ 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 machines for KVM, Xen, and QEmu. Start, stop, add or remove virtual devices, @@ -141,6 +155,11 @@ Common files used by the different Virtual Machine Manager interfaces. %prep %setup -q %patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 %build %if %{qemu_user} @@ -163,7 +182,7 @@ Common files used by the different Virtual Machine Manager interfaces. %define _disable_unsupported_rhel --disable-unsupported-rhel-options %endif -%if %{default_graphics} +%if %{?default_graphics} %define _default_graphics --with-default-graphics=%{default_graphics} %endif @@ -178,7 +197,7 @@ Common files used by the different Virtual Machine Manager interfaces. %{?_kvm_packages} \ %{?_libvirt_packages} \ %{?_preferred_distros} \ - %{?_enable_unsupported_rhel} \ + %{?_disable_unsupported_rhel} \ %{?_default_graphics} make %{?_smp_mflags} @@ -195,15 +214,22 @@ rm -rf $RPM_BUILD_ROOT %gconf_schema_prepare %{name} %post +/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : update-desktop-database -q %{_datadir}/applications %gconf_schema_upgrade %{name} %postun +if [ $1 -eq 0 ] ; then + /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null + /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : +fi update-desktop-database -q %{_datadir}/applications %preun %gconf_schema_remove %{name} +%posttrans +/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %if %{with_tui} %files @@ -251,6 +277,14 @@ update-desktop-database -q %{_datadir}/applications %endif %changelog +* Tue Sep 27 2011 Cole Robinson - 0.9.0-6 +- Fix 'Resize to VM' graphical option (bz 738806) +- Fix deleting guest with managed save data +- Fix error when adding default storage +- Don't flush XML cache on every tick +- Use labels for non-editable network info fields (bz 738751) +- Properly update icon cache (bz 733836) + * Tue Aug 02 2011 Cole Robinson - 0.9.0-5 - Fix python-newt_syrup dep