diff options
author | Simon Rettberg | 2023-02-01 14:28:24 +0100 |
---|---|---|
committer | Simon Rettberg | 2023-02-01 14:28:24 +0100 |
commit | 4abeec0ad971f131fac00d81f20324e5d9342dc2 (patch) | |
tree | 0b04cd616b3410c1310398158909e50a18555039 /core/modules/qemu | |
parent | [dmidecode] Switch to https url (diff) | |
download | mltk-4abeec0ad971f131fac00d81f20324e5d9342dc2.tar.gz mltk-4abeec0ad971f131fac00d81f20324e5d9342dc2.tar.xz mltk-4abeec0ad971f131fac00d81f20324e5d9342dc2.zip |
[qemu] Implement new way of enabling GVT-g in QEMU
Diffstat (limited to 'core/modules/qemu')
2 files changed, 6 insertions, 27 deletions
diff --git a/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationSpecificQemuMdevPassthroughIntel.java b/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationSpecificQemuMdevPassthroughIntel.java index 1550a233..303befab 100644 --- a/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationSpecificQemuMdevPassthroughIntel.java +++ b/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationSpecificQemuMdevPassthroughIntel.java @@ -116,16 +116,11 @@ public class TransformationSpecificQemuMdevPassthroughIntel mdevDevice.setMemoryFramebufferOn( true ); mdevDevice.setSource( mdevDeviceAddress ); - // set Intel specific QEMU options that are not handeled by Libvirt yet - config.addQemuCmdlnArgument( "-set" ); - config.addQemuCmdlnArgument( "device.hostdev0.x-igd-opregion=on" ); - config.addQemuCmdlnArgument( "-set" ); - config.addQemuCmdlnArgument( "device.hostdev0.driver=vfio-pci-nohotplug" ); - - // set Intel specific rom file for GVT-g if UEFI loader is used if ( config.getOsLoader() != null && !config.getOsLoader().isEmpty() ) { - config.addQemuCmdlnArgument( "-set" ); - config.addQemuCmdlnArgument( "device.hostdev0.romfile=" + INTEL_GVT_G_UEFI_ROMFILE ); + // set Intel specific rom file for GVT-g if UEFI loader is used + config.addGvtg( INTEL_GVT_G_UEFI_ROMFILE ); + } else { + config.addGvtg( null ); } // disable all software video devices if device passthrough debug mode is not enabled diff --git a/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationSpecificQemuMdevPassthroughIntelTest.java b/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationSpecificQemuMdevPassthroughIntelTest.java index ca478ba1..86b6be5b 100644 --- a/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationSpecificQemuMdevPassthroughIntelTest.java +++ b/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationSpecificQemuMdevPassthroughIntelTest.java @@ -78,18 +78,7 @@ public class TransformationSpecificQemuMdevPassthroughIntelTest assertEquals( HostdevMdevDeviceAddress.valueOf( TransformationTestUtils.DEFAULT_VM_ILMDEVID0 ), mdevDevice.getSource() ); - final List<String> qemuCmdlnArguments = config.getQemuCmdlnArguments(); - assertNotNull( qemuCmdlnArguments ); - boolean qemuCmdlnIgdOpRegion = false; - boolean qemuCmdlnVfioNoHotplug = false; - for ( final String qemuCmdlnArgument : qemuCmdlnArguments ) { - if ( "device.hostdev0.x-igd-opregion=on".equals( qemuCmdlnArgument ) ) { - qemuCmdlnIgdOpRegion = true; - } else if ( "device.hostdev0.driver=vfio-pci-nohotplug".equals( qemuCmdlnArgument ) ) { - qemuCmdlnVfioNoHotplug = true; - } - } - assertTrue( qemuCmdlnIgdOpRegion && qemuCmdlnVfioNoHotplug ); + // TODO: Check the override section of XML final List<Video> videoDevices = config.getVideoDevices(); assertNotNull( videoDevices ); @@ -115,12 +104,7 @@ public class TransformationSpecificQemuMdevPassthroughIntelTest assertNotNull( mdevDevices ); assertEquals( 0, mdevDevices.size() ); - final List<String> qemuCmdlnArguments = config.getQemuCmdlnArguments(); - assertNotNull( qemuCmdlnArguments ); - for ( final String qemuCmdlnArgument : qemuCmdlnArguments ) { - assertNotEquals( "device.hostdev0.x-igd-opregion=on", qemuCmdlnArgument ); - assertNotEquals( "device.hostdev0.driver=vfio-pci-nohotplug", qemuCmdlnArgument ); - } + // TODO: Check the override section of XML final List<Video> videoDevices = config.getVideoDevices(); assertNotNull( videoDevices ); |