From 81288085dbb5d87ef9e92ce3a5d7b982af450590 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 15 May 2024 17:17:39 +0200 Subject: [qemu] Use virt-manager if CoW admin/edit mode is active --- .../opt/openslx/vmchooser/plugins/qemukvm/run-virt.include | 3 +++ .../src/main/java/org/openslx/runvirt/plugin/qemu/App.java | 2 +- .../openslx/runvirt/plugin/qemu/cmdln/CommandLineArgs.java | 11 +++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) (limited to 'core/modules') diff --git a/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include index 391ba5a5..2cd2c60e 100644 --- a/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include +++ b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include @@ -116,6 +116,9 @@ run_plugin() { if $DEBUG; then VIRTCMDOPTS+=( "-xmledit" ) fi + if notempty DMSD_COW_SESSION; then + VIRTCMDOPTS+=( "-manager" ) + fi if [ "${SHARE_REMAP_MODE}" -gt 1 ]; then notempty HOME_SHARE_PATH && VIRTCMDOPTS+=( "-vmfssrc0" "${HOME_SHARE_PATH}" ) diff --git a/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/App.java b/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/App.java index 0744c9b5..6e1efa61 100644 --- a/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/App.java +++ b/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/App.java @@ -237,7 +237,7 @@ public class App vmViewer = new ViewerLookingGlassClient( vm, hypervisor, cmdLn.isDebugEnabled() ); } else { // viewer for non-GPU passthrough (no framebuffer access) is required - if ( cmdLn.isDebugEnabled() ) { + if ( cmdLn.isDebugEnabled() || cmdLn.isManagerEnabled() ) { // create specific Virtual Machine Manager viewer if debug mode is enabled vmViewer = new ViewerVirtManager( vm, hypervisor ); } else { diff --git a/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/cmdln/CommandLineArgs.java b/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/cmdln/CommandLineArgs.java index 396c0d8c..1236a997 100644 --- a/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/cmdln/CommandLineArgs.java +++ b/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/plugin/qemu/cmdln/CommandLineArgs.java @@ -170,6 +170,16 @@ public class CommandLineArgs return ( "true".equals( debugArg ) ) ? true : false; } + /** + * Returns the presence of the command line option {@link CmdLnOption#MANAGER}. + * + * @return presence of the command line option {@link CmdLnOption#MANAGER}. + */ + public boolean isManagerEnabled() + { + return this.cmdLn.hasOption( CmdLnOption.MANAGER.getShortOption() ); + } + /** * Returns the state of the command line option {@link CmdLnOption#DEBUG_PTH}. * @@ -526,6 +536,7 @@ public class CommandLineArgs + " for testing and debugging purposes"), VM_CPU_TOPO ( '1', "cputopo", 1, "Set pairs of CPUs belonging to the same thread, semi-colon separated." + " Each group can contain commas or dashes to mark ranges. E.g. 0,1;2-3;4;5;6;7;8,9,10,11" ), + MANAGER ( '2', "manager", 0, "Force using virt-manager even if not in debug mode" ), VM_MAC0 ( 'a', "vmmac0", 1, "MAC address for the first network interface" ), DEBUG ( 'b', "debug", 1, "Enable or disable debug mode" ), VM_NCPUS ( 'c', "vmncpus", 1, "Number of virtual CPUs for the virtual machine" ), -- cgit v1.2.3-55-g7522