diff options
Diffstat (limited to 'remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/setup_vm_hypervisor.inc')
-rw-r--r-- | remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/setup_vm_hypervisor.inc | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/setup_vm_hypervisor.inc b/remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/setup_vm_hypervisor.inc new file mode 100644 index 00000000..ce15524f --- /dev/null +++ b/remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/setup_vm_hypervisor.inc @@ -0,0 +1,34 @@ +########################################################################## +# Include: Setup virtual machine hypervisor via vm-specific include file # +########################################################################## + +# Get all virtual machine specific stuff from the respective include file +if [ ! -e "$VMCHOOSER_DIR/$xmlvirt/run-virt.include" ] ; then + slxlog "virt-plugin-missing" "Could not find run-virt.include for $xmlvirt ($VMCHOOSER_DIR/$xmlvirt/run-virt.include)" + writelog "Failed because of missing ${xmlvirt} plugin." + error_user "Konnte den Virtualisierer '$xmlvirt' nicht finden. Starten der Virtuellen Maschine fehlgeschlagen. + Starten Sie den Computer neu und wenden Sie sich an den Support, wenn das Problem weiterhin besteht." + cleanexit 1 +fi + +self="${xmlvirt}" + +if ! bash -n "$VMCHOOSER_DIR/$xmlvirt/run-virt.include"; then + slxlog "virt-plugin-syntax" "run-virt.include for $xmlvirt contains syntax errors (bash -n run-virt.include failed)" + writelog "Erroneous run-virt.include for $xmlvirt (syntax check)" + error_user "Das Start-Script für den Virtualisierer '$xmlvirt' ist fehlerhaft. + Starten Sie den Computer neu und wenden Sie sich an den Support, wenn das Problem weiterhin besteht." + cleanexit 1 +fi + +setup_vm_commandline () { + # Now including the hypervisor specific include file: + if ! source "$VMCHOOSER_DIR/$xmlvirt/run-virt.include"; then + slxlog "virt-plugin-error" "run-virt.include for $xmlvirt could not be sourced properly." + writelog "Erroneous run-virt.include for ${xmlvirt}? Source returned != 0" + error_user "Das Start-Script für den Virtualisierer '$xmlvirt' hat einen fehlercode zurückgegeben. + Starten Sie den Computer neu, falls es beim Ausführen der VM zu Problemen kommt + und wenden Sie sich an den Support, wenn das Problem weiterhin besteht." + fi +} + |