DaanHoogland commented on code in PR #11507:
URL: https://github.com/apache/cloudstack/pull/11507#discussion_r2332299165
##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetUnmanagedInstancesCommandWrapper.java:
##########
@@ -174,6 +174,9 @@ private List<UnmanagedInstanceTO.Nic>
getUnmanagedInstanceNics(List<LibvirtVMDef
nic.setNetwork(interfaceDef.getDevName());
nic.setPciSlot(interfaceDef.getSlot().toString());
nic.setVlan(interfaceDef.getVlanTag());
+ if (nic.getVlan() == -1 && interfaceDef.getNetType() ==
LibvirtVMDef.InterfaceDef.GuestNetType.BRIDGE) {
Review Comment:
```suggestion
if (nic.getVlan() == -1
&&
LibvirtVMDef.InterfaceDef.GuestNetType.BRIDGE.equals(interfaceDef.getNetType()))
{
```
##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetUnmanagedInstancesCommandWrapper.java:
##########
@@ -174,6 +174,9 @@ private List<UnmanagedInstanceTO.Nic>
getUnmanagedInstanceNics(List<LibvirtVMDef
nic.setNetwork(interfaceDef.getDevName());
nic.setPciSlot(interfaceDef.getSlot().toString());
nic.setVlan(interfaceDef.getVlanTag());
+ if (nic.getVlan() == -1 && interfaceDef.getNetType() ==
LibvirtVMDef.InterfaceDef.GuestNetType.BRIDGE) {
Review Comment:
@abhisar, in context this may be a non-issue but we can not guarantee the
list will never contain a null, so as a matter of defensive programming.
--
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]