Juan Hernandez has posted comments on this change.

Change subject: restapi: added support for io_threads
......................................................................


Patch Set 5:

(2 comments)

https://gerrit.ovirt.org/#/c/40094/5/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
File 
backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd:

Line 3253:     <xs:complexType name="IO">
Line 3254:         <xs:sequence>
Line 3255:             <xs:element name="threads" type="xs:int" minOccurs="0" 
maxOccurs="1"/>
Line 3256:         </xs:sequence>
Line 3257:     </xs:complexType>
Remember to fix the indentation before merging: 2 spaces per level.
Line 3258: 
Line 3259:   <xs:complexType name="VmBase">
Line 3260:     <xs:annotation>
Line 3261:       <xs:appinfo>


https://gerrit.ovirt.org/#/c/40094/5/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmBaseMapper.java
File 
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmBaseMapper.java:

Line 183:         model.setMemory((long) entity.getMemSizeMb() * BYTES_PER_MB);
Line 184: 
Line 185:         IO io = new IO();
Line 186:         io.setThreads(entity.getNumOfIoThreads());
Line 187:         model.setIo(io);
The "IO" property of the passed model may have been already populated (not now, 
I know, but in the future that may change) and here you are completely 
replacing it. Instead of that check if it exists and create only if needed:

  IO io = model.getIo();
  if (io == null) {
    io = new IO();
    model.setIo();
  }
  io.setTrheads(...);

I know that we do this incorrectly in other places, like with the cluster a few 
lines below, but better if we don't do it even more.
Line 188: 
Line 189:         if (entity.getVdsGroupId() != null) {
Line 190:             Cluster cluster = new Cluster();
Line 191:             cluster.setId(entity.getVdsGroupId().toString());


-- 
To view, visit https://gerrit.ovirt.org/40094
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3e6f9b76d424027ef21e17cc3b3c9ffd7023b52d
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tomas Jelinek <tjeli...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjeli...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to