From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: "Fam Zheng" <fam@euphon.net>,
"Maxim Levitsky" <mlevitsk@redhat.com>,
qemu-block@nongnu.org, qemu-devel@nongnu.org,
"Max Reitz" <mreitz@redhat.com>,
"Xueqiang Wei" <xuwei@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: [PATCH] block/nvme: Do not allow image creation with NVMe block driver
Date: Fri, 18 Dec 2020 11:20:24 +0100 [thread overview]
Message-ID: <20201218102024.GC9596@merkur.fritz.box> (raw)
In-Reply-To: <20201217161729.GB24632@stefanha-x1.localdomain>
[-- Attachment #1: Type: text/plain, Size: 1572 bytes --]
Am 17.12.2020 um 17:17 hat Stefan Hajnoczi geschrieben:
> On Mon, Dec 07, 2020 at 06:16:04PM +0100, Philippe Mathieu-Daudé wrote:
> > On 12/4/20 11:28 PM, Philippe Mathieu-Daudé wrote:
> > > On 12/4/20 5:57 PM, Philippe Mathieu-Daudé wrote:
> > >> The NVMe driver does not support image creation.
> > >> The full drive has to be passed to the guest.
> > >>
> > >> Before:
> > >>
> > >> $ qemu-img create -f raw nvme://0000:04:00.0/1 20G
> > >> Formatting 'nvme://0000:04:00.0/1', fmt=raw size=21474836480
> > >>
> > >> $ qemu-img info nvme://0000:04:00.0/1
> > >> image: nvme://0000:04:00.0/1
> > >> file format: raw
> > >> virtual size: 349 GiB (375083606016 bytes)
> > >> disk size: unavailable
> >
> > Maybe I should not forbid all formats... But 'raw' is kinda
> > dangerous, as there is no way to enforce the next layer to
> > access beside the size allocated.
> >
> > Safe drive partitioning can be achieved creating namespaces,
> > feature which is not yet implemented.
>
> I don't see the need for this patch. Or if there is a need then
> block/file-posix.c, block/iscsi.c, and block/nbd.c should also be
> changed (anything that uses bdrv_co_create_opts_simple()).
>
> Instead I suggest adding a warning at creation time if a raw format
> image is created on top of a BDS that is larger than requested. The
> warning should remind the user that they need to use the raw format
> drivers's size= open option to restrict the disk capacity when opening
> the image.
This sounds like a good idea to me.
Kevin
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2020-12-18 10:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-04 16:57 [PATCH] block/nvme: Do not allow image creation with NVMe block driver Philippe Mathieu-Daudé
2020-12-04 22:28 ` Philippe Mathieu-Daudé
2020-12-07 17:16 ` Philippe Mathieu-Daudé
2020-12-17 16:17 ` Stefan Hajnoczi
2020-12-18 10:20 ` Kevin Wolf [this message]
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=20201218102024.GC9596@merkur.fritz.box \
--to=kwolf@redhat.com \
--cc=fam@euphon.net \
--cc=mlevitsk@redhat.com \
--cc=mreitz@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=xuwei@redhat.com \
/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).