mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Summary: Begone pesky tabs
This commit is contained in:
parent
f09d453efe
commit
2d69a1855d
@ -669,8 +669,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements
|
|||||||
|
|
||||||
if (_bridgeType == BridgeType.OPENVSWITCH) {
|
if (_bridgeType == BridgeType.OPENVSWITCH) {
|
||||||
if (conn.getLibVirVersion() < (9 * 1000 + 11)) {
|
if (conn.getLibVirVersion() < (9 * 1000 + 11)) {
|
||||||
throw new ConfigurationException(
|
throw new ConfigurationException("LibVirt version 0.9.11 required for openvswitch support, but version "
|
||||||
"LibVirt version 0.9.11 required for openvswitch support, but version "
|
|
||||||
+ conn.getLibVirVersion() + " detected");
|
+ conn.getLibVirVersion() + " detected");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -720,12 +719,13 @@ public class LibvirtComputingResource extends ServerResourceBase implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (_bridgeType) {
|
switch (_bridgeType) {
|
||||||
case NATIVE:
|
|
||||||
getPifs();
|
|
||||||
break;
|
|
||||||
case OPENVSWITCH:
|
case OPENVSWITCH:
|
||||||
getOvsPifs();
|
getOvsPifs();
|
||||||
break;
|
break;
|
||||||
|
case NATIVE:
|
||||||
|
default:
|
||||||
|
getPifs();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_pifs.get("private") == null) {
|
if (_pifs.get("private") == null) {
|
||||||
@ -789,8 +789,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements
|
|||||||
if (_bridgeType == BridgeType.OPENVSWITCH) {
|
if (_bridgeType == BridgeType.OPENVSWITCH) {
|
||||||
s_logger.info("No libvirt.vif.driver specififed. Defaults to OvsVifDriver.");
|
s_logger.info("No libvirt.vif.driver specififed. Defaults to OvsVifDriver.");
|
||||||
vifDriverName = "com.cloud.hypervisor.kvm.resource.OvsVifDriver";
|
vifDriverName = "com.cloud.hypervisor.kvm.resource.OvsVifDriver";
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
s_logger.info("No libvirt.vif.driver specififed. Defaults to BridgeVifDriver.");
|
s_logger.info("No libvirt.vif.driver specififed. Defaults to BridgeVifDriver.");
|
||||||
vifDriverName = "com.cloud.hypervisor.kvm.resource.BridgeVifDriver";
|
vifDriverName = "com.cloud.hypervisor.kvm.resource.BridgeVifDriver";
|
||||||
}
|
}
|
||||||
@ -810,7 +809,6 @@ public class LibvirtComputingResource extends ServerResourceBase implements
|
|||||||
throw new ConfigurationException("Failed to initialize libvirt.vif.driver " + e);
|
throw new ConfigurationException("Failed to initialize libvirt.vif.driver " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -839,10 +837,11 @@ public class LibvirtComputingResource extends ServerResourceBase implements
|
|||||||
List<String> bridges = Arrays.asList(cmdout.split("%"));
|
List<String> bridges = Arrays.asList(cmdout.split("%"));
|
||||||
for (String bridge : bridges) {
|
for (String bridge : bridges) {
|
||||||
s_logger.debug("looking for pif for bridge " + bridge);
|
s_logger.debug("looking for pif for bridge " + bridge);
|
||||||
//String pif = getOvsPif(bridge);
|
// String pif = getOvsPif(bridge);
|
||||||
// Not really interested in the pif name at this point for ovs bridges
|
// Not really interested in the pif name at this point for ovs
|
||||||
|
// bridges
|
||||||
String pif = bridge;
|
String pif = bridge;
|
||||||
if(_publicBridgeName != null && bridge.equals(_publicBridgeName)){
|
if (_publicBridgeName != null && bridge.equals(_publicBridgeName)) {
|
||||||
_pifs.put("public", pif);
|
_pifs.put("public", pif);
|
||||||
}
|
}
|
||||||
if (_guestBridgeName != null && bridge.equals(_guestBridgeName)) {
|
if (_guestBridgeName != null && bridge.equals(_guestBridgeName)) {
|
||||||
|
|||||||
@ -36,8 +36,7 @@ import com.cloud.utils.script.OutputInterpreter;
|
|||||||
import com.cloud.utils.script.Script;
|
import com.cloud.utils.script.Script;
|
||||||
|
|
||||||
public class OvsVifDriver extends VifDriverBase {
|
public class OvsVifDriver extends VifDriverBase {
|
||||||
private static final Logger s_logger = Logger
|
private static final Logger s_logger = Logger.getLogger(OvsVifDriver.class);
|
||||||
.getLogger(OvsVifDriver.class);
|
|
||||||
private int _timeout;
|
private int _timeout;
|
||||||
private String _modifyVlanPath;
|
private String _modifyVlanPath;
|
||||||
|
|
||||||
@ -174,7 +173,6 @@ public class OvsVifDriver extends VifDriverBase {
|
|||||||
Script.runSimpleBashScript("ovs-vsctl add-br " + privBrName + "; ifconfig " + privBrName + " up; ifconfig " +
|
Script.runSimpleBashScript("ovs-vsctl add-br " + privBrName + "; ifconfig " + privBrName + " up; ifconfig " +
|
||||||
privBrName + " 169.254.0.1", _timeout);
|
privBrName + " 169.254.0.1", _timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isBridgeExists(String bridgeName) {
|
private boolean isBridgeExists(String bridgeName) {
|
||||||
|
|||||||
@ -206,8 +206,7 @@ public class Script implements Callable<String> {
|
|||||||
_logger.debug("Execution is successful.");
|
_logger.debug("Execution is successful.");
|
||||||
if (interpreter != null) {
|
if (interpreter != null) {
|
||||||
return interpreter.drain() ? task.getResult() : interpreter.interpret(ir);
|
return interpreter.drain() ? task.getResult() : interpreter.interpret(ir);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// null return is ok apparently
|
// null return is ok apparently
|
||||||
return (_process.exitValue() == 0) ? "Ok" : "Failed, exit code " + _process.exitValue();
|
return (_process.exitValue() == 0) ? "Ok" : "Failed, exit code " + _process.exitValue();
|
||||||
}
|
}
|
||||||
@ -216,7 +215,10 @@ public class Script implements Callable<String> {
|
|||||||
}
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
if (!_isTimeOut) {
|
if (!_isTimeOut) {
|
||||||
/* This is not timeout, we are interrupted by others, continue */
|
/*
|
||||||
|
* This is not timeout, we are interrupted by others,
|
||||||
|
* continue
|
||||||
|
*/
|
||||||
_logger.debug("We are interrupted but it's not a timeout, just continue");
|
_logger.debug("We are interrupted but it's not a timeout, just continue");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user