From 20b7b0b73b2ae64e3f525acb50dca1e5a4f5dce7 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 12 Apr 2020 12:55:48 +0200 Subject: [PATCH] qemu: Skip QEMU_MNT and QEMU_HOST directories if not set Signed-off-by: Joachim Nilsson --- bin/qemu | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/qemu b/bin/qemu index 5e3f00d..3fefbd1 100755 --- a/bin/qemu +++ b/bin/qemu @@ -87,6 +87,10 @@ dtb_args() mnt_args() { + if [ -z "${QEMU_MNT}" ]; then + return + fi + echo -n "-device ${QEMU_SCSI},id=scsi0 " echo -n "-device scsi-hd,bus=scsi0.0,drive=drive0 " echo -n "-drive file=${QEMU_MNT},if=none,format=raw,discard=unmap,id=drive0 " @@ -94,6 +98,10 @@ mnt_args() host_args() { + if [ -z "${QEMU_HOST}" ]; then + return + fi + echo -n "-virtfs local,id=hosfts,path=${QEMU_HOST},security_model=none,mount_tag=hostfs " }