Mike Kolesnik has posted comments on this change.

Change subject: core: Validate Network is in Host for HotPlug (#850854)
......................................................................


Patch Set 1: (4 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmInterfaceCommand.java
Line 111:         if (!plugVmNicReturnValue.getSucceeded()) {
Line 112:             getReturnValue().getExecuteFailedMessages().add("Failed 
hot-plugging nic to VM");
Line 113:             
getReturnValue().getCanDoActionMessages().addAll(plugVmNicReturnValue.getCanDoActionMessages());
Line 114:             
getReturnValue().getCanDoActionMessages().remove(VdcBllMessages.VAR__ACTION__ADD);
Line 115:             getReturnValue().setCanDoAction(false);
Please perform this change in the patch the you pushed the call to the command
Line 116:         }
Line 117:         return plugVmNicReturnValue.getSucceeded();
Line 118:     }
Line 119: 


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/PlugUnplugVmNicCommand.java
Line 60:         return returnValue;
Line 61:     }
Line 62: 
Line 63:     private String getNetworkName() {
Line 64:         return 
getVmNetworkInterfaceDAO().get(getParameters().getNicId()).getNetworkName();
Possible NPE if the interface doesn't exist.
Line 65:     }
Line 66: 
Line 67:     @Override
Line 68:     protected void ExecuteVmCommand() {


Line 103:         return vmStatus == VMStatus.Up || vmStatus == VMStatus.Down;
Line 104:     }
Line 105: 
Line 106:     private boolean networkAttachedToVds(String networkName, Guid 
vdsId) {
Line 107:         if (networkName != null) {
Suggestion:

It would be easier to read if you do it like this:
if (networkName == null) {
    return false;
}

// do the work


Since the nesting adds a level of complexity which can be easily avoided.
Line 108:             List<VdsNetworkInterface> listOfInterfaces = 
getInterfaceDAO().getAllInterfacesForVds(vdsId);
Line 109:             for (VdsNetworkInterface vdsNetworkInterface : 
listOfInterfaces) {
Line 110:                 if 
(networkName.equals(vdsNetworkInterface.getNetworkName())) {
Line 111:                     return true;


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmCommand.java
Line 506:     protected DiskImageDAO getDiskImageDAO() {
Line 507:         return getDbFacade().getDiskImageDAO();
Line 508:     }
Line 509: 
Line 510:     protected InterfaceDAO getInterfaceDAO() {
Why did you define this at this command?
Line 511:         return getDbFacade().getInterfaceDAO();
Line 512:     }
Line 513: 
Line 514:     protected boolean checkPayload(VmPayload payload, String isoPath) 
{


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie1ef34503e5232280c506cf6a909fd703e99acb3
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Muli Salem <[email protected]>
Gerrit-Reviewer: Mike Kolesnik <[email protected]>
Gerrit-Reviewer: Muli Salem <[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