You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2018/05/18 08:31:07 UTC

[GitHub] rhtyd commented on a change in pull request #2653: Generate MAC address if the MAC in command addNicToVirtualMachine is invalid

rhtyd commented on a change in pull request #2653: Generate MAC address if the MAC in command addNicToVirtualMachine is invalid
URL: https://github.com/apache/cloudstack/pull/2653#discussion_r189197392
 
 

 ##########
 File path: server/src/com/cloud/vm/UserVmManagerImpl.java
 ##########
 @@ -1158,7 +1158,9 @@ public UserVm addNicToVirtualMachine(AddNicToVMCmd cmd) throws InvalidParameterV
             }
         }
 
-        if(_nicDao.findByNetworkIdAndMacAddress(networkId, macAddress) != null) {
+        macAddress = lookForNextAvailableMacAddressInNetworkIfMacIsInvalid(macAddress, network.getId());
 
 Review comment:
   This may enforce and end up changing any passed mac address. Instead, please do a isBlank check on the macaddress, we should only override that when the macaddress is not provided as part of `addNicToVirtualMachine` API.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services