Skip to content

Commit

Permalink
qemu: Skip QEMU_MNT and QEMU_HOST directories if not set
Browse files Browse the repository at this point in the history
Signed-off-by: Joachim Nilsson <[email protected]>
  • Loading branch information
troglobit committed Apr 12, 2020
1 parent c96e0e0 commit 20b7b0b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/qemu
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,21 @@ 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 "
}

host_args()
{
if [ -z "${QEMU_HOST}" ]; then
return
fi

echo -n "-virtfs local,id=hosfts,path=${QEMU_HOST},security_model=none,mount_tag=hostfs "
}

Expand Down

0 comments on commit 20b7b0b

Please sign in to comment.