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/4.2 to 5d9fa5d
Date Mon, 22 Jul 2013 23:17:55 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/b77723df
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b77723df
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b77723df

Branch: refs/heads/4.2
Commit: b77723df13d5ef5695ca69d74adff9309de3b8ef
Parents: 9f9f7d3
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 16:17:41 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/b77723df/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