kvm: Throw a proper exception when pool could not be fetched from libvirt

Otherwise NULL is returned and leads to a NPE further up the chain.
This commit is contained in:
Wido den Hollander 2014-08-20 13:39:52 +02:00
parent 14f3ad55ec
commit 1ed0fe4ee7

View File

@ -204,6 +204,8 @@ public class KVMStoragePoolManager {
StoragePoolInformation info = _storagePools.get(uuid);
if (info != null) {
pool = createStoragePool(info.name, info.host, info.port, info.path, info.userInfo, info.poolType, info.type);
} else {
throw new CloudRuntimeException("Could not fetch storage pool " + uuid + " from libvirt");
}
}
return pool;