cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amog...@apache.org
Subject git commit: updated refs/heads/master to d1d722f
Date Mon, 11 Aug 2014 21:57:20 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 97efbc56e -> d1d722f9b


CLOUDSTACK-7295: VMs is Stopped state have no host ID, resulting in NPE


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

Branch: refs/heads/master
Commit: d1d722f9bde91ce36f494142f4651a22c6795d6b
Parents: 97efbc5
Author: amoghvk <amogh.vasekar@citrix.com>
Authored: Mon Aug 11 14:53:02 2014 -0700
Committer: amoghvk <amogh.vasekar@citrix.com>
Committed: Mon Aug 11 14:56:58 2014 -0700

----------------------------------------------------------------------
 .../vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java      | 7 +++++--
 .../xenserver/src/com/cloud/hypervisor/XenServerGuru.java     | 7 +++++--
 server/src/com/cloud/hypervisor/KVMGuru.java                  | 7 +++++--
 server/src/com/cloud/hypervisor/LXCGuru.java                  | 7 +++++--
 4 files changed, 20 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d1d722f9/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
index 08d12f2..abc7cdb 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java
@@ -314,8 +314,11 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru,
Co
         to.setOs(guestOS.getDisplayName());
         to.setHostName(vm.getHostName());
         HostVO host = _hostDao.findById(vm.getVirtualMachine().getHostId());
-        GuestOSHypervisorVO guestOsMapping = _guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(),
getHypervisorType().toString(), host.getHypervisorVersion());
-        if (guestOsMapping == null) {
+        GuestOSHypervisorVO guestOsMapping = null;
+        if (host != null) {
+            guestOsMapping = _guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(),
getHypervisorType().toString(), host.getHypervisorVersion());
+        }
+        if (guestOsMapping == null || host == null) {
             to.setPlatformEmulator(null);
         } else {
             to.setPlatformEmulator(guestOsMapping.getGuestOsName());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d1d722f9/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java
index c10f4a0..c1de8bb 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java
@@ -92,8 +92,11 @@ public class XenServerGuru 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) {
+        GuestOSHypervisorVO guestOsMapping = null;
+        if (host != null) {
+            guestOsMapping = _guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(),
getHypervisorType().toString(), host.getHypervisorVersion());
+        }
+        if (guestOsMapping == null || host == null) {
             to.setPlatformEmulator(null);
         } else {
             to.setPlatformEmulator(guestOsMapping.getGuestOsName());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d1d722f9/server/src/com/cloud/hypervisor/KVMGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/KVMGuru.java b/server/src/com/cloud/hypervisor/KVMGuru.java
index 80279ad..492342c 100644
--- a/server/src/com/cloud/hypervisor/KVMGuru.java
+++ b/server/src/com/cloud/hypervisor/KVMGuru.java
@@ -60,8 +60,11 @@ public class KVMGuru 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) {
+        GuestOSHypervisorVO guestOsMapping = null;
+        if (host != null) {
+            guestOsMapping = _guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(),
getHypervisorType().toString(), host.getHypervisorVersion());
+        }
+        if (guestOsMapping == null || host == null) {
             to.setPlatformEmulator("Other");
         } else {
             to.setPlatformEmulator(guestOsMapping.getGuestOsName());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d1d722f9/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 7283ac5..46989d9 100644
--- a/server/src/com/cloud/hypervisor/LXCGuru.java
+++ b/server/src/com/cloud/hypervisor/LXCGuru.java
@@ -56,8 +56,11 @@ public class LXCGuru extends HypervisorGuruBase implements HypervisorGuru
{
         to.setOs(guestOS.getDisplayName());
 
         HostVO host = _hostDao.findById(vm.getVirtualMachine().getHostId());
-        GuestOSHypervisorVO guestOsMapping = _guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(),
getHypervisorType().toString(), host.getHypervisorVersion());
-        if (guestOsMapping == null) {
+        GuestOSHypervisorVO guestOsMapping = null;
+        if (host != null) {
+            guestOsMapping = _guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(),
getHypervisorType().toString(), host.getHypervisorVersion());
+        }
+        if (guestOsMapping == null || host == null) {
             to.setPlatformEmulator("Other");
         } else {
             to.setPlatformEmulator(guestOsMapping.getGuestOsName());


Mime
View raw message