All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Alexander Mikhalitsyn <alexander@mihalicyn.com>
Cc: qemu-devel@nongnu.org, "Hanna Reitz" <hreitz@redhat.com>,
	qemu-block@nongnu.org, "Laurent Vivier" <lvivier@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Keith Busch" <kbusch@kernel.org>, "Fam Zheng" <fam@euphon.net>,
	"Stéphane Graber" <stgraber@stgraber.org>,
	"Klaus Jensen" <its@irrelevant.dk>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Fabiano Rosas" <farosas@suse.de>, "Peter Xu" <peterx@redhat.com>,
	"Jesper Devantier" <foss@defmacro.it>,
	"Alexander Mikhalitsyn" <aleksandr.mikhalitsyn@futurfusion.io>
Subject: Re: [PATCH v7 0/8] hw/nvme: add basic live migration support
Date: Mon, 11 May 2026 13:59:44 -0400	[thread overview]
Message-ID: <20260511175944.GC536999@fedora> (raw)
In-Reply-To: <20260511151131.483217-1-alexander@mihalicyn.com>

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

On Mon, May 11, 2026 at 05:11:23PM +0200, Alexander Mikhalitsyn wrote:
> From: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>
> 
> Dear friends,
> 
> This patchset adds basic live migration support for
> QEMU emulated NVMe device.
> 
> Implementation has some limitations:
> - only one NVMe namespace is supported
> - SMART counters are not preserved
> - CMB is not supported
> - PMR is not supported
> - SPDM is not supported
> - SR-IOV is not supported
> 
> I believe this is something I can support in next patchset versions or
> separately on-demand (when usecase appears).
> 
> Testing.
> 
> This patch series was manually tested on:
> - Debian 13.3 VM (kernel 6.12.69+deb13-amd64) using fio on *non-root* NVMe disk
>   (root disk was virtio-scsi):
> 
> time fio --name=nvme-verify \
>     --filename=/dev/nvme0n1 \
>     --size=5G \
>     --rw=randwrite \
>     --bs=4k \
>     --iodepth=16 \
>     --numjobs=1 \
>     --direct=0 \
>     --ioengine=io_uring \
>     --verify=crc32c \
>     --verify_fatal=1
> 
> - Windows Server 2022 VM (NVMe drive was a *root* disk) with opened browser
>   playing video.
> 
> No defects were found.
> 
> Git tree:
> https://github.com/mihalicyn/qemu/commits/nvme-live-migration
> 
> Changelog for version 7:
> - rebased on top of recent main
> - addressed review comments from Stefan Hajnoczi:
>   - better incoming migration stream validation (SQ/CQids correctness)
>   - endianness bugs are fixed in qtest (validated on s390x)
> - added RWB tags from Klaus
> 
> Changelog for version 6:
> - rebased on top of:
>   https://gitlab.com/peterx/qemu/-/tree/vmstate-array-null
>   (see also https://lore.kernel.org/all/20260401202844.673494-1-peterx@redhat.com)
> - addressed review comments from Stefan Hajnoczi:
>   - supported "full CQ" case by serializing NvmeRequest state
>   - added qtest for NVMe device migration with full CQ
> 
> Changelog for version 5:
> - rebased on top of https://lore.kernel.org/all/20260304212303.667141-1-vsementsov@yandex-team.ru/
>   (as Peter has requested)
> 
> Changelog for version 4:
> - vmstate dynamic array support reworked as suggested by Peter Xu
>   VMS_ARRAY_OF_POINTER_ALLOW_NULL flag was introduced
>   qtests were added
> - NVMe migration blockers were reworked as Klaus has requested earlier
>   Now, instead of having "deny list" approach, we have more strict pattern
>   of NVMe features filtering and it should be harded to break migration when
>   adding new NVMe features.
> 
> Changelog for version 3:
> - rebased
> - simple functional test was added (in accordance with Klaus Jensen's review comment)
>   $ meson test 'func-x86_64-nvme_migration' --setup thorough -C build
> 
> Changelog for version 2:
> - full support for AERs (in-flight requests and queued events too)
> 
> Kind regards,
> Alex
> 
> Alexander Mikhalitsyn (8):
>   tests/functional/migration: add VM launch/configure hooks
>   hw/nvme: add migration blockers for non-supported cases
>   hw/nvme: split nvme_init_sq/nvme_init_cq into helpers
>   hw/nvme: set CQE.sq_id earlier in nvme_process_sq
>   hw/nvme: unmap req->sg earlier in nvme_enqueue_req_completion
>   hw/nvme: add basic live migration support
>   tests/functional/x86_64: add migration test for NVMe device
>   tests/qtest/nvme-test: add migration test with full CQ
> 
>  hw/nvme/ctrl.c                                | 1007 ++++++++++++++++-
>  hw/nvme/ns.c                                  |  160 +++
>  hw/nvme/nvme.h                                |   12 +
>  hw/nvme/trace-events                          |   10 +
>  include/block/nvme.h                          |   12 +
>  tests/functional/migration.py                 |   22 +-
>  tests/functional/x86_64/meson.build           |    1 +
>  .../functional/x86_64/test_nvme_migration.py  |  159 +++
>  tests/qtest/nvme-test.c                       |  395 +++++++
>  9 files changed, 1742 insertions(+), 36 deletions(-)
>  create mode 100755 tests/functional/x86_64/test_nvme_migration.py
> 
> -- 
> 2.47.3
> 

Acked-by: Stefan Hajnoczi <stefanha@redhat.com>

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

  parent reply	other threads:[~2026-05-11 18:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11 15:11 [PATCH v7 0/8] hw/nvme: add basic live migration support Alexander Mikhalitsyn
2026-05-11 15:11 ` [PATCH v7 1/8] tests/functional/migration: add VM launch/configure hooks Alexander Mikhalitsyn
2026-05-19 17:21   ` Peter Xu
2026-05-11 15:11 ` [PATCH v7 2/8] hw/nvme: add migration blockers for non-supported cases Alexander Mikhalitsyn
2026-05-18 13:02   ` Klaus Jensen
2026-05-11 15:11 ` [PATCH v7 3/8] hw/nvme: split nvme_init_sq/nvme_init_cq into helpers Alexander Mikhalitsyn
2026-05-11 15:11 ` [PATCH v7 4/8] hw/nvme: set CQE.sq_id earlier in nvme_process_sq Alexander Mikhalitsyn
2026-05-11 15:11 ` [PATCH v7 5/8] hw/nvme: unmap req->sg earlier in nvme_enqueue_req_completion Alexander Mikhalitsyn
2026-05-11 15:11 ` [PATCH v7 6/8] hw/nvme: add basic live migration support Alexander Mikhalitsyn
2026-05-11 15:11 ` [PATCH v7 7/8] tests/functional/x86_64: add migration test for NVMe device Alexander Mikhalitsyn
2026-05-11 15:11 ` [PATCH v7 8/8] tests/qtest/nvme-test: add migration test with full CQ Alexander Mikhalitsyn
2026-05-11 17:59 ` Stefan Hajnoczi [this message]
2026-05-12  8:21   ` [PATCH v7 0/8] hw/nvme: add basic live migration support Alexander Mikhalitsyn

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=20260511175944.GC536999@fedora \
    --to=stefanha@redhat.com \
    --cc=aleksandr.mikhalitsyn@futurfusion.io \
    --cc=alexander@mihalicyn.com \
    --cc=fam@euphon.net \
    --cc=farosas@suse.de \
    --cc=foss@defmacro.it \
    --cc=hreitz@redhat.com \
    --cc=its@irrelevant.dk \
    --cc=kbusch@kernel.org \
    --cc=kwolf@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stgraber@stgraber.org \
    --cc=zhao1.liu@intel.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.