diff options
Diffstat (limited to 'core/modules/qemu/runvirt-plugin-qemu/src/main/java/org')
2 files changed, 24 insertions, 2 deletions
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 e5bc4780..a3e1c5b7 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 @@ -29,6 +29,7 @@ import org.openslx.runvirt.plugin.qemu.virtualization.LibvirtHypervisorQemu; import org.openslx.runvirt.plugin.qemu.virtualization.LibvirtHypervisorQemu.QemuSessionType; import org.openslx.runvirt.viewer.Viewer; import org.openslx.runvirt.viewer.ViewerException; +import org.openslx.runvirt.viewer.ViewerVirtManager; import org.openslx.runvirt.viewer.ViewerVirtViewer; import org.openslx.runvirt.virtualization.LibvirtHypervisor; import org.openslx.runvirt.virtualization.LibvirtHypervisorException; @@ -182,8 +183,17 @@ public class App System.exit( 7 ); } - // display Libvirt VM with a specific viewer on the screen - final Viewer vmViewer = new ViewerVirtViewer( vm, hypervisor ); + // create specific viewer to display Libvirt VM + final Viewer vmViewer; + if ( cmdLn.isDebugEnabled() ) { + // create specific Virtual Machine Manager viewer if debug mode is enabled + vmViewer = new ViewerVirtManager( vm, hypervisor ); + } else { + // create Virtual Viewer if debug mode is disabled + vmViewer = new ViewerVirtViewer( vm, hypervisor ); + } + + // display Libvirt VM with the specific viewer on the screen try { vmViewer.display(); } catch ( ViewerException e ) { 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 03df8923..eb7c8739 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 @@ -128,6 +128,17 @@ public class CommandLineArgs } /** + * Returns the state of the command line option {@link CmdLnOption#DEBUG}. + * + * @return state of the command line option {@link CmdLnOption#DEBUG}. + */ + public boolean isDebugEnabled() + { + final String debugArg = this.getArgument( CmdLnOption.DEBUG ); + return ( "true".equals( debugArg ) ) ? true : false; + } + + /** * Returns the argument of the command line option {@link CmdLnOption#VM_CFGINP}. * * @return argument of the command line option {@link CmdLnOption#VM_CFGINP}. @@ -344,6 +355,7 @@ public class CommandLineArgs { // @formatter:off HELP ( 'h', "help", false, "" ), + DEBUG ( 'b', "debug", true, "Enable or disable debug mode" ), VM_CFGINP ( 'i', "vmcfginp", true, "File name of an existing and filtered Libvirt domain XML configuration file" ), VM_CFGOUT ( 'o', "vmcfgout", true, "File name to output a finalized Libvirt domain XML configuration file" ), VM_NAME ( 'n', "vmname", true, "Name for the virtual machine" ), |