Change in ovirt-engine[ovirt-engine-4.1]: engine: handle NPE for guest info data of a powered-off vm

Code Review gerrit at ovirt.org
Mon Jul 24 07:32:51 UTC 2017


>From Piotr Kliczewski <piotr.kliczewski at gmail.com>:

Piotr Kliczewski has submitted this change and it was merged. ( https://gerrit.ovirt.org/79643 )

Change subject: engine: handle NPE for guest info data of a powered-off vm
......................................................................


engine: handle NPE for guest info data of a powered-off vm

In case of powering-off a running VM with guest info data (i.e.
guest agent installed) and guestOsType == OsType.Windows, then
displaying 'guest info' sub-tab raises a NPE.

This is becuase powering off a VM, sets vm.guestOs field to null in
ResourceManager.resetVmAttributes(), while other Os fields like
guestOsType are not set to null.
That causes VmGuestInfoModel.setGuestOsNamedVersion() to fail while
trying to access that field.

This patch fixes it by avoid setting vm.guestOs to null.

Bug-Url: https://bugzilla.redhat.com/1448650

Change-Id: I4f84fbe6abbc74bae54de80d8f5348646b8df3b4
Signed-off-by: Sharon Gratch <sgratch at redhat.com>
---
M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/ResourceManager.java
M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmGuestInfoModel.java
2 files changed, 1 insertion(+), 2 deletions(-)

Approvals:
  Jenkins CI: Passed CI tests
  Sharon Gratch: Verified
  Arik Hadas: Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4f84fbe6abbc74bae54de80d8f5348646b8df3b4
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-4.1
Gerrit-Owner: Sharon Gratch <sgratch at redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Sharon Gratch <sgratch at redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjelinek at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the Engine-commits mailing list