8b3b1b9096
848123e6-fix-memory-stats-for-shutoff-VM.patch ebcb7c06-fix-exception-when-the-address-is-not-an-IP.patch c4d26d16-fix-VM-polling-on-old-libvirt.patch ac2be796-do-not-throw-exception-if-volume-or-pool-dont-exist.patch 88e18c86-fix-sending-net-removed-signal.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=231
52 lines
2.0 KiB
Diff
52 lines
2.0 KiB
Diff
Subject: storage: do not throw exception if the volume or the pool don't exist
|
|
From: Giuseppe Scrivano gscrivan@redhat.com Thu May 7 13:42:00 2015 +0200
|
|
Date: Thu May 7 17:42:58 2015 +0200:
|
|
Git: ac2be79658ec5673d00ca9603db63b9b0de4fbd3
|
|
|
|
commit 5357b91402fb7a8a73921216926908c08f6ad99d changed the semantic of
|
|
conn.get_(vm|pool|interface|nodedev|net), to return None instead of
|
|
raising KeyError. Leave the exception handling code in case the
|
|
semantic is going to be reverted.
|
|
|
|
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1219427
|
|
|
|
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
|
|
|
|
Index: virt-manager-1.2.0/virtManager/delete.py
|
|
===================================================================
|
|
--- virt-manager-1.2.0.orig/virtManager/delete.py
|
|
+++ virt-manager-1.2.0/virtManager/delete.py
|
|
@@ -236,7 +236,11 @@ def populate_storage_list(storage_list,
|
|
if disk.source_pool:
|
|
try:
|
|
pool = conn.get_pool(disk.source_pool)
|
|
+ if pool is None:
|
|
+ return disk.path
|
|
vol = pool.get_volume(disk.path)
|
|
+ if vol is None:
|
|
+ return disk.path
|
|
return vol.get_target_path()
|
|
except KeyError:
|
|
return disk.path
|
|
Index: virt-manager-1.2.0/virtManager/details.py
|
|
===================================================================
|
|
--- virt-manager-1.2.0.orig/virtManager/details.py
|
|
+++ virt-manager-1.2.0/virtManager/details.py
|
|
@@ -2698,12 +2698,14 @@ class vmmDetails(vmmGObjectUI):
|
|
if not path:
|
|
size = "-"
|
|
else:
|
|
+ vol = None
|
|
if source_pool:
|
|
try:
|
|
pool = self.conn.get_pool(source_pool)
|
|
- vol = pool.get_volume(path)
|
|
+ if pool is not None:
|
|
+ vol = pool.get_volume(path)
|
|
except KeyError:
|
|
- vol = None
|
|
+ pass
|
|
else:
|
|
vol = self.conn.get_vol_by_path(path)
|
|
|