Copilot commented on code in PR #13379:
URL: https://github.com/apache/cloudstack/pull/13379#discussion_r3375738782


##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java:
##########
@@ -186,9 +186,16 @@ protected boolean isValidProtocolAndVnetId(final String 
vNetId, final String pro
 
     protected String createStorageVnetBridgeIfNeeded(NicTO nic, String 
trafficLabel,
                  String storageBrName) throws InternalErrorException {
-        if 
(!Networks.BroadcastDomainType.Storage.equals(nic.getBroadcastType()) || 
nic.getBroadcastUri() == null) {
+        if (nic.getBroadcastUri() == null) {
             return storageBrName;
         }
+
+        boolean isStorageBroadcast = 
Networks.BroadcastDomainType.Storage.equals(nic.getBroadcastType()) ||
+                
Networks.BroadcastDomainType.Storage.equals(Networks.BroadcastDomainType.getSchemeValue(nic.getBroadcastUri()));
+        if (!isStorageBroadcast) {
+            return storageBrName;
+        }

Review Comment:
   The new branch that treats a NIC as “storage broadcast” based on the 
broadcast URI scheme (to handle cases where broadcastType is not Storage) isn’t 
covered by existing unit tests. There are tests for 
createStorageVnetBridgeIfNeeded, but none that assert the new behavior when 
broadcastType is Native/other and broadcastUri is storage://<vlan>, which is 
the regression scenario described in #13378.



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