From: Maxim Levitsky <mlevitsk@redhat.com>
To: Max Reitz <mreitz@redhat.com>, qemu-devel@nongnu.org
Cc: Fam Zheng <fam@euphon.net>, Paolo Bonzini <pbonzini@redhat.com>,
John Snow <jsnow@redhat.com>,
qemu-block@nongnu.org, Kevin Wolf <kwolf@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 4/6] block/nvme: add support for image creation
Date: Sun, 07 Jul 2019 12:03:00 +0300 [thread overview]
Message-ID: <f53af77fcd36c1147642761791162e99ac7fedde.camel@redhat.com> (raw)
In-Reply-To: <fdd3554a-c972-68eb-bac1-058c726df66e@redhat.com>
On Fri, 2019-07-05 at 14:09 +0200, Max Reitz wrote:
> 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 <mlevitsk@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.
I fully agree with you, and the whole thing did felt kind of wrong.
I kind of think that bdrv_co_create_opts is kind of outdated for the purpose, especially
with the nvme driver.
I think that it would be better if the bdrv_file_open just supported something like 'O_CREAT'.
I done this the mostly the same was as the file-posix does this on the block devices,
including that 'hack' of zeroing the first sector, for which I really don't know if this is the right solution.
>
> 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).
For existing images, the 'bdrv_create_file' is already kind of a nop, other that zeroing the first sector,
which kind of makes sense, but probably best done on higher level than in each driver.
So these are my thoughts about this, thanks for the review!
Best regards,
Maxim Levitsky
next prev parent reply other threads:[~2019-07-07 9:04 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-03 15:59 [Qemu-devel] [PATCH v3 0/6] Few fixes for userspace NVME driver Maxim Levitsky
2019-07-03 15:59 ` [Qemu-devel] [PATCH v3 1/6] block/nvme: don't touch the completion entries Maxim Levitsky
2019-07-05 11:03 ` Max Reitz
2019-07-07 8:43 ` Maxim Levitsky
2019-07-08 12:23 ` Max Reitz
2019-07-08 12:51 ` Maxim Levitsky
2019-07-08 13:00 ` Max Reitz
2019-07-08 13:06 ` Maxim Levitsky
2019-07-03 15:59 ` [Qemu-devel] [PATCH v3 2/6] block/nvme: fix doorbell stride Maxim Levitsky
2019-07-05 11:09 ` Max Reitz
2019-07-05 11:10 ` Max Reitz
2019-07-07 8:47 ` Maxim Levitsky
2019-07-03 15:59 ` [Qemu-devel] [PATCH v3 3/6] block/nvme: support larger that 512 bytes sector devices Maxim Levitsky
2019-07-05 11:58 ` Max Reitz
2019-07-07 8:51 ` Maxim Levitsky
2019-07-03 15:59 ` [Qemu-devel] [PATCH v3 4/6] block/nvme: add support for image creation Maxim Levitsky
2019-07-05 12:09 ` Max Reitz
2019-07-07 9:03 ` Maxim Levitsky [this message]
2019-07-03 15:59 ` [Qemu-devel] [PATCH v3 5/6] block/nvme: add support for write zeros Maxim Levitsky
2019-07-05 13:33 ` Max Reitz
2019-07-07 9:19 ` Maxim Levitsky
2019-07-03 15:59 ` [Qemu-devel] [PATCH v3 6/6] block/nvme: add support for discard Maxim Levitsky
2019-07-03 16:07 ` [Qemu-devel] [PATCH v4] " Maxim Levitsky
2019-07-05 13:50 ` Max Reitz
2019-07-07 9:40 ` Maxim Levitsky
2019-07-03 20:43 ` [Qemu-devel] [PATCH v3 0/6] Few fixes for userspace NVME driver no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f53af77fcd36c1147642761791162e99ac7fedde.camel@redhat.com \
--to=mlevitsk@redhat.com \
--cc=fam@euphon.net \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).