cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ni...@apache.org
Subject [2/2] git commit: updated refs/heads/master to 78c683f
Date Fri, 25 Apr 2014 20:10:29 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/78c683f5
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/78c683f5
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/78c683f5

Branch: refs/heads/master
Commit: 78c683f5682560deffa405ac76edf23f8e17565d
Parents: 2960ba7
Author: Amogh Vasekar <amogh.vasekar@citrix.com>
Authored: Fri Apr 25 13:09:47 2014 -0700
Committer: Nitin Mehta <nitin.mehta@citrix.com>
Committed: Fri Apr 25 13:10:10 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                 | 875 +++++++++++++++++++
 6 files changed, 906 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/78c683f5/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/78c683f5/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/78c683f5/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/78c683f5/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/78c683f5/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 081145f..bb4f514 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -2028,7 +2028,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 : "
@@ -2039,6 +2039,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);
 
     }
@@ -2071,6 +2072,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