From bbd37d719a83047173e4d5ba6bcf9796c46cd529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sp=C3=B6hel?= Date: Fri, 23 Apr 2021 10:45:01 +0200 Subject: Adding what is necessary to start vEOSlab. --- libexec/container/start-qemu | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'libexec') 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} -- cgit v1.2.3