summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
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}