Maor Lipchuk has posted comments on this change.

Change subject: core: [DO NOT SUBMIT] Default quota name
......................................................................


Patch Set 3: (5 inline comments)

....................................................
File backend/manager/dbscripts/upgrade/03_01_0910_fix_default_quota_name.sql
Line 2: SET    quota_name = 'DefaultQuota-' || (SELECT name FROM storage_pool 
WHERE storage_pool.id = quota.storage_pool_id)
quota_name field length should be updated to more then 60 characters, since the 
storage pool name has 50 character length,.

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/QuotaHelper.java
Line 377:         if (!quota.getIsDefaultQuota() && 
quota.getQuotaName().equals(defaultQuotaForDCName)) {
Need to check if the quota name is not null, since its a parameter which 
initialize in the client

Line 389:     protected String getStoragePoolNameForQuota(Quota quota) {
Take in mind there is a hidden bug here,
Consider the following scenario

1. Edit the default quota when DC is Enabled to make it no default any more and 
change its name from DefaultQuota-DC1 to DefaultQuota-DC2
2. Now change the DC name from DC1 to DC2 and disable the DC.

Result : operation will fail duo to duplicate constraint, and user will not be 
able to disable its DC until change its DC name back

Line 393:             if (storagePoolId != null) {
I think, you dont need to check null for storagePoold, the DAO can handle it.

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateQuotaCommand.java
Line 28:         getQuota().setIsDefaultQuota(false);
Should not be here, quota could be null,
before it was after the can do action checks so it was certain it is not null

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I3c58f42a28a21ebe4fdacf09647fe085327b6437
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to