use of org.ovirt.engine.core.common.businessentities.UsbControllerModel in project ovirt-engine by oVirt.
the class OsRepositoryImplTest method testNonExistingUsbControllerModel.
@Test
public void testNonExistingUsbControllerModel() {
final UsbControllerModel model = OsRepositoryImpl.INSTANCE.getOsUsbControllerModel(OsRepositoryImpl.INSTANCE.getOsIdByUniqueName("windows_8"), null, ChipsetType.I440FX);
assertNull(model);
}
use of org.ovirt.engine.core.common.businessentities.UsbControllerModel in project ovirt-engine by oVirt.
the class OsRepositoryImplTest method testExistingUsbControllerModelWithNonExistingVersion.
@Test
public void testExistingUsbControllerModelWithNonExistingVersion() {
final UsbControllerModel model = OsRepositoryImpl.INSTANCE.getOsUsbControllerModel(OsRepositoryImpl.INSTANCE.getOsIdByUniqueName("rhel6"), Version.v4_1, ChipsetType.I440FX);
assertEquals(UsbControllerModel.NEC_XHCI, model);
}
use of org.ovirt.engine.core.common.businessentities.UsbControllerModel in project ovirt-engine by oVirt.
the class VmDeviceUtils method updateNormalUsb.
private void updateNormalUsb(VmBase vmBase, ChipsetType chipset) {
final Collection<VmDevice> usbControllers = getUsbControllers(vmBase.getId());
final List<VmDevice> unmanagedControllers = usbControllers.stream().filter(d -> !d.isManaged()).collect(Collectors.toList());
final List<VmDevice> managedUsbControllers = usbControllers.stream().filter(VmDevice::isManaged).collect(Collectors.toList());
if (unmanagedControllers.size() > 0) {
acquireUnmanagedUsbController(vmBase, chipset, managedUsbControllers, unmanagedControllers);
return;
}
final UsbControllerModel controllerModel = getUsbControllerModel(vmBase, chipset);
if ((managedUsbControllers.isEmpty() && controllerModel == null) || (managedUsbControllers.size() == 1 && controllerModel != null && controllerModel.libvirtName.equals(getUsbControllerModelName(managedUsbControllers.get(0))))) {
return;
}
disableNormalUsb(vmBase.getId());
enableNormalUsb(vmBase, chipset);
}
use of org.ovirt.engine.core.common.businessentities.UsbControllerModel in project ovirt-engine by oVirt.
the class OsRepositoryImplTest method testExistingUsbControllerModelWithoutVersion.
@Test
public void testExistingUsbControllerModelWithoutVersion() {
final UsbControllerModel model = OsRepositoryImpl.INSTANCE.getOsUsbControllerModel(OsRepositoryImpl.INSTANCE.getOsIdByUniqueName("rhel7"), null, ChipsetType.I440FX);
assertEquals(UsbControllerModel.NEC_XHCI, model);
}
use of org.ovirt.engine.core.common.businessentities.UsbControllerModel in project ovirt-engine by oVirt.
the class OsRepositoryImplTest method testExistingUsbControllerModelWithChipset.
@Test
public void testExistingUsbControllerModelWithChipset() {
final UsbControllerModel model = OsRepositoryImpl.INSTANCE.getOsUsbControllerModel(OsRepositoryImpl.INSTANCE.getOsIdByUniqueName("rhel7"), null, ChipsetType.Q35);
assertEquals(UsbControllerModel.QEMU_XHCI, model);
}
Aggregations