You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mt...@apache.org on 2014/06/24 23:27:19 UTC

git commit: updated refs/heads/master to 3d9eaf0

Repository: cloudstack
Updated Branches:
  refs/heads/master b2283d7a2 -> 3d9eaf075


Fixed some spacing issues from 4d6c682f18d9bca50c145b55d8fa61ea1ab71755


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

Branch: refs/heads/master
Commit: 3d9eaf07537aa7ef5da291912c308ea7dc08df81
Parents: b2283d7
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Tue Jun 24 15:26:25 2014 -0600
Committer: Mike Tutkowski <mi...@solidfire.com>
Committed: Tue Jun 24 15:27:06 2014 -0600

----------------------------------------------------------------------
 .../orchestration/VolumeOrchestrator.java       |  4 ++-
 .../xenserver/resource/CitrixResourceBase.java  | 37 ++++++++++----------
 .../com/cloud/storage/VolumeApiServiceImpl.java |  2 +-
 3 files changed, 22 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3d9eaf07/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
index ab0a76c..9ba3451 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
@@ -1051,8 +1051,10 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         details.put(DiskTO.VOLUME_SIZE, String.valueOf(volumeInfo.getSize()));
         details.put(DiskTO.IQN, volumeInfo.get_iScsiName());
         details.put(DiskTO.MOUNT_POINT, volumeInfo.get_iScsiName());
+
         VolumeVO volume = _volumeDao.findById(volumeInfo.getId());
-        details.put(DiskTO.PROTOCOL_TYPE, (volume.getPoolType()!=null)?volume.getPoolType().toString():null);
+
+        details.put(DiskTO.PROTOCOL_TYPE, (volume.getPoolType() != null) ? volume.getPoolType().toString() : null);
 
         ChapInfo chapInfo = volService.getChapInfo(volumeInfo, dataStore);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3d9eaf07/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
index 397e665..602de53 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
@@ -1886,16 +1886,14 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
         String mountpoint = details.get(DiskTO.MOUNT_POINT);
         String protocoltype=details.get(DiskTO.PROTOCOL_TYPE);
 
-        if(StoragePoolType.NetworkFilesystem.toString().equalsIgnoreCase(protocoltype)){
-        String poolid = storageHost+":"+mountpoint;
-        String namelable = mountpoint;
-        String volumedesc = storageHost+":"+mountpoint;
+        if (StoragePoolType.NetworkFilesystem.toString().equalsIgnoreCase(protocoltype)) {
+            String poolid = storageHost + ":" + mountpoint;
+            String namelable = mountpoint;
+            String volumedesc = storageHost + ":" + mountpoint;
 
-        return getNfsSR(conn, poolid, namelable, storageHost, mountpoint, volumedesc);
-
-        }else{
-
-        return getIscsiSR(conn, iScsiName, storageHost, iScsiName, chapInitiatorUsername, chapInitiatorSecret, true);
+            return getNfsSR(conn, poolid, namelable, storageHost, mountpoint, volumedesc);
+        } else {
+            return getIscsiSR(conn, iScsiName, storageHost, iScsiName, chapInitiatorUsername, chapInitiatorSecret, true);
         }
     }
 
@@ -1908,20 +1906,21 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
         if (vdi == null) {
 
             vdi = createVdi(sr, vdiNameLabel, volumeSize);
-        }else {
+        } else {
+            // if VDI is not null, it must have already been created, so check whether a resize of the volume was performed
+            // if true, resize the VDI to the volume size
 
-            // if vdi is not null, it must have been already created, check whether a resize of volume was done
-            // if true , resize the vdi to the volume size
             s_logger.info("checking for the resize of the datadisk");
-            long vdiVirtualsize = vdi.getVirtualSize(conn);
 
-            if(vdiVirtualsize != volumeSize){
-                s_logger.info("resizing the datadisk(vdi) from vdiVirtualsize :"+ vdiVirtualsize + "to volumeSize :" + volumeSize);
+            long vdiVirtualSize = vdi.getVirtualSize(conn);
+
+            if (vdiVirtualSize != volumeSize) {
+                s_logger.info("resizing the datadisk(vdi) from vdiVirtualsize :"+ vdiVirtualSize + "to volumeSize :" + volumeSize);
 
                 try {
                     vdi.resize(conn, volumeSize);
                 } catch (Exception e) {
-                    s_logger.warn("Unable to resize volume",e);
+                    s_logger.warn("Unable to resize volume", e);
                 }
             }
          }
@@ -5086,7 +5085,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
         StorageFilerTO pool = cmd.getPool();
         try {
             if (pool.getType() == StoragePoolType.NetworkFilesystem) {
-                getNfsSR(conn, Long.toString(pool.getId()),pool.getUuid(),pool.getHost(),pool.getPath(),pool.toString());
+                getNfsSR(conn, Long.toString(pool.getId()), pool.getUuid(), pool.getHost(), pool.getPath(), pool.toString());
             } else if (pool.getType() == StoragePoolType.IscsiLUN) {
                 getIscsiSR(conn, pool.getUuid(), pool.getHost(), pool.getPath(), null, null, false);
             } else if (pool.getType() == StoragePoolType.PreSetup) {
@@ -6096,7 +6095,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
         }
     }
 
-    protected SR getNfsSR(Connection conn,String poolid,String uuid, String server,String serverpath,String pooldesc) {
+    protected SR getNfsSR(Connection conn, String poolid, String uuid, String server, String serverpath, String pooldesc) {
         Map<String, String> deviceConfig = new HashMap<String, String>();
         try {
             serverpath = serverpath.replace("//", "/");
@@ -6129,7 +6128,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
 
                 if (server.equals(dc.get("server")) && serverpath.equals(dc.get("serverpath"))) {
                     throw new CloudRuntimeException("There is a SR using the same configuration server:" + dc.get("server") + ", serverpath:" + dc.get("serverpath") +
-                            " for pool " + uuid + "on host:" + _host.uuid);
+                            " for pool " + uuid + " on host:" + _host.uuid);
                 }
 
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3d9eaf07/server/src/com/cloud/storage/VolumeApiServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
index 76bc50c..7af404e 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -2094,7 +2094,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
             details.put(DiskTO.VOLUME_SIZE, String.valueOf(volumeToAttach.getSize()));
             details.put(DiskTO.IQN, volumeToAttach.get_iScsiName());
             details.put(DiskTO.MOUNT_POINT, volumeToAttach.get_iScsiName());
-            details.put(DiskTO.PROTOCOL_TYPE, (volumeToAttach.getPoolType()!=null) ? volumeToAttach.getPoolType().toString() : null);
+            details.put(DiskTO.PROTOCOL_TYPE, (volumeToAttach.getPoolType() != null) ? volumeToAttach.getPoolType().toString() : null);
 
             if (chapInfo != null) {
                 details.put(DiskTO.CHAP_INITIATOR_USERNAME, chapInfo.getInitiatorUsername());