mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 7142: fix the race condition that multiple create vlan requests coming from mgt svr
status 7142: resolved fixed
This commit is contained in:
parent
8af7b2473b
commit
6944979f94
@ -859,8 +859,14 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
||||
boolean isDirectAttachedNetwork(String type) {
|
||||
if ("untagged".equalsIgnoreCase(type))
|
||||
return true;
|
||||
else
|
||||
else {
|
||||
try {
|
||||
Long vnetId = Long.valueOf(type);
|
||||
} catch (NumberFormatException e) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected synchronized String startDomainRouter(StartRouterCommand cmd) {
|
||||
@ -2231,7 +2237,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
||||
return new MigrateAnswer(cmd, result == null, result, null);
|
||||
}
|
||||
|
||||
private Answer execute(PrepareForMigrationCommand cmd) {
|
||||
private synchronized Answer execute(PrepareForMigrationCommand cmd) {
|
||||
final String vmName = cmd.getVmName();
|
||||
String result = null;
|
||||
|
||||
|
||||
23
scripts/vm/network/vnet/modifyvlan.sh
Normal file → Executable file
23
scripts/vm/network/vnet/modifyvlan.sh
Normal file → Executable file
@ -22,8 +22,12 @@ addVlan() {
|
||||
|
||||
if [ $? -gt 0 ]
|
||||
then
|
||||
printf "Failed to create vlan $vlanId on pif: $pif."
|
||||
return 1
|
||||
# race condition that someone already creates the vlan
|
||||
if [ ! -d /sys/class/net/$vlanDev ]
|
||||
then
|
||||
printf "Failed to create vlan $vlanId on pif: $pif."
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -40,8 +44,11 @@ addVlan() {
|
||||
|
||||
if [ $? -gt 0 ]
|
||||
then
|
||||
printf "Failed to create br: $vlanBr"
|
||||
return 2
|
||||
if [ ! -d /sys/class/net/$vlanBr ]
|
||||
then
|
||||
printf "Failed to create br: $vlanBr"
|
||||
return 2
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -52,8 +59,12 @@ addVlan() {
|
||||
brctl addif $vlanBr $vlanDev > /dev/null
|
||||
if [ $? -gt 0 ]
|
||||
then
|
||||
printf "Failed to add vlan: $vlanDev to $vlanBr"
|
||||
return 3
|
||||
ls /sys/class/net/$vlanBr/brif/ |grep -w "$vlanDev" > /dev/null
|
||||
if [ $? -gt 0 ]
|
||||
then
|
||||
printf "Failed to add vlan: $vlanDev to $vlanBr"
|
||||
return 3
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
# is vlanBr up?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user