Shahar Havivi has submitted this change and it was merged.
Change subject: core: Correct flow of RunVmCommand.endAction()
......................................................................
core: Correct flow of RunVmCommand.endAction()
Recent change in RunVmCommand.getCallback() forces RunVmCommand to
actively use the callback. This requires changes in other places to
correctly execute RunVmCommand.endAction() in every situation.
The flow selected by RunVmCommand.getFlow() method is now cached in
RunVmParams. The cache in RunVmCommand itself is useless, because the
command is created from scratch when CoCo calls its callback, and
getFlow() cannot determine the flow correctly in this situation.
AttachUserToVmFromPoolAndRunCommand is modified to correctly use the
callback - without it endAction() is never called. RunVmCommand is
started as COMMAND_MANAGED and performs by itself all actions needed to
start a VM as stateless or stateful.
AttachUserToVmFromPoolAndRunCommand.endAction() is executed after that
and checks the final result of RunVmCommand. If it failed, user's
ownership of the VM is reverted.
Change-Id: I099d5a8b7ee3aef6b8abb124de39767de6a99c20
Bug-Url:
https://bugzilla.redhat.com/show_bug.cgi?id=1342795
Signed-off-by: Shmuel Melamud <smelamud(a)redhat.com>
---
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AttachUserToVmFromPoolAndRunCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RunVmCommandTest.java
M
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/RunVmParams.java
4 files changed, 94 insertions(+), 59 deletions(-)
Approvals:
Shahar Havivi: Looks good to me, approved
Jenkins CI: Passed CI tests
Shmuel Leib Melamud: Verified
--
To view, visit
https://gerrit.ovirt.org/58555
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I099d5a8b7ee3aef6b8abb124de39767de6a99c20
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shmuel Leib Melamud <smelamud(a)redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Liron Aravot <laravot(a)redhat.com>
Gerrit-Reviewer: Shahar Havivi <shavivi(a)redhat.com>
Gerrit-Reviewer: Shmuel Leib Melamud <smelamud(a)redhat.com>
Gerrit-Reviewer: Shmuel Melamud <smelamud(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>