From ddcc045e756a7eea48778faadee042a8bd4d8091 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 29 Oct 2024 15:29:03 +0100 Subject: [qemu] Clean up SPICE transformation --- .../TransformationSpecificQemuGraphics.java | 26 ++++++++-------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'core') 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 ); } } -- cgit v1.2.3-55-g7522