bhouse-nexthop commented on code in PR #14378:
URL: https://github.com/apache/cloudstack/pull/14378#discussion_r4273924948
##########
server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java:
##########
@@ -1041,6 +1070,12 @@ private void
applyResolvedValuesToCommand(CloneVPCOfferingCmd cmd, VpcOfferingVO
List<Long> sourceDomainIds,
List<Long> sourceZoneIds,
Map<String, String>
sourceServiceCapabilityList) {
try {
+ Map<String, String> requestPayload = new HashMap<>();
+ if (cmd.getJob() instanceof AsyncJobVO) {
+ String asyncJobPayload = ((AsyncJobVO)
cmd.getJob()).getCmdInfo();
+ requestPayload =
GsonHelper.getGson().fromJson(asyncJobPayload, new TypeToken<HashMap<String,
String>>() {}.getType());
Review Comment:
You shouldn't need to parse the job's cmdInfo. The param is missing from the
request exactly when the field is null, and that's how the rest of this method
already checks (`cmd.getNetworkMode() == null`):
```java
if (cmd.getPublicMultiqueueNumber() == null &&
sourceOffering.getPublicMultiqueueNumber() != null) {
ConfigurationManagerImpl.setField(cmd, "publicMultiqueueNumber",
sourceOffering.getPublicMultiqueueNumber());
}
```
##########
api/src/main/java/com/cloud/network/NetworkModel.java:
##########
@@ -321,9 +321,9 @@ public interface NetworkModel {
boolean isNetworkAvailableInDomain(long networkId, long domainId);
- NicProfile getNicProfile(VirtualMachine vm, long networkId, String
broadcastUri);
+ NicProfile getNicProfile(VirtualMachine vm, long networkId, String
broadcastUri, Integer multiqueueNumber);
Review Comment:
Adding `multiqueueNumber` to both `getNicProfile` overloads touches about 20
callers, and they all pass `null`. Only `NetworkHelperImpl.getNicTO` uses it.
If you set it there, the interface stays the same:
```java
NicProfile nicProfile = _networkModel.getNicProfile(router, networkId,
broadcastUri);
nicProfile.setMultiqueueNumber(multiqueueNumber);
```
--
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]