summaryrefslogtreecommitdiffstats
path: root/core/modules/qemukvm
diff options
context:
space:
mode:
authorJonathan Bauer2017-01-25 18:32:35 +0100
committerJonathan Bauer2017-01-25 18:32:35 +0100
commiteea5898961a40fc50f01356f90c42904a73a3f74 (patch)
tree52c19d11efc2d7d904ac89e36ff271de305cfc5a /core/modules/qemukvm
parent[pam] Include cifs.upcall for DFS support (diff)
downloadmltk-eea5898961a40fc50f01356f90c42904a73a3f74.tar.gz
mltk-eea5898961a40fc50f01356f90c42904a73a3f74.tar.xz
mltk-eea5898961a40fc50f01356f90c42904a73a3f74.zip
major run-virt restructure, only vmware plugin tested!
Diffstat (limited to 'core/modules/qemukvm')
-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/run-virt.include (renamed from core/modules/qemukvm/data/opt/openslx/vmchooser/qemukvm/run-virt.include)59
2 files changed, 33 insertions, 27 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
new file mode 100644
index 00000000..549d0037
--- /dev/null
+++ b/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/README
@@ -0,0 +1 @@
+Not tested since refactoring! (January 2017)
diff --git a/core/modules/qemukvm/data/opt/openslx/vmchooser/qemukvm/run-virt.include b/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include
index 81bf9218..e2a60f9c 100644
--- a/core/modules/qemukvm/data/opt/openslx/vmchooser/qemukvm/run-virt.include
+++ b/core/modules/qemukvm/data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include
@@ -30,6 +30,8 @@ setup_if ()
################################################################################
### Declaration of default variables
################################################################################
+# Define which features the VMware plugin supports
+declare -rg PLUGIN_FEATURES="TODO"
VMCHOOSERQK="/opt/openslx/vmchooser/${self}"
# create TMPDIR for all users
@@ -52,12 +54,12 @@ else
fi
# set the emulator/virtualization options for various operating systems
-sound="es1370"
+SOUND_DEV="es1370"
case "${VM_OS_TYPE}" in
beos*)
VIRTCMDOPTS="qemu-system-i386 -machine accel=tcg"
- sound="sb16"
- if [ "${totalmem}" -ge "1000" ]; then
+ SOUND_DEV="sb16"
+ if [ "${HOST_MEM_TOTAL}" -ge "1000" ]; then
forcemem=512
else
forcemem=256
@@ -65,7 +67,7 @@ case "${VM_OS_TYPE}" in
;;
win3*|win*3*|Win*3*)
VIRTCMDOPTS="qemu-system-i386 -machine accel=tcg"
- sound="sb16"
+ SOUND_DEV="sb16"
forcemem=32
;;
win95*|Win*95)
@@ -78,12 +80,12 @@ case "${VM_OS_TYPE}" in
;;
winme*|windowsme*)
VIRTCMDOPTS="qemu-system-i386 -machine accel=tcg"
- sound="ac97"
+ SOUND_DEV="ac97"
forcemem=384
;;
winxp*64|windowsxp*64)
VIRTCMDOPTS="qemu-system-x86_64 -machine accel=kvm"
- sound="ac97"
+ SOUND_DEV="ac97"
;;
esac
@@ -110,14 +112,14 @@ if [ -n "${forcemem}" ]; then
mem="${forcemem}"
else
permem=30
- if [ "${totalmem}" -ge "1600" ]; then
+ if [ "${HOST_MEM_TOTAL}" -ge "1600" ]; then
permem=40
fi
# # check if /tmp is on harddisk
# if grep -qe "/dev/.* /tmp " /proc/mounts ; then
# permem=60
# id44="1"
-# #if [ "${totalmem}" -ge "2500" ]; then
+# #if [ "${HOST_MEM_TOTAL}" -ge "2500" ]; then
# #permem=40
# #rmdir ${snapshotdir}
# #snapshotdirold=${snapshotdir}
@@ -126,27 +128,29 @@ else
# #ln -sf ${snapshotdir} ${snapshotdirold}
# #fi
# fi
- mem=$(expr ${totalmem} / 100 \* ${permem})
+ mem=$(expr ${HOST_MEM_TOTAL} / 100 \* ${permem})
if [ "${id44}" = "1" ]; then
- memhost=$(expr ${totalmem} - ${mem})
+ HOST_MEM_REMAINING=$(expr ${HOST_MEM_TOTAL} - ${VM_MEM})
else
- memhost=$(expr ${totalmem} - ${mem} - ${mem})
+ HOST_MEM_REMAINING=$(expr ${HOST_MEM_TOTAL} - ${VM_MEM} - ${VM_MEM})
fi
# static first
permem=50
- mem=$(expr ${totalmem} / 100 \* ${permem})
- if [ "${mem}" -lt "256" ] || [ "${memhost}" -lt "256" ]; then
- writelog "Memory out of range: ${mem} MB (guest) / ${memhost} MB (host)!"
+ mem=$(expr ${HOST_MEM_TOTAL} / 100 \* ${permem})
+ if [ "${VM_MEM}" -lt "256" ] || [ "${HOST_MEM_REMAINING}" -lt "256" ]; then
+ writelog "Memory out of range: ${VM_MEM} MB (guest) / ${HOST_MEM_REMAINING} MB (host)!"
writelog "Min. 256 MB for host and guest!"
exit 1
fi
fi
-VIRTCMDOPTS="${VIRTCMDOPTS} -m ${mem}"
+VIRTCMDOPTS="${VIRTCMDOPTS} -m ${VM_MEM}"
# network adaptor alternatives: rtl8139, pcnet, e1000
network_card=${network_card:=pcnet}
-VIRTCMDOPTS="${VIRTCMDOPTS} -net nic,macaddr=${macaddr},model=${network_card}"
+# TODO handle new way of generating MAC addr with prefix/suffix
+# KVM MAC prefix should be 52:54:00
+VIRTCMDOPTS="${VIRTCMDOPTS} -net nic,macaddr=${VM_MAC_ADDR},model=${network_card}"
# define network kind and configure the interfaces
case "${network_kind}" in
@@ -190,6 +194,7 @@ else
boot="c"
fi
+# TODO externalize!
# external GUI port
vncport="590${VM_ID}"
@@ -199,29 +204,29 @@ ide="TRUE"
hddrv="ide"
# special feature for real and virtual floppy disks
-[ -n "${floppy_0}" ] && VIRTCMDOPTS="${VIRTCMDOPTS} -fda ${floppy_0}"
-VIRTCMDOPTS="${VIRTCMDOPTS} -fdb /opt/openslx/vmchooser/data/loopimg/fd.img"
+[ -n "${floppy_0}" ] && VIRTCMDOPTS="${VIRTCMDOPTS} -fda ${FLOPPY_0}"
+VIRTCMDOPTS="${VIRTCMDOPTS} -fdb ${SLX_FLOPPY_IMG}"
# add optical drive if available
-[ -n "${cdrom_0}" ] && VIRTCMDOPTS="${VIRTCMDOPTS} -cdrom ${cdrom_0}"
+[ -n "${CDROM_0}" ] && VIRTCMDOPTS="${VIRTCMDOPTS} -cdrom ${CDROM_0}"
# audio
-VIRTCMDOPTS="${VIRTCMDOPTS} -soundhw ${sound}"
+VIRTCMDOPTS="${VIRTCMDOPTS} -soundhw ${SOUND_DEV}"
# serial
[ "x${serial}" == "xttyS0" ] && VIRTCMDOPTS="${VIRTCMDOPTS} -serial /dev/ttyS0"
writelog "Virtual Hardware:"
-writelog "\tGuest RAM:\t\t${mem} MB"
-# echo nur wenn memhost gesetzt
-[ -n "${memhost}" ] && writelog "\tHost RAM:\t\t${memhost} MB"
-writelog "\tMAC address:\t\t$macaddr"
+writelog "\tGuest RAM:\t\t${VM_MEM} MB"
+# echo nur wenn HOST_MEM_REMAINING gesetzt
+[ -n "${HOST_MEM_REMAINING}" ] && writelog "\tHost RAM:\t\t${HOST_MEM_REMAINING} MB"
+writelog "\tMAC address:\t\t${VM_MAC_ADDR}"
writelog "\tNetwork card:\t\t${network_card}"
writelog "\tNetwork kind:\t\t${network_kind}"
-writelog "\tCD-ROM1:\t${cdrom0}"
+writelog "\tCD-ROM1:\t${CDROM_0}"
#writelog "\tCD-ROM2:\t${cdrom1}"
-writelog "\tFloppy_A:\t${floppy_0}"
-writelog "\tFloppy_B:\t/opt/openslx/vmchooser/data/loopimg/fd.img"
+writelog "\tFloppy_A:\t${FLOPPY_0}"
+writelog "\tFloppy_B:\t${SLX_FLOPPY_IMG}"
#writelog "\tShared Folders 'home':\t/home/${USER}"
################################################################################