cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From devd...@apache.org
Subject git commit: updated refs/heads/4.3 to 1a46045
Date Fri, 06 Dec 2013 12:36:37 GMT
Updated Branches:
  refs/heads/4.3 65642e98b -> 1a4604576


CLOUDSTACK-5339: Porting the fix for enabling vhdx virtual disk type for hyperv.


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

Branch: refs/heads/4.3
Commit: 1a4604576a695354708885acb4ae9d759b14d799
Parents: 65642e9
Author: Devdeep Singh <devdeep@gmail.com>
Authored: Fri Dec 6 18:05:50 2013 +0530
Committer: Devdeep Singh <devdeep@gmail.com>
Committed: Fri Dec 6 18:05:50 2013 +0530

----------------------------------------------------------------------
 .../com/cloud/storage/VolumeApiServiceImpl.java | 18 ++++++++-----
 .../template/HypervisorTemplateAdapter.java     | 27 ++++++++++----------
 2 files changed, 25 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1a460457/server/src/com/cloud/storage/VolumeApiServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
index 7630567..91131fe 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -379,6 +379,8 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
             userSpecifiedName = getRandomVolumeName();
         }
         if ((!url.toLowerCase().endsWith("vhd")) && (!url.toLowerCase().endsWith("vhd.zip"))
&& (!url.toLowerCase().endsWith("vhd.bz2")) &&
+            (!url.toLowerCase().endsWith("vhdx")) && (!url.toLowerCase().endsWith("vhdx.zip"))
&& 
+            (!url.toLowerCase().endsWith("vhdx.gz")) && (!url.toLowerCase().endsWith("vhdx.bz2"))
&& 
             (!url.toLowerCase().endsWith("vhd.gz")) && (!url.toLowerCase().endsWith("qcow2"))
&& (!url.toLowerCase().endsWith("qcow2.zip")) &&
             (!url.toLowerCase().endsWith("qcow2.bz2")) && (!url.toLowerCase().endsWith("qcow2.gz"))
&& (!url.toLowerCase().endsWith("ova")) &&
             (!url.toLowerCase().endsWith("ova.zip")) && (!url.toLowerCase().endsWith("ova.bz2"))
&& (!url.toLowerCase().endsWith("ova.gz")) &&
@@ -386,12 +388,14 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
             throw new InvalidParameterValueException("Please specify a valid " + format.toLowerCase());
         }
 
-        if ((format.equalsIgnoreCase("vhd") && (!url.toLowerCase().endsWith(".vhd")
&& !url.toLowerCase().endsWith("vhd.zip") && !url.toLowerCase().endsWith("vhd.bz2")
&& !url
-                .toLowerCase().endsWith("vhd.gz"))) ||
-            (format.equalsIgnoreCase("qcow2") && (!url.toLowerCase().endsWith(".qcow2")
&& !url.toLowerCase().endsWith("qcow2.zip") && !url.toLowerCase().endsWith("qcow2.bz2")
&& !url
-                    .toLowerCase().endsWith("qcow2.gz"))) ||
-            (format.equalsIgnoreCase("ova") && (!url.toLowerCase().endsWith(".ova")
&& !url.toLowerCase().endsWith("ova.zip") && !url.toLowerCase().endsWith("ova.bz2")
&& !url
-                    .toLowerCase().endsWith("ova.gz"))) || (format.equalsIgnoreCase("raw")
&& (!url.toLowerCase().endsWith(".img") && !url.toLowerCase().endsWith("raw"))))
{
+        if ((format.equalsIgnoreCase("vhd") && (!url.toLowerCase().endsWith(".vhd")
&& !url.toLowerCase().endsWith("vhd.zip") && !url.toLowerCase().endsWith("vhd.bz2")
&&
+                !url.toLowerCase().endsWith("vhd.gz"))) ||
+            (format.equalsIgnoreCase("vhdx") && (!url.toLowerCase().endsWith(".vhdx")
&& !url.toLowerCase().endsWith("vhdx.zip") && !url.toLowerCase().endsWith("vhdx.bz2")
&&
+                !url.toLowerCase().endsWith("vhdx.gz"))) ||
+            (format.equalsIgnoreCase("qcow2") && (!url.toLowerCase().endsWith(".qcow2")
&& !url.toLowerCase().endsWith("qcow2.zip") && !url.toLowerCase().endsWith("qcow2.bz2")
&&
+                !url.toLowerCase().endsWith("qcow2.gz"))) ||
+            (format.equalsIgnoreCase("ova") && (!url.toLowerCase().endsWith(".ova")
&& !url.toLowerCase().endsWith("ova.zip") && !url.toLowerCase().endsWith("ova.bz2")
&&
+                !url.toLowerCase().endsWith("ova.gz"))) || (format.equalsIgnoreCase("raw")
&& (!url.toLowerCase().endsWith(".img") && !url.toLowerCase().endsWith("raw"))))
{
             throw new InvalidParameterValueException("Please specify a valid URL. URL:" +
url + " is an invalid for the format " + format.toLowerCase());
         }
         UriUtils.validateUrl(url);
@@ -1556,6 +1560,8 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
             return "vhd";
         } else if (cluster.getHypervisorType() == HypervisorType.KVM) {
             return "qcow2";
+        } else if (cluster.getHypervisorType() == HypervisorType.Hyperv) {
+            return "vhdx";
         } else if (cluster.getHypervisorType() == HypervisorType.VMware) {
             return "ova";
         } else if (cluster.getHypervisorType() == HypervisorType.Ovm) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1a460457/server/src/com/cloud/template/HypervisorTemplateAdapter.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/HypervisorTemplateAdapter.java b/server/src/com/cloud/template/HypervisorTemplateAdapter.java
