Allon Mureinik has posted comments on this change.

Change subject: core: Add alias and description for disk meta data
......................................................................


Patch Set 19: Code-Review-1

(3 comments)

http://gerrit.ovirt.org/#/c/34163/19/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmDiskCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmDiskCommand.java:

Line 185:                 setAndValidateDiskProfiles();
Line 186:     }
Line 187: 
Line 188:     protected StorageDomainValidator 
getStorageDomainValidator(DiskImage diskImage) {
Line 189:         if (storageDomainValidator == null) {
If you have a parameter, caching the validator doesn't make sense - the API 
seems as though you can pass a DiskImage and get a validator for it, when in 
practice you'll get the same validator regardless of the param.
Line 190:             StorageDomain storageDomain = 
getStorageDomainDAO().getForStoragePool(
Line 191:                     diskImage.getStorageIds().get(0), 
diskImage.getStoragePoolId());
Line 192:             storageDomainValidator = new 
StorageDomainValidator(storageDomain);
Line 193:         }


Line 297:         }
Line 298:         return true;
Line 299:     }
Line 300: 
Line 301:     private boolean isDomainExistAndActive() {
I think you should drop this method - see below.
Line 302:         return (validate(getStorageDomainValidator((DiskImage) 
getNewDisk()).isDomainExistAndActive()));
Line 303:     }
Line 304: 
Line 305:     protected boolean validateCanResizeDisk() {


Line 414:     private void updateMetaDataDescription(DiskImage diskImage) {
Line 415:         StorageDomain storageDomain =
Line 416:                 
getStorageDomainDAO().getForStoragePool(diskImage.getStorageIds().get(0),
Line 417:                         getVm().getStoragePoolId());
Line 418:         if (!isDomainExistAndActive()) {
This will change the CDA messages in the execute phase - eak.

This should be something like

    if (getStorageDomainValidator(diskImage).isExistsAndUp().isValid()) {
Line 419:             
auditLogForNoMetadataDescriptionUpdate(AuditLogType.UPDATE_DESCRIPTION_FOR_DISK_FAILED_SINCE_STORAGE_DOMAIN_NOT_ACTIVE,
Line 420:                     storageDomain,
Line 421:                     diskImage);
Line 422:             return;


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie2642ae7016579ead699509426e01ac2010bd374
Gerrit-PatchSet: 19
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to