Moti Asayag has posted comments on this change. Change subject: engine: Dual mode shouldn't be sent to vdsm on hotplug nic ......................................................................
Patch Set 4: (1 comment) http://gerrit.ovirt.org/#/c/26380/4/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotPlugNicVDSCommand.java File backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HotPlugNicVDSCommand.java: Line 48: Line 49: addAddress(map, vmDevice.getAddress()); Line 50: map.put(VdsProperties.SpecParams, vmDevice.getSpecParams()); Line 51: Line 52: VmInterfaceType ifaceType = VmInterfaceType.forValue(nic.getType()); this shares the same logic as VmInforBuilder.buildVmNetworkInterfaces() which is kind of redundant to maintain. Therefore, please extract a method out of both places to evaluate the desired VmInterfaceType to be sent to vdsm. Than you can use it in both places, for example here: map.put(VdsProperties.NIC_TYPE, VmInfoBuilder.evaluateInterfaceType(vm, ifaceType)); and on VmInfoBuilder you'll replace lines 371-390 with: addNetworkInterfaceProperties(struct, vmInterface, vmDevice, VmInfoBuilder.evaluateInterfaceType(vm, ifaceType), vm.getVdsGroupCompatibilityVersion()); you could even add a nice a test for this new method :-) Line 53: if (ifaceType == VmInterfaceType.rtl8139_pv) { Line 54: if (getParameters().getVm().getHasAgent()) { Line 55: map.put(VdsProperties.NIC_TYPE, VmInterfaceType.pv.name()); Line 56: } else { -- To view, visit http://gerrit.ovirt.org/26380 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifdc878a5f8391659a58cf25f2f9137c944689ce4 Gerrit-PatchSet: 4 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alona Kaplan <alkap...@redhat.com> Gerrit-Reviewer: Lior Vernia <lver...@redhat.com> Gerrit-Reviewer: Martin Mucha <mmu...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: Yevgeny Zaspitsky <yzasp...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches