Oved Ourfali has posted comments on this change.

Change subject: core: fix adding the right video device type (#849635)
......................................................................


Patch Set 4: (1 inline comment)

See minor comment.

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java
Line 192:                 if (vm.getdisplay_type() == DisplayType.vnc) {
Line 193:                     break;
Line 194:                 }
Line 195:             }
Line 196: 
Not sure I like this part.

The num of monitors is checked in VmHandler, so we shouldn't get to a case in 
which it is VNC with monitors > 1.

However, better safe than sorry, so consider doing the following:
Simple one:
1. Just calculate the number of monitor devices you want to add before the loop 
(using spice/vnc logic), and iterate on it.

More complex one:
1. Add VmHandler (or somewhere else?) with a method returning the max number of 
monitors according to display type.
2. Use it in isNumOfMonitorsLegal.
3. Use this also in this part of VmDeviceUtils, making the num_of_monitors be 
the min between the allowed number and the current number, and iterate on this 
number.

(I'd +2 every alternative you choose :-) ).
Line 197:         }
Line 198:     }
Line 199: 
Line 200:     private static void addVideoDevice(VM vm) {


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I3d28d171b53eb5d44a97f0956384b1012ab5cd1f
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Roy Golan <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to