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'
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')