You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by gi...@git.apache.org on 2017/05/24 08:30:35 UTC

[GitHub] abhinandanprateek commented on a change in pull request #2108: [4.9+] CLOUDSTACK-9860: Power off VMs when force stop is provided

abhinandanprateek commented on a change in pull request #2108: [4.9+] CLOUDSTACK-9860: Power off VMs when force stop is provided
URL: https://github.com/apache/cloudstack/pull/2108#discussion_r118192523
 
 

 ##########
 File path: plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
 ##########
 @@ -4862,10 +4862,15 @@ public synchronized Network setupvSwitchNetwork(final Connection conn) {
         return null;
     }
 
-    public void shutdownVM(final Connection conn, final VM vm, final String vmName) throws XmlRpcException {
+    public void shutdownVM(final Connection conn, final VM vm, final String vmName, final boolean forcedStop) throws XmlRpcException {
         Task task = null;
         try {
-            task = vm.cleanShutdownAsync(conn);
+            if (forcedStop) {
+                task = vm.hardShutdownAsync(conn);
+            } else {
+                task = vm.cleanShutdownAsync(conn);
+            }
+
 
 Review comment:
   The method as it was tried to do a graceful shutdown and upon failure will be followed by a hard shutdown, so in a way, the shutdownVM was taking care of the scenario in which the VM may not stop gracefully. This method does not really need a forcedStop param.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services