blob: c41f989cfc7d83adb3c550b2f2bea02f9f81b7d6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
package org.openslx.runvirt.plugin.qemu.configuration;
import org.openslx.libvirt.domain.Domain;
import org.openslx.runvirt.plugin.qemu.cmdln.CommandLineArgs;
import org.openslx.runvirt.plugin.qemu.virtualization.LibvirtHypervisorQemu;
import org.openslx.virtualization.configuration.transformation.TransformationException;
import org.openslx.virtualization.configuration.transformation.TransformationSpecific;
/**
* Specific Nvidia GPU passthrough transformation for Libvirt/QEMU virtualization configurations.
*
* @author Manuel Bentele
* @version 1.0
*/
public class TransformationSpecificQemuGpuPassthroughNvidia
extends TransformationSpecific<Domain, CommandLineArgs, LibvirtHypervisorQemu>
{
/**
* Name of the configuration transformation.
*/
private static final String NAME = "QEMU GPU passthrough [Nvidia]";
/**
* Creates a new Nvidia GPU passthrough transformation for Libvirt/QEMU virtualization
* configurations.
*
* @param hypervisor Libvirt/QEMU hypervisor.
*/
public TransformationSpecificQemuGpuPassthroughNvidia( LibvirtHypervisorQemu hypervisor )
{
super( TransformationSpecificQemuGpuPassthroughNvidia.NAME, hypervisor );
}
/**
* Validates a virtualization configuration and input arguments for this transformation.
*
* @param config virtualization configuration for the validation.
* @param args input arguments for the validation.
* @throws TransformationException validation has failed.
*/
private void validateInputs( Domain config, CommandLineArgs args ) throws TransformationException
{
if ( config == null || args == null ) {
throw new TransformationException( "Virtualization configuration or input arguments are missing!" );
}
}
@Override
public void transform( Domain config, CommandLineArgs args ) throws TransformationException
{
// validate configuration and input arguments
this.validateInputs( config, args );
// check if IOMMU support is available on the host
// TODO: implement Nvidia hypervisor shadowing
// call this filter at the end, since -> override of software graphics to 'none' necessary
}
}
|