Search in sources :

Example 1 with ConsoleTargetType

use of org.ovirt.engine.core.common.businessentities.ConsoleTargetType in project ovirt-engine by oVirt.

the class VmDeviceUtils method getConsoleDeviceSpecParams.

/**
 * Returns console device spec params.
 */
private Map<String, Object> getConsoleDeviceSpecParams(Guid vmId) {
    Map<String, Object> specParams = new HashMap<>();
    VmBase vmBase = getVmBase(vmId);
    ConsoleTargetType targetType = osRepository.getOsConsoleTargetType(vmBase.getOsId(), CompatibilityVersionUtils.getEffective(vmBase, () -> vmBase.getClusterId() != null ? clusterDao.get(vmBase.getClusterId()) : null));
    specParams.put("enableSocket", "true");
    specParams.put("consoleType", targetType == null ? "serial" : targetType.libvirtName);
    return specParams;
}
Also used : HashMap(java.util.HashMap) VmBase(org.ovirt.engine.core.common.businessentities.VmBase) ConsoleTargetType(org.ovirt.engine.core.common.businessentities.ConsoleTargetType)

Aggregations

HashMap (java.util.HashMap)1 ConsoleTargetType (org.ovirt.engine.core.common.businessentities.ConsoleTargetType)1 VmBase (org.ovirt.engine.core.common.businessentities.VmBase)1