cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kous...@apache.org
Subject git commit: updated refs/heads/master to 5cbb182
Date Thu, 19 Jun 2014 04:38:44 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 05c01a7dc -> 5cbb182c6


CLOUDSTACK-6636: [Windows] Can not create Template from ROOT snapshot on Windows management
server with Xen/NFS storage type. This change is only for XenServer with NFS Storage Server.
Will fix remaining when we touch them.

Signed-off-by: Koushik Das <koushik@apache.org>


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

Branch: refs/heads/master
Commit: 5cbb182c6d280a2d286d6b2443b235bcf87f2f17
Parents: 05c01a7
Author: Damodar Reddy <damoder.reddy@citrix.com>
Authored: Wed Jun 18 14:55:05 2014 +0530
Committer: Koushik Das <koushik@apache.org>
Committed: Thu Jun 19 09:35:26 2014 +0530

----------------------------------------------------------------------
 api/src/com/cloud/agent/api/to/DataStoreTO.java   |  2 ++
 api/src/com/cloud/agent/api/to/NfsTO.java         |  6 ++++++
 api/src/com/cloud/agent/api/to/S3TO.java          |  6 ++++++
 api/src/com/cloud/agent/api/to/SwiftTO.java       |  6 ++++++
 .../cloudstack/storage/to/ImageStoreTO.java       |  6 ++++++
 .../cloudstack/storage/to/PrimaryDataStoreTO.java |  6 ++++++
 .../resource/XenServerStorageProcessor.java       | 18 +++++++++---------
 7 files changed, 41 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5cbb182c/api/src/com/cloud/agent/api/to/DataStoreTO.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/to/DataStoreTO.java b/api/src/com/cloud/agent/api/to/DataStoreTO.java
