rafaelweingartner commented on a change in pull request #2288: CLOUDSTACK-10107: For VMware VMs add devices without unit number URL: https://github.com/apache/cloudstack/pull/2288#discussion_r143729189
########## File path: vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareHelper.java ########## @@ -210,16 +208,13 @@ public static VirtualDevice prepareDvNicDevice(VirtualMachineMO vmMo, ManagedObj dvPortConnection.setPortgroupKey(morNetwork.getValue()); dvPortBacking.setPort(dvPortConnection); nic.setBacking(dvPortBacking); - nic.setKey(30); connectInfo.setAllowGuestControl(true); - connectInfo.setConnected(conntected); + connectInfo.setConnected(connected); connectInfo.setStartConnected(connectOnStart); nic.setAddressType("Manual"); nic.setConnectable(connectInfo); nic.setMacAddress(macAddress); - - nic.setUnitNumber(deviceNumber); nic.setKey(-contextNumber); Review comment: @rhtyd I know this is not your code, but there is something that called my attention (maybe you know why this is the way it is). At first I thought it was some dusty on my laptop screen... When the method `nic.setKey` is called, the code does `-contextNumber`, converting the positive integer to a negative one. I looked at the docs and the key is a unique ID of the NIC, but I reading the docs I did not see any reasons to use negative value as IDs. Do you understand why we are using negative values there? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services