Spiff up the upload_image() format handling
* attempt to detect format of *.img files automatically, recognizing: qcow2,raw,vdi,vmdk,vpc Change-Id: I92ec141584ba8237b67ca640e401a1b88860747e
This commit is contained in:
parent
d85135ee40
commit
636a3ff429
@ -792,7 +792,12 @@ function upload_image() {
|
||||
*.img)
|
||||
IMAGE="$FILES/$IMAGE_FNAME";
|
||||
IMAGE_NAME=$(basename "$IMAGE" ".img")
|
||||
DISK_FORMAT=raw
|
||||
format=$(qemu-img info ${IMAGE} | awk '/^file format/ { print $3; exit }')
|
||||
if [[ ",qcow2,raw,vdi,vmdk,vpc," =~ ",$format," ]]; then
|
||||
DISK_FORMAT=$format
|
||||
else
|
||||
DISK_FORMAT=raw
|
||||
fi
|
||||
CONTAINER_FORMAT=bare
|
||||
;;
|
||||
*.img.gz)
|
||||
|
Loading…
Reference in New Issue
Block a user