diff options
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. |