Moti Asayag has posted comments on this change.

Change subject: engine: Host with no display network should not be selected to 
run VMs
......................................................................


Patch Set 4: (3 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsSelector.java
Line 34: public class VdsSelector {
Line 35:     private final List<Guid> privateRunVdssList = new 
ArrayList<Guid>();
Line 36:     private List<VmNetworkInterface> vmNICs;
Line 37:     private boolean displayNetworkInitialized;
Line 38:     private Network displayNetwork = null;
this initialization is redundant.
Line 39: 
Line 40:     public List<Guid> getRunVdssList() {
Line 41:         return privateRunVdssList;
Line 42:     }


Line 407:             return true;
Line 408:         }
Line 409: 
Line 410:         if (!displayNetworkInitialized) {
Line 411:             // Find the cluster's display network
would you mind extracting this part into its own 'resolveDisplayNetwork' method 
?
Line 412:             List<Network> allNetworksInCluster =
Line 413:                     
DbFacade.getInstance().getNetworkDao().getAllForCluster(host.getVdsGroupId());
Line 414: 
Line 415:             for (Network tempNetwork : allNetworksInCluster) {


Line 426:         }
Line 427: 
Line 428:         // Check if display network attached to host
Line 429:         final List<VdsNetworkInterface> allInterfacesForVds =
Line 430:                 
DbFacade.getInstance().getInterfaceDao().getAllInterfacesForVds(host.getId());
The list of interfaces was already resolved for the host by the previous 
HostValidator.

Perhaps it would be beneficial to merge there 2 validators:

Invoking the logic above from within areRequiredNetworksAvailable()
This requires a minor refactor for areRequiredNetworksAvailable().
Line 431: 
Line 432:         for (VdsNetworkInterface nic : allInterfacesForVds) {
Line 433:             if 
(displayNetwork.getName().equals(nic.getNetworkName())) {
Line 434:                 return true;


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie90e2821f2299be85b1d4c9a6f064a4053f93e73
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to