
Tal Nisan 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@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: Jenkins CI: Passed CI tests Shmuel Leib Melamud: Verified Arik Hadas: Looks good to me, approved Michal Skrivanek: Looks good to me, but someone else must approve -- To view, visit https://gerrit.ovirt.org/59180 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I099d5a8b7ee3aef6b8abb124de39767de6a99c20 Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-4.0 Gerrit-Owner: Shmuel Leib Melamud <smelamud@redhat.com> Gerrit-Reviewer: Arik Hadas <ahadas@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Liron Aravot <laravot@redhat.com> Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek@redhat.com> Gerrit-Reviewer: Shmuel Leib Melamud <smelamud@redhat.com> Gerrit-Reviewer: Tal Nisan <tnisan@redhat.com> Gerrit-Reviewer: gerrit-hooks <automation@ovirt.org>