You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2015/02/05 13:57:50 UTC

git commit: updated refs/heads/4.5 to 82eebab

Repository: cloudstack
Updated Branches:
  refs/heads/4.5 a4d24adfb -> 82eebab0b


CID-1241966 Fix potential null deref
(cherry picked from commit 1c94017ff693fbff51553d0095aef4d9e0552098)

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


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

Branch: refs/heads/4.5
Commit: 82eebab0baccf98fcf0e0c7b828e88ee44185a8e
Parents: a4d24ad
Author: Hugo Trippaers <ht...@schubergphilis.com>
Authored: Tue Sep 30 11:27:51 2014 +0200
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Thu Feb 5 18:27:09 2015 +0530

----------------------------------------------------------------------
 .../orchestration/VolumeOrchestrator.java       | 66 ++++++++++----------
 1 file changed, 33 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/82eebab0/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 a6ebd34..4b9d7ef 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
@@ -228,16 +228,16 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
 
     public VolumeVO allocateDuplicateVolumeVO(Volume oldVol, Long templateId) {
         VolumeVO newVol = new VolumeVO(oldVol.getVolumeType(),
-            oldVol.getName(),
-            oldVol.getDataCenterId(),
-            oldVol.getDomainId(),
-            oldVol.getAccountId(),
-            oldVol.getDiskOfferingId(),
-            oldVol.getProvisioningType(),
-            oldVol.getSize(),
-            oldVol.getMinIops(),
-            oldVol.getMaxIops(),
-            oldVol.get_iScsiName());
+                oldVol.getName(),
+                oldVol.getDataCenterId(),
+                oldVol.getDomainId(),
+                oldVol.getAccountId(),
+                oldVol.getDiskOfferingId(),
+                oldVol.getProvisioningType(),
+                oldVol.getSize(),
+                oldVol.getMinIops(),
+                oldVol.getMaxIops(),
+                oldVol.get_iScsiName());
         if (templateId != null) {
             newVol.setTemplateId(templateId);
         } else {
@@ -612,16 +612,16 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         maxIops = maxIops != null ? maxIops : offering.getMaxIops();
 
         VolumeVO vol = new VolumeVO(type,
-            name,
-            vm.getDataCenterId(),
-            owner.getDomainId(),
-            owner.getId(),
-            offering.getId(),
-            offering.getProvisioningType(),
-            size,
-            minIops,
-            maxIops,
-            null);
+                name,
+                vm.getDataCenterId(),
+                owner.getDomainId(),
+                owner.getId(),
+                offering.getId(),
+                offering.getProvisioningType(),
+                size,
+                minIops,
+                maxIops,
+                null);
         if (vm != null) {
             vol.setInstanceId(vm.getId());
         }
@@ -673,16 +673,16 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         maxIops = maxIops != null ? maxIops : offering.getMaxIops();
 
         VolumeVO vol = new VolumeVO(type,
-            name,
-            vm.getDataCenterId(),
-            owner.getDomainId(),
-            owner.getId(),
-            offering.getId(),
-            offering.getProvisioningType(),
-            size,
-            minIops,
-            maxIops,
-            null);
+                name,
+                vm.getDataCenterId(),
+                owner.getDomainId(),
+                owner.getId(),
+                offering.getId(),
+                offering.getProvisioningType(),
+                size,
+                minIops,
+                maxIops,
+                null);
         vol.setFormat(getSupportedImageFormatForCluster(template.getHypervisorType()));
         if (vm != null) {
             vol.setInstanceId(vm.getId());
@@ -699,8 +699,8 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         }
 
         if (vm.getType() == VirtualMachine.Type.User) {
-           UserVmVO userVm = _userVmDao.findById(vm.getId());
-           vol.setDisplayVolume(userVm.isDisplayVm());
+            UserVmVO userVm = _userVmDao.findById(vm.getId());
+            vol.setDisplayVolume(userVm.isDisplayVm());
         }
 
 
@@ -1117,7 +1117,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
             if (assignedPool == null && recreate) {
                 assignedPool = _storagePoolDao.findById(vol.getPoolId());
             }
-            if (assignedPool != null || recreate) {
+            if (assignedPool != null) {
                 Volume.State state = vol.getState();
                 if (state == Volume.State.Allocated || state == Volume.State.Creating) {
                     VolumeTask task = new VolumeTask(VolumeTaskType.RECREATE, vol, null);