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;
}
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;
}
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;
}
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;
}
Aggregations