From 4b074600eb6f4fe09ddfa1a6b2c4c6a866764665 Mon Sep 17 00:00:00 2001 From: Abhinandan Prateek Date: Fri, 11 Nov 2011 10:50:18 +0530 Subject: [PATCH] bug 11979: if a VM is absent on the cluster, it is effectively in stopped state. reviewed-by: kishan --- .../src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java b/core/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java index 2927a1388b3..59c4e45a867 100644 --- a/core/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java +++ b/core/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java @@ -36,7 +36,7 @@ public class XenServerPoolVms { public State getState(String clusterId, String name){ HashMap> vms = getClusterVmState(clusterId); Pair pv = vms.get(name); - return pv.second(); + return pv == null ? State.Stopped : pv.second(); // if a VM is absent on the cluster, it is effectively in stopped state. } public void put(String clusterId, String hostUuid, String name, State state){