Itamar Heim has submitted this change and it was merged.
Change subject: core: adding support for db lock of all disk snapshots
......................................................................
core: adding support for db lock of all disk snapshots
This change is part of
http://gerrit.ovirt.org/#/c/17679/ and is
separated just for review sake.
This patch adds the ability to lock all disk snapshots/volumes as part
of adding support for attaching disk snapshots to VMs.
The added method in ImagesHandler can be used to lock all the disk
snapshots, while the current "lock" method locks the given volume only.
The need for this change is to prevent race conditions, provide
ability to lock only the needed snapshots of a disk and to have correct
UI indication of the current state.
Example use cases:
1. When removing a disk, all the disk snapshots should be locked and
have their status reverted (otherwise they will be displayed as "OK" for
vms that they are attached to).
2. When extending a disk with snapshots, only the active snapshot should
be locked as other snapshots can be used as attached disk snapshots in
other vms.
3. When moving a disk all the disk snapshots should be locked, as when
the copy of the data ends the source would be deleted.
Change-Id: Ibac8daf6a9e970859a6759d84d7849e7f84e0d79
Signed-off-by: Liron Aravot <laravot(a)redhat.com>
---
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AttachDiskToVmCommand.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/BaseImagesCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImagesHandler.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveImageGroupCommand.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveImageCommand.java
M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/ImageDao.java
M
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/ImageDaoDbFacadeImpl.java
M backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/ImageDaoTest.java
M packaging/dbscripts/images_sp.sql
9 files changed, 112 insertions(+), 24 deletions(-)
Approvals:
Allon Mureinik: Looks good to me, approved
Liron Ar: Verified
--
To view, visit
http://gerrit.ovirt.org/20458
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibac8daf6a9e970859a6759d84d7849e7f84e0d79
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Liron Ar <laravot(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Itamar Heim <iheim(a)redhat.com>
Gerrit-Reviewer: Liron Ar <laravot(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server