set format for raw images

This commit is contained in:
Ilfat G 2022-10-27 15:48:38 +03:00
parent 3678f4013f
commit 8ae599ea57
No known key found for this signature in database
GPG key ID: D5E884CA11E29755

9
qemoo
View file

@ -49,11 +49,11 @@ checkImg(){
echo 'error' echo 'error'
exit ${LINENO} exit ${LINENO}
fi fi
elif ! qemu-img info "$IMG" | grep -q "file.*raw" ; then elif file "$IMG" | grep -q "ISO 9660"; then
echo "virt" echo "iso"
return 0 return 0
else else
echo "iso" echo "virt"
return 0 return 0
fi fi
} }
@ -146,10 +146,11 @@ run() {
case $type in case $type in
'virt' ) 'virt' )
echo "Virtual machine image: $IMG" echo "Virtual machine image: $IMG"
qemu-img info "$IMG" |grep -q "file.*raw" && RAW=",format=raw"
cmdline=" cmdline="
$COMMON \ $COMMON \
-boot c \ -boot c \
-hda $IMG" -drive file=$IMG,cache=none$RAW"
run $cmdline run $cmdline
;; ;;
'blockdev') 'blockdev')