cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From devd...@apache.org
Subject [1/3] git commit: updated refs/heads/master to 5ba5da3
Date Fri, 09 May 2014 11:24:27 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 0f79223f2 -> 5ba5da369


CLOUDSTACK-6399: When there are no vms running on hyperv host, then agent was returning null.
In
that case cloudstack was not doing anything and not updating the state of the vms to stopped.
Now the agent returns empty list of hostvmstatereport. Management server will then update
the
vm state to stopped (instead of not acting upon the return state).


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

Branch: refs/heads/master
Commit: 7916542d99e858a62b236d2ef34232ba2e36d4f0
Parents: 0f79223
Author: Anshul Gangwar <anshul.gangwar@citrix.com>
Authored: Fri May 9 14:32:36 2014 +0530
Committer: Devdeep Singh <devdeep@gmail.com>
Committed: Fri May 9 16:31:06 2014 +0530

----------------------------------------------------------------------
 .../hyperv/resource/HypervDirectConnectResource.java  | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7916542d/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java
b/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java
index 7888e43..1816baf 100644
--- a/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java
+++ b/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java
@@ -90,10 +90,10 @@ import com.cloud.agent.api.SetupGuestNetworkCommand;
 import com.cloud.agent.api.StartCommand;
 import com.cloud.agent.api.StartupCommand;
 import com.cloud.agent.api.StartupRoutingCommand;
-import com.cloud.agent.api.UnPlugNicAnswer;
-import com.cloud.agent.api.UnPlugNicCommand;
 import com.cloud.agent.api.StartupRoutingCommand.VmState;
 import com.cloud.agent.api.StartupStorageCommand;
+import com.cloud.agent.api.UnPlugNicAnswer;
+import com.cloud.agent.api.UnPlugNicCommand;
 import com.cloud.agent.api.UnsupportedAnswer;
 import com.cloud.agent.api.check.CheckSshAnswer;
 import com.cloud.agent.api.check.CheckSshCommand;
@@ -355,8 +355,12 @@ public class HypervDirectConnectResource extends ServerResourceBase implements
S
         }
         s_logger.debug("HostVmStateReportCommand received response "
                 + s_gson.toJson(result));
-        if (!result.isEmpty()) {
-            return result;
+        if (result != null) {
+            if (!result.isEmpty()) {
+                return result;
+            } else {
+                return new ArrayList<Map<String, String>>();
+            }
         }
         return null;
     }
@@ -364,7 +368,7 @@ public class HypervDirectConnectResource extends ServerResourceBase implements
S
     protected HashMap<String, HostVmStateReportEntry> getHostVmStateReport() {
         final HashMap<String, HostVmStateReportEntry> vmStates = new HashMap<String,
HostVmStateReportEntry>();
         ArrayList<Map<String, String>> vmList = requestHostVmStateReport();
-        if (vmList == null || vmList.isEmpty()) {
+        if (vmList == null) {
             return null;
         }
 


Mime
View raw message