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 89fabe8
Date Thu, 31 Jul 2014 17:04:08 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master b371356ab -> 89fabe82b


CLOUDSTACK-7211: Add Guest OS mapping before returning VirtualMachineTO object

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/89fabe82
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/89fabe82
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/89fabe82

Branch: refs/heads/master
Commit: 89fabe82b9b28df7405022a1707f71dbddfe1604
Parents: b371356
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Thu Jul 31 19:01:57 2014 +0200
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Thu Jul 31 19:03:51 2014 +0200

----------------------------------------------------------------------
 server/src/com/cloud/hypervisor/LXCGuru.java | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89fabe82/server/src/com/cloud/hypervisor/LXCGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/LXCGuru.java b/server/src/com/cloud/hypervisor/LXCGuru.java
index 52e289a..7283ac5 100644
--- a/server/src/com/cloud/hypervisor/LXCGuru.java
+++ b/server/src/com/cloud/hypervisor/LXCGuru.java
@@ -20,15 +20,23 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 
 import com.cloud.agent.api.to.VirtualMachineTO;
+import com.cloud.host.HostVO;
+import com.cloud.host.dao.HostDao;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.storage.GuestOSHypervisorVO;
 import com.cloud.storage.GuestOSVO;
 import com.cloud.storage.dao.GuestOSDao;
+import com.cloud.storage.dao.GuestOSHypervisorDao;
 import com.cloud.vm.VirtualMachineProfile;
 
 @Local(value = HypervisorGuru.class)
 public class LXCGuru extends HypervisorGuruBase implements HypervisorGuru {
     @Inject
     GuestOSDao _guestOsDao;
+    @Inject
+    GuestOSHypervisorDao _guestOsHypervisorDao;
+    @Inject
+    HostDao _hostDao;
 
     @Override
     public HypervisorType getHypervisorType() {
@@ -47,6 +55,14 @@ public class LXCGuru extends HypervisorGuruBase implements HypervisorGuru
{
         GuestOSVO guestOS = _guestOsDao.findById(vm.getVirtualMachine().getGuestOSId());
         to.setOs(guestOS.getDisplayName());
 
+        HostVO host = _hostDao.findById(vm.getVirtualMachine().getHostId());
+        GuestOSHypervisorVO guestOsMapping = _guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(),
getHypervisorType().toString(), host.getHypervisorVersion());
+        if (guestOsMapping == null) {
+            to.setPlatformEmulator("Other");
+        } else {
+            to.setPlatformEmulator(guestOsMapping.getGuestOsName());
+        }
+
         return to;
     }
 


Mime
View raw message