From 90230fbec6438766e9cbfd7b362052d4c9cb5f5b Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 28 Feb 2014 13:10:20 -0500 Subject: [PATCH] Fix creating storage paths if directory is all digits (bz #1069351) Properly close connection if tick fails (bz #1069351) virt-manager: Handle unrefreshed storage pools (bz #1070883) Fix unsetting 'auto resize' console property --- ...erate-target-only-if-not-customizing.patch | 44 ++++++++++++ ...ect-names-that-are-only-all-numbers-.patch | 29 ++++++++ ...ng-connection-when-tick-fails-bz-106.patch | 69 +++++++++++++++++++ ...andle-missing-storage-volumes-bz-107.patch | 39 +++++++++++ ...etting-resize-guest-property-from-UI.patch | 25 +++++++ virt-manager.spec | 30 +++++++- 6 files changed, 233 insertions(+), 3 deletions(-) create mode 100644 0005-addhardware-generate-target-only-if-not-customizing.patch create mode 100644 0006-Don-t-forbid-object-names-that-are-only-all-numbers-.patch create mode 100644 0007-engine-Fix-closing-connection-when-tick-fails-bz-106.patch create mode 100644 0008-vmm-connection-Handle-missing-storage-volumes-bz-107.patch create mode 100644 0009-console-Fix-unsetting-resize-guest-property-from-UI.patch diff --git a/0005-addhardware-generate-target-only-if-not-customizing.patch b/0005-addhardware-generate-target-only-if-not-customizing.patch new file mode 100644 index 0000000..b64118d --- /dev/null +++ b/0005-addhardware-generate-target-only-if-not-customizing.patch @@ -0,0 +1,44 @@ +From c7312ce1f5f13d77daf922924cef2f4f7b550e42 Mon Sep 17 00:00:00 2001 +From: Martin Kletzander +Date: Tue, 18 Feb 2014 11:38:56 +0100 +Subject: [PATCH] addhardware: generate target only if not customizing + +Commit 078e1a4d0503d98884b5b61df83021941bf32e8d changed the fact that +disk target was generated only when adding new disk, not when current +disk is being customized, so fix that back. + +Signed-off-by: Martin Kletzander +(cherry picked from commit bc5d84b0407257b1e257e7cabaf619430a7e8f83) +--- + virtManager/addhardware.py | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py +index ecb5fc8..b1f6251 100644 +--- a/virtManager/addhardware.py ++++ b/virtManager/addhardware.py +@@ -1471,20 +1471,22 @@ class vmmAddHardware(vmmGObjectUI): + return disk + + try: ++ used = [] + disk.bus = bus + if cache: + disk.driver_cache = cache + + # Generate target + if not self.is_customize_dialog: +- used = [] + disks = (self.vm.get_disk_devices() + + self.vm.get_disk_devices(inactive=True)) + for d in disks: + used.append(d.target) + + prefer_ctrl = self._set_disk_controller(disk, controller_model, disks) +- disk.generate_target(used, prefer_ctrl) ++ ++ if not self.is_customize_dialog: ++ disk.generate_target(used, prefer_ctrl) + + except Exception, e: + return self.err.val_err(_("Storage parameter error."), e) diff --git a/0006-Don-t-forbid-object-names-that-are-only-all-numbers-.patch b/0006-Don-t-forbid-object-names-that-are-only-all-numbers-.patch new file mode 100644 index 0000000..54a9ee1 --- /dev/null +++ b/0006-Don-t-forbid-object-names-that-are-only-all-numbers-.patch @@ -0,0 +1,29 @@ +From f6756e8367757301d095dc35fbe477f234ba20d1 Mon Sep 17 00:00:00 2001 +From: Cole Robinson +Date: Tue, 25 Feb 2014 14:54:06 -0500 +Subject: [PATCH] Don't forbid object names that are only all numbers (bz + 1067127) + +Just let libvirt error, since in the case of things like storage pools +this is totally legitimate. + +(cherry picked from commit 3efbefe91a1ec23cbcf3d4f5a72a02fab87daa83) +--- + virtinst/util.py | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/virtinst/util.py b/virtinst/util.py +index 31ccd38..2fe00d3 100644 +--- a/virtinst/util.py ++++ b/virtinst/util.py +@@ -140,10 +140,6 @@ def validate_uuid(val): + + + def validate_name(name_type, val): +- if re.match("^[0-9]+$", val): +- raise ValueError(_("%s name can not be only numeric characters") % +- name_type) +- + # Rather than try and match libvirt's regex, just forbid things we + # know don't work + forbid = [" "] diff --git a/0007-engine-Fix-closing-connection-when-tick-fails-bz-106.patch b/0007-engine-Fix-closing-connection-when-tick-fails-bz-106.patch new file mode 100644 index 0000000..18d5c56 --- /dev/null +++ b/0007-engine-Fix-closing-connection-when-tick-fails-bz-106.patch @@ -0,0 +1,69 @@ +From 74e0b06cb64009b5253e8ed54b1e56f1343cb85c Mon Sep 17 00:00:00 2001 +From: Cole Robinson +Date: Tue, 25 Feb 2014 15:17:34 -0500 +Subject: [PATCH] engine: Fix closing connection when tick() fails (bz 1069351) + +(cherry picked from commit ce64d037bff56db994fedd065a9a34b8e827dda2) +--- + virtManager/engine.py | 39 ++++++++++++++++++++++++--------------- + 1 file changed, 24 insertions(+), 15 deletions(-) + +diff --git a/virtManager/engine.py b/virtManager/engine.py +index cef3d20..0e5e15d 100644 +--- a/virtManager/engine.py ++++ b/virtManager/engine.py +@@ -344,30 +344,39 @@ class vmmEngine(vmmGObject): + return 1 + + def _tick_single_conn(self, conn, kwargs): ++ e = None + try: + conn.tick(**kwargs) + except KeyboardInterrupt: + raise +- except libvirt.libvirtError, e: +- from_remote = getattr(libvirt, "VIR_FROM_REMOTE", None) +- from_rpc = getattr(libvirt, "VIR_FROM_RPC", None) +- sys_error = getattr(libvirt, "VIR_ERR_SYSTEM_ERROR", None) ++ except Exception, e: ++ pass ++ ++ if e is None: ++ return + ++ from_remote = getattr(libvirt, "VIR_FROM_REMOTE", None) ++ from_rpc = getattr(libvirt, "VIR_FROM_RPC", None) ++ sys_error = getattr(libvirt, "VIR_ERR_SYSTEM_ERROR", None) ++ ++ dom = -1 ++ code = -1 ++ if isinstance(e, libvirt.libvirtError): + dom = e.get_error_domain() + code = e.get_error_code() + +- if (dom in [from_remote, from_rpc] and +- code in [sys_error]): +- logging.exception("Could not refresh connection %s", +- conn.get_uri()) +- logging.debug("Closing connection since libvirtd " +- "appears to have stopped") +- else: +- error_msg = _("Error polling connection '%s': %s") \ +- % (conn.get_uri(), e) +- self.idle_add(lambda: self.err.show_err(error_msg)) ++ if (dom in [from_remote, from_rpc] and ++ code in [sys_error]): ++ logging.exception("Could not refresh connection %s", ++ conn.get_uri()) ++ logging.debug("Closing connection since libvirtd " ++ "appears to have stopped") ++ else: ++ error_msg = _("Error polling connection '%s': %s") \ ++ % (conn.get_uri(), e) ++ self.idle_add(lambda: self.err.show_err(error_msg)) + +- self.idle_add(conn.close) ++ self.idle_add(conn.close) + + + def increment_window_counter(self, src): diff --git a/0008-vmm-connection-Handle-missing-storage-volumes-bz-107.patch b/0008-vmm-connection-Handle-missing-storage-volumes-bz-107.patch new file mode 100644 index 0000000..9f6896d --- /dev/null +++ b/0008-vmm-connection-Handle-missing-storage-volumes-bz-107.patch @@ -0,0 +1,39 @@ +From 84c1bd12297b366a7187592ca29cc03cb1daf3c5 Mon Sep 17 00:00:00 2001 +From: Cole Robinson +Date: Thu, 27 Feb 2014 13:16:21 -0500 +Subject: [PATCH] vmm connection: Handle missing storage volumes (bz 1070883) + +Similar to what was done in a808bd669293ac66047a716b2e84a5a64c99667b +for the virtinst connection wrapper. + +(cherry picked from commit f67df117017e6de855a8c0e900e47fe920dfaa48) +--- + virtManager/connection.py | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +diff --git a/virtManager/connection.py b/virtManager/connection.py +index 6f6c838..96dfa1c 100644 +--- a/virtManager/connection.py ++++ b/virtManager/connection.py +@@ -172,10 +172,17 @@ class vmmConnection(vmmGObject): + self._backend.cb_fetch_all_pools = ( + lambda: [obj.get_xmlobj(refresh_if_nec=False) + for obj in self.pools.values()]) +- self._backend.cb_fetch_all_vols = ( +- lambda: [obj.get_xmlobj(refresh_if_nec=False) +- for pool in self.pools.values() +- for obj in pool.get_volumes(refresh=False).values()]) ++ ++ def fetch_all_vols(): ++ ret = [] ++ for pool in self.pools.values(): ++ for vol in pool.get_volumes(refresh=False).values(): ++ try: ++ ret.append(vol.get_xmlobj(refresh_if_nec=False)) ++ except libvirt.libvirtError, e: ++ logging.debug("Fetching volume XML failed: %s", e) ++ return ret ++ self._backend.cb_fetch_all_vols = fetch_all_vols + + def clear_cache(pools=False): + if not pools: diff --git a/0009-console-Fix-unsetting-resize-guest-property-from-UI.patch b/0009-console-Fix-unsetting-resize-guest-property-from-UI.patch new file mode 100644 index 0000000..33bb3e4 --- /dev/null +++ b/0009-console-Fix-unsetting-resize-guest-property-from-UI.patch @@ -0,0 +1,25 @@ +From 4daa270c84825f41583e313b5b64bb10e6eae639 Mon Sep 17 00:00:00 2001 +From: Cole Robinson +Date: Fri, 28 Feb 2014 11:46:05 -0500 +Subject: [PATCH] console: Fix unsetting 'resize-guest' property from UI + +Reported in the followup of bz 754559 + +(cherry picked from commit 4a2493f1e4bede671eac713081f61965f036d6ed) +--- + virtManager/console.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/virtManager/console.py b/virtManager/console.py +index 6ac8abc..5199f5a 100644 +--- a/virtManager/console.py ++++ b/virtManager/console.py +@@ -1092,7 +1092,7 @@ class vmmConsolePages(vmmGObjectUI): + + def resizeguest_ui_changed_cb(self, src): + # Called from details.py +- if not src.get_active(): ++ if not src.get_sensitive(): + return + + val = int(self.widget("details-menu-view-resizeguest").get_active()) diff --git a/virt-manager.spec b/virt-manager.spec index f4ca564..aefda90 100644 --- a/virt-manager.spec +++ b/virt-manager.spec @@ -20,7 +20,7 @@ %define _version 1.0.0 -%define _release 2 +%define _release 3 # This macro is used for the continuous automated builds. It just @@ -45,8 +45,17 @@ Patch0001: 0001-connect-Fix-connecting-to-lxc-URI.patch # Fix issues creating ppc64 guests Patch0002: 0002-create-Fix-non-x86-qemu-kvm-guest-creation.patch Patch0003: 0003-caps-Simplify-guest-lookup-routines.patch -# Fix generating disk targets from customize->addhw Patch0004: 0004-create-Don-t-alter-caps-machine-list.patch +# Fix generating disk targets from customize->addhw +Patch0005: 0005-addhardware-generate-target-only-if-not-customizing.patch +# Fix creating storage paths if directory is all digits (bz #1069351) +Patch0006: 0006-Don-t-forbid-object-names-that-are-only-all-numbers-.patch +# Properly close connection if tick fails (bz #1069351) +Patch0007: 0007-engine-Fix-closing-connection-when-tick-fails-bz-106.patch +# virt-manager: Handle unrefreshed storage pools (bz #1070883) +Patch0008: 0008-vmm-connection-Handle-missing-storage-volumes-bz-107.patch +# Fix unsetting 'auto resize' console property +Patch0009: 0009-console-Fix-unsetting-resize-guest-property-from-UI.patch BuildArch: noarch @@ -118,8 +127,17 @@ machine). # Fix issues creating ppc64 guests %patch0002 -p1 %patch0003 -p1 -# Fix generating disk targets from customize->addhw %patch0004 -p1 +# Fix generating disk targets from customize->addhw +%patch0005 -p1 +# Fix creating storage paths if directory is all digits (bz #1069351) +%patch0006 -p1 +# Properly close connection if tick fails (bz #1069351) +%patch0007 -p1 +# virt-manager: Handle unrefreshed storage pools (bz #1070883) +%patch0008 -p1 +# Fix unsetting 'auto resize' console property +%patch0009 -p1 %build %if %{qemu_user} @@ -229,6 +247,12 @@ fi %changelog +* Fri Feb 28 2014 Cole Robinson - 1.0.0-3 +- Fix creating storage paths if directory is all digits (bz #1069351) +- Properly close connection if tick fails (bz #1069351) +- virt-manager: Handle unrefreshed storage pools (bz #1070883) +- Fix unsetting 'auto resize' console property + * Tue Feb 18 2014 Cole Robinson - 1.0.0-2 - Fix open connection->lxc - Fix issues creating ppc64 guests