public boolean isIommuPlaceholder() { return isIommuPlaceHolder(getSpecParams()); }
public VmHostDevice() { setType(VmDeviceGeneralType.HOSTDEV); setAddress(""); setManaged(true); setPlugged(true); setId(new VmDeviceId()); setSpecParams(new HashMap<String, Object>()); }
public VmHostDevice(Guid vmId, HostDevice device) { this(); setDeviceId(Guid.newGuid()); setVmId(vmId); setDevice(device.getDeviceName()); }
public VmHostDevice(VmDevice device) { this(); setId(device.getId()); setDevice(device.getDevice()); setSpecParams(device.getSpecParams()); setAddress(device.getAddress()); setAlias(device.getAlias()); }
private void fetchExistingDevices() { startProgress(); AsyncDataProvider.getInstance().getConfiguredVmHostDevices(new AsyncQuery<>(devices -> { for (VmHostDevice device : devices) { if (!device.isIommuPlaceholder()) { alreadyAttachedDevices.add(device.getDevice()); } } // initHosts must be called after alreadyAttachedDevices are initialized initHosts(); }), getVm().getId()); }
@Override public HostDeviceView mapRow(ResultSet rs, int rowNum) throws SQLException { HostDeviceView device = new HostDeviceView(); map(rs, device); device.setConfiguredVmId(getGuid(rs, "configured_vm_id")); device.setAttachedVmNames(split(rs.getString("attached_vm_names"))); device.setRunningVmName(rs.getString("running_vm_name")); Map<String, Object> specParams = SerializationFactory.getDeserializer() .deserializeOrCreateNew(rs.getString("spec_params"), HashMap.class); device.setIommuPlaceholder(specParams != null && VmHostDevice.isIommuPlaceHolder(specParams)); return device; } }
public void setIommuPlaceholder(boolean placeholder) { getSpecParams().put(IOMMU_PLACEHOLDER, placeholder); }