[Pkg-libvirt-commits] [SCM] VirtManager Debian packaging branch, master, updated. debian/0.9.0-4

Guido Günther agx at sigxcpu.org
Tue Jan 10 19:31:18 UTC 2012


The following commit has been merged in the master branch:
commit e7e6e5b1116b3ef379e29c7f22d50663aac1e787
Author: Guido Günther <agx at sigxcpu.org>
Date:   Tue Jan 10 20:03:54 2012 +0100

    New patch 0005-storagebrowser-ignore-unparseable-volumes.patch

diff --git a/debian/patches/0005-storagebrowser-ignore-unparseable-volumes.patch b/debian/patches/0005-storagebrowser-ignore-unparseable-volumes.patch
new file mode 100644
index 0000000..444d261
--- /dev/null
+++ b/debian/patches/0005-storagebrowser-ignore-unparseable-volumes.patch
@@ -0,0 +1,60 @@
+From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx at sigxcpu.org>
+Date: Tue, 10 Jan 2012 19:37:09 +0100
+Subject: storagebrowser: ignore unparseable volumes
+
+This e.g. happens when the volume was moved away but the pool didn't get
+refereshed:
+
+Traceback (most recent call last):
+  File "/usr/share/virt-manager/virtManager/create.py", line 1229, in browse_import
+    self._browse_file(set_path, is_media=False)
+  File "/usr/share/virt-manager/virtManager/create.py", line 2118, in _browse_file
+    self.storage_browser.show(self.topwin, self.conn)
+  File "/usr/share/virt-manager/virtManager/storagebrowse.py", line 74, in show
+    self.reset_state(conn)
+  File "/usr/share/virt-manager/virtManager/storagebrowse.py", line 183, in reset_state
+    self.pool_selected()
+  File "/usr/share/virt-manager/virtManager/storagebrowse.py", line 257, in pool_selected
+    self.populate_storage_volumes()
+  File "/usr/share/virt-manager/virtManager/storagebrowse.py", line 322, in populate_storage_volumes
+    path = vol.get_target_path()
+  File "/usr/share/virt-manager/virtManager/storagevol.py", line 49, in get_target_path
+    return util.xpath(self.get_xml(), "/volume/target/path")
+  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 93, in get_xml
+    self.refresh_xml()
+  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 105, in refresh_xml
+    self._xml = self._XMLDesc(self._active_xml_flags)
+  File "/usr/share/virt-manager/virtManager/storagevol.py", line 35, in _XMLDesc
+    return self.vol.XMLDesc(flags)
+  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 2002, in XMLDesc
+    if ret is None: raise libvirtError ('virStorageVolGetXMLDesc() failed', vol=self)
+libvirt.libvirtError: cannot stat file '/var/scratch/vms/squeeze-template.img': No such file or directory
+
+Instead of failing the whole pool simply ignore the one failing volume.
+Without this patch selecting "Browse..." when creating a new vm from an
+existing disk image won't show the volume dialog if the default pool has
+a missing volume.
+---
+ src/virtManager/storagebrowse.py |    9 +++++++--
+ 1 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/virtManager/storagebrowse.py b/src/virtManager/storagebrowse.py
+index 10093ce..108ce43 100644
+--- a/src/virtManager/storagebrowse.py
++++ b/src/virtManager/storagebrowse.py
+@@ -319,8 +319,13 @@ class vmmStorageBrowser(vmmGObjectUI):
+         for key in vols.keys():
+             vol = vols[key]
+             sensitive = True
+-            path = vol.get_target_path()
+-            fmt = vol.get_format() or ""
++            try:
++                path = vol.get_target_path()
++                fmt = vol.get_format() or ""
++            except Exception:
++                logging.exception("Failed to determine volume parameters, "
++                                  "skipping volume %s" % key)
++		continue
+             namestr = None
+ 
+             try:
diff --git a/debian/patches/series b/debian/patches/series
index 095fc5f..49610e0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@
 0002-Use-IPy-from-python-ipy.patch
 0003-virt-manager-Fix-Resize-to-VM-menu-option.patch
 0004-console-Fix-crashes-when-deleting-vm-on-F16.patch
+0005-storagebrowser-ignore-unparseable-volumes.patch

-- 
VirtManager Debian packaging



More information about the Pkg-libvirt-commits mailing list