mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
parent
594c70dde0
commit
2752c49fa7
@ -721,6 +721,13 @@ public class AgentProperties{
|
||||
*/
|
||||
public static final Property<Integer> IOTHREADS = new Property<>("iothreads", 1);
|
||||
|
||||
/**
|
||||
* BGP controll CIDR
|
||||
* Data type: String.<br>
|
||||
* Default value: <code>169.254.0.0/16</code>
|
||||
*/
|
||||
public static final Property<String> CONTROL_CIDR = new Property<>("control.cidr", "169.254.0.0/16");
|
||||
|
||||
public static class Property <T>{
|
||||
private String name;
|
||||
private T defaultValue;
|
||||
|
||||
@ -65,10 +65,7 @@ public class BridgeVifDriver extends VifDriverBase {
|
||||
|
||||
String networkScriptsDir = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.NETWORK_SCRIPTS_DIR);
|
||||
|
||||
String controlCidr = (String)params.get("control.cidr");
|
||||
if (StringUtils.isNotBlank(controlCidr)) {
|
||||
_controlCidr = controlCidr;
|
||||
}
|
||||
_controlCidr = getControlCidr(_controlCidr);
|
||||
|
||||
String value = (String)params.get("scripts.timeout");
|
||||
_timeout = NumbersUtil.parseInt(value, 30 * 60) * 1000;
|
||||
|
||||
@ -26,7 +26,6 @@ import java.util.regex.Pattern;
|
||||
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.libvirt.LibvirtException;
|
||||
|
||||
@ -71,10 +70,7 @@ public class IvsVifDriver extends VifDriverBase {
|
||||
}
|
||||
_ivsIfUpPath = Script.findScript(utilScriptsDir, "qemu-ivs-ifup");
|
||||
|
||||
String controlCidr = (String)params.get("control.cidr");
|
||||
if (StringUtils.isNotBlank(controlCidr)) {
|
||||
_controlCidr = controlCidr;
|
||||
}
|
||||
_controlCidr = getControlCidr(_controlCidr);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -60,10 +60,7 @@ public class OvsVifDriver extends VifDriverBase {
|
||||
dpdkDriver = new DpdkDriverImpl();
|
||||
}
|
||||
|
||||
String controlCidr = (String)params.get("control.cidr");
|
||||
if (StringUtils.isNotBlank(controlCidr)) {
|
||||
_controlCidr = controlCidr;
|
||||
}
|
||||
_controlCidr = getControlCidr(_controlCidr);
|
||||
|
||||
String value = (String)params.get("scripts.timeout");
|
||||
_timeout = NumbersUtil.parseInt(value, 30 * 60) * 1000;
|
||||
|
||||
@ -23,6 +23,8 @@ import java.util.Map;
|
||||
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
import com.cloud.agent.properties.AgentProperties;
|
||||
import com.cloud.agent.properties.AgentPropertiesFileHandler;
|
||||
import org.libvirt.LibvirtException;
|
||||
|
||||
import com.cloud.agent.api.to.NicTO;
|
||||
@ -41,6 +43,11 @@ public abstract class VifDriverBase implements VifDriver {
|
||||
_pifs = (Map<String, String>)params.get("libvirt.host.pifs");
|
||||
}
|
||||
|
||||
protected String getControlCidr(String defaultValue) {
|
||||
String controlCidr = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.CONTROL_CIDR);
|
||||
return controlCidr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract LibvirtVMDef.InterfaceDef plug(NicTO nic, String guestOsType, String nicAdapter, Map<String, String> extraConfig) throws InternalErrorException, LibvirtException;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user