cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject git commit: updated refs/heads/master to 79a46fe
Date Thu, 23 Apr 2015 13:28:29 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 682939964 -> 79a46fe0b


CLOUDSTACK-8399: Allow changing hvm flag in updateTemplate API

This allows changing the hvm flag for a template after the template has been
registered.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 3e8b12bbb12554baf7ba2a625bfa064f86bfa9cc)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


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

Branch: refs/heads/master
Commit: 79a46fe0b4982e812d6a6ed0f08d1fe92b0b5e8d
Parents: 6829399
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Thu Apr 23 15:23:28 2015 +0200
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Thu Apr 23 15:28:22 2015 +0200

----------------------------------------------------------------------
 .../apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java   | 9 ++++++++-
 .../cloudstack/api/command/user/iso/UpdateIsoCmd.java       | 5 +++++
 server/src/com/cloud/template/TemplateManagerImpl.java      | 7 ++++++-
 3 files changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79a46fe0/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java b/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
index 5e94232..31de029 100644
--- a/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
@@ -32,9 +32,12 @@ public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    @Parameter(name = ApiConstants.BOOTABLE, type = CommandType.BOOLEAN, description = "true
if image is bootable, false otherwise")
+    @Parameter(name = ApiConstants.BOOTABLE, type = CommandType.BOOLEAN, description = "true
if image is bootable, false otherwise; available only for updateIso API")
     private Boolean bootable;
 
+    @Parameter(name = ApiConstants.REQUIRES_HVM, type = CommandType.BOOLEAN, description
= "true if the template requres HVM, false otherwise; available only for updateTemplate API")
+    private Boolean requiresHvm;
+
     @Parameter(name = ApiConstants.DISPLAY_TEXT, type = CommandType.STRING, description =
"the display text of the image", length = 4096)
     private String displayText;
 
@@ -78,6 +81,10 @@ public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
         return bootable;
     }
 
+    public Boolean getRequiresHvm() {
+        return requiresHvm;
+    }
+
     public String getDisplayText() {
         return displayText;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79a46fe0/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java
index b569d65..5e61160 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java
@@ -39,6 +39,11 @@ public class UpdateIsoCmd extends BaseUpdateTemplateOrIsoCmd {
     /////////////////////////////////////////////////////
 
     @Override
+    public Boolean getRequiresHvm() {
+        return null;
+    }
+
+    @Override
     public Boolean isPasswordEnabled() {
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/79a46fe0/server/src/com/cloud/template/TemplateManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java
index 330b19e..c322b12 100644
--- a/server/src/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/com/cloud/template/TemplateManagerImpl.java
@@ -1753,6 +1753,7 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
         Boolean isDynamicallyScalable = cmd.isDynamicallyScalable();
         Boolean isRoutingTemplate = cmd.isRoutingType();
         Boolean bootable = cmd.isBootable();
+        Boolean requiresHvm = cmd.getRequiresHvm();
         Integer sortKey = cmd.getSortKey();
         Map details = cmd.getDetails();
         Account account = CallContext.current().getCallingAccount();
@@ -1776,7 +1777,7 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
         }
 
         boolean updateNeeded =
-                !(name == null && displayText == null && format == null &&
guestOSId == null && passwordEnabled == null && bootable == null &&
sortKey == null &&
+                !(name == null && displayText == null && format == null &&
guestOSId == null && passwordEnabled == null && bootable == null &&
requiresHvm == null && sortKey == null &&
                         isDynamicallyScalable == null && isRoutingTemplate == null
&& details == null);
         if (!updateNeeded) {
             return template;
@@ -1839,6 +1840,10 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
             template.setBootable(bootable);
         }
 
+        if (requiresHvm != null) {
+            template.setRequiresHvm(requiresHvm);
+        }
+
         if (isDynamicallyScalable != null) {
             template.setDynamicallyScalable(isDynamicallyScalable);
         }


Mime
View raw message