Arik Hadas has posted comments on this change. Change subject: core: add graphics device to management classes ......................................................................
Patch Set 30: (3 comments) partial review http://gerrit.ovirt.org/#/c/28567/30/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java: Line 842: for (GraphicsType type : GraphicsType.values()) { Line 843: GraphicsDevice graphicsDevice = getParameters().getGraphicsDevices().get(type); Line 844: if (graphicsDevice == null) { Line 845: continue; Line 846: } why not just to iterate over getParameters().getGraphicsDevices().values() and ignore 'null' if exists instead ? Line 847: Line 848: graphicsDevice.setVmId(getVmId()); Line 849: getBackend().runInternalAction(VdcActionType.AddGraphicsDevice, new GraphicsParameters(graphicsDevice)); Line 850: } Line 1428: } Line 1429: } Line 1430: Line 1431: protected boolean checkNumberOfMonitors() { Line 1432: Set<GraphicsType> graphicsTypesToBeSet = getParameters().graphicsTypesToBeSet(); why not taking the keys from the graphics map in the parameters instead? I mean in add-vm we don't expect to see devices that should be remove right? Line 1433: int numOfMonitors = getParameters().getVmStaticData().getNumOfMonitors(); Line 1434: Line 1435: return VmHandler.isNumOfMonitorsLegal(graphicsTypesToBeSet, Line 1436: numOfMonitors, 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 310: private void updateGraphicsDevice() { Line 311: for (GraphicsType type : GraphicsType.values()) { Line 312: if (!getParameters().getGraphicsDevices().containsKey(type)) { Line 313: continue; Line 314: } can we iterate the keys instead? Line 315: Line 316: GraphicsDevice vmGraphicsDevice = getGraphicsDevOfType(type); Line 317: if (vmGraphicsDevice == null) { Line 318: if (getParameters().getGraphicsDevices().get(type) != 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