fix delete storage pool

This commit is contained in:
Edison Su 2011-01-31 16:37:00 -05:00
parent cbb54c549e
commit 14d09f53a4
1 changed files with 3 additions and 1 deletions

View File

@ -60,13 +60,14 @@ public class LibvirtStorageResource {
public boolean deleteStoragePool(Connect conn, StorageFilerTO spt) throws LibvirtException {
StoragePool pool = getStoragePool(conn, spt.getUuid());
LibvirtStoragePoolDef spd = getStoragePoolDef(conn, pool);
synchronized (getStoragePool(pool.getUUIDString())) {
pool.destroy();
pool.undefine();
}
LibvirtStoragePoolDef spd = getStoragePoolDef(conn, pool);
if (spd.getPoolType() == poolType.NETFS) {
KVMHABase.NfsStoragePool sp = new KVMHABase.NfsStoragePool(spt.getUuid(),
@ -270,6 +271,7 @@ public class LibvirtStorageResource {
pool.getHost(), pool.getPath(), pool.getPath());
StoragePool sp = null;
try {
s_logger.debug(spd.toString());
addStoragePool(pool.getUuid());
synchronized (getStoragePool(pool.getUuid())) {
sp = conn.storagePoolDefineXML(spd.toString(), 0);