weizhouapache commented on a change in pull request #5875:
URL: https://github.com/apache/cloudstack/pull/5875#discussion_r800472984



##########
File path: 
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/DirectVifDriver.java
##########
@@ -47,12 +47,8 @@
     public LibvirtVMDef.InterfaceDef plug(NicTO nic, String guestOsType, 
String nicAdapter, Map<String, String> extraConfig) throws 
InternalErrorException, LibvirtException {
         LibvirtVMDef.InterfaceDef intf = new LibvirtVMDef.InterfaceDef();
 
-        if (nic.getType() == Networks.TrafficType.Guest) {
-            Integer networkRateKBps = (nic.getNetworkRateMbps() != null && 
nic.getNetworkRateMbps().intValue() != -1) ? 
nic.getNetworkRateMbps().intValue() * 128 : 0;
-            
intf.defDirectNet(_libvirtComputingResource.getNetworkDirectDevice(), null, 
nic.getMac(), getGuestNicModel(guestOsType, nicAdapter),
-                _libvirtComputingResource.getNetworkDirectSourceMode(), 
networkRateKBps);
-
-        } else if (nic.getType() == Networks.TrafficType.Public) {
+        if (Sets.newHashSet(Networks.TrafficType.Guest,

Review comment:
       is Sets imported already ?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to