All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: mr-083 <matthieu@minio.io>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, its@irrelevant.dk,
	kbusch@kernel.org, stefanha@redhat.com, berrange@redhat.com,
	mr-083 <matthieu@min.io>,
	armbru@redhat.com
Subject: Re: [PATCH] block: add blockdev-attach QMP command
Date: Fri, 24 Apr 2026 19:06:22 +0200	[thread overview]
Message-ID: <aeujDmRSu39026wD@redhat.com> (raw)
In-Reply-To: <20260415173905.71224-1-matthieu@min.io>

Am 15.04.2026 um 19:39 hat mr-083 geschrieben:
> Add a blockdev-attach QMP command that attaches a block driver state
> tree to a device's block backend.  Unlike blockdev-insert-medium, this
> works for non-removable devices such as NVMe namespaces.
> 
> After drive_del removes a device's backing store, the BlockBackend
> remains attached to the guest device but has no BlockDriverState.
> blockdev-attach reconnects a block node (previously created with
> blockdev-add) to the device's BlockBackend via blk_insert_bs().
> 
> This separates the two concerns as recommended: blockdev-add creates
> the block node, blockdev-attach associates it with the device.
> 
> Example usage with NVMe namespace hot-swap:
>   drive_del drv0
>   blockdev-add node-name=node0 driver=qcow2 file.driver=file \
>                file.filename=disk.qcow2
>   blockdev-attach id=ns0 node-name=node0

Is the intended functionality the same as the following?

   blockdev-add node-name=node0 driver=qcow2 file.driver=file \
                file.filename=disk.qcow2
   qom-set path=ns0 property=drive value=node0
   drive-del drv0 / blockdev-del node-name=old-node

This seems cleaner because there is no window where the namespace
isn't backed by any block node.

If this does what you want, it's unclear to me if we want a separate QMP
command to do the same in a maybe more discoverable way. Markus, do we
have precedence for this?

> An HMP wrapper is included for convenience.

An HMP convenience command mapping to qom-set should still be possible
either way.

Kevin



      parent reply	other threads:[~2026-04-24 17:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-15 17:39 [PATCH] block: add blockdev-attach QMP command mr-083
2026-04-23 16:29 ` Stefan Hajnoczi
2026-05-06  6:10   ` Markus Armbruster
2026-05-06 15:40     ` Stefan Hajnoczi
2026-04-24 17:06 ` 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=aeujDmRSu39026wD@redhat.com \
    --to=kwolf@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=its@irrelevant.dk \
    --cc=kbusch@kernel.org \
    --cc=matthieu@min.io \
    --cc=matthieu@minio.io \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.