Arik Hadas has posted comments on this change.

Change subject: core: add graphics device to management classes
......................................................................


Patch Set 30:

(3 comments)

http://gerrit.ovirt.org/#/c/28567/30/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java:

Line 336:     // first dev or null
Line 337:     private GraphicsDevice getGraphicsDevOfType(GraphicsType type) {
Line 338:         VdcQueryReturnValue query =
Line 339:                 
getBackend().runInternalQuery(VdcQueryType.GetGraphicsDevices, new 
IdQueryParameters(getParameters().getVmId()));
Line 340:         List<GraphicsDevice> graphicsDevices = query.getReturnValue();
it seems that for each type of graphics device we query the DB with the same 
input. can we cache it?
Line 341: 
Line 342:         for (GraphicsDevice dev : graphicsDevices) {
Line 343:             if (dev.getGraphicsType() == type) {
Line 344:                 return dev;


http://gerrit.ovirt.org/#/c/28567/30/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmTemplateCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmTemplateCommand.java:

Line 417:                 return dev;
Line 418:             }
Line 419:         }
Line 420: 
Line 421:         return null;
same as for the VM - how about caching the query result?
Line 422:     }
Line 423: 


http://gerrit.ovirt.org/#/c/28567/30/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VmTemplateParametersBase.java
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VmTemplateParametersBase.java:

Line 158:      * Helper method for determining which graphics types are 
supposed to be set for the template.
Line 159:      *
Line 160:      * @return graphics types of graphics devices that will be set to 
the template.
Line 161:      */
Line 162:     public Set<GraphicsType> graphicsTypesToBeSet() {
is it ever being used?
Line 163:         HashSet<GraphicsType> result = new HashSet<GraphicsType>();
Line 164: 
Line 165:         for (GraphicsType graphicsType : GraphicsType.values()) {
Line 166:             if (graphicsDevices.get(graphicsType) != null) {


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I39c84ce94cd3cb52286c52d765a389e69c9b0e62
Gerrit-PatchSet: 30
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Frank Kobzik <fkob...@redhat.com>
Gerrit-Reviewer: Arik Hadas <aha...@redhat.com>
Gerrit-Reviewer: Frank Kobzik <fkob...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@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