cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelv...@apache.org
Subject [27/33] git commit: updated refs/heads/master to 90262a8
Date Fri, 28 Feb 2014 23:37:47 GMT
make sure XS report VM state even if there is no running VM on the host.


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

Branch: refs/heads/master
Commit: b21662f8904dabddb4246418459afa68b2df99c8
Parents: 7ce5e5b
Author: Kelven Yang <kelveny@gmail.com>
Authored: Mon Feb 24 16:51:58 2014 -0800
Committer: Kelven Yang <kelveny@gmail.com>
Committed: Fri Feb 28 15:35:59 2014 -0800

----------------------------------------------------------------------
 api/src/org/apache/cloudstack/context/CallContext.java        | 2 ++
 .../src/com/cloud/vm/VirtualMachineManagerImpl.java           | 2 +-
 .../src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java    | 6 ++++++
 .../cloudstack/framework/jobs/AsyncJobExecutionContext.java   | 2 +-
 .../com/cloud/hypervisor/xen/resource/CitrixResourceBase.java | 7 +++----
 5 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b21662f8/api/src/org/apache/cloudstack/context/CallContext.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/context/CallContext.java b/api/src/org/apache/cloudstack/context/CallContext.java
index 0457c33..f80b921 100644
--- a/api/src/org/apache/cloudstack/context/CallContext.java
+++ b/api/src/org/apache/cloudstack/context/CallContext.java
@@ -252,6 +252,8 @@ public class CallContext {
 
         if (!stack.isEmpty()) {
             s_currentContext.set(stack.peek());
+        } else {
+            s_currentContext.set(null);
         }
 
         return context;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b21662f8/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
index 805ecce..6b73f4d 100755
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -3048,7 +3048,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
                 }
 
                 if(VmJobEnabled.value()) {
-                    if (ping.getHostVmStateReport() != null && ping.getHostVmStateReport().size()
> 0) {
+                    if (ping.getHostVmStateReport() != null) {
                         _syncMgr.processHostVmStatePingReport(agentId, ping.getHostVmStateReport());
                     }
                 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b21662f8/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java
index 635603f..6332958 100644
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java
@@ -66,6 +66,9 @@ public class VirtualMachinePowerStateSyncImpl implements VirtualMachinePowerStat
 
     private void processReport(long hostId, Map<Long, VirtualMachine.PowerState> translatedInfo)
{
 
+        if (s_logger.isDebugEnabled())
+            s_logger.debug("Process VM state report. host: " + hostId + ", number of records
in report: " + translatedInfo.size());
+
         for (Map.Entry<Long, VirtualMachine.PowerState> entry : translatedInfo.entrySet())
{
 
             if (s_logger.isDebugEnabled())
@@ -105,6 +108,9 @@ public class VirtualMachinePowerStateSyncImpl implements VirtualMachinePowerStat
                 }
             }
         }
+
+        if (s_logger.isDebugEnabled())
+            s_logger.debug("Done with process of VM state report. host: " + hostId);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b21662f8/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobExecutionContext.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobExecutionContext.java
b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobExecutionContext.java
index 129d9ca..86c6542 100644
--- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobExecutionContext.java
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobExecutionContext.java
@@ -207,7 +207,7 @@ public class AsyncJobExecutionContext  {
     public static String getOriginJobId() {
         AsyncJobExecutionContext context = AsyncJobExecutionContext.getCurrentExecutionContext();
         if (context != null && context.getJob() != null)
-            return "Job-" + context.getJob().getId();
+            return "" + context.getJob().getId();
 
         return "";
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b21662f8/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index 33e7462..bbe15c8 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -324,9 +324,9 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
     static {
         s_powerStatesTable = new HashMap<Types.VmPowerState, PowerState>();
         s_powerStatesTable.put(Types.VmPowerState.HALTED, PowerState.PowerOff);
-        s_powerStatesTable.put(Types.VmPowerState.PAUSED, PowerState.PowerOn);
+        s_powerStatesTable.put(Types.VmPowerState.PAUSED, PowerState.PowerOff);
         s_powerStatesTable.put(Types.VmPowerState.RUNNING, PowerState.PowerOn);
-        s_powerStatesTable.put(Types.VmPowerState.SUSPENDED, PowerState.PowerOn);
+        s_powerStatesTable.put(Types.VmPowerState.SUSPENDED, PowerState.PowerOff);
         s_powerStatesTable.put(Types.VmPowerState.UNRECOGNIZED, PowerState.PowerUnknown);
     }
 
@@ -2524,7 +2524,7 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
         }
 
         if (vm_map == null) {
-            return null;
+            return vmStates;
         }
         for (VM.Record record : vm_map.values()) {
             if (record.isControlDomain || record.isASnapshot || record.isATemplate) {
@@ -4927,7 +4927,6 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
             }
             if (srr.shared) {
                 Host host = Host.getByUuid(conn, _host.uuid);
-
                 boolean found = false;
                 for (PBD pbd : pbds) {
                     PBD.Record pbdr = pbd.getRecord(conn);


Mime
View raw message