summaryrefslogtreecommitdiffstats
path: root/libexec/container
diff options
context:
space:
mode:
authorSimon Spöhel <simon@spoehel.ch>2021-04-23 08:45:01 +0000
committerSakirnth Nagarasa <sakirnth@gmail.com>2021-09-01 08:24:59 +0000
commitbbd37d719a83047173e4d5ba6bcf9796c46cd529 (patch)
tree6a011c7f40456e876bb094fe78c0f5374302b744 /libexec/container
parentReading VM related variables from config file. (diff)
downloadcompute-tools-bbd37d719a83047173e4d5ba6bcf9796c46cd529.tar.xz
compute-tools-bbd37d719a83047173e4d5ba6bcf9796c46cd529.zip
Adding what is necessary to start vEOSlab.
Diffstat (limited to '')
-rwxr-xr-xlibexec/container/start-qemu37
1 files changed, 35 insertions, 2 deletions
diff --git a/libexec/container/start-qemu b/libexec/container/start-qemu
index e27df60..3f05c8c 100755
--- a/libexec/container/start-qemu
+++ b/libexec/container/start-qemu
@@ -223,7 +223,6 @@ then
DIRECTORY="$(awk -Fdirectory= '/^directory=/ { print $2 }' ${CONFIG}/${NAME}.conf || echo ${MACHINES}/${NAMES})"
- DRIVE=""
DRIVES="$(awk -Fdrive= '/^drive=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
case "${DRIVES}" in
@@ -238,6 +237,20 @@ then
;;
esac
+ DEVICES="$(awk -Fdevice= '/^device=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+
+ case "${DEVICES}" in
+ "")
+ ;;
+
+ *)
+ for DEVICE_ITEM in ${DEVICES}
+ do
+ DEVICE="${DEVICE} -device ${DEVICE_ITEM}"
+ done
+ ;;
+ esac
+
MEMORY="-m $(awk -Fmemory= '/^memory=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
SERIAL="-serial $(awk -Fserial= '/^serial=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
@@ -257,6 +270,25 @@ then
BIOS="-bios ${BIOS_FILE}"
;;
esac
+
+ NETDEVS="$(awk -Fvm.netdev= '/^vm.netdev=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+
+ case "${NETDEVS}" in
+ "")
+ ;;
+
+ *)
+ OLDIFS="${IFS}"
+ IFS='
+'
+ for NETDEV_ITEM in ${NETDEVS}
+ do
+ NETDEV="${NETDEV} -netdev ${NETDEV_ITEM}"
+ done
+ IFS="${OLDIFS}"
+ ;;
+ esac
+
DROP_CAPABILITY="$(awk -Fdrop-capability= '/^drop-capability=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
case "${DROP_CAPABILITY}" in
@@ -431,7 +463,8 @@ case "${START}" in
${DRIVE} \
${MEMORY} \
-name ${NAME} \
- ${NETWORK_VETH_EXTRA} \
+ ${DEVICE} \
+ ${NETDEV} \
${BIOS} \
${SERIAL} \
${RAW_OPTIONS}