public void setDeviceType(VmDeviceType type) { super.setDevice(type.getName()); }
selectSingleNode(node, VMD_VIRTUAL_QUANTITY, _xmlNS).innerText); if (virtualQuantity > 1) { vmDevice.setDevice(VmDeviceType.QXL.getName()); } else { if (!supportedGraphicsAndDisplays.isEmpty()) { DisplayType firstDisplayType = supportedGraphicsAndDisplays.get(0).getSecond(); vmDevice.setDevice(firstDisplayType.getDefaultVmDeviceType().getName()); } else { vmDevice.setDevice(VmDeviceType.QXL.getName()); vmDevice.setDevice(VmDeviceType.QXL.getName()); vmDevice.setDevice(VmDeviceType.getoVirtDevice(Integer.parseInt(resourceType)).getName()); vmDevice.setDevice(VmDeviceType.HOST_DEVICE.getName()); } else { vmDevice.setDevice(VmDeviceType.BRIDGE.getName());
public static void addVirtIoScsiDevice(VmBase vmBase) { VmDevice vmDevice = new VmDevice(); vmDevice.setId(new VmDeviceId(Guid.newGuid(), vmBase.getId())); vmDevice.setType(VmDeviceGeneralType.CONTROLLER); vmDevice.setDevice(VmDeviceType.VIRTIOSCSI.getName()); vmDevice.setManaged(true); vmDevice.setPlugged(true); vmDevice.setReadOnly(false); vmDevice.setAddress(""); vmBase.getManagedDeviceMap().put(vmDevice.getDeviceId(), vmDevice); }
public static void addCdDevice(VmBase vmBase) { VmDevice vmDevice = new VmDevice(); vmDevice.setId(new VmDeviceId(Guid.newGuid(), vmBase.getId())); vmDevice.setType(VmDeviceGeneralType.DISK); vmDevice.setDevice(VmDeviceType.CDROM.getName()); vmDevice.setManaged(true); vmDevice.setPlugged(true); vmDevice.setReadOnly(true); vmDevice.setAddress(""); vmBase.getManagedDeviceMap().put(vmDevice.getDeviceId(), vmDevice); }
vmDevice.setDevice(String.valueOf(selectSingleNode(node, VMD_DEVICE, _xmlNS).innerText)); } else { setDeviceByResource(node, vmDevice);
public static void addVideoDevice(VmBase vmBase) { if (vmBase.getDefaultDisplayType().getDefaultVmDeviceType() == null) { return; } VmDevice vmDevice = new VmDevice(); vmDevice.setId(new VmDeviceId(Guid.newGuid(), vmBase.getId())); vmDevice.setType(VmDeviceGeneralType.VIDEO); vmDevice.setDevice(vmBase.getDefaultDisplayType().getDefaultVmDeviceType().getName()); vmDevice.setManaged(true); vmDevice.setPlugged(true); vmDevice.setReadOnly(false); vmDevice.setAddress(""); vmBase.getManagedDeviceMap().put(vmDevice.getDeviceId(), vmDevice); }
private VmDevice createNetworkInterfaceDevice(boolean plugged, Guid id) { VmDevice device = new VmDevice(); device.setType(VmDeviceGeneralType.INTERFACE); device.setDevice(VmDeviceType.BRIDGE.getName()); device.setPlugged(plugged); device.setId(new VmDeviceId(id, null)); return device; }
private VmDevice createCdRomDevice() { Guid id = Guid.newGuid(); VmDevice device = new VmDevice(); device.setType(VmDeviceGeneralType.DISK); device.setDevice(VmDeviceType.CDROM.getName()); device.setPlugged(true); device.setId(new VmDeviceId(id, null)); return device; } }
private VmDevice createDiskDevice(boolean boot, Map<VmDeviceId, DiskVmElement> idToDiskElement) { Guid id = Guid.newGuid(); VmDevice device = new VmDevice(); device.setType(VmDeviceGeneralType.DISK); device.setDevice(VmDeviceType.DISK.getName()); device.setId(new VmDeviceId(id, null)); DiskVmElement dve = new DiskVmElement(new VmDeviceId(id, null)); dve.setBoot(boot); idToDiskElement.put(dve.getId(), dve); return device; }
@BeforeEach @Override public void setUp() throws Exception { super.setUp(); existingVmInterface = dao.get(FixturesTool.VM_NETWORK_INTERFACE); existingTemplateInterface = dao.get(FixturesTool.TEMPLATE_NETWORK_INTERFACE); newVmInterface = new VmNetworkInterface(); newVmInterface.setStatistics(new VmNetworkStatistics()); newVmInterface.setId(Guid.newGuid()); newVmInterface.setVnicProfileId(FixturesTool.VM_NETWORK_INTERFACE_PROFILE); newVmInterface.setName("eth77"); newVmInterface.setNetworkName("enginet"); newVmInterface.setLinked(true); newVmInterface.setSpeed(1000); newVmInterface.setType(3); newVmInterface.setMacAddress("01:C0:81:21:71:17"); newVmDevice.setType(VmDeviceGeneralType.INTERFACE); newVmDevice.setDevice("bridge"); newVmDevice.setAddress("sample"); newVmDevice.setManaged(true); newVmDevice.setPlugged(true); newVmDevice.setReadOnly(false); Map<String, String> customProp = new LinkedHashMap<>(); customProp.put("prop1", "val1"); newVmDevice.setCustomProperties(customProp); }