Am 02.12.2017 um 00:49 hat Klim Kireev geschrieben: > Now, if you type something like > > qemu-img create disk.qcow2 1G > or > qemu-img dd if=/dev/sda of=disk.qcow2 > > it creates a raw image and if you need you should > manually specify an image format with -f qcow2. It would > be more convenient if it could be assumed from an extension. > > This patch adds a simple heuristic to recognize the image format > for qcow, qcow2, vmdk, vhdx, vdi > > It warns users about guessed format and informs them about '-f' option. > > Signed-off-by: Klim Kireev <klim.kir...@virtuozzo.com>
This is an incompatible change. If we want to go there, we must introduce a deprecation warning now without any other change in behaviour. We need to warn users for two releases that the behaviour will change in the future, and only then we can switch over (i.e. in qemu 2.14 the earliest if we introduce the warning in 2.12). I'm not sure if we even want to automatically guess the format from the filename, or if a warning/error would be enough even in the long term. The behaviour I have in mind is like this: * qemu-img create x.raw 4G => works, possibly warning * qemu-img create -f raw x.raw 4G => works * qemu-img create x.qcow2 4G => error, need -f for non-raw * qemu-img create -f qcow2 x.qcow2 4G => works * qemu-img create -f raw x.qcow2 4G => works, possibly warning Kevin