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

This commit is contained in:
Edison Su 2013-12-19 11:11:20 -08:00
parent 37f99d8ac2
commit 223b2729d7
1 changed files with 5 additions and 4 deletions

View File

@ -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>(