alexanderbazhenoff edited a comment on issue #2918: Improved perfomance on 
creating VM (KVM)
URL: https://github.com/apache/cloudstack/pull/2918#issuecomment-432412102
 
 
   > It makes sense, right? I mean, if it is not up, we set it to up.
   
   Yes, it makes sense. To be honest I don't see the reason to use the whole 
constructions (which again takies some milliseconds on creating VMs):
   
   `# is vlanBr up?`
   `ip link show dev $vlanBr > /dev/null 2>/dev/null`
   `if [ $? -eq 0 ]`
   `then`
   `ip link set $vlanBr up`
   `fi`
   `return 0`
   
   Just to save original code style. But:
   
   `ip link set $vlanBr up > /dev/null 2>/dev/null`
   
   without any condition is faster.
   
   Also:
   
   `ip link set $vlanDev up > /dev/null 2>/dev/null`
   
   instead of:
   
   `# is up?`
   `ip link show dev $vlanDev > /dev/null 2>/dev/null`
   `if [ $? -eq 0 ]`
   `then`
   `ip link set $vlanDev up > /dev/null`
   `fi`
   
   This will not fail on nonnexistent interfaces.
   
   

----------------------------------------------------------------
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

Reply via email to