summaryrefslogtreecommitdiffstats
path: root/core/modules/qemukvm/data/opt/openslx
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/qemukvm/data/opt/openslx')
-rw-r--r--core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/README1
-rw-r--r--core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/determine_hardware_limitations.inc89
-rw-r--r--core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/log_config_summary.inc35
-rw-r--r--core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_network.inc56
-rw-r--r--core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_rw_layer.inc25
5 files changed, 0 insertions, 206 deletions
diff --git a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/README b/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/README
deleted file mode 100644
index 549d0037..00000000
--- a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/README
+++ /dev/null
@@ -1 +0,0 @@
-Not tested since refactoring! (January 2017)
diff --git a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/determine_hardware_limitations.inc b/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/determine_hardware_limitations.inc
deleted file mode 100644
index dd83b587..00000000
--- a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/determine_hardware_limitations.inc
+++ /dev/null
@@ -1,89 +0,0 @@
-##################################################################
-# qemu/kvm include: determine virtual hardware based on guest OS #
-##################################################################
-
-set_vm_hw_limits() {
- # FIXME when we have better metadata for qemu
- if isempty VM_OS_TYPE; then
- writelog "VM_OS_TYPE is empty! This should have been parsed from the XML file"
- EXIT_TYPE="user" EXIT_REASON="Konnte Gastbetriebsystems der virtuellen Maschine nicht ermitteln!" cleanexit 1
- fi
-
- # define global hardware-related variables
- declare -g MAXMEM="9999999"
- declare -g MAXCORES="4"
- declare -g SOUND_DEV="es1370"
-
- # determine if we need a 32bit or 64bit machine
- # FIXME depending on the guest OS for now
- # (sadly does not support all the exotic OSs the
- # the world has even seen like vmware plugin :<)
- local bits=64
- case "${VM_OS_TYPE}" in
- beos*)
- bits=32
- SOUND_DEV="sb16"
- ;;
- win3*|win*3*|Win*3*)
- bits=32
- SOUND_DEV="sb16"
- MAXMEM=32
- ;;
- win95*|Win*95)
- bits=32
- MAXMEM=96
- ;;
- win98)
- bits=32
- MAXMEM=256
- ;;
- winme*|windowsme*)
- bits=32
- SOUND_DEV="ac97"
- MAXMEM=384
- ;;
- winxp*64|windowsxp*64)
- SOUND_DEV="ac97"
- ;;
- windows7|windows8|windows9)
- SOUND_DEV="ac97"
- MAXMEM="8000"
- MAXCORES="4"
- ;;
- windows7-64|windows8-64|windows9-64)
- SOUND_DEV="ac97"
- MAXMEM="32000"
- MAXCORES="8"
- ;;
- *64)
- MAXMEM="16000"
- MAXCORES="4"
- ;;
- *)
- bits=32
- MAXMEM="8000"
- MAXCORES="1"
- ;;
- esac
- declare -g VIRTCMD
- if [ "$bits" = 32 ]; then
- declare -rg VIRTCMD="qemu-system-i386"
- VIRTCMDOPTS+=( "-machine" "accel=tcg" ) # TODO: 32bit VMs can't use kvm!?
- else # 64 bit
- declare -rg VIRTCMD="qemu-system-x86_64"
- VIRTCMDOPTS+=( "-machine" "accel=kvm" )
- fi
-
-
- # check for allocated cores
- declare -g CPU_CORES="${HW_THREADS:-1}"
- declare -rg HOST_CORE_COUNT="${CPU_CORES}"
- [ "${CPU_CORES}" -gt "${MAXCORES}" ] && CPU_CORES="${MAXCORES}"
-
- # check if memory set by the generic run-virt is above the threshold
- [ "${VM_MEM}" -gt "${MAXMEM}" ] && VM_MEM="${MAXMEM}"
- return 0
-}
-
-## MAIN ##
-call_post_source set_vm_hw_limits
diff --git a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/log_config_summary.inc b/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/log_config_summary.inc
deleted file mode 100644
index 6b4b279f..00000000
--- a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/log_config_summary.inc
+++ /dev/null
@@ -1,35 +0,0 @@
-##################################################
-# Include: Print vm config summary into log file #
-##################################################
-
-log_config_summary() {
- writelog "Directories:"
- writelog "\tTMPDIR:\t\t\t$TMPDIR"
- writelog "Disk image:"
- writelog "\tSource disk:\t\t$VM_DISKFILE_RO"
- if [ -e "${VM_DISKFILE_RW}" ]; then
- writelog "\tDisk mode:\t\twritable"
- writelog "\tRW-Layer:\t\t$VM_DISKFILE_RW"
- else
- writelog "\tDisk mode:\t\tread-only"
- fi
-
- writelog "Virtual Hardware:"
- writelog "\tvCPU cores:\t\t${CPU_CORES}"
- writelog "\tGuest RAM:\t\t${VM_MEM} MB"
-
- # echo nur wenn HOST_MEM_REMAINING gesetzt
- if isset HOST_MEM_REMAINING; then
- writelog "\tHost RAM:\t\t${HOST_MEM_REMAINING} MB"
- fi
- writelog "\tMAC address:\t\t${VM_MAC_ADDR}"
- writelog "\tNetwork card:\t\t${NIC_MODEL}"
- writelog "\tNetwork kind:\t\t${NETWORK_MODE}"
- writelog "\tCD-ROM1:\t${CDROM_0}"
- writelog "\tCD-ROM2:\t${CDROM_1}"
- writelog "\tFloppy_A:\t${FLOPPY_0}"
- writelog "\tFloppy_B:\t${SLX_FLOPPY_IMG}"
- #writelog "\tShared Folders 'home':\t/home/${USER}"
-}
-
-call_post_source log_config_summary
diff --git a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_network.inc b/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_network.inc
deleted file mode 100644
index 73fb2518..00000000
--- a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_network.inc
+++ /dev/null
@@ -1,56 +0,0 @@
-###################################
-# qemu/kvm include: Network setup #
-###################################
-# This now makes use of the qemu's bridge helper
-# which creates a tap device and adds it to the
-# bridge corresponding to the network type
-# TODO configurable network type
-setup_network() {
- # list available models with:
- # qemu-system-x86_64 -net nic,model=?
- # e.g. as of 2.0.0:
- # ne2k_pci,i82551,i82557b,i82559er,rtl8139,e1000,pcnet,virtio
- declare -rg NIC_MODEL="e1000"
-
- # add MAC address and network card model
- VIRTCMDOPTS+=( "-device" "${NIC_MODEL},mac=${VM_MAC_ADDR},netdev=guestnet0" )
-
- # TODO support different network kinds for lectures in bwlehrpool-suite, just NAT for now
- declare -g NETWORK_MODE="nat"
-
- # detect if qemu's bridge helper binary is available
- declare -g QEMU_BRIDGE_HELPER=
- for HELPER_PATH in /usr/lib/qemu-bridge-helper /usr/local/libexec/qemu-bridge-helper; do
- if [ -x "${HELPER_PATH}" ] && [ -u "${HELPER_PATH}" ]; then
- QEMU_BRIDGE_HELPER="${HELPER_PATH}"
- readonly QEMU_BRIDGE_HELPER
- break
- fi
- done
- if isempty QEMU_BRIDGE_HELPER; then
- writelog "Could not find qemu-bridge-helper on this machine. Setting network mode to user."
- # Even though falling back to creating tap devices ourselves, we should instead
- # garantee the existance of qemu's helper on minilinux build time.
- # qemu's user network mode allows tcp/udp connections in a nat-fashion and
- # it allows access to the web which seems suffisant for a fallback.
- NETWORK_MODE="user"
- fi
-
- case "${NETWORK_MODE}" in
- nat*)
- VIRTCMDOPTS+=( "-netdev" "bridge,br=nat1,id=guestnet0,helper=${QEMU_BRIDGE_HELPER}" )
- ;;
- bridge*)
- VIRTCMDOPTS+=( "-netdev" "bridge,br=br0,id=guestnet0,helper=${QEMU_BRIDGE_HELPER}" )
- ;;
- host*)
- VIRTCMDOPTS+=( "-netdev" "bridge,br=vsw2,id=guestnet0,helper=${QEMU_BRIDGE_HELPER}" )
- ;;
- user*|*)
- VIRTCMDOPTS+=( "-netdev" "user,id=guestnet0" )
- ;;
- esac
-}
-
-## MAIN ##
-call_post_source setup_network
diff --git a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_rw_layer.inc b/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_rw_layer.inc
deleted file mode 100644
index 32637e5d..00000000
--- a/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/setup_rw_layer.inc
+++ /dev/null
@@ -1,25 +0,0 @@
-
-setup_rw_layer() {
- if isempty VM_DISKFILE_RO; then
- writelog "No source diskfile found! This should be specified in the given XML file. Is it valid?"
- EXIT_TYPE="user" EXIT_REASON="Keine virtuelle Festplatte zu dieser Veranstaltung angegeben!" cleanexit 1
- fi
-
- # setup qcow2 backing file for that disk file
- writelog "Creating backing file for '${VM_DISKFILE_RO}'..."
- # TODO: WTF? This is fucked up, VM_DISKFILE_RW is set if we want to run in persistent mode,
- # this plugin shouldn't mess around with it....
- declare -rg VM_DISKFILE_RW="${TMPDIR}/$(basename ${VM_DISKFILE_RO}).qcow2"
- if qemu-img create -f qcow2 -b "${VM_DISKFILE_RO}" "${VM_DISKFILE_RW}"; then
- # all good, use it as main disk drive
- # TODO: determine the proper type of controller to use, ideally virtio?
- VIRTCMDOPTS+=("-drive" "if=virtio,format=qcow2,file=${VM_DISKFILE_RW}" )
- else
- writelog "Error creating backing file for '${VM_DISKFILE_RO}'"
- # TODO use -snapshot as fallback, test it!
- # How is this supposed to even work without a disk?
- VIRTCMDOPTS+=( "-snapshot" )
- fi
-}
-
-call_post_source setup_rw_layer