[PATCH v3 0/2] hw/nvme: support online resize

Alexander Mikhalitsyn posted 2 patches 1 month, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260803083046.110121-1-alexander@mihalicyn.com
Maintainers: Keith Busch <kbusch@kernel.org>, Klaus Jensen <its@irrelevant.dk>, Jesper Devantier <foss@defmacro.it>
hw/nvme/ctrl.c | 10 ++++++++
hw/nvme/ns.c   | 68 +++++++++++++++++++++++++++++++++++++++++++++++++-
hw/nvme/nvme.h |  2 ++
3 files changed, 79 insertions(+), 1 deletion(-)
[PATCH v3 0/2] hw/nvme: support online resize
Posted by Alexander Mikhalitsyn 1 month, 3 weeks ago
From: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>

Dear friends,

This patchset is aimed to support online resize for NVMe emulated
device. My approach is simple - I just implement (BlockDevOps *)->resize_cb()
callback and ensure that AER notification is fired to all controllers using
a namespace that is being resized.

Testing.

I manually validated this with Debian 13 VM (a resized disk was a root disk) and
Windows Server 2022 (a resized disk was a secondary one).

Git tree:
https://gitlab.com/mihalicyn/qemu/-/commits/nvme-resize

Changelog for version 3:
- rebased

Changelog for version 2:
- checkpatch fixes
- rebased
- CI is green (https://gitlab.com/mihalicyn/qemu/-/pipelines/2602102750)

Kind regards,
Alex

Alexander Mikhalitsyn (2):
  hw/nvme: initialize ns->subsys for n->namespace
  hw/nvme: support online resize

 hw/nvme/ctrl.c | 10 ++++++++
 hw/nvme/ns.c   | 68 +++++++++++++++++++++++++++++++++++++++++++++++++-
 hw/nvme/nvme.h |  2 ++
 3 files changed, 79 insertions(+), 1 deletion(-)

-- 
2.47.3
Re: [PATCH v3 0/2] hw/nvme: support online resize
Posted by Klaus Jensen 1 month, 3 weeks ago
On Aug  3 10:30, Alexander Mikhalitsyn wrote:
> From: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>
> 
> Dear friends,
> 
> This patchset is aimed to support online resize for NVMe emulated
> device. My approach is simple - I just implement (BlockDevOps *)->resize_cb()
> callback and ensure that AER notification is fired to all controllers using
> a namespace that is being resized.
> 
> Testing.
> 
> I manually validated this with Debian 13 VM (a resized disk was a root disk) and
> Windows Server 2022 (a resized disk was a secondary one).
> 
> Git tree:
> https://gitlab.com/mihalicyn/qemu/-/commits/nvme-resize
> 
> Changelog for version 3:
> - rebased
> 
> Changelog for version 2:
> - checkpatch fixes
> - rebased
> - CI is green (https://gitlab.com/mihalicyn/qemu/-/pipelines/2602102750)
> 
> Kind regards,
> Alex
> 
> Alexander Mikhalitsyn (2):
>   hw/nvme: initialize ns->subsys for n->namespace
>   hw/nvme: support online resize
> 
>  hw/nvme/ctrl.c | 10 ++++++++
>  hw/nvme/ns.c   | 68 +++++++++++++++++++++++++++++++++++++++++++++++++-
>  hw/nvme/nvme.h |  2 ++
>  3 files changed, 79 insertions(+), 1 deletion(-)
> 
> -- 
> 2.47.3
> 
> 

LGTM.

Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Re: [PATCH v3 0/2] hw/nvme: support online resize
Posted by Alexander Mikhalitsyn 3 weeks, 6 days ago
Am Mo., 3. Aug. 2026 um 15:42 Uhr schrieb Klaus Jensen <its@irrelevant.dk>:
>
> On Aug  3 10:30, Alexander Mikhalitsyn wrote:
> > From: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>
> >
> > Dear friends,
> >
> > This patchset is aimed to support online resize for NVMe emulated
> > device. My approach is simple - I just implement (BlockDevOps *)->resize_cb()
> > callback and ensure that AER notification is fired to all controllers using
> > a namespace that is being resized.
> >
> > Testing.
> >
> > I manually validated this with Debian 13 VM (a resized disk was a root disk) and
> > Windows Server 2022 (a resized disk was a secondary one).
> >
> > Git tree:
> > https://gitlab.com/mihalicyn/qemu/-/commits/nvme-resize
> >
> > Changelog for version 3:
> > - rebased
> >
> > Changelog for version 2:
> > - checkpatch fixes
> > - rebased
> > - CI is green (https://gitlab.com/mihalicyn/qemu/-/pipelines/2602102750)
> >
> > Kind regards,
> > Alex
> >
> > Alexander Mikhalitsyn (2):
> >   hw/nvme: initialize ns->subsys for n->namespace
> >   hw/nvme: support online resize
> >
> >  hw/nvme/ctrl.c | 10 ++++++++
> >  hw/nvme/ns.c   | 68 +++++++++++++++++++++++++++++++++++++++++++++++++-
> >  hw/nvme/nvme.h |  2 ++
> >  3 files changed, 79 insertions(+), 1 deletion(-)
> >
> > --
> > 2.47.3
> >
> >

Hi Klaus,

>
> LGTM.
>
> Reviewed-by: Klaus Jensen <k.jensen@samsung.com>

Thank you, I wonder if you have a plan to take this into nvme.next soon?

Kind regards,
Alex
Re: [PATCH v3 0/2] hw/nvme: support online resize
Posted by Klaus Jensen 2 weeks, 6 days ago
On Aug 31 09:04, Alexander Mikhalitsyn wrote:
> Am Mo., 3. Aug. 2026 um 15:42 Uhr schrieb Klaus Jensen <its@irrelevant.dk>:
> >
> > On Aug  3 10:30, Alexander Mikhalitsyn wrote:
> > > From: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>
> > >
> > > Dear friends,
> > >
> > > This patchset is aimed to support online resize for NVMe emulated
> > > device. My approach is simple - I just implement (BlockDevOps *)->resize_cb()
> > > callback and ensure that AER notification is fired to all controllers using
> > > a namespace that is being resized.
> > >
> > > Testing.
> > >
> > > I manually validated this with Debian 13 VM (a resized disk was a root disk) and
> > > Windows Server 2022 (a resized disk was a secondary one).
> > >
> > > Git tree:
> > > https://gitlab.com/mihalicyn/qemu/-/commits/nvme-resize
> > >
> > > Changelog for version 3:
> > > - rebased
> > >
> > > Changelog for version 2:
> > > - checkpatch fixes
> > > - rebased
> > > - CI is green (https://gitlab.com/mihalicyn/qemu/-/pipelines/2602102750)
> > >
> > > Kind regards,
> > > Alex
> > >
> > > Alexander Mikhalitsyn (2):
> > >   hw/nvme: initialize ns->subsys for n->namespace
> > >   hw/nvme: support online resize
> > >
> > >  hw/nvme/ctrl.c | 10 ++++++++
> > >  hw/nvme/ns.c   | 68 +++++++++++++++++++++++++++++++++++++++++++++++++-
> > >  hw/nvme/nvme.h |  2 ++
> > >  3 files changed, 79 insertions(+), 1 deletion(-)
> > >
> > > --
> > > 2.47.3
> > >
> > >
> 
> Hi Klaus,
> 
> >
> > LGTM.
> >
> > Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
> 
> Thank you, I wonder if you have a plan to take this into nvme.next soon?
> 
> Kind regards,
> Alex
> 

Hi Alex,

Applied to nvme.next. Thanks!

I dropped the assert on ctrls (always true).


Thanks,
Klaus
Re: [PATCH v3 0/2] hw/nvme: support online resize
Posted by Alexander Mikhalitsyn 2 weeks, 6 days ago
Am Mo., 7. Sept. 2026 um 09:39 Uhr schrieb Klaus Jensen <its@irrelevant.dk>:
>
> On Aug 31 09:04, Alexander Mikhalitsyn wrote:
> > Am Mo., 3. Aug. 2026 um 15:42 Uhr schrieb Klaus Jensen <its@irrelevant.dk>:
> > >
> > > On Aug  3 10:30, Alexander Mikhalitsyn wrote:
> > > > From: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>
> > > >
> > > > Dear friends,
> > > >
> > > > This patchset is aimed to support online resize for NVMe emulated
> > > > device. My approach is simple - I just implement (BlockDevOps *)->resize_cb()
> > > > callback and ensure that AER notification is fired to all controllers using
> > > > a namespace that is being resized.
> > > >
> > > > Testing.
> > > >
> > > > I manually validated this with Debian 13 VM (a resized disk was a root disk) and
> > > > Windows Server 2022 (a resized disk was a secondary one).
> > > >
> > > > Git tree:
> > > > https://gitlab.com/mihalicyn/qemu/-/commits/nvme-resize
> > > >
> > > > Changelog for version 3:
> > > > - rebased
> > > >
> > > > Changelog for version 2:
> > > > - checkpatch fixes
> > > > - rebased
> > > > - CI is green (https://gitlab.com/mihalicyn/qemu/-/pipelines/2602102750)
> > > >
> > > > Kind regards,
> > > > Alex
> > > >
> > > > Alexander Mikhalitsyn (2):
> > > >   hw/nvme: initialize ns->subsys for n->namespace
> > > >   hw/nvme: support online resize
> > > >
> > > >  hw/nvme/ctrl.c | 10 ++++++++
> > > >  hw/nvme/ns.c   | 68 +++++++++++++++++++++++++++++++++++++++++++++++++-
> > > >  hw/nvme/nvme.h |  2 ++
> > > >  3 files changed, 79 insertions(+), 1 deletion(-)
> > > >
> > > > --
> > > > 2.47.3
> > > >
> > > >
> >
> > Hi Klaus,
> >
> > >
> > > LGTM.
> > >
> > > Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
> >
> > Thank you, I wonder if you have a plan to take this into nvme.next soon?
> >
> > Kind regards,
> > Alex
> >
>
> Hi Alex,

Hi Klaus,

>
> Applied to nvme.next. Thanks!
>
> I dropped the assert on ctrls (always true).

Thank you ;-)

Kind regards,
Alex

>
>
> Thanks,
> Klaus