All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: mr-083 <matthieu@minio.io>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org, its@irrelevant.dk,
	kbusch@kernel.org, mr-083 <matthieu@min.io>
Subject: Re: [PATCH 2/2] block/monitor: add drive_insert HMP command
Date: Wed, 15 Apr 2026 08:33:10 -0400	[thread overview]
Message-ID: <20260415123310.GA163810@fedora> (raw)
In-Reply-To: <ad9s9CRT0niUAPQn@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1885 bytes --]

On Wed, Apr 15, 2026 at 11:48:20AM +0100, Daniel P. Berrangé wrote:
> On Thu, Apr 09, 2026 at 08:01:54AM +0200, mr-083 wrote:
> > Add a drive_insert HMP command that reconnects a host block device file
> > to an existing guest device whose backing store was previously removed
> > with drive_del.
> > 
> > After drive_del, the BlockBackend remains attached to the guest device
> > but has no BlockDriverState (shown as "[not inserted]" in info block).
> > drive_insert opens the specified file, finds the device's BlockBackend
> > by iterating all backends and matching the attached device ID, then
> > calls blk_insert_bs() to reconnect the backing store.
> > 
> > This complements drive_del for non-removable devices (such as NVMe
> > namespaces) where blockdev-change-medium cannot be used. Combined with
> > PCIe AER Surprise Down error injection to trigger a controller reset,
> > this enables complete NVMe disk hot-swap simulation where the guest
> > sees the same device names throughout.
> > 
> > Example usage:
> >   drive_del drv0             # remove backing store
> >   drive_insert ns0 disk.qcow2  # reconnect backing
> >   pcie_aer_inject_error rp0 SDN  # trigger controller reset
> > 
> > Signed-off-by: Matthieu Receveur <matthieu@min.io>
> > ---
> >  block/monitor/block-hmp-cmds.c | 59 ++++++++++++++++++++++++++++++++++
> >  hmp-commands.hx                | 18 +++++++++++
> 
> I see v3 has dropped this new command, but in case you have plans
> to re-introduce it..

I suggest splitting this into two separate patch series since two
different use cases are being addressed:

1. --device nvme-ns hotplug using NVMe AEN. Allows users to attach and
   detach storage to the NVMe controller at runtime (without PCI
   hotplug).

2. PCIe Surprise Down and AER. Allows testing of PCI error recovery in
   guest drivers.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2026-04-15 12:33 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09  6:01 [PATCH 0/2] NVMe namespace hotplug and drive reconnection support mr-083
2026-04-09  6:01 ` [PATCH 1/2] hw/nvme: add namespace hotplug support mr-083
2026-04-09  6:01 ` [PATCH 2/2] block/monitor: add drive_insert HMP command mr-083
2026-04-14 17:57   ` Stefan Hajnoczi
2026-04-14 18:02     ` Matthieu Rolla
2026-04-14 19:05       ` Warner Losh
2026-04-14 21:01         ` Matthieu Rolla
2026-04-15 10:48   ` Daniel P. Berrangé
2026-04-15 12:32     ` Matthieu Rolla
2026-04-16 19:52       ` Stefan Hajnoczi
2026-04-16 22:00         ` Matthieu Rolla
2026-04-15 12:33     ` Stefan Hajnoczi [this message]
2026-04-09 21:34 ` [PATCH v2] hw/nvme: add namespace hotplug support mr-083
2026-04-10 12:41   ` Stefan Hajnoczi
2026-04-10 14:30 ` [PATCH v3] " mr-083
2026-04-10 14:33   ` Matthieu Rolla
2026-04-10 20:14     ` Stefan Hajnoczi
2026-04-13 15:24       ` Matthieu Rolla
2026-04-13 17:17 ` [PATCH 0/2] NVMe namespace hotplug and drive reconnection support Klaus Jensen
2026-04-14 12:42   ` Stefan Hajnoczi
2026-04-14 13:36     ` Matthieu Rolla
2026-04-14 18:09       ` Keith Busch
2026-04-14 18:10       ` Stefan Hajnoczi
2026-04-14 18:14         ` Matthieu Rolla
2026-04-15 12:45           ` Stefan Hajnoczi
2026-04-15 17:39             ` Matthieu Rolla
2026-04-14 14:04     ` John Meneghini
2026-04-16 10:11       ` Nilay Shroff
2026-04-16 12:33         ` Matthieu Rolla
2026-04-14 14:42     ` Keith Busch
2026-04-15 17:38 ` [PATCH v4] hw/nvme: add namespace hotplug support mr-083
2026-04-16 19:42   ` Stefan Hajnoczi
2026-04-17  9:29   ` Klaus Jensen
2026-04-17  9:45     ` Matthieu Rolla
  -- strict thread matches above, loose matches on Subject: below --
2026-04-09  7:01 [PATCH 0/2] NVMe namespace hotplug and drive reconnection support mr-083
2026-04-09  7:01 ` [PATCH 2/2] block/monitor: add drive_insert HMP command mr-083

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=20260415123310.GA163810@fedora \
    --to=stefanha@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 \
    /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.