qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: Fam Zheng <fam@euphon.net>, Kevin Wolf <kwolf@redhat.com>,
	qemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Maxim Levitsky <mlevitsk@redhat.com>,
	Xueqiang Wei <xuwei@redhat.com>
Subject: Re: [PATCH] block/nvme: Do not allow image creation with NVMe block driver
Date: Fri, 4 Dec 2020 23:28:32 +0100	[thread overview]
Message-ID: <d1deeab3-251f-5081-7d45-0092b381bc5a@redhat.com> (raw)
In-Reply-To: <20201204165724.2647357-1-philmd@redhat.com>

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
> 
> After:
> 
>   $ qemu-img create -f raw nvme://0000:04:00.0/1 20G
>   qemu-img: nvme://0000:04:00.0/1: Protocol driver 'nvme' does not support image creation
> 
> Fixes: 5a5e7f8cd86 ("block: trickle down the fallback image creation function use to the block drivers")
> Reported-by: Xueqiang Wei <xuwei@redhat.com>
> Suggested-by: Max Reitz <mreitz@redhat.com>

Well Max didn't suggest the change but pointed me to commit 5a5e7f8cd86.

> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> Cc: Maxim Levitsky <mlevitsk@redhat.com>
> ---
>  block/nvme.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/block/nvme.c b/block/nvme.c
> index a06a188d530..73ddf837c2b 100644
> --- a/block/nvme.c
> +++ b/block/nvme.c
> @@ -1515,9 +1515,6 @@ static BlockDriver bdrv_nvme = {
>      .protocol_name            = "nvme",
>      .instance_size            = sizeof(BDRVNVMeState),
>  
> -    .bdrv_co_create_opts      = bdrv_co_create_opts_simple,
> -    .create_opts              = &bdrv_create_opts_simple,
> -
>      .bdrv_parse_filename      = nvme_parse_filename,
>      .bdrv_file_open           = nvme_file_open,
>      .bdrv_close               = nvme_close,
> 



  reply	other threads:[~2020-12-04 22:32 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é [this message]
2020-12-07 17:16   ` Philippe Mathieu-Daudé
2020-12-17 16:17     ` Stefan Hajnoczi
2020-12-18 10:20       ` Kevin Wolf

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=d1deeab3-251f-5081-7d45-0092b381bc5a@redhat.com \
    --to=philmd@redhat.com \
    --cc=fam@euphon.net \
    --cc=kwolf@redhat.com \
    --cc=mlevitsk@redhat.com \
    --cc=mreitz@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).