Repository: cloudstack
Updated Branches:
  refs/heads/4.5 e77b4ae8e -> c37841817


ensure agent reconciliation triggers events

(cherry picked from commit 0ba75bcebde4e8a4773c7b31e5d8b88bf748a131)
Signed-off-by: Rohit Yadav <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c3784181
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c3784181
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c3784181

Branch: refs/heads/4.5
Commit: c37841817eabcce6957259a1e6f4a13e52f4a79c
Parents: e77b4ae
Author: Pierre-Yves Ritschard <[email protected]>
Authored: Mon Feb 16 17:30:51 2015 +0100
Committer: Rohit Yadav <[email protected]>
Committed: Wed Feb 18 11:15:13 2015 +0530

----------------------------------------------------------------------
 api/src/com/cloud/vm/VirtualMachine.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c3784181/api/src/com/cloud/vm/VirtualMachine.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/vm/VirtualMachine.java 
b/api/src/com/cloud/vm/VirtualMachine.java
index 2a6039f..b45ac7c 100755
--- a/api/src/com/cloud/vm/VirtualMachine.java
+++ b/api/src/com/cloud/vm/VirtualMachine.java
@@ -145,7 +145,10 @@ public interface VirtualMachine extends RunningOn, 
ControlledEntity, Identity, I
         }
 
         public static boolean isVmStopped(State oldState, Event e, State 
newState) {
-            if (oldState == State.Stopping && newState == State.Stopped) {
+            if ((oldState == State.Stopping && newState == State.Stopped) ||
+                (oldState == State.Running &&
+                 newState == State.Stopped &&
+                 e == Event.FollowAgentPowerOffReport)) {
                 return true;
             }
             return false;

Reply via email to