Skip to content

Commit 9bf4281

Browse files
committed
Merge pull request #2011 from ustcweizhou/fix-issue-p55p1
CLOUDSTACK-9811: fix duplicated nics on VR caused by nic name p<slot_number>p<port_number> * pr/2011: CLOUDSTACK-9811: fix duplicated nics on VR caused by nic name p<slot_number>p<port_number> Signed-off-by: Rajani Karuturi <rajani.karuturi@accelerite.com>
2 parents 929c823 + bf93b63 commit 9bf4281

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,15 +1464,17 @@ public String getResizeScriptType(final KVMStoragePool pool, final KVMPhysicalDi
14641464

14651465
private String getBroadcastUriFromBridge(final String brName) {
14661466
final String pif = matchPifFileInDirectory(brName);
1467-
final Pattern pattern = Pattern.compile("(\\D+)(\\d+)(\\D*)(\\d*)");
1467+
final Pattern pattern = Pattern.compile("(\\D+)(\\d+)(\\D*)(\\d*)(\\D*)(\\d*)");
14681468
final Matcher matcher = pattern.matcher(pif);
14691469
s_logger.debug("getting broadcast uri for pif " + pif + " and bridge " + brName);
14701470
if(matcher.find()) {
14711471
if (brName.startsWith("brvx")){
14721472
return BroadcastDomainType.Vxlan.toUri(matcher.group(2)).toString();
14731473
}
14741474
else{
1475-
if (!matcher.group(4).isEmpty()) {
1475+
if (!matcher.group(6).isEmpty()) {
1476+
return BroadcastDomainType.Vlan.toUri(matcher.group(6)).toString();
1477+
} else if (!matcher.group(4).isEmpty()) {
14761478
return BroadcastDomainType.Vlan.toUri(matcher.group(4)).toString();
14771479
} else {
14781480
//untagged or not matching (eth|bond|team)#.#

0 commit comments

Comments
 (0)