[Kimchi-devel] [PATCH] List as many pools' info as possible
Christy Perez
christy at linux.vnet.ibm.com
Tue Dec 2 22:55:54 UTC 2014
If a pool happens to be busy at the time the pool.refresh() is
called, then libvirt will throw an error: "internal error:
pool 'default' has asynchronous jobs running." Currently, kimchi
rasise an exception and no pools' storage volumes are listed.
This patch returns a 0 for that particular pool, and allows
the user to continue to request information for other pools.
Without this patch, nothing is shown at all on the Storage tab
if one pool is busy.
In the future, we can check for VIR_ERR_RESOURCE_BUSY and
come up with a plan that works with the UI to display "Busy"
for a pool. But for now, this works around the issue.
Signed-off-by: Christy Perez <christy at linux.vnet.ibm.com>
---
src/kimchi/model/storagepools.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/kimchi/model/storagepools.py b/src/kimchi/model/storagepools.py
index 20c9e5a..ba2cf3e 100644
--- a/src/kimchi/model/storagepools.py
+++ b/src/kimchi/model/storagepools.py
@@ -202,6 +202,11 @@ def _get_storagepool_vols_num(self, pool):
else:
return 0
except libvirt.libvirtError as e:
+ # If something (say a busy pool) prevents the refresh,
+ # throwing an Exception here would prevent all pools from
+ # displaying information -- so return None for busy
+ return 0
+ except Exception as e:
raise OperationFailed("KCHPOOL0008E",
{'name': pool.name(),
'err': e.get_error_message()})
--
1.9.3
More information about the Kimchi-devel
mailing list