diff options
author | Manuel Bentele | 2021-07-06 09:57:54 +0200 |
---|---|---|
committer | Manuel Bentele | 2021-07-06 09:57:54 +0200 |
commit | 8ef029d599c058ab677f900ed233a67f12e06e77 (patch) | |
tree | 044b2c076410f9f368a34ca4994d498fa969be88 /core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemu/run-virt.include | |
parent | Merge branch 'master' into installer (diff) | |
parent | [qemu] Rename vmchooser plugin to 'qemukvm' (diff) | |
download | mltk-installer.tar.gz mltk-installer.tar.xz mltk-installer.zip |
Merge branch 'master' into installerinstaller
Diffstat (limited to 'core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemu/run-virt.include')
-rw-r--r-- | core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemu/run-virt.include | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemu/run-virt.include b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemu/run-virt.include deleted file mode 100644 index 04dca832..00000000 --- a/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemu/run-virt.include +++ /dev/null @@ -1,71 +0,0 @@ -# ----------------------------------------------------------------------------- -# -# Copyright (c) 2009..2021 bwLehrpool-Projektteam -# -# This program/file is free software distributed under the GPL version 2. -# See https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html -# -# If you have any feedback please consult https://bwlehrpool.de and -# send your feedback to bwlehrpool@hs-offenburg.de. -# -# General information about bwLehrpool can be found at https://bwlehrpool.de -# -# ----------------------------------------------------------------------------- -# run-virt.include -# - qemu plugin for vmchooser run-virt -################################################################################ - -# BASH_SOURCE[0] contains the file being sourced, namely this one -declare -rg QEMU_PLUGIN_DIR="$(dirname "${BASH_SOURCE[0]}")" -declare -rg QEMU_INCLUDE_DIR="${QEMU_PLUGIN_DIR}/includes" - -# Define which features the QEMU plugin supports -declare -rg PLUGIN_FEATURES="firewall printer usb slxfloppy sound netshares" - -run_plugin() { - # setup RW image access for operation - local vm_diskfile - if notempty VM_DISKFILE_RO; then - # create copy-on-write layer for readonly image - vm_diskfile="${TMPDIR}/$(basename ${VM_DISKFILE_RO}).cow.qcow2" - local vm_diskfile_type="$(qemu-img info --output=json ${VM_DISKFILE_RO} | jq -r '.format')" - qemu-img create -F "${vm_diskfile_type}" -b "${VM_DISKFILE_RO}" -f qcow2 "${vm_diskfile}" - elif notempty VM_DISKFILE_RW; then - # use supplied RW disk image from run-virt - vm_diskfile="${VM_DISKFILE_RW}" - fi - - # write finalized config in debug mode to temporary folder for debugging purposes - if [ "${DEBUG}" = "true" ]; then - local vm_final_config="/tmp/qemu-last-config.xml" - fi - - # call the Libvirt Java tool to finalize configuration and start VM - declare -rg VIRTCMD="java" - VIRTCMDOPTS=( "-jar" "${QEMU_PLUGIN_DIR}/runvirt-plugin-qemu.jar" ) - - notempty DEBUG && VIRTCMDOPTS+=( "-debug" "${DEBUG}" ) - notempty VM_CLEANNAME && VIRTCMDOPTS+=( "-vmname" "${VM_CLEANNAME}" ) - notempty VM_DISPLAYNAME && VIRTCMDOPTS+=( "-vmdsplname" "${VM_DISPLAYNAME}" ) - notempty VM_OS_TYPE && VIRTCMDOPTS+=( "-vmos" "${VM_OS_TYPE}" ) - notempty TMPCONFIG && VIRTCMDOPTS+=( "-vmcfginp" "${TMPCONFIG}" ) - notempty vm_final_config && VIRTCMDOPTS+=( "-vmcfgout" "${vm_final_config}" ) - notempty IMGUUID && VIRTCMDOPTS+=( "-vmuuid" "${IMGUUID}" ) - notempty HW_CORES && VIRTCMDOPTS+=( "-vmncpus" "${HW_CORES}" ) - notempty VM_MEM && VIRTCMDOPTS+=( "-vmmem" "${VM_MEM}" ) - notempty VM_MAC_ADDR && VIRTCMDOPTS+=( "-vmmac0" "${VM_MAC_ADDR}" ) - notempty vm_diskfile && VIRTCMDOPTS+=( "-vmhdd0" "${vm_diskfile}" ) - VIRTCMDOPTS+=( "-vmfloppy0" "${FLOPPY_0}" ) - notempty SLX_FLOPPY_IMG && VIRTCMDOPTS+=( "-vmfloppy1" "${SLX_FLOPPY_IMG}" ) - notempty CDROM_0 && VIRTCMDOPTS+=( "-vmcdrom0" "${CDROM_0}" ) - notempty CDROM_1 && VIRTCMDOPTS+=( "-vmcdrom1" "${CDROM_1}" ) - notempty SERIAL0 && VIRTCMDOPTS+=( "-vmserial0" "${SERIAL0}" ) - notempty PARALLEL0 && VIRTCMDOPTS+=( "-vmparallel0" "${PARALLEL0}" ) - - if [ "${SHARE_REMAP_MODE}" -gt 1 ]; then - notempty HOME_SHARE_PATH && VIRTCMDOPTS+=( "-vmfssrc0" "${HOME_SHARE_PATH}" ) - notempty HOME_SHARE_NAME && VIRTCMDOPTS+=( "-vmfstgt0" "${HOME_SHARE_NAME}" ) - notempty COMMON_SHARE_PATH && VIRTCMDOPTS+=( "-vmfssrc1" "${COMMON_SHARE_PATH}" ) - notempty COMMON_SHARE_NAME && VIRTCMDOPTS+=( "-vmfstgt1" "${COMMON_SHARE_NAME}" ) - fi -} |