index 8d47adc..1c901a6 100644
--- a/api/src/com/cloud/agent/api/to/DataStoreTO.java
+++ b/api/src/com/cloud/agent/api/to/DataStoreTO.java
@@ -26,4 +26,6 @@ public interface DataStoreTO {
     String getUuid();
 
     String getUrl();
+
+    String getPathSeparator();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5cbb182c/api/src/com/cloud/agent/api/to/NfsTO.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/to/NfsTO.java b/api/src/com/cloud/agent/api/to/NfsTO.java
index 1c9ee38..51d1aad 100644
--- a/api/src/com/cloud/agent/api/to/NfsTO.java
+++ b/api/src/com/cloud/agent/api/to/NfsTO.java
@@ -23,6 +23,7 @@ public class NfsTO implements DataStoreTO {
     private String _url;
     private DataStoreRole _role;
     private String uuid;
+    private static final String pathSeparator = "/";
 
     public NfsTO() {
 
@@ -65,4 +66,9 @@ public class NfsTO implements DataStoreTO {
     public void setUuid(String uuid) {
         this.uuid = uuid;
     }
+
+    @Override
+    public String getPathSeparator() {
+        return pathSeparator;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5cbb182c/api/src/com/cloud/agent/api/to/S3TO.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/to/S3TO.java b/api/src/com/cloud/agent/api/to/S3TO.java
index f64fe35..346dd62 100644
--- a/api/src/com/cloud/agent/api/to/S3TO.java
+++ b/api/src/com/cloud/agent/api/to/S3TO.java
@@ -40,6 +40,7 @@ public final class S3TO implements S3Utils.ClientOptions, DataStoreTO {
     private Date created;
     private boolean enableRRS;
     private long maxSingleUploadSizeInBytes;
+    private static final String pathSeparator = "/";
 
     public S3TO() {
 
@@ -289,4 +290,9 @@ public final class S3TO implements S3Utils.ClientOptions, DataStoreTO
{
             }
         }
     }
+
+    @Override
+    public String getPathSeparator() {
+        return pathSeparator;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5cbb182c/api/src/com/cloud/agent/api/to/SwiftTO.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/to/SwiftTO.java b/api/src/com/cloud/agent/api/to/SwiftTO.java
index 3b76dad..c7a9866 100644
--- a/api/src/com/cloud/agent/api/to/SwiftTO.java
+++ b/api/src/com/cloud/agent/api/to/SwiftTO.java
@@ -26,6 +26,7 @@ public class SwiftTO implements DataStoreTO, SwiftUtil.SwiftClientCfg {
 
     String userName;
     String key;
+    private static final String pathSeparator = "/";
 
     public SwiftTO() {
     }
@@ -76,4 +77,9 @@ public class SwiftTO implements DataStoreTO, SwiftUtil.SwiftClientCfg {
     public String getUuid() {
         return null;
     }
+
+    @Override
+    public String getPathSeparator() {
+        return pathSeparator;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5cbb182c/core/src/org/apache/cloudstack/storage/to/ImageStoreTO.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/to/ImageStoreTO.java b/core/src/org/apache/cloudstack/storage/to/ImageStoreTO.java
index 93c62f6..09ac2d8 100644
--- a/core/src/org/apache/cloudstack/storage/to/ImageStoreTO.java
+++ b/core/src/org/apache/cloudstack/storage/to/ImageStoreTO.java
@@ -27,6 +27,7 @@ public class ImageStoreTO implements DataStoreTO {
     private String providerName;
     private DataStoreRole role;
     private String uuid;
+    private static final String pathSeparator = "/";
 
     public ImageStoreTO() {
 
@@ -98,4 +99,9 @@ public class ImageStoreTO implements DataStoreTO {
     public void setUuid(String uuid) {
         this.uuid = uuid;
     }
+
+    @Override
+    public String getPathSeparator() {
+        return pathSeparator;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5cbb182c/core/src/org/apache/cloudstack/storage/to/PrimaryDataStoreTO.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/to/PrimaryDataStoreTO.java b/core/src/org/apache/cloudstack/storage/to/PrimaryDataStoreTO.java
index 29e53b0..c3c9f8c 100644
--- a/core/src/org/apache/cloudstack/storage/to/PrimaryDataStoreTO.java
+++ b/core/src/org/apache/cloudstack/storage/to/PrimaryDataStoreTO.java
@@ -46,6 +46,7 @@ public class PrimaryDataStoreTO implements DataStoreTO {
     private int port;
     private final String url;
     private Map<String, String> details;
+    private static final String pathSeparator = "/";
 
     public PrimaryDataStoreTO(PrimaryDataStore dataStore) {
         this.uuid = dataStore.getUuid();
@@ -123,6 +124,11 @@ public class PrimaryDataStoreTO implements DataStoreTO {
     }
 
     @Override
+    public String getPathSeparator() {
+        return pathSeparator;
+    }
+
+    @Override
     public String toString() {
         return new StringBuilder("PrimaryDataStoreTO[uuid=").append(uuid)
             .append("|name=")

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5cbb182c/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServerStorageProcessor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServerStorageProcessor.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServerStorageProcessor.java
index e96ebf4..2a1ee1b 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServerStorageProcessor.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServerStorageProcessor.java
@@ -109,7 +109,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
                 return new AttachAnswer("Can't attach a iso which is not created on nfs:
");
             }
             NfsTO nfsStore = (NfsTO) store;
-            isoURL = nfsStore.getUrl() + File.separator + data.getPath();
+            isoURL = nfsStore.getUrl() + nfsStore.getPathSeparator() + data.getPath();
         }
 
         String vmName = cmd.getVmName();
@@ -290,7 +290,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
                 return new AttachAnswer("Can't attach a iso which is not created on nfs:
");
             }
             NfsTO nfsStore = (NfsTO) store;
-            isoURL = nfsStore.getUrl() + File.separator + data.getPath();
+            isoURL = nfsStore.getUrl() + nfsStore.getPathSeparator() + data.getPath();
         }
 
         try {
@@ -933,7 +933,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
                 SR primaryStoragePool = hypervisorResource.getStorageRepository(conn, destVolume.getDataStore().getUuid());
                 String srUuid = primaryStoragePool.getUuid(conn);
                 URI uri = new URI(nfsStore.getUrl());
-                String volumePath = uri.getHost() + ":" + uri.getPath() + File.separator
+ srcVolume.getPath();
+                String volumePath = uri.getHost() + ":" + uri.getPath() + nfsStore.getPathSeparator()
+ srcVolume.getPath();
                 String uuid = copy_vhd_from_secondarystorage(conn, volumePath, srUuid, wait);
                 VolumeObjectTO newVol = new VolumeObjectTO();
                 newVol.setPath(uuid);
@@ -970,7 +970,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
                 }
 
                 // Create a SR for the volume UUID folder
-                secondaryStorage = hypervisorResource.createNfsSRbyURI(conn, new URI(nfsStore.getUrl()
+ File.separator + destVolume.getPath()), false);
+                secondaryStorage = hypervisorResource.createNfsSRbyURI(conn, new URI(nfsStore.getUrl()
+ nfsStore.getPathSeparator() + destVolume.getPath()), false);
                 // Look up the volume on the source primary storage pool
                 VDI srcVdi = getVDIbyUuid(conn, srcVolume.getPath());
                 // Copy the volume to secondary storage
@@ -978,7 +978,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
                 String destVolumeUUID = destVdi.getUuid(conn);
 
                 VolumeObjectTO newVol = new VolumeObjectTO();
-                newVol.setPath(destVolume.getPath() + File.separator + destVolumeUUID + ".vhd");
+                newVol.setPath(destVolume.getPath() + nfsStore.getPathSeparator() + destVolumeUUID
+ ".vhd");
                 newVol.setSize(srcVolume.getSize());
                 return new CopyCmdAnswer(newVol);
             } catch (Exception e) {
@@ -1282,7 +1282,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
                         }
                         // finalPath = folder + File.separator + snapshotBackupUuid;
                     } else {
-                        finalPath = folder + File.separator + snapshotBackupUuid;
+                        finalPath = folder + cacheStore.getPathSeparator() + snapshotBackupUuid;
                     }
 
                 } finally {
@@ -1310,7 +1310,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
                     String[] tmp = results.split("#");
                     snapshotBackupUuid = tmp[1];
                     physicalSize = Long.parseLong(tmp[2]);
-                    finalPath = folder + File.separator + snapshotBackupUuid;
+                    finalPath = folder + cacheStore.getPathSeparator() + snapshotBackupUuid;
                 }
             }
             // delete primary snapshots with only the last one left
@@ -1461,13 +1461,13 @@ public class XenServerStorageProcessor implements StorageProcessor
{
             }
             // Get the absolute path of the snapshot on the secondary storage.
             String snapshotInstallPath = snapshot.getPath();
-            int index = snapshotInstallPath.lastIndexOf(File.separator);
+            int index = snapshotInstallPath.lastIndexOf(nfsImageStore.getPathSeparator());
             String snapshotName = snapshotInstallPath.substring(index + 1);
 
             if (!snapshotName.startsWith("VHD-") && !snapshotName.endsWith(".vhd"))
{
                 snapshotInstallPath = snapshotInstallPath + ".vhd";
             }
-            URI snapshotURI = new URI(secondaryStorageUrl + File.separator + snapshotInstallPath);
+            URI snapshotURI = new URI(secondaryStorageUrl + nfsImageStore.getPathSeparator()
+ snapshotInstallPath);
             String snapshotPath = snapshotURI.getHost() + ":" + snapshotURI.getPath();
             String srUuid = primaryStorageSR.getUuid(conn);
             volumeUUID = copy_vhd_from_secondarystorage(conn, snapshotPath, srUuid, wait);


Mime
View raw message