Gilad Chaplik has posted comments on this change. Change subject: core, db: disk profile for disk image ......................................................................
Patch Set 13: (3 comments) new patch to follow, prefer to leave the 'eauals' method as it is, please see inline http://gerrit.ovirt.org/#/c/29036/13/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java: Line 704: ArrayList<Guid> storageIds = new ArrayList<Guid>(); Line 705: storageIds.add(storageId); Line 706: newImage.setStorageIds(storageIds); Line 707: newImage.setQuotaId(image.getQuotaId()); Line 708: newImage.setDiskProfileId(image.getDiskProfileId()); > please verify that I'll mark the verify flag before merging :-) Line 709: return newImage; Line 710: } Line 711: Line 712: protected boolean canAddVm(List<String> reasons, String name, Guid storagePoolId, http://gerrit.ovirt.org/#/c/29036/13/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/DiskImage.java File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/DiskImage.java: Line 534: && ObjectUtils.objectsEqual(readLatency, other.readLatency) Line 535: && ObjectUtils.objectsEqual(writeLatency, other.writeLatency) Line 536: && ObjectUtils.objectsEqual(flushLatency, other.flushLatency) Line 537: && ObjectUtils.objectsEqual(diskProfileIds, other.diskProfileIds) Line 538: && ObjectUtils.objectsEqual(diskProfileNames, other.diskProfileNames)); > how we can? that depends on the order it's queried from the db in most case Take a look at line 530, we're using the same equality, hence, the diskProfiles will be ordered as the SDs. IMO performing equality of objects irrespective to order is costly, anyway I think that this case it's very rare, and doesn't worth dealing with it. If there would be a bug here (which I doubt), we can solve it easily. Line 539: } Line 540: http://gerrit.ovirt.org/#/c/29036/13/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/ImageStorageDomainMapDao.java File backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/ImageStorageDomainMapDao.java: Line 53: * @param diskId Line 54: * @param storageDomainId Line 55: * @param diskProfileId Line 56: */ Line 57: void updateDiskProfileByImageGroupId(Guid diskId, Guid storageDomainId, Guid diskProfileId); > ByImageGroupIdAndStorageDomainId Done -- To view, visit http://gerrit.ovirt.org/29036 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9488a1e31e85013a01ee088fdf71854f765059c9 Gerrit-PatchSet: 13 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Daniel Erez <de...@redhat.com> Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com> Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Liron Aravot <lara...@redhat.com> Gerrit-Reviewer: Tal Nisan <tni...@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