[Kimchi-devel] [PATCH v2] List as many pools' info as possible
Christy Perez
christy at linux.vnet.ibm.com
Thu Dec 4 20:12:58 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.
v1 -> v2:
- Log exception message and error code
Signed-off-by: Christy Perez <christy at linux.vnet.ibm.com>
---
src/kimchi/model/storagepools.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/kimchi/model/storagepools.py b/src/kimchi/model/storagepools.py
index 20c9e5a..e03c6bb 100644
--- a/src/kimchi/model/storagepools.py
+++ b/src/kimchi/model/storagepools.py
@@ -202,6 +202,15 @@ 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
+ kimchi_log.error("ERROR: Storage Pool get vol count: %s "
+ % e.get_error_message())
+ kimchi_log.error("ERROR: Storage Pool get vol count error no: %s "
+ % e.get_error_code())
+ 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