Reduce qemu disk image format guesswork (#968598)
-
qemu: Guess format of main disk image
In qemu 5.1, qemu-img outputs a deprecation warning if it is made to guess the format of a disk image, on the basis that untrusted disk images can be crafted to have ambiguous contents: for example, if an image is guessed to be in raw format, a guest can overwrite suitable magic numbers to turn it into something that qemu will guess to be qcow2.
autopkgtest-virt-qemu has historically accepted either raw or qcow2 images, and our images are presumably at least somewhat trusted, so explicitly guess using qemu-info to suppress the warning. A future enhancement would be to provide a way for the user to specify the format of the disk image(s) they are providing, removing the need to guess.
Closes: #968598
-
tools: Don't make qemu guess what format the disk image is
In autopkgtest-build-qemu, we know vmdb2 produced a raw image; in autopkgtest-buildvm-ubuntu-cloud, we know that the Ubuntu image is in qcow2 format, while the cloud-init seed generated by genisoimage is a raw image.