From 1ed0fe4ee710d33bdb5c14704bc40de01f49d540 Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Wed, 20 Aug 2014 13:39:52 +0200 Subject: [PATCH] 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. --- .../com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java index 1d288042fe5..f44bb037dc3 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java @@ -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;