index f981997..711aff0 100755
--- a/server/src/com/cloud/template/HypervisorTemplateAdapter.java
+++ b/server/src/com/cloud/template/HypervisorTemplateAdapter.java
@@ -141,6 +141,8 @@ public class HypervisorTemplateAdapter extends TemplateAdapterBase {
     private void checkFormat(String format, String url) {
         if((!url.toLowerCase().endsWith("vhd"))&&(!url.toLowerCase().endsWith("vhd.zip"))
                 &&(!url.toLowerCase().endsWith("vhd.bz2"))&&(!url.toLowerCase().endsWith("vhd.gz"))
+                && (!url.toLowerCase().endsWith("vhdx")) && (!url.toLowerCase().endsWith("vhdx.gz"))
+                && (!url.toLowerCase().endsWith("vhdx.bz2")) && (!url.toLowerCase().endsWith("vhdx.zip"))
                 &&(!url.toLowerCase().endsWith("qcow2"))&&(!url.toLowerCase().endsWith("qcow2.zip"))
                 &&(!url.toLowerCase().endsWith("qcow2.bz2"))&&(!url.toLowerCase().endsWith("qcow2.gz"))
                 &&(!url.toLowerCase().endsWith("ova"))&&(!url.toLowerCase().endsWith("ova.zip"))
@@ -151,20 +153,17 @@ public class HypervisorTemplateAdapter extends TemplateAdapterBase {
             throw new InvalidParameterValueException("Please specify a valid " + format.toLowerCase());
         }
 
-        if ((format.equalsIgnoreCase("vhd") && (!url.toLowerCase().endsWith("vhd")
-                && !url.toLowerCase().endsWith("vhd.zip") && !url.toLowerCase().endsWith("vhd.bz2")
&& !url
-                .toLowerCase().endsWith("vhd.gz")))
-                || (format.equalsIgnoreCase("qcow2") && (!url.toLowerCase().endsWith("qcow2")
-                        && !url.toLowerCase().endsWith("qcow2.zip") && !url.toLowerCase().endsWith("qcow2.bz2")
&& !url
-                        .toLowerCase().endsWith("qcow2.gz")))
-                        || (format.equalsIgnoreCase("ova") && (!url.toLowerCase().endsWith("ova")
-                                && !url.toLowerCase().endsWith("ova.zip") &&
!url.toLowerCase().endsWith("ova.bz2") && !url
-                                .toLowerCase().endsWith("ova.gz")))
-                                || (format.equalsIgnoreCase("tar") && (!url.toLowerCase().endsWith("tar")
-                                        && !url.toLowerCase().endsWith("tar.zip")
&& !url.toLowerCase().endsWith("tar.bz2") && !url
-                                        .toLowerCase().endsWith("tar.gz")))
-                                        || (format.equalsIgnoreCase("raw") && (!url.toLowerCase().endsWith("img")
&& !url.toLowerCase()
-                                                .endsWith("raw")))) {
+        if ((format.equalsIgnoreCase("vhd") && (!url.toLowerCase().endsWith("vhd")
&& !url.toLowerCase().endsWith("vhd.zip") && !url.toLowerCase().endsWith("vhd.bz2")
&&
+                !url.toLowerCase().endsWith("vhd.gz"))) ||
+            (format.equalsIgnoreCase("vhdx") && (!url.toLowerCase().endsWith("vhdx")
&& !url.toLowerCase().endsWith("vhdx.zip") && !url.toLowerCase().endsWith("vhdx.bz2")
&&
+                !url.toLowerCase().endsWith("vhdx.gz"))) ||
+            (format.equalsIgnoreCase("qcow2") && (!url.toLowerCase().endsWith("qcow2")
&& !url.toLowerCase().endsWith("qcow2.zip") && !url.toLowerCase().endsWith("qcow2.bz2")
&&
+                !url.toLowerCase().endsWith("qcow2.gz"))) ||
+            (format.equalsIgnoreCase("ova") && (!url.toLowerCase().endsWith("ova")
&& !url.toLowerCase().endsWith("ova.zip") && !url.toLowerCase().endsWith("ova.bz2")
&&
+                !url.toLowerCase().endsWith("ova.gz"))) ||
+            (format.equalsIgnoreCase("tar") && (!url.toLowerCase().endsWith("tar")
&& !url.toLowerCase().endsWith("tar.zip") && !url.toLowerCase().endsWith("tar.bz2")
&&
+                !url.toLowerCase().endsWith("tar.gz"))) ||
+            (format.equalsIgnoreCase("raw") && (!url.toLowerCase().endsWith("img")
&& !url.toLowerCase().endsWith("raw")))) {
             throw new InvalidParameterValueException("Please specify a valid URL. URL:" +
url
                     + " is an invalid for the format " + format.toLowerCase());
         }


Mime
View raw message