Mike Kolesnik has posted comments on this change. Change subject: core: HotPlugNicVDSCommand should send "linkState" to the vdsm. ......................................................................
Patch Set 17: (3 inline comments) .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ActivateDeactivateVmNicCommand.java Line 42: // HotPlug in the host needs to be called only if the Vm is UP Line 43: if (hotPlugVmNicRequired(getVm().getStatus())) { Line 44: setVdsId(getVm().getRunOnVds().getValue()); Line 45: returnValue = canPerformHotPlug(); Line 46: if (returnValue && (getNetworkName() != null && !networkAttachedToVds(getNetworkName(), getVdsId()))) { Why check it if it's already checked in networkAttachedToVds ? Alternatively if you check it here you don't need to check it there.. Line 47: addCanDoActionMessage(VdcBllMessages.ACTIVATE_DEACTIVATE_NETWORK_NOT_IN_VDS); Line 48: returnValue = false; Line 49: } Line 50: } .................................................... File backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotPlugNicVDSCommand.java Line 40: Line 41: map.add(VdsProperties.Type, VmDeviceType.INTERFACE.getName()); Line 42: map.add(VdsProperties.Device, VmDeviceType.BRIDGE.getName()); Line 43: map.add(VdsProperties.mac_addr, nic.getMacAddress()); Line 44: if (nic.getNetworkName() != null) { This could be inlined as: map.add(VdsProperties.network, nic.getNetworkName() == null ? "" : nic.getNetworkName()); Line 45: map.add(VdsProperties.network, nic.getNetworkName()); Line 46: } else { Line 47: map.add(VdsProperties.network, ""); Line 48: } Line 62: map.add(VdsProperties.BootOrder, String.valueOf(vmDevice.getBootOrder())); Line 63: } Line 64: Line 65: if (nic.isPortMirroring()) { Line 66: if (nic.getNetworkName() != null) { This could be inlined as: map.add(VdsProperties.portMirroring, nic.getNetworkName() == null ? Collections.emptyList() : Collections.singletonList(nic.getNetworkName())); Line 67: map.add(VdsProperties.portMirroring, Collections.singletonList(nic.getNetworkName())); Line 68: } else { Line 69: map.add(VdsProperties.portMirroring, new ArrayList<String>()); Line 70: } -- To view, visit http://gerrit.ovirt.org/9519 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I127fc3202702f8cb1920990eb77d9fbccdb9804b Gerrit-PatchSet: 17 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alona Kaplan <alkap...@redhat.com> Gerrit-Reviewer: Alona Kaplan <alkap...@redhat.com> Gerrit-Reviewer: Antoni Segura Puimedon <asegu...@redhat.com> Gerrit-Reviewer: Mike Kolesnik <mkole...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: Muli Salem <msa...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches