summaryrefslogtreecommitdiffstats
path: root/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/includes/finalize_start_command.inc
blob: eff764fe9090296200978db5c13fec268e94d3fd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# -----------------------------------------------------------------------------
#
# Copyright (c) 2009..2018 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 support@bwlehrpool.de.
#
# General information about bwLehrpool can be found at https://bwlehrpool.de
#
# -----------------------------------------------------------------------------
# run-virt.include
#    - Include script for running the QEMU/Linux KVM virtual machine on an 
#      OpenSLX client via the run-virt.sh or run-vmgrid.sh
################################################################################

# set options that depend on previous includes
# and build the final start command
finalize_start_command() {

	# set cpu type
	VIRTCMDOPTS+=( "-cpu" "host" )
	# set cpu cores
	VIRTCMDOPTS+=( "-smp" "${CPU_CORES}" )

	# set RAM
	VIRTCMDOPTS+=( "-m" "${VM_MEM}" )

	# special feature for real and virtual floppy disks
	isset FLOPPY_0 && VIRTCMDOPTS+=( "-fda" "${FLOPPY_0}" )
	isset SLX_FLOPPY_IMG && VIRTCMDOPTS+=( "-fdb" "${SLX_FLOPPY_IMG}" )

	# add optical drive if available
	isset CDROM_0 && VIRTCMDOPTS+=( "-cdrom" "${CDROM_0}" )

	# audio
	isset SOUND_DEV && VIRTCMDOPTS+=( "-soundhw" "${SOUND_DEV}" )

	# serial devices TODO test
	if isset SERIAL_PORTS; then
		for DEV in $SERIAL_PORTS; do
			: # buggeh: VIRTCMDOPTS+=( "-serial" "${DEV}" )
		done
	fi
}

call_post_source finalize_start_command