bug 11979: if a VM is absent on the cluster, it is effectively in stopped state.

reviewed-by: kishan
This commit is contained in:
Abhinandan Prateek 2011-11-11 10:50:18 +05:30 committed by root
parent 7fe51e06b6
commit 4b074600eb
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ public class XenServerPoolVms {
public State getState(String clusterId, String name){
HashMap<String, Pair<String, State>> vms = getClusterVmState(clusterId);
Pair<String, State> 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){