summaryrefslogtreecommitdiffstats
path: root/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include
blob: a1a41499481c257cd343344abc24cf4c03af77f3 (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
# -----------------------------------------------------------------------------
#
# 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
#    - qemu/kvm plugin for vmchooser run-virt
################################################################################

# BASH_SOURCE[0] contains the file being sourced, namely this one
declare -rg QEMUKVM_PLUGIN_DIR="$(dirname "${BASH_SOURCE[0]}")"
declare -rg QEMUKVM_INCLUDE_DIR="${QEMUKVM_PLUGIN_DIR}/includes"

# TODO make this part of the metadata coming from the server
# TBD: "firewall printer usb slxfloppy sound netshares"
declare -rg PLUGIN_FEATURES="slxfloppy"

run_plugin() {
	# declaration of default functions and variables for vmware
	$(safesource --exit "${QEMUKVM_INCLUDE_DIR}/init_core.inc")
	
	# determine limitations wrt RAM and CPU count of VM
	$(safesource "${QEMUKVM_INCLUDE_DIR}/determine_hardware_limitations.inc")

	# setup networking
	$(safesource "${QEMUKVM_INCLUDE_DIR}/setup_network.inc")
	
	# setup rw layer for ro image
	$(safesource "${QEMUKVM_INCLUDE_DIR}/setup_rw_layer.inc")

	# build the final start command
	$(safesource "${QEMUKVM_INCLUDE_DIR}/finalize_start_command.inc")
	
	# print summary - needs writelog() from vmchooser-run_virt
	$(safesource "${QEMUKVM_INCLUDE_DIR}/log_config_summary.inc")
}