} catch (LibvirtException e) {
throw new CloudRuntimeException(e.toString());
}
StoragePool sp = null;
Secret s = null;
try {
sp = conn.storagePoolLookupByUUIDString(uuid);
} catch (LibvirtException e) {
return true;
}
/*
* Some storage pools, like RBD also have 'secret' information stored in libvirt
* Destroy them if they exist
*/
try {
s = conn.secretLookupByUUIDString(uuid);
} catch (LibvirtException e) {
}
try {
if (sp.isPersistent() == 1) {
sp.destroy();
sp.undefine();
} else {
sp.destroy();
}
sp.free();
if (s != null) {
s.undefine();
s.free();
}
return true;
} catch (LibvirtException e) {
// handle ebusy error when pool is quickly destroyed
if (e.toString().contains("exit status 16")) {