use of org.ovirt.engine.core.common.businessentities.VmStatic in project ovirt-engine by oVirt.
the class VmMapper method map.
public static VmStatic map(VmTemplate entity, VmStatic template, Version version) {
VmStatic staticVm = template != null ? template : new VmStatic();
staticVm.setId(Guid.Empty);
staticVm.setVmtGuid(entity.getId());
staticVm.setClusterId(entity.getClusterId());
staticVm.setOsId(entity.getOsId());
staticVm.setNiceLevel(entity.getNiceLevel());
staticVm.setCpuShares(entity.getCpuShares());
staticVm.setFailBack(entity.isFailBack());
staticVm.setStateless(entity.isStateless());
staticVm.setDeleteProtected(entity.isDeleteProtected());
staticVm.setSsoMethod(entity.getSsoMethod());
staticVm.setVmType(entity.getVmType());
staticVm.setIsoPath(entity.getIsoPath());
staticVm.setKernelUrl(entity.getKernelUrl());
staticVm.setKernelParams(entity.getKernelParams());
staticVm.setInitrdUrl(entity.getInitrdUrl());
staticVm.setTimeZone(entity.getTimeZone());
staticVm.setAllowConsoleReconnect(entity.isAllowConsoleReconnect());
staticVm.setVncKeyboardLayout(entity.getVncKeyboardLayout());
staticVm.setVmInit(entity.getVmInit());
staticVm.setSerialNumberPolicy(entity.getSerialNumberPolicy());
staticVm.setCustomSerialNumber(entity.getCustomSerialNumber());
staticVm.setSpiceFileTransferEnabled(entity.isSpiceFileTransferEnabled());
staticVm.setSpiceCopyPasteEnabled(entity.isSpiceCopyPasteEnabled());
staticVm.setRunAndPause(entity.isRunAndPause());
staticVm.setCpuProfileId(entity.getCpuProfileId());
staticVm.setAutoConverge(entity.getAutoConverge());
staticVm.setMigrateCompressed(entity.getMigrateCompressed());
staticVm.setCustomProperties(entity.getCustomProperties());
staticVm.setCustomEmulatedMachine(entity.getCustomEmulatedMachine());
staticVm.setCustomCpuName(entity.getCustomCpuName());
staticVm.setConsoleDisconnectAction(entity.getConsoleDisconnectAction());
staticVm.setSmallIconId(entity.getSmallIconId());
staticVm.setLargeIconId(entity.getLargeIconId());
staticVm.setQuotaId(entity.getQuotaId());
staticVm.setBootMenuEnabled(entity.isBootMenuEnabled());
return doMapVmBaseHwPartToVmStatic(entity, staticVm, version);
}
use of org.ovirt.engine.core.common.businessentities.VmStatic in project ovirt-engine by oVirt.
the class VmPoolMapper method map.
@Mapping(from = VmPool.class, to = VmStatic.class)
public static VmStatic map(VmPool model, VmStatic template) {
VmStatic entity = template != null ? template : new VmStatic();
if (model.getVm() != null) {
entity = VmMapper.map(model.getVm(), entity);
}
entity.setName(model.getName());
entity.setDescription(model.getDescription());
if (model.isSetTemplate() && model.getTemplate().isSetId()) {
entity.setVmtGuid(GuidUtils.asGuid(model.getTemplate().getId()));
}
if (model.isSetCluster() && model.getCluster().isSetId()) {
entity.setClusterId(GuidUtils.asGuid(model.getCluster().getId()));
}
if (model.isSetUseLatestTemplateVersion()) {
entity.setUseLatestVersion(model.isUseLatestTemplateVersion());
}
return entity;
}
use of org.ovirt.engine.core.common.businessentities.VmStatic in project ovirt-engine by oVirt.
the class AddGraphicsAndVideoDevicesCommand method setVmToNonHeadlessMode.
private void setVmToNonHeadlessMode() {
VmStatic vmStatic = vmStaticDao.get(getVmBaseId());
if (vmStatic == null) {
return;
}
if (vmStatic.getDefaultDisplayType() == DisplayType.none) {
vmStatic.setDefaultDisplayType(DisplayType.qxl);
resourceManager.getVmManager(getVmBaseId()).update(vmStatic);
}
vmDeviceUtils.addVideoDevicesOnlyIfNoVideoDeviceExists(vmStatic);
}
use of org.ovirt.engine.core.common.businessentities.VmStatic in project ovirt-engine by oVirt.
the class AddAffinityGroupCommandTest method setup.
@Before
public void setup() {
command.setCluster(new Cluster());
VmStatic vmStatic = new VmStatic();
vmStatic.setClusterId(clusterId);
vmStatic.setId(vmId);
doReturn(Collections.singletonList(vmStatic)).when(vmStaticDao).getByIds(any());
}
use of org.ovirt.engine.core.common.businessentities.VmStatic in project ovirt-engine by oVirt.
the class EntityDaoImplTest method testGetEntityNameByIdAndTypeForVM.
@Test
public void testGetEntityNameByIdAndTypeForVM() {
VmStatic vmStatic = vmStaticDao.get(VM_ID);
assertNotNull(vmStatic);
String name = vmStatic.getName();
assertEquals(name, underTest.getEntityNameByIdAndType(VM_STATIC_GUID, VdcObjectType.VM));
}
Aggregations