
Allon Mureinik has submitted this change and it was merged. Change subject: core: lock correct volume when creating a template ...................................................................... core: lock correct volume when creating a template When creating a template out of a vm, CreateImageTemplateCommand is being called for each of the needed vm disks. In that command there all the disk snapshots are being loaded in order to lock the active disk snapshot. That logic caused for 2 bugs in that command: 1. The lock is done always on a wrong disk snapshot, as ImagesHandler.getAllImageSnapshots() will always return the active images as first on the list, and ImagesHandler.getActiveVolume() returns the last on the list, the lock won't be performed on the active volume. 2. The cloned disk properties were copied from that snapshots and from the correct snapshots, leading to wrong persisted information. The fix is to just remove that load and set, as currently a template is created for the active disks only we are supposed to always have the active one already loaded. If and when creating a template from a snapshot will be supported, the locking could be re-inspected, right now there's no need for further db loads. Change-Id: I7f27535de8ec6e007035ffa7a2e5fad80460701a Signed-off-by: Liron Aravot <laravot@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CreateImageTemplateCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ImportVmCommandTest.java 3 files changed, 8 insertions(+), 7 deletions(-) Approvals: Allon Mureinik: Verified; Looks good to me, approved -- To view, visit http://gerrit.ovirt.org/20477 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7f27535de8ec6e007035ffa7a2e5fad80460701a Gerrit-PatchSet: 5 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Liron Ar <laravot@redhat.com> Gerrit-Reviewer: Allon Mureinik <amureini@redhat.com> Gerrit-Reviewer: Daniel Erez <derez@redhat.com> Gerrit-Reviewer: Liron Ar <laravot@redhat.com> Gerrit-Reviewer: Maor Lipchuk <mlipchuk@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server