Change in ovirt-engine[master]: core: add locks to VmTemplate commands (#761515)

mkublin at redhat.com mkublin at redhat.com
Tue Sep 25 11:17:30 UTC 2012


Michael Kublin has submitted this change and it was merged.

Change subject: core: add locks to VmTemplate commands (#761515)
......................................................................


core: add locks to VmTemplate commands (#761515)

https://bugzilla.redhat.com/761515

Currently the different VmTemplate commands make use of DB lock only,
which causes to different race conditions (as the lock is check and only
then acquired - non atomic operation). This patch adds to the different
VmTemplate commands the use of in-memory lock and canDoAction() checks
in order to prevent those race conditions and possible corruption.

NOTE: this patch doesn't add the use of locks to the different export
domain VmTemplate related commands, the reason for this is that the
exported template is not present on the engine DB so a lock on that
export object cannot be done.

Change-Id: I2d5b6518bbf19077ae5822b9359a6147c87d0f46
Signed-off-by: Liron Aravot <laravot at redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmFromTemplateCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ExportVmTemplateCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyTemplateCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveVmTemplateCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmTemplateHandler.java
5 files changed, 61 insertions(+), 46 deletions(-)

Approvals:
  Michael Kublin: Verified; Looks good to me, approved


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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2d5b6518bbf19077ae5822b9359a6147c87d0f46
Gerrit-PatchSet: 17
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Aravot <laravot at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron at redhat.com>
Gerrit-Reviewer: Daniel Erez <derez at redhat.com>
Gerrit-Reviewer: Liron Aravot <laravot at redhat.com>
Gerrit-Reviewer: Michael Kublin <mkublin at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: Vered Volansky <vvolansk at redhat.com>



More information about the Engine-commits mailing list