bug 13551: in some case, libvirt returns storage pool available, but mount point is not there

status 13551: resolved fixed
Reviewed-by: anthony
This commit is contained in:
Edison Su 2012-02-08 20:16:34 -08:00
parent 08987f0f22
commit ee1cefcb8e
1 changed files with 11 additions and 1 deletions

View File

@ -339,8 +339,18 @@ public class LibvirtStorageResource {
StoragePool sp = null;
try {
sp = conn.storagePoolLookupByUUIDString(spt.getUuid());
//double check the mount point
String targetPath = _mountPoint + File.separator + spt.getUuid();
if (!_storageLayer.exists(targetPath)) {
try {
sp.destroy();
sp.undefine();
} catch(LibvirtException e) {
}
sp = null;
}
} catch (LibvirtException e) {
}
if (sp == null) {