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/hotfix/4.4-6905 to 9800b9f
Date Mon, 11 Aug 2014 22:00:10 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/hotfix/4.4-6905 [created] 9800b9f07


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

Branch: refs/heads/hotfix/4.4-6905
Commit: 9800b9f07a5b887da93661c12441e0d5f99fd717
Parents: 9a7cdc0
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:07 2014 -0700

----------------------------------------------------------------------
 .../vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java      | 7 +++++--
 .../xen/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/9800b9f0/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 f82c2c1..8a04910 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/9800b9f0/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java
index 3f950d6..5f8b031 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java
@@ -92,8 +92,11 @@ public class XenServerGuru extends HypervisorGuruBase implements HypervisorGuru
         GuestOSVO guestOS = _guestOsDao.findByIdIncludingRemoved(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/9800b9f0/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 f000a1a..b6a7651 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.findByIdIncludingRemoved(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/9800b9f0/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