fix http://bugs.cloud.com/show_bug.cgi?id=14775, it happened when untagged network created on tagged vlan

This commit is contained in:
Edison Su 2012-08-29 09:46:44 -07:00
parent 5751385444
commit 7bd5c58fc3

View File

@ -1249,12 +1249,12 @@ public class LibvirtComputingResource extends ServerResourceBase implements
if (nic.getBrName().equalsIgnoreCase(_linkLocalBridgeName)) {
vlanAllocatedToVM.put("LinkLocal", nicPos);
} else {
String vlanId = getVlanIdFromBridge(nic.getBrName());
if (vlanId != null) {
vlanAllocatedToVM.put(vlanId, nicPos);
} else {
vlanAllocatedToVM.put(Vlan.UNTAGGED, nicPos);
}
if (nic.getBrName().equalsIgnoreCase(_publicBridgeName) || nic.getBrName().equalsIgnoreCase(_privBridgeName) || nic.getBrName().equalsIgnoreCase(_guestBridgeName)) {
vlanAllocatedToVM.put(Vlan.UNTAGGED, nicPos);
} else {
String vlanId = getVlanIdFromBridge(nic.getBrName());
vlanAllocatedToVM.put(vlanId, nicPos);
}
}
nicPos++;
}