cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject git commit: updated refs/heads/4.2 to 6826528
Date Tue, 23 Jul 2013 18:14:54 GMT
Updated Branches:
  refs/heads/4.2 50557ba1e -> 682652865


CLOUDSTACK-3733: fixed migrateVm - no need to cast vm to user vm to retrieve the iso information.
Extract iso information from VirtualMachineProfile object passed to the method.


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

Branch: refs/heads/4.2
Commit: 682652865e1151988802a21f54cdb0e72b571cf6
Parents: 50557ba
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Tue Jul 23 10:54:28 2013 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Tue Jul 23 10:56:39 2013 -0700

----------------------------------------------------------------------
 .../com/cloud/storage/VolumeManagerImpl.java    | 38 ++++++++++++--------
 1 file changed, 23 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/68265286/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 f7e0437..4074229 100644
--- a/server/src/com/cloud/storage/VolumeManagerImpl.java
+++ b/server/src/com/cloud/storage/VolumeManagerImpl.java
@@ -31,10 +31,6 @@ import java.util.concurrent.ExecutionException;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.cloudstack.engine.subsystem.api.storage.*;
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
 import org.apache.cloudstack.api.BaseCmd;
 import org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd;
 import org.apache.cloudstack.api.command.user.volume.CreateVolumeCmd;
@@ -42,10 +38,22 @@ import org.apache.cloudstack.api.command.user.volume.DetachVolumeCmd;
 import org.apache.cloudstack.api.command.user.volume.ExtractVolumeCmd;
 import org.apache.cloudstack.api.command.user.volume.MigrateVolumeCmd;
 import org.apache.cloudstack.api.command.user.volume.ResizeVolumeCmd;
+import org.apache.cloudstack.api.command.user.volume.UpdateVolumeCmd;
 import org.apache.cloudstack.api.command.user.volume.UploadVolumeCmd;
-
-import com.cloud.storage.dao.*;
-import org.apache.cloudstack.api.command.user.volume.*;
+import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo;
+import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
+import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
+import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProviderManager;
+import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
+import org.apache.cloudstack.engine.subsystem.api.storage.Scope;
+import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotDataFactory;
+import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo;
+import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator;
+import org.apache.cloudstack.engine.subsystem.api.storage.TemplateDataFactory;
+import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
+import org.apache.cloudstack.engine.subsystem.api.storage.VolumeDataFactory;
+import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
+import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService;
 import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService.VolumeApiResult;
 import org.apache.cloudstack.framework.async.AsyncCallFuture;
 import org.apache.cloudstack.storage.command.AttachAnswer;
@@ -61,6 +69,8 @@ import org.apache.cloudstack.storage.datastore.db.VolumeDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.VolumeDataStoreVO;
 import org.apache.cloudstack.storage.image.datastore.ImageStoreEntity;
 import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
@@ -128,6 +138,7 @@ import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.storage.dao.VMTemplatePoolDao;
 import com.cloud.storage.dao.VMTemplateS3Dao;
 import com.cloud.storage.dao.VolumeDao;
+import com.cloud.storage.dao.VolumeDetailsDao;
 import com.cloud.storage.download.DownloadMonitor;
 import com.cloud.storage.s3.S3Manager;
 import com.cloud.storage.secondary.SecondaryStorageVmManager;
@@ -140,8 +151,8 @@ import com.cloud.template.TemplateManager;
 import com.cloud.user.Account;
 import com.cloud.user.AccountManager;
 import com.cloud.user.ResourceLimitService;
-import com.cloud.user.VmDiskStatisticsVO;
 import com.cloud.user.UserContext;
+import com.cloud.user.VmDiskStatisticsVO;
 import com.cloud.user.dao.AccountDao;
 import com.cloud.user.dao.UserDao;
 import com.cloud.user.dao.VmDiskStatisticsDao;
@@ -2310,13 +2321,10 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager
{
             vm.addDisk(disk);
         }
 
-        if (vm.getType() == VirtualMachine.Type.User) {
-            UserVmVO userVM = (UserVmVO) vm.getVirtualMachine();
-            if (userVM.getIsoId() != null) {
-                DataTO dataTO = tmplFactory.getTemplate(userVM.getIsoId(), DataStoreRole.Image,
userVM.getDataCenterId()).getTO();
-                DiskTO iso = new DiskTO(dataTO, 3L, null, Volume.Type.ISO);
-                vm.addDisk(iso);
-            }
+        if (vm.getType() == VirtualMachine.Type.User && vm.getTemplate().getFormat()
== ImageFormat.ISO) {
+            DataTO dataTO = tmplFactory.getTemplate(vm.getTemplate().getId(), DataStoreRole.Image,
vm.getVirtualMachine().getDataCenterId()).getTO();
+            DiskTO iso = new DiskTO(dataTO, 3L, null, Volume.Type.ISO);
+            vm.addDisk(iso);
         }
     }
 


Mime
View raw message