Jonathan Choate has posted comments on this change.

Change subject: engine : Hotplug - a new command added, main logic
......................................................................


Patch Set 2: (4 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HotPlugDiskToVmCommand.java
Line 30:     protected boolean canDoAction() {
this method has a lot of calls to getVm(), why not create a local variable so 
you don't have to keep making the call every time you need it?

Line 44:                 .contains(getVm().getguest_os().toLowerCase())) {
This is a moderately risky way of determining if the OS is supported.  For 
instance if the HotPlugSupportedList was "OpenSUSE,Kubuntu"  it would return a 
false positive for both "SUSE" and "Ubuntu".  All four of those are legitimate 
distributions as listed on distrowatch.  You may want to parse the string out 
into a list to check that it is an exact match.

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HotUnPlugDiskFromVmCommand.java
Line 13: public class HotUnPlugDiskFromVmCommand<T extends 
HotPlugDiskToVmParameters> extends HotPlugDiskToVmCommand<T> {
This is confusing - what the inheritance hierarchy is saying is that an hot 
unplug command is a type of hot plug command.  Not only is this illogical, it 
would allow the use of an unplug command in place of a plug command.

Additionally this signature could be simplified to HotUnPlugDiskFromVmCommand 
extends HotPlugDiskToVmCommand<HotPlugDiskToVmParameters>.

....................................................
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotUnPlugDiskVDSCommand.java
Line 5: public class HotUnPlugDiskVDSCommand<P extends 
HotPlugDiskVDSParameters> extends HotPlugDiskVDSCommand<P> {
Same comment as on the bll command clases

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

Gerrit-MessageType: comment
Gerrit-Change-Id: If3190a8f82c7abee7af2ab470b37a2cdc36009d9
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Michael Kublin <[email protected]>
Gerrit-Reviewer: Jonathan Choate <[email protected]>
Gerrit-Reviewer: Michael Kublin <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to