use of org.ovirt.engine.core.common.businessentities.VmDevice in project ovirt-engine by oVirt.
the class VmDevicesListModel method syncSearch.
@Override
protected void syncSearch() {
if (getEntity() != null) {
final E vm = getEntity();
final AsyncQuery<QueryReturnValue> asyncQuery = new AsyncQuery<QueryReturnValue>(new AsyncCallback<QueryReturnValue>() {
@Override
public void onSuccess(QueryReturnValue returnValue) {
final Collection<VmDevice> vmDevices = returnValue.getReturnValue();
final ArrayList<VmDeviceFeEntity> frontendDevices = new ArrayList<>();
for (VmDevice vmDevice : vmDevices) {
// exclude USB controller devices with model property set to 'none'
if (vmDevice.getDevice().equals(VmDeviceType.USB.getName()) && vmDevice.getType() == VmDeviceGeneralType.CONTROLLER && (vmDevice.getSpecParams().get(MODEL)) != null && vmDevice.getSpecParams().get(MODEL).equals(UsbControllerModel.NONE.libvirtName)) {
continue;
}
frontendDevices.add(new VmDeviceFeEntity(vmDevice, vm, idsOfDevicesBeingUnplugged.contains(vmDevice.getId())));
}
setItems(frontendDevices);
}
}) {
};
super.syncSearch(QueryType.GetVmDevicesForVm, new IdQueryParameters(vm.getId()), asyncQuery);
}
}
use of org.ovirt.engine.core.common.businessentities.VmDevice in project ovirt-engine by oVirt.
the class GetConsoleDevicesQuery method executeQueryCommand.
@Override
protected void executeQueryCommand() {
final List<VmDevice> consoleDevices = vmDeviceDao.getVmDeviceByVmIdAndType(getParameters().getId(), VmDeviceGeneralType.CONSOLE);
List<String> result = new ArrayList<>(consoleDevices.size());
for (VmDevice v : consoleDevices) {
result.add(v.getDevice());
}
getQueryReturnValue().setReturnValue(result);
}
use of org.ovirt.engine.core.common.businessentities.VmDevice in project ovirt-engine by oVirt.
the class UpdateGraphicsDeviceCommand method executeCommand.
@Override
protected void executeCommand() {
VmDevice graphicsDev = getParameters().getDev();
vmDeviceDao.update(graphicsDev);
setSucceeded(true);
setActionReturnValue(graphicsDev.getId().getDeviceId());
}
use of org.ovirt.engine.core.common.businessentities.VmDevice in project ovirt-engine by oVirt.
the class UpdateRngDeviceCommand method executeCommand.
@Override
protected void executeCommand() {
VmDevice rngDevice = getParameters().getRngDevice();
vmDeviceDao.update(rngDevice);
setSucceeded(true);
}
use of org.ovirt.engine.core.common.businessentities.VmDevice in project ovirt-engine by oVirt.
the class RemoveRngDeviceCommand method executeCommand.
@Override
protected void executeCommand() {
List<VmDevice> rngDevices = getRngDevices();
Set<VmDeviceId> idsToRemove = new HashSet<>();
for (VmDevice dev : rngDevices) {
idsToRemove.add(dev.getId());
}
vmDeviceDao.removeAll(idsToRemove);
setSucceeded(true);
}
Aggregations