On 11/26/19 9:54 AM, Eric Blake wrote:
On 11/26/19 9:48 AM, Kevin Wolf wrote:
If both the create options (qemu-img create -o ...) and the size
parameter were given, the size parameter was silently ignored. Instead,
make specifying two sizes an error.
Signed-off-by: Kevin Wolf <kw...@redhat.com>
---
block.c | 10 ++++++++--
tests/qemu-iotests/049 | 5 +++++
tests/qemu-iotests/049.out | 5 +++++
3 files changed, 18 insertions(+), 2 deletions(-)
Longtime bug, so not essential for 4.2-rc3. But small enough that you
could sneak it in if you have other patches to queue and don't want to
wait for 5.0.
Reviewed-by: Eric Blake <ebl...@redhat.com>
Actually, your patch fails to diagnose:
$ qemu-img create -o size=1m,size=2m -f qcow2 x.qcow2
Formatting 'x.qcow2', fmt=qcow2 size=2097152 cluster_size=65536
lazy_refcounts=off refcount_bits=16
so you may want to enhance this patch to also catch the case of -o size
used more than once.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org