value = (String) params.get("host.reserved.mem.mb");
_dom0MinMem = NumbersUtil.parseInt(value, 0) * 1024 * 1024;
LibvirtConnection.initialize(_hypervisorURI);
Connect conn = null;
try {
conn = LibvirtConnection.getConnection();
if (_bridgeType == BridgeType.OPENVSWITCH) {
if (conn.getLibVirVersion() < (10 * 1000 + 0)) {
throw new ConfigurationException("LibVirt version 0.10.0 required for openvswitch support, but version "
+ conn.getLibVirVersion() + " detected");
}
}
} catch (LibvirtException e) {
throw new CloudRuntimeException(e.getMessage());
}
if (HypervisorType.KVM == _hypervisorType) {
/* Does node support HVM guest? If not, exit */
if (!IsHVMEnabled(conn)) {
throw new ConfigurationException(
"NO HVM support on this machine, please make sure: "
+ "1. VT/SVM is supported by your CPU, or is enabled in BIOS. "
+ "2. kvm modules are loaded (kvm, kvm_amd|kvm_intel)");
}
}
_hypervisorPath = getHypervisorPath(conn);
try {
_hvVersion = conn.getVersion();
_hvVersion = (_hvVersion % 1000000) / 1000;
_hypervisorLibvirtVersion = conn.getLibVirVersion();
_hypervisorQemuVersion = conn.getVersion();
} catch (LibvirtException e) {
s_logger.trace("Ignoring libvirt error.", e);
}
_guestCpuMode = (String) params.get("guest.cpu.mode");