Change in ovirt-engine[ovirt-engine-4.1]: core: Avoid NPE when importing unregistered Template.

Code Review gerrit at ovirt.org
Mon Feb 6 09:36:36 UTC 2017


>From Tal Nisan <tnisan at redhat.com>:

Tal Nisan has submitted this change and it was merged.

Change subject: core: Avoid NPE when importing unregistered Template.
......................................................................


core: Avoid NPE when importing unregistered Template.

When importing an unregistered Template the initialization of this
Template is being done only in the validate method since it includes
several DB calls and OVF parsing.

Since the init function of ImportVmTemplateFromConfigurationCommand
executes updateMaxMemorySize which uses getVmTemplate()
we get an NPE and fail to register an unregistered Template.

The following fix uses the same technique which is used for
updateGraphicsDevices by checking if the vmBase is null, and if so
simply return.

Change-Id: If13d8aa654e72569d02cc18e91f19d4af7445ac7
Bug-Url: https://bugzilla.redhat.com/1419364
Signed-off-by: Maor Lipchuk <mlipchuk at redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmHandler.java
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Jenkins CI: Passed CI tests
  Maor Lipchuk: Verified
  Arik Hadas: Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: If13d8aa654e72569d02cc18e91f19d4af7445ac7
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-4.1
Gerrit-Owner: Maor Lipchuk <mlipchuk at redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Maor Lipchuk <mlipchuk at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the Engine-commits mailing list