Maor Lipchuk has uploaded a new change for review.

Change subject: core: Add getSnapshotLeaf method to ImagesHandler
......................................................................

core: Add getSnapshotLeaf method to ImagesHandler

Add a method to fetch the last leaf of the disk image group chane so we
will be able to know the parent id of new Cinder snapshots.

Change-Id: I7c2e042cf2e973617c46d9a9b799e475c7b41f8c
Bug-Url: https://bugzilla.redhat.com/1185826
Signed-off-by: Maor Lipchuk <mlipc...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImagesHandler.java
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/14/41914/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImagesHandler.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImagesHandler.java
index 71d00e0..3bc5b42 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImagesHandler.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImagesHandler.java
@@ -725,6 +725,13 @@
         
updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation(Collections.singletonList(diskId),
 status, statusForCompensation, compensationContext);
     }
 
+    public static DiskImage getSnapshotLeaf(Guid diskId) {
+        List<DiskImage> diskSnapshots =
+                
DbFacade.getInstance().getDiskImageDao().getAllSnapshotsForImageGroup(diskId);
+        sortImageList(diskSnapshots);
+        return diskSnapshots.get(diskSnapshots.size() - 1);
+    }
+
     public static void 
updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation(final 
Collection<Guid> diskIds,
                                                                          final 
ImageStatus status,
                                                                          
ImageStatus statusForCompensation,


-- 
To view, visit https://gerrit.ovirt.org/41914
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c2e042cf2e973617c46d9a9b799e475c7b41f8c
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to