You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2015/03/25 18:31:08 UTC

git commit: updated refs/heads/master to 340aa9f

Repository: cloudstack
Updated Branches:
  refs/heads/master a4c23b170 -> 340aa9ff0


findbugs: make default encoding explicit

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

Branch: refs/heads/master
Commit: 340aa9ff0f11ee06af57e15c07684a21a62e76c2
Parents: a4c23b1
Author: Daan Hoogland <dh...@schubergphilis.com>
Authored: Wed Mar 25 18:31:08 2015 +0100
Committer: Daan Hoogland <dh...@schubergphilis.com>
Committed: Wed Mar 25 18:31:08 2015 +0100

----------------------------------------------------------------------
 .../ovm3/resources/Ovm3HypervisorResource.java      | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/340aa9ff/plugins/hypervisors/ovm3/src/main/java/com/cloud/hypervisor/ovm3/resources/Ovm3HypervisorResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/ovm3/src/main/java/com/cloud/hypervisor/ovm3/resources/Ovm3HypervisorResource.java b/plugins/hypervisors/ovm3/src/main/java/com/cloud/hypervisor/ovm3/resources/Ovm3HypervisorResource.java
index bb43e89..ea0d407 100644
--- a/plugins/hypervisors/ovm3/src/main/java/com/cloud/hypervisor/ovm3/resources/Ovm3HypervisorResource.java
+++ b/plugins/hypervisors/ovm3/src/main/java/com/cloud/hypervisor/ovm3/resources/Ovm3HypervisorResource.java
@@ -17,6 +17,7 @@
 
 package com.cloud.hypervisor.ovm3.resources;
 
+import java.nio.charset.Charset;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.UUID;
@@ -25,13 +26,14 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
+import org.apache.log4j.Logger;
+
 import org.apache.cloudstack.storage.command.AttachCommand;
 import org.apache.cloudstack.storage.command.CopyCommand;
 import org.apache.cloudstack.storage.command.CreateObjectCommand;
 import org.apache.cloudstack.storage.command.DeleteCommand;
 import org.apache.cloudstack.storage.command.DettachCommand;
 import org.apache.cloudstack.storage.command.StorageSubSystemCommand;
-import org.apache.log4j.Logger;
 
 import com.cloud.agent.IAgentControl;
 import com.cloud.agent.api.Answer;
@@ -89,11 +91,11 @@ import com.cloud.hypervisor.ovm3.objects.OvmObject;
 import com.cloud.hypervisor.ovm3.objects.Xen;
 import com.cloud.hypervisor.ovm3.resources.helpers.Ovm3Configuration;
 import com.cloud.hypervisor.ovm3.resources.helpers.Ovm3HypervisorNetwork;
+import com.cloud.hypervisor.ovm3.resources.helpers.Ovm3HypervisorSupport;
 import com.cloud.hypervisor.ovm3.resources.helpers.Ovm3StoragePool;
 import com.cloud.hypervisor.ovm3.resources.helpers.Ovm3VirtualRoutingSupport;
 import com.cloud.hypervisor.ovm3.resources.helpers.Ovm3VmGuestTypes;
 import com.cloud.hypervisor.ovm3.resources.helpers.Ovm3VmSupport;
-import com.cloud.hypervisor.ovm3.resources.helpers.Ovm3HypervisorSupport;
 import com.cloud.network.Networks.TrafficType;
 import com.cloud.resource.ServerResourceBase;
 import com.cloud.resource.hypervisor.HypervisorResource;
@@ -124,13 +126,13 @@ public class Ovm3HypervisorResource extends ServerResourceBase implements
     private Ovm3VirtualRoutingSupport virtualroutingsupport;
     private Ovm3Configuration configuration;
     private Ovm3VmGuestTypes guesttypes;
-    private OvmObject ovmObject = new OvmObject();
+    private final OvmObject ovmObject = new OvmObject();
 
     /*
      * TODO: Add a network map, so we know which tagged interfaces we can remove
      * and switch to ConcurrentHashMap
      */
-    private Map<String, Xen.Vm> vmMap = new HashMap<String, Xen.Vm>();
+    private final Map<String, Xen.Vm> vmMap = new HashMap<String, Xen.Vm>();
 
     @Override
     public Type getType() {
@@ -379,7 +381,7 @@ public class Ovm3HypervisorResource extends ServerResourceBase implements
         storageHandler = new StorageSubsystemCommandHandlerBase(storageprocessor);
         virtualroutingsupport = new Ovm3VirtualRoutingSupport(c, configuration,
                 virtualroutingresource);
-        this.setConfigParams(params);
+        setConfigParams(params);
         return true;
     }
 
@@ -412,8 +414,8 @@ public class Ovm3HypervisorResource extends ServerResourceBase implements
             vm.setVmCpus(vmSpec.getCpus());
             /* in mb not in bytes */
             vm.setVmMemory(vmSpec.getMinRam() / 1024 / 1024);
-            vm.setVmUuid(UUID.nameUUIDFromBytes(vmSpec.getName().getBytes())
-                    .toString());
+            vm.setVmUuid(UUID.nameUUIDFromBytes(vmSpec.getName().
+                    getBytes(Charset.defaultCharset())).toString());
             vm.setVmName(vmName);
 
             String domType = guesttypes.getOvm3GuestType(vmSpec.getOs());