cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sw...@apache.org
Subject [1/2] git commit: updated refs/heads/4.7 to 8eedead
Date Tue, 28 Jun 2016 15:19:53 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.7 3952e3e83 -> 8eedeade7


CLOUDSTACK-9353: [XenServer] Fixed VM migration with storage


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

Branch: refs/heads/4.7
Commit: 458264aac843d4d21500a5f0ab49f8e6a00410cd
Parents: 9275ba2
Author: Anshul Gangwar <anshul.gangwar@accelerite.com>
Authored: Wed Jun 15 11:38:03 2016 +0530
Committer: Anshul Gangwar <anshul.gangwar@accelerite.com>
Committed: Fri Jun 24 09:31:20 2016 +0530

----------------------------------------------------------------------
 .../XenServer610MigrateWithStorageCommandWrapper.java | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/458264aa/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/xen610/XenServer610MigrateWithStorageCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/xen610/XenServer610MigrateWithStorageCommandWrapper.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/xen610/XenServer610MigrateWithStorageCommandWrapper.java
index 2a79d26..f3f9f64 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/xen610/XenServer610MigrateWithStorageCommandWrapper.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/wrapper/xen610/XenServer610MigrateWithStorageCommandWrapper.java
@@ -24,6 +24,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import com.cloud.utils.Pair;
 import org.apache.cloudstack.storage.to.VolumeObjectTO;
 import org.apache.log4j.Logger;
 
@@ -60,7 +61,7 @@ public final class XenServer610MigrateWithStorageCommandWrapper extends
CommandW
     public Answer execute(final MigrateWithStorageCommand command, final XenServer610Resource
xenServer610Resource) {
         final Connection connection = xenServer610Resource.getConnection();
         final VirtualMachineTO vmSpec = command.getVirtualMachine();
-        final Map<VolumeTO, StorageFilerTO> volumeToFiler = command.getVolumeToFiler();
+        final List<Pair<VolumeTO, StorageFilerTO>> volumeToFiler = command.getVolumeToFilerAsList();
         final String vmName = vmSpec.getName();
         Task task = null;
 
@@ -80,13 +81,14 @@ public final class XenServer610MigrateWithStorageCommandWrapper extends
CommandW
             final XsLocalNetwork nativeNetworkForTraffic = xenServer610Resource.getNativeNetworkForTraffic(connection,
TrafficType.Storage, null);
             final Network networkForSm = nativeNetworkForTraffic.getNetwork();
 
-            // Create the vif map. The vm stays in the same cluster so we have to pass an
empty vif map.
+            // Create the vif map. The  vm stays in the same cluster so we have to pass an
empty vif map.
             final Map<VIF, Network> vifMap = new HashMap<VIF, Network>();
             final Map<VDI, SR> vdiMap = new HashMap<VDI, SR>();
-            for (final Map.Entry<VolumeTO, StorageFilerTO> entry : volumeToFiler.entrySet())
{
-                final VolumeTO volume = entry.getKey();
-                final StorageFilerTO sotrageFiler = entry.getValue();
-                vdiMap.put(xenServer610Resource.getVDIbyUuid(connection, volume.getPath()),
xenServer610Resource.getStorageRepository(connection, sotrageFiler.getUuid()));
+
+            for (final Pair<VolumeTO, StorageFilerTO> entry : volumeToFiler) {
+                final StorageFilerTO storageFiler = entry.second();
+                final VolumeTO volume = entry.first();
+                vdiMap.put(xenServer610Resource.getVDIbyUuid(connection, volume.getPath()),
xenServer610Resource.getStorageRepository(connection, storageFiler.getUuid()));
             }
 
             // Get the vm to migrate.


Mime
View raw message