Merge "Detect image format for qemu-nbd --format"
This commit is contained in:
commit
409fcf8ae1
|
@ -92,7 +92,14 @@ remove_device () {
|
|||
mount_image() {
|
||||
set -x
|
||||
|
||||
qemu-nbd --connect $NBD_DEVICE $IMAGE_FILE
|
||||
if qemu-img info --output json $IMAGE_FILE |grep '"format": "raw"' ; then
|
||||
image_format='--format raw'
|
||||
elif qemu-img info --output json $IMAGE_FILE |grep '"format": "qcow2"' ; then
|
||||
image_format='--format qcow2'
|
||||
else
|
||||
image_format=''
|
||||
fi
|
||||
qemu-nbd $image_format --connect $NBD_DEVICE $IMAGE_FILE
|
||||
|
||||
# search for the vg volume group, this is automatic in some environments
|
||||
vgscan
|
||||
|
|
Loading…
Reference in New Issue