bug 7080: fix usage for kvm;Reviewed-by: kishan

This commit is contained in:
Edison Su 2012-03-20 15:04:17 -07:00
parent c76349ffe1
commit 0b4c0e3e46
1 changed files with 5 additions and 2 deletions

View File

@ -1185,10 +1185,13 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
if (!vlanAllocatedToVM.containsKey(ip.getVlanId())) {
/*plug a vif into router*/
VifHotPlug(conn, routerName, ip.getVlanId(), ip.getVifMacAddress());
vlanAllocatedToVM.put(ip.getVlanId(), nicPos++);
vlanAllocatedToVM.put(ip.getVlanId(), nicPos);
networkUsage(routerIp, "addVif", "eth" + nicPos);
nicPos++;
}
nicNum = vlanAllocatedToVM.get(ip.getVlanId());
networkUsage(routerIp, "addVif", "eth" + nicNum);
result = _virtRouterResource.assignPublicIpAddress(routerName, routerIp, ip.getPublicIp(), ip.isAdd(),
ip.isFirstIP(), ip.isSourceNat(),
ip.getVlanId(), ip.getVlanGateway(), ip.getVlanNetmask(),