diff options
author | Simon Rettberg | 2024-10-29 15:29:03 +0100 |
---|---|---|
committer | Simon Rettberg | 2024-10-29 15:29:03 +0100 |
commit | ddcc045e756a7eea48778faadee042a8bd4d8091 (patch) | |
tree | a90ca9358047d55bb33e99975136925428b89692 | |
parent | [hardware-stats] Check that kernel has vfio.ko built-in (diff) | |
download | mltk-ddcc045e756a7eea48778faadee042a8bd4d8091.tar.gz mltk-ddcc045e756a7eea48778faadee042a8bd4d8091.tar.xz mltk-ddcc045e756a7eea48778faadee042a8bd4d8091.zip |
[qemu] Clean up SPICE transformation
-rw-r--r-- | core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationSpecificQemuGraphics.java | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationSpecificQemuGraphics.java b/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationSpecificQemuGraphics.java index 29727bfa..bb94a8d8 100644 --- a/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationSpecificQemuGraphics.java +++ b/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationSpecificQemuGraphics.java @@ -81,30 +81,22 @@ public class TransformationSpecificQemuGraphics // validate configuration and input arguments this.validateInputs( config, args ); - // convert all VNC graphics devices to local SPICE graphics devices + // Remove all existing graphics devices for ( final GraphicsVnc graphicsVncDevice : config.getGraphicVncDevices() ) { - // remove VNC graphics device graphicsVncDevice.remove(); - - // add SPICE graphics device with local Unix domain socket access - this.addLocalSpiceGraphics( config, false ); } // convert all SPICE graphics devices to local SPICE graphics devices + boolean isOGL = false; for ( final GraphicsSpice graphicsSpiceDevice : config.getGraphicSpiceDevices() ) { - - if ( graphicsSpiceDevice.getListenType() != ListenType.NONE ) { - - // save state of configured OpenGL option - final boolean openGlEnabled = graphicsSpiceDevice.isOpenGlEnabled(); - - // remove VNC graphics device - graphicsSpiceDevice.remove(); - - // add SPICE graphics device with local Unix domain socket access - this.addLocalSpiceGraphics( config, openGlEnabled ); - } + // save state of configured OpenGL option + isOGL = graphicsSpiceDevice.isOpenGlEnabled() || isOGL; + // remove VNC graphics device + graphicsSpiceDevice.remove(); } + + // finally, add one SPICE graphics device with local Unix domain socket access + this.addLocalSpiceGraphics( config, isOGL ); } } |