Gilad Chaplik has posted comments on this change.

Change subject: core: Set HotSetNumberOfCpusCommand as Quota consume
......................................................................


Patch Set 2:

(3 comments)

http://gerrit.ovirt.org/#/c/27356/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HotSetNumberOfCpusCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HotSetNumberOfCpusCommand.java:

Line 110:         List<QuotaConsumptionParameter> list = new ArrayList<>();
Line 111: 
Line 112:         // Calculate the change in CPU consumption, result above Zero 
means we add CPUs to
Line 113:         // the VM
Line 114:         // result bellow Zero means we subtracted CPUs from the VM
/s/negative, /s/positive

what about result == 0? is there a CDA for that?
Line 115:         int cpuToConsume =
Line 116:                 getParameters().getVm().getNumOfCpus() - 
getVm().getNumOfCpus();
Line 117: 
Line 118:         if (cpuToConsume > 0) {


Line 120:             list.add(new 
QuotaVdsGroupConsumptionParameter(getVm().getQuotaId(),
Line 121:                     null,
Line 122:                     QuotaConsumptionParameter.QuotaAction.CONSUME,
Line 123:                     getVm().getVdsGroupId(),
Line 124:                     getVm().getCpuPerSocket() * cpuToConsume,
what about count cores as threads, I'm not sure we're handling that in quota. 
can you please check?
Line 125:                     0));
Line 126: 
Line 127:         } else if (cpuToConsume < 0) {
Line 128:             // Release CPU quota


Line 129:             list.add(new 
QuotaVdsGroupConsumptionParameter(getVm().getQuotaId(),
Line 130:                     null,
Line 131:                     QuotaConsumptionParameter.QuotaAction.RELEASE,
Line 132:                     getVm().getVdsGroupId(),
Line 133:                     getVm().getCpuPerSocket() * 
Math.abs(cpuToConsume),
you can multiply by -1, the number is negative.
Line 134:                     0));
Line 135:         }
Line 136:         return list;
Line 137:     }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I6d1db7c2f7cbc4ae94e540b26e15dbcf7246bde0
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Kobi Ianko <k...@redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com>
Gerrit-Reviewer: Kobi Ianko <k...@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