use of org.ovirt.engine.core.common.businessentities.UsbControllerModel in project ovirt-engine by oVirt.
the class OsRepositoryImplTest method testExistingUsbControllerModelWithVersion.
@Test
public void testExistingUsbControllerModelWithVersion() {
final UsbControllerModel model = OsRepositoryImpl.INSTANCE.getOsUsbControllerModel(OsRepositoryImpl.INSTANCE.getOsIdByUniqueName("rhel6"), Version.v4_0, ChipsetType.I440FX);
assertEquals(UsbControllerModel.NONE, model);
}
use of org.ovirt.engine.core.common.businessentities.UsbControllerModel in project ovirt-engine by oVirt.
the class VmDeviceUtils method enableNormalUsb.
private void enableNormalUsb(VmBase vmBase, ChipsetType chipset) {
final UsbControllerModel controllerModel = getUsbControllerModel(vmBase, chipset);
if (controllerModel == null) {
return;
}
addManagedDevice(new VmDeviceId(Guid.newGuid(), vmBase.getId()), VmDeviceGeneralType.CONTROLLER, VmDeviceType.USB, createUsbControllerSpecParams(controllerModel.libvirtName, 0), true, false);
}
use of org.ovirt.engine.core.common.businessentities.UsbControllerModel in project ovirt-engine by oVirt.
the class VmDeviceUtils method acquireUnmanagedUsbController.
/**
* If there is an existing unmanaged usb controller, it drops all managed ones and acquires it.
*
* <p>This can be dropped together with support of USB controllers without specified model. Used till engine 3.6.
* they may survive as part of long-running VMs and snapshots.</p>
*/
private void acquireUnmanagedUsbController(VmBase vmBase, ChipsetType chipset, List<VmDevice> managedUsbControllers, List<VmDevice> unmanagedControllers) {
if (unmanagedControllers.size() > 1) {
throw new IllegalStateException(format("At most one unmanaged USB controller expected for VM=%s(%s), found=%s", vmBase.getName(), vmBase.getId(), unmanagedControllers));
}
if (unmanagedControllers.isEmpty()) {
return;
}
UsbControllerModel controllerModel = getUsbControllerModel(vmBase, chipset);
// should not be here but due to https://bugzilla.redhat.com/1438188 can appear one
// remove it
removeVmDevices(managedUsbControllers);
// has been created on pre 4.0 engine by VDSM, adopt it as ours
VmDevice device = unmanagedControllers.iterator().next();
device.setManaged(true);
device.setPlugged(true);
device.setReadOnly(false);
device.setSpecParams(createUsbControllerSpecParams(controllerModel.libvirtName, 0));
vmDeviceDao.update(device);
}
Aggregations