Change in ovirt-engine[master]: core: introduce RunVmCommand#RunVmFlow

ahadas at redhat.com ahadas at redhat.com
Tue Mar 4 14:14:02 UTC 2014


Arik Hadas has submitted this change and it was merged.

Change subject: core: introduce RunVmCommand#RunVmFlow
......................................................................


core: introduce RunVmCommand#RunVmFlow

RunVmCommand is a complicated command since it contains several
different flows:
- Resume paused VM
- Resume hibernated VM
- Create snapshot and then run the VM for running stateless VMs
- Remove snapshot in case the VM already contains stateless snapshot
- Run VM in all other cases

This patch introduces an enumeration that represents the different flows.
The benefits of using an enum:
- It replaces local flags that indicates the different flows (mResume,
  isFailedStatelessSnapshot)
- It makes the code more structured
- It can be used to eliminate unnecessary operations in certain flows
  more easily. In this patch, I used it in order to prevent initialize
  the VM object in flows where we don't really need it
- In the context of the planned enhancements for RunVmCommand, it allows
  us to query the flow from outside of the command

Change-Id: I2a3f062323c4246b45757d3062478c0109d70708
Signed-off-by: Arik Hadas <ahadas at redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmOnceCommand.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RunVmCommandTest.java
3 files changed, 200 insertions(+), 46 deletions(-)

Approvals:
  Arik Hadas: Verified; Looks good to me, approved



-- 
To view, visit http://gerrit.ovirt.org/22663
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2a3f062323c4246b45757d3062478c0109d70708
Gerrit-PatchSet: 23
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofrenkel at redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list