From 8ae599ea5773c935a49149edd902aa32ed224d28 Mon Sep 17 00:00:00 2001 From: Ilfat G Date: Thu, 27 Oct 2022 15:48:38 +0300 Subject: [PATCH] set format for raw images --- qemoo | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qemoo b/qemoo index 4caaa58..4f7aa55 100755 --- a/qemoo +++ b/qemoo @@ -49,11 +49,11 @@ checkImg(){ echo 'error' exit ${LINENO} fi - elif ! qemu-img info "$IMG" | grep -q "file.*raw" ; then - echo "virt" + elif file "$IMG" | grep -q "ISO 9660"; then + echo "iso" return 0 else - echo "iso" + echo "virt" return 0 fi } @@ -146,10 +146,11 @@ run() { case $type in 'virt' ) echo "Virtual machine image: $IMG" + qemu-img info "$IMG" |grep -q "file.*raw" && RAW=",format=raw" cmdline=" $COMMON \ -boot c \ - -hda $IMG" + -drive file=$IMG,cache=none$RAW" run $cmdline ;; 'blockdev')