Search in sources :

Example 1 with Console

use of org.ovirt.engine.api.model.Console in project ovirt-engine by oVirt.

the class BackendInstanceTypeResource method doPopulate.

@Override
protected InstanceType doPopulate(InstanceType model, org.ovirt.engine.core.common.businessentities.InstanceType entity) {
    if (!model.isSetConsole()) {
        model.setConsole(new Console());
    }
    model.getConsole().setEnabled(!getConsoleDevicesForEntity(entity.getId()).isEmpty());
    if (!model.isSetVirtioScsi()) {
        model.setVirtioScsi(new VirtioScsi());
    }
    model.getVirtioScsi().setEnabled(!VmHelper.getVirtioScsiControllersForEntity(this, entity.getId()).isEmpty());
    model.setSoundcardEnabled(!VmHelper.getSoundDevicesForEntity(this, entity.getId()).isEmpty());
    setRngDevice(model);
    return model;
}
Also used : VirtioScsi(org.ovirt.engine.api.model.VirtioScsi) Console(org.ovirt.engine.api.model.Console)

Example 2 with Console

use of org.ovirt.engine.api.model.Console in project ovirt-engine by oVirt.

the class BackendTemplatesResource method doPopulate.

@Override
protected Template doPopulate(Template model, VmTemplate entity) {
    if (!model.isSetConsole()) {
        model.setConsole(new Console());
    }
    model.getConsole().setEnabled(!getConsoleDevicesForEntity(entity.getId()).isEmpty());
    if (!model.isSetVirtioScsi()) {
        model.setVirtioScsi(new VirtioScsi());
    }
    model.getVirtioScsi().setEnabled(!VmHelper.getVirtioScsiControllersForEntity(this, entity.getId()).isEmpty());
    model.setSoundcardEnabled(!VmHelper.getSoundDevicesForEntity(this, entity.getId()).isEmpty());
    List<VmRngDevice> rngDevices = getRngDevices(entity.getId());
    if (rngDevices != null && !rngDevices.isEmpty()) {
        model.setRngDevice(RngDeviceMapper.map(rngDevices.get(0), null));
    }
    MemoryPolicyHelper.setupMemoryBalloon(model, this);
    return model;
}
Also used : VirtioScsi(org.ovirt.engine.api.model.VirtioScsi) Console(org.ovirt.engine.api.model.Console) VmRngDevice(org.ovirt.engine.core.common.businessentities.VmRngDevice)

Example 3 with Console

use of org.ovirt.engine.api.model.Console in project ovirt-engine by oVirt.

the class BackendTemplateResource method doPopulate.

@Override
protected Template doPopulate(Template model, VmTemplate entity) {
    if (!model.isSetConsole()) {
        model.setConsole(new Console());
    }
    model.getConsole().setEnabled(!getConsoleDevicesForEntity(entity.getId()).isEmpty());
    if (!model.isSetVirtioScsi()) {
        model.setVirtioScsi(new VirtioScsi());
    }
    model.getVirtioScsi().setEnabled(!VmHelper.getVirtioScsiControllersForEntity(this, entity.getId()).isEmpty());
    model.setSoundcardEnabled(VmHelper.getSoundDevicesForEntity(this, entity.getId()).isEmpty());
    setRngDevice(model);
    return model;
}
Also used : VirtioScsi(org.ovirt.engine.api.model.VirtioScsi) Console(org.ovirt.engine.api.model.Console)

Example 4 with Console

use of org.ovirt.engine.api.model.Console in project ovirt-engine by oVirt.

the class BackendInstanceTypesResource method doPopulate.

@Override
protected InstanceType doPopulate(InstanceType model, org.ovirt.engine.core.common.businessentities.InstanceType entity) {
    if (!model.isSetConsole()) {
        model.setConsole(new Console());
    }
    model.getConsole().setEnabled(!getConsoleDevicesForEntity(entity.getId()).isEmpty());
    if (!model.isSetVirtioScsi()) {
        model.setVirtioScsi(new VirtioScsi());
    }
    model.getVirtioScsi().setEnabled(!VmHelper.getVirtioScsiControllersForEntity(this, entity.getId()).isEmpty());
    model.setSoundcardEnabled(!VmHelper.getSoundDevicesForEntity(this, entity.getId()).isEmpty());
    List<VmRngDevice> rngDevices = getRngDevices(entity.getId());
    if (rngDevices != null && !rngDevices.isEmpty()) {
        model.setRngDevice(RngDeviceMapper.map(rngDevices.get(0), null));
    }
    MemoryPolicyHelper.setupMemoryBalloon(model, this);
    return model;
}
Also used : VirtioScsi(org.ovirt.engine.api.model.VirtioScsi) Console(org.ovirt.engine.api.model.Console) VmRngDevice(org.ovirt.engine.core.common.businessentities.VmRngDevice)

Aggregations

Console (org.ovirt.engine.api.model.Console)4 VirtioScsi (org.ovirt.engine.api.model.VirtioScsi)4 VmRngDevice (org.ovirt.engine.core.common.businessentities.VmRngDevice)2