Development discussions about virtio-fs
 help / color / mirror / Atom feed
* [PATCH v5 0/6] vhost-user-blk: add compatibility with older qemu versions
@ 2026-07-28 10:08 Alexandr Moshkov
  2026-07-28 10:08 ` [PATCH v5 1/6] vhost-user: add skip_drain param to do_vhost_virtqueue_stop Alexandr Moshkov
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Alexandr Moshkov @ 2026-07-28 10:08 UTC (permalink / raw)
  To: qemu-devel
  Cc: Hanna Reitz, Jason Wang, Vladimir Sementsov-Ogievskiy,
	Gonglei (Arei), Jason Wang, Fam Zheng, qemu-block,
	Stefan Hajnoczi, Alex Bennée, yc-core@yandex-team.ru,
	Pierrick Bouvier, Pierrick Bouvier, Michael S. Tsirkin, virtio-fs,
	Kevin Wolf, zhenwei pi, Paolo Bonzini, Stefano Garzarella,
	Milan Zamazal, Raphael Norwitz, Alexandr Moshkov

v4 -> v5:
- introduce protocol feature VHOST_USER_PROTOCOL_F_GET_VRING_BASE_SKIP_DRAIN
  to guard the new message, instead of reusing the existing
  VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INLIFGHT. Update docs.
- improved commit messages.

v3 -> v4:
- add new protocol message GET_VRING_BASE_SKIP_DRAIN instead of parameter to GET_VRING_BASE message. This new message can be send instead of GET_VRING_BASE, allowing back-end to suspend inflight I/O immediately instead of waiting and completing them.
- rebase to newer master

v2 -> v3:
- fix complile problems
- add assert check in do_vhost_virtio_stop
- make inflight-migration property mutable

v1 -> v2:
- reorganize commits: make refactor commits first, then core semantic change
- add additional pre_save check for inflight migration possibility

---

This is v5 of the series previously sent as
"[PATCH v4 0/6] vhost-user-blk: fix inflight migration compatibility".

This series extends the vhost-user-blk inflight migration feature
introduced in QEMU 11.0 to address a runtime compatibility problem.

Currently, the inflight migration behaviour in vhost-user-blk is
controlled by VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIGHT, which is
negotiated once at connection time. Once the feature is negotiated, the
back-end always uses suspend semantics on GET_VRING_BASE — there is no
way for the front-end to request normal drain behaviour on a per-call
basis without reconnecting. This makes it impossible to disable
inflight-migration at runtime, which is needed when, for example,
migrating a VM to an older QEMU version that does not support the
feature.

To solve this, the series introduces a new protocol message
VHOST_USER_GET_VRING_BASE_SKIP_DRAIN (id=45) guarded by a new protocol
feature VHOST_USER_PROTOCOL_F_GET_VRING_BASE_SKIP_DRAIN. The message is
semantically identical to GET_VRING_BASE but explicitly instructs the
back-end to suspend in-flight I/O immediately rather than draining it.
This gives the front-end explicit per-call control: GET_VRING_BASE for
normal operation, GET_VRING_BASE_SKIP_DRAIN during live migration.

In vhost-user-blk, GET_VRING_BASE_SKIP_DRAIN is sent only when
inflight-migration is enabled and the device is stopping due to live
migration (RUN_STATE_FINISH_MIGRATE). The inflight-migration property
is also made mutable so it can be toggled via qom-set at runtime without
reconnecting to the back-end.

Alexandr Moshkov (6):
  vhost-user: add skip_drain param to do_vhost_virtqueue_stop
  vhost-user: add GET_VRING_BASE_SKIP_DRAIN message
  vhost-user: use skip_drain with GET_VRING_BASE_SKIP_DRAIN message
  vhost-user-blk: make inflight-migration prop mutable
  vhost-user-blk: move inflight_needed higher
  vhost-user-blk: use GET_VRING_BASE_SKIP_DRAIN during inflight
    migration

 backends/cryptodev-vhost.c        |  2 +-
 backends/vhost-user.c             |  2 +-
 docs/interop/vhost-user.rst       | 88 +++++++++++++++++++------------
 hw/block/vhost-user-blk.c         | 43 ++++++++++++---
 hw/net/vhost_net.c                |  9 ++--
 hw/scsi/vhost-scsi-common.c       |  2 +-
 hw/virtio/vdpa-dev.c              |  2 +-
 hw/virtio/vhost-user-base.c       |  2 +-
 hw/virtio/vhost-user-fs.c         |  2 +-
 hw/virtio/vhost-user-scmi.c       |  2 +-
 hw/virtio/vhost-user.c            | 47 ++++++++++++++---
 hw/virtio/vhost-vsock-common.c    |  2 +-
 hw/virtio/vhost.c                 | 34 ++++++++----
 include/hw/virtio/vhost-backend.h |  1 +
 include/hw/virtio/vhost-user.h    |  2 +-
 include/hw/virtio/vhost.h         |  7 ++-
 16 files changed, 172 insertions(+), 75 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2026-07-29 18:50 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-28 10:08 [PATCH v5 0/6] vhost-user-blk: add compatibility with older qemu versions Alexandr Moshkov
2026-07-28 10:08 ` [PATCH v5 1/6] vhost-user: add skip_drain param to do_vhost_virtqueue_stop Alexandr Moshkov
2026-07-28 10:08 ` [PATCH v5 2/6] vhost-user: add GET_VRING_BASE_SKIP_DRAIN message Alexandr Moshkov
2026-07-29  9:14   ` Michael S. Tsirkin
2026-07-28 10:08 ` [PATCH v5 3/6] vhost-user: use skip_drain with " Alexandr Moshkov
2026-07-28 10:08 ` [PATCH v5 4/6] vhost-user-blk: make inflight-migration prop mutable Alexandr Moshkov
2026-07-29  9:32   ` Michael S. Tsirkin
     [not found]     ` <679a33d1-0f6c-4456-ac76-1f9e1251f2ec@yandex-team.ru>
2026-07-29 10:14       ` Michael S. Tsirkin
2026-07-29 10:35         ` Alexandr Moshkov
2026-07-29 10:48           ` Michael S. Tsirkin
     [not found]             ` <dd1f5830-75ff-4256-a179-6a8341a3b4ec@yandex-team.ru>
2026-07-29 12:13               ` Michael S. Tsirkin
2026-07-29 14:07                 ` Alexandr Moshkov
2026-07-29 14:48                   ` Michael S. Tsirkin
2026-07-29 15:18                     ` Alexandr Moshkov
2026-07-29 18:50                       ` Michael S. Tsirkin
2026-07-28 10:08 ` [PATCH v5 5/6] vhost-user-blk: move inflight_needed higher Alexandr Moshkov
2026-07-28 10:08 ` [PATCH v5 6/6] vhost-user-blk: use GET_VRING_BASE_SKIP_DRAIN during inflight migration Alexandr Moshkov
2026-07-29  9:14 ` [PATCH v5 0/6] vhost-user-blk: add compatibility with older qemu versions Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox