cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [12/26] git commit: updated refs/heads/4.4-forward to 0594598
Date Tue, 22 Apr 2014 08:02:39 GMT
CLOUDSTACK-6437:
Add ability to distinguish between user defined and system defined guest OS and mappings
Add default mappings for XenServer

Local testing with
1. Add new guest OS by API
2. Add new guest OS mapping by API


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

Branch: refs/heads/4.4-forward
Commit: 3419c812aee23b638ae2f8d1cacd92ae2f46ff40
Parents: 4c0505f
Author: Amogh Vasekar <amogh.vasekar@citrix.com>
Authored: Fri Apr 18 11:33:14 2014 -0700
Committer: Nitin Mehta <nitin.mehta@citrix.com>
Committed: Fri Apr 18 11:33:42 2014 -0700

----------------------------------------------------------------------
 api/src/com/cloud/storage/GuestOS.java          |   2 +
 .../com/cloud/storage/GuestOSHypervisor.java    |   2 +
 .../com/cloud/storage/GuestOSHypervisorVO.java  |  12 +
 .../schema/src/com/cloud/storage/GuestOSVO.java |  12 +
 .../com/cloud/server/ManagementServerImpl.java  |   4 +-
 setup/db/db/schema-430to440.sql                 | 873 +++++++++++++++++++
 6 files changed, 904 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3419c812/api/src/com/cloud/storage/GuestOS.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/GuestOS.java b/api/src/com/cloud/storage/GuestOS.java
index 767a60e..371260b 100644
--- a/api/src/com/cloud/storage/GuestOS.java
+++ b/api/src/com/cloud/storage/GuestOS.java
@@ -32,4 +32,6 @@ public interface GuestOS extends InternalIdentity, Identity {
     Date getCreated();
 
     Date getRemoved();
+
+    boolean getIsUserDefined();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3419c812/api/src/com/cloud/storage/GuestOSHypervisor.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/GuestOSHypervisor.java b/api/src/com/cloud/storage/GuestOSHypervisor.java
index 1cfc3a1..f579ce3 100644
--- a/api/src/com/cloud/storage/GuestOSHypervisor.java
+++ b/api/src/com/cloud/storage/GuestOSHypervisor.java
@@ -35,4 +35,6 @@ public interface GuestOSHypervisor extends InternalIdentity {
     Date getRemoved();
 
     Date getCreated();
+
+    boolean getIsUserDefined();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3419c812/engine/schema/src/com/cloud/storage/GuestOSHypervisorVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/GuestOSHypervisorVO.java b/engine/schema/src/com/cloud/storage/GuestOSHypervisorVO.java
index 1fbc9d7..087649b 100644
--- a/engine/schema/src/com/cloud/storage/GuestOSHypervisorVO.java
+++ b/engine/schema/src/com/cloud/storage/GuestOSHypervisorVO.java
@@ -57,6 +57,9 @@ public class GuestOSHypervisorVO implements GuestOSHypervisor {
     @Column(name = GenericDao.CREATED_COLUMN)
     Date created;
 
+    @Column(name = "is_user_defined")
+    private boolean isUserDefined;
+
     @Override
     public long getId() {
         return id;
@@ -120,4 +123,13 @@ public class GuestOSHypervisorVO implements GuestOSHypervisor {
     public void setRemoved(Date removed) {
         this.removed = removed;
     }
+
+    @Override
+    public boolean getIsUserDefined() {
+        return isUserDefined;
+    }
+
+    public void setIsUserDefined(boolean isUserDefined) {
+        this.isUserDefined = isUserDefined;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3419c812/engine/schema/src/com/cloud/storage/GuestOSVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/GuestOSVO.java b/engine/schema/src/com/cloud/storage/GuestOSVO.java
index a0040be..f04f9a4 100644
--- a/engine/schema/src/com/cloud/storage/GuestOSVO.java
+++ b/engine/schema/src/com/cloud/storage/GuestOSVO.java
@@ -54,6 +54,9 @@ public class GuestOSVO implements GuestOS {
     @Column(name = GenericDao.CREATED_COLUMN)
     private Date created;
 
+    @Column(name = "is_user_defined")
+    private boolean isUserDefined;
+
     @Override
     public long getId() {
         return id;
@@ -108,4 +111,13 @@ public class GuestOSVO implements GuestOS {
     public Date getRemoved() {
         return removed;
     }
+
+    @Override
+    public boolean getIsUserDefined() {
+        return isUserDefined;
+    }
+
+    public void setIsUserDefined(boolean isUserDefined) {
+        this.isUserDefined = isUserDefined;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3419c812/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index 5cc9154..b6fc280 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -2030,7 +2030,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
             throw new InvalidParameterValueException("Unable to find the guest OS by name
or UUID");
         }
         //check for duplicates
-        GuestOSHypervisorVO duplicate = _guestOSHypervisorDao.findByOsIdAndHypervisor(osTypeId.longValue(),
hypervisorType.toString(), hypervisorVersion);
+        GuestOSHypervisorVO duplicate = _guestOSHypervisorDao.findByOsIdAndHypervisor(guestOs.getId(),
hypervisorType.toString(), hypervisorVersion);
 
         if (duplicate != null) {
             throw new InvalidParameterValueException("Mapping from hypervisor : " + hypervisorType.toString()
+ ", version : " + hypervisorVersion + " and guest OS : "
@@ -2041,6 +2041,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
         guestOsMapping.setGuestOsName(osNameForHypervisor);
         guestOsMapping.setHypervisorType(hypervisorType.toString());
         guestOsMapping.setHypervisorVersion(hypervisorVersion);
+        guestOsMapping.setIsUserDefined(true);
         return _guestOSHypervisorDao.persist(guestOsMapping);
 
     }
@@ -2073,6 +2074,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
         guestOsVo.setCategoryId(categoryId.longValue());
         guestOsVo.setDisplayName(displayName);
         guestOsVo.setName(name);
+        guestOsVo.setIsUserDefined(true);
         return _guestOSDao.persist(guestOsVo);
     }
 


Mime
View raw message