You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2013/12/19 20:11:40 UTC

git commit: updated refs/heads/4.2 to 223b272

Updated Branches:
  refs/heads/4.2 37f99d8ac -> 223b2729d


CS-18685: do not modify vo, if you don't want to store it in db afterwards, as vo is cached by default.


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

Branch: refs/heads/4.2
Commit: 223b2729d7b3fc9d4e2c11ab2ebf3a09aadd9a8b
Parents: 37f99d8
Author: Edison Su <su...@gmail.com>
Authored: Thu Dec 19 11:11:20 2013 -0800
Committer: Edison Su <su...@gmail.com>
Committed: Thu Dec 19 11:11:20 2013 -0800

----------------------------------------------------------------------
 server/src/com/cloud/storage/VolumeManagerImpl.java | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/223b2729/server/src/com/cloud/storage/VolumeManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeManagerImpl.java b/server/src/com/cloud/storage/VolumeManagerImpl.java
index 38392ba..7295391 100644
--- a/server/src/com/cloud/storage/VolumeManagerImpl.java
+++ b/server/src/com/cloud/storage/VolumeManagerImpl.java
@@ -651,11 +651,8 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
             DiskOfferingVO diskOffering, List<StoragePool> avoids,
             long size, HypervisorType hyperType) {
         StoragePool pool = null;
-        DiskProfile dskCh = null;
-        if (diskOffering != null && diskOffering.isCustomized()) {
-            dskCh.setSize(size);
-        }
 
+        DiskProfile dskCh = null;
         if (volume.getVolumeType() == Type.ROOT
                 && Storage.ImageFormat.ISO != template.getFormat()) {
             dskCh = createDiskCharacteristics(volume, template, dc, offering);
@@ -664,6 +661,10 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
                     diskOffering);
         }
 
+        if (diskOffering != null && diskOffering.isCustomized()) {
+            dskCh.setSize(size);
+        }
+
         dskCh.setHyperType(hyperType);
 
         final HashSet<StoragePool> avoidPools = new HashSet<StoragePool>(