Arik Hadas has uploaded a new change for review.

Change subject: core: prevent npe when vm disappears from vdsm
......................................................................

core: prevent npe when vm disappears from vdsm

VmInternalData is set to null for a VM that disappeared from the host
and is not reported by VDSM. In this case the VM should be monitored in
the getAllStats cycle, so returning 'true' in
VdsManager#shouldUpdateVmStatus and prevent NPE.

Change-Id: I048866e03ae8b25d5b67e6b1be78046166c92217
Signed-off-by: Arik Hadas <aha...@redhat.com>
---
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsManager.java
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/68/42468/1

diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsManager.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsManager.java
index eb89c2c..abfd41d 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsManager.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsManager.java
@@ -172,6 +172,10 @@
     }
 
     public boolean shouldUpdateVmStatus(VmInternalData vmInternalData) {
+        if (vmInternalData == null) {
+            // VM disappeared from VDSM, we need to have monitoring cycle
+            return true;
+        }
         Guid id = vmInternalData.getVmDynamic().getId();
         if (!vmStatusUpdated.containsKey(id)) {
             vmStatusUpdated.put(id, vmInternalData.getTimestamp());


-- 
To view, visit https://gerrit.ovirt.org/42468
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I048866e03ae8b25d5b67e6b1be78046166c92217
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <aha...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to