On 03.07.19 17:59, Maxim Levitsky wrote: > Tesed on a nvme device like that: > > # create preallocated qcow2 image > $ qemu-img create -f qcow2 nvme://0000:06:00.0/1 10G -o preallocation=metadata > Formatting 'nvme://0000:06:00.0/1', fmt=qcow2 size=10737418240 > cluster_size=65536 preallocation=metadata lazy_refcounts=off refcount_bits=16 > > # create an empty qcow2 image > $ qemu-img create -f qcow2 nvme://0000:06:00.0/1 10G -o preallocation=off > Formatting 'nvme://0000:06:00.0/1', fmt=qcow2 size=10737418240 > cluster_size=65536 preallocation=off lazy_refcounts=off refcount_bits=16 > > Signed-off-by: Maxim Levitsky <mlevi...@redhat.com> > --- > block/nvme.c | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 108 insertions(+)
Hm. I’m not quite sure I like this, because this is not image creation. What we need is a general interface for formatting existing files. I mean, we have that in QMP (blockdev-create), but the problem is that this doesn’t really translate to qemu-img create. I wonder whether it’s best to hack something up that makes bdrv_create_file() a no-op, or whether we should expose blockdev-create over qemu-img. I’ll see how difficult the latter is, it sounds fun (famous last words). Max
signature.asc
Description: OpenPGP digital signature