Liron Aravot has posted comments on this change.

Change subject: core: Use the latest OVF_STORE files
......................................................................


Patch Set 5:

(2 comments)

http://gerrit.ovirt.org/#/c/32747/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AttachStorageDomainToPoolCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AttachStorageDomainToPoolCommand.java:

Line 203:         List<DiskImage> ovfStoreDiskImages = 
getAllOVFDisks(unregisteredDisks);
Line 204:         if (!ovfStoreDiskImages.isEmpty()) {
Line 205:             registerAllOvfDisks(ovfStoreDiskImages);
Line 206:             boolean entitiesRetrieved = false;
Line 207:             while (!ovfStoreDiskImages.isEmpty()) {
> we can't do for loop here, since every time we get the best match OVF_STORE
i'll elaborate more to clarify my point.

what you should do is to at first sort the disks so that the "best" disks will 
be first, after the second best and so on and than use for-each loop here.
Line 208:                 Pair<DiskImage, Long> ovfDiskAndSize = 
getLatestOVFDisk(ovfStoreDiskImages);
Line 209:                 DiskImage ovfDisk = ovfDiskAndSize.getFirst();
Line 210:                 if (ovfDisk != null) {
Line 211:                     if (!entitiesRetrieved) {


Line 258:                         null,
Line 259:                         ovfDisk.getId(),
Line 260:                         StorageDomainOvfInfoStatus.OUTDATED,
Line 261:                         null);
Line 262:         
getDbFacade().getStorageDomainOvfInfoDao().save(storageDomainOvfInfo);
> I will call getEntitiesFromStorageOvfDisk as part of the transaction at lin
you can't do that, we'll have that way vdsm calls within the transaction which 
is something we want to avoid.
Line 263:     }
Line 264: 
Line 265:     private void registerAllOvfDisks(List<DiskImage> 
ovfStoreDiskImages) {
Line 266:         for (DiskImage ovfStoreDiskImage : ovfStoreDiskImages) {


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8252281f295df49a28c3c131d9a98fef9af8f35e
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Liron Aravot <lara...@redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to