diff options
author | Manuel Bentele | 2021-06-10 10:47:50 +0200 |
---|---|---|
committer | Manuel Bentele | 2021-06-10 10:49:50 +0200 |
commit | 9cda192f9f5ee9ffb5d8d6962651d950a7b0fd76 (patch) | |
tree | 04fb49f4724a39f0e4a318102f1c11c30ee9310c /src/main/java/org/openslx/libvirt/domain/device/Video.java | |
parent | Add test Libvirt capabilities XML file with old QEMU machine versions (diff) | |
download | master-sync-shared-9cda192f9f5ee9ffb5d8d6962651d950a7b0fd76.tar.gz master-sync-shared-9cda192f9f5ee9ffb5d8d6962651d950a7b0fd76.tar.xz master-sync-shared-9cda192f9f5ee9ffb5d8d6962651d950a7b0fd76.zip |
Add Libvirt PCI, shared memory and hypervisor features for GPU passthrough
Diffstat (limited to 'src/main/java/org/openslx/libvirt/domain/device/Video.java')
-rw-r--r-- | src/main/java/org/openslx/libvirt/domain/device/Video.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/main/java/org/openslx/libvirt/domain/device/Video.java b/src/main/java/org/openslx/libvirt/domain/device/Video.java index 0f8861f..f3ee13f 100644 --- a/src/main/java/org/openslx/libvirt/domain/device/Video.java +++ b/src/main/java/org/openslx/libvirt/domain/device/Video.java @@ -71,7 +71,7 @@ public class Video extends Device if ( model != null ) { if ( model == Model.VIRTIO ) { // only set acceleration on supported Virtio GPUs - this.setXmlElementAttributeValue( "model/acceleration", "accel2d", acceleration ); + this.setXmlElementAttributeValueYesNo( "model/acceleration", "accel2d", acceleration ); } else { String errorMsg = new String( "Video card model '" + model.toString() + "' does not support enabled 2D hardware acceleration." ); @@ -101,7 +101,7 @@ public class Video extends Device if ( model == Model.VIRTIO ) { // only set acceleration on supported Virtio GPUs - this.setXmlElementAttributeValue( "model/acceleration", "accel3d", acceleration ); + this.setXmlElementAttributeValueYesNo( "model/acceleration", "accel3d", acceleration ); } else { String errorMsg = new String( "Video card model '" + model.toString() + "' does not support enabled 3D hardware acceleration." ); @@ -110,6 +110,15 @@ public class Video extends Device } /** + * Disables the video device by setting the model to {@link Model#NONE}. + */ + public void disable() + { + this.removeXmlElementChilds(); + this.setModel( Model.NONE ); + } + + /** * Creates a non-existent video device as Libvirt XML device element. * * @param xmlNode Libvirt XML node of the Libvirt XML device that is created. |