[PATCH v4 0/6] vhost-user-blk: fix compatibility with older qemu versions

Alexandr Moshkov posted 6 patches 3 weeks, 3 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260702091023.3306378-1-dtalexundeer@yandex-team.ru
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Stefano Garzarella <sgarzare@redhat.com>, "Gonglei (Arei)" <arei.gonglei@huawei.com>, zhenwei pi <zhenwei.pi@linux.dev>, Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>, Raphael Norwitz <rnorwitz@nvidia.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Jason Wang <jasowangio@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>, "Alex Bennée" <alex.bennee@linaro.org>, Stefan Hajnoczi <stefanha@redhat.com>, Milan Zamazal <mzamazal@redhat.com>
backends/cryptodev-vhost.c        |  2 +-
backends/vhost-user.c             |  2 +-
docs/interop/vhost-user.rst       | 38 ++++++++++++++++++---------
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            | 40 +++++++++++++++++++++++-----
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    |  1 -
include/hw/virtio/vhost.h         |  7 +++--
16 files changed, 137 insertions(+), 52 deletions(-)
[PATCH v4 0/6] vhost-user-blk: fix compatibility with older qemu versions
Posted by Alexandr Moshkov 3 weeks, 3 days ago
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 a small continuation of my series about inflight migration for vhost-user-blk.

This series is designed to solve the problem of compatibility with older versions of qemu, where this feature has not yet been introduced (for example, if we want to downgrade versions due to some problems).

In the current version for vhost-user-blk, this feature is enabled using the parameter and further migration of the inflight region will depend on whether the vhost-user has accepted the new protocol feature or not. This creates an inconvenient dependency, because there is no way to disable this feature without reconnecting to the backend.
This series add new protocol message - GET_VRING_BASE_SKIP_DRAIN. 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. This new message can be used only with protocol feature VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIGHT.

Thus, now user can enable or disable inflight-migration param for vhost-user-blk to maintain compatibility with older versions of QEMU by using GET_VRING_BASE_SKIP_DRAIN or GET_VRING_BASE messages.

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       | 38 ++++++++++++++++++---------
 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            | 40 +++++++++++++++++++++++-----
 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    |  1 -
 include/hw/virtio/vhost.h         |  7 +++--
 16 files changed, 137 insertions(+), 52 deletions(-)

-- 
2.34.1
Re: [PATCH v4 0/6] vhost-user-blk: fix compatibility with older qemu versions
Posted by Alexandr Moshkov 1 week, 3 days ago
Ping :)

On 7/2/26 14:10, Alexandr Moshkov wrote:
> 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 a small continuation of my series about inflight migration for vhost-user-blk.
>
> This series is designed to solve the problem of compatibility with older versions of qemu, where this feature has not yet been introduced (for example, if we want to downgrade versions due to some problems).
>
> In the current version for vhost-user-blk, this feature is enabled using the parameter and further migration of the inflight region will depend on whether the vhost-user has accepted the new protocol feature or not. This creates an inconvenient dependency, because there is no way to disable this feature without reconnecting to the backend.
> This series add new protocol message - GET_VRING_BASE_SKIP_DRAIN. 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. This new message can be used only with protocol feature VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIGHT.
>
> Thus, now user can enable or disable inflight-migration param for vhost-user-blk to maintain compatibility with older versions of QEMU by using GET_VRING_BASE_SKIP_DRAIN or GET_VRING_BASE messages.
>
> 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       | 38 ++++++++++++++++++---------
>   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            | 40 +++++++++++++++++++++++-----
>   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    |  1 -
>   include/hw/virtio/vhost.h         |  7 +++--
>   16 files changed, 137 insertions(+), 52 deletions(-)
>
Re: [PATCH v4 0/6] vhost-user-blk: fix compatibility with older qemu versions
Posted by Michael S. Tsirkin 1 day, 4 hours ago
On Thu, Jul 16, 2026 at 12:30:33PM +0500, Alexandr Moshkov wrote:
> Ping :)


I don't know what to do with this one. IIUC in flight migration is in 11.0
so I doubt we can just introduce new messages without a protocol flag.

It says fix compatibility but really it's a feature, right?

And this is somehow related to GET_BASE?

Half the commits here have no or a single line of comment, those that
do, repeat what the commit does instead of explaining why.

That's not how it should be.

Here's a good template to use:

Currently .... This is a problem because ... We can not do .... because
... To address .... And then ....

HTH

-- 
MST