#!/bin/bash QEMU_ARGS=() WAIT=true while [ ! -z "$1" ] ; do case "$1" in "--detach") WAIT=false ;; *) QEMU_ARGS+=("$1") ;; esac shift done qemu-system-x86_64 \ --bios /usr/share/edk2/x64/OVMF.fd \ -vga virtio \ -serial stdio \ -drive if=none,id=stick,format=raw,file=staging/x86_64_iso/fat.img \ -device nec-usb-xhci,id=xhci \ -device usb-storage,bus=xhci.0,drive=stick "${QEMU_ARGS[@]}" & if ${WAIT} ; then wait fi