Dogface2k commented on code in PR #13791:
URL: https://github.com/apache/cloudstack/pull/13791#discussion_r3725441830
##########
server/src/main/java/com/cloud/network/NetworkServiceImpl.java:
##########
@@ -4230,6 +4236,20 @@ protected boolean canUpgrade(Network network, long
oldNetworkOfferingId, long ne
return canMoveToPhysicalNetwork(network, oldNetworkOfferingId,
newNetworkOfferingId);
}
+ protected boolean haveMatchingNsxSegmentProfiles(long
oldNetworkOfferingId, long newNetworkOfferingId) {
+ Map<NetworkOffering.Detail, String> oldDetails =
_networkModel.getNtwkOffDetails(oldNetworkOfferingId);
+ Map<NetworkOffering.Detail, String> newDetails =
_networkModel.getNtwkOffDetails(newNetworkOfferingId);
+ for (NetworkOffering.Detail detail :
List.of(NetworkOffering.Detail.NsxIpDiscoveryProfileId,
+ NetworkOffering.Detail.NsxMacDiscoveryProfileId,
NetworkOffering.Detail.NsxSegmentSecurityProfileId)) {
Review Comment:
haveMatchingNsxSegmentProfiles() is called only during explicit
network-offering upgrade validation, not from a hot data-plane, polling, or
request-processing loop. The allocation is a bounded three-element immutable
List.of(...) once per administrator-triggered upgrade check. Moving it to a
class-level constant would not materially change performance or correctness, so
I am retaining the local list for locality and resolving this optional
optimisation without a code change.
--
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]