cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthon...@apache.org
Subject [2/2] git commit: updated refs/heads/master to eff27e1
Date Mon, 22 Jul 2013 22:59:31 GMT
don't update VM state if the state doesn't really change. updating VM state increases the update
count, which might cause real VM update fail


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

Branch: refs/heads/master
Commit: eff27e1f839de57b4c9f5bba3c07b8907e0f0bf9
Parents: 668089d
Author: Anthony Xu <anthony.xu@citrix.com>
Authored: Mon Jul 22 15:49:11 2013 -0700
Committer: Anthony Xu <anthony.xu@citrix.com>
Committed: Mon Jul 22 15:56:37 2013 -0700

----------------------------------------------------------------------
 engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/eff27e1f/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
index 8cbc6b6..e8f98e9 100644
--- a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
@@ -398,6 +398,10 @@ public class VMInstanceDaoImpl extends GenericDaoBase<VMInstanceVO,
Long> implem
     	Long oldHostId = vmi.getHostId();
     	Long oldUpdated = vmi.getUpdated();
     	Date oldUpdateDate = vmi.getUpdateTime();
+    	if ( newState.equals(oldState) && newHostId != null && newHostId.equals(oldHostId)
) {
+    	    // state is same, don't need to update
+    	    return true;
+    	}
 
     	SearchCriteria<VMInstanceVO> sc = StateChangeSearch.create();
     	sc.setParameters("id", vmi.getId());


Mime
View raw message