On 3/2/26 04:34, Stefan Hajnoczi wrote:
On Tue, Feb 24, 2026 at 12:50:53PM +0500, Alexandr Moshkov wrote:
In case of migration of QEMU from the new version (where the
inllight-migration parameter is present), to the old one (where it is
absent) there is no way to disable this feature on the backend during
runtime.

This commit slightly changes the semantics of the protocol feature
VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIGHT. Enabling this feature
adds a new parameter for GET_VRING_BASE, which allows to control the
drain in-flight requests on the backend.
Thus, QEMU will be able to turn this feature on GET_VRING_BASE off and
on anytime.

Signed-off-by: Alexandr Moshkov<[email protected]>
---
  backends/cryptodev-vhost.c     |  2 +-
  backends/vhost-user.c          |  2 +-
  docs/interop/vhost-user.rst    |  3 ++-
  hw/block/vhost-user-blk.c      |  2 +-
  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-vsock-common.c |  2 +-
  hw/virtio/vhost.c              | 24 +++++++++++++++---------
  include/hw/virtio/vhost.h      |  7 +++++--
  13 files changed, 36 insertions(+), 25 deletions(-)

diff --git a/backends/cryptodev-vhost.c b/backends/cryptodev-vhost.c
index 943680a23a..7a457380d0 100644
--- a/backends/cryptodev-vhost.c
+++ b/backends/cryptodev-vhost.c
@@ -110,7 +110,7 @@ static void
  cryptodev_vhost_stop_one(CryptoDevBackendVhost *crypto,
                                   VirtIODevice *dev)
  {
-    vhost_dev_stop(&crypto->dev, dev, false);
+    vhost_dev_stop(&crypto->dev, dev, false, false);
      vhost_dev_disable_notifiers(&crypto->dev, dev);
  }
diff --git a/backends/vhost-user.c b/backends/vhost-user.c
index 42845329e7..10be713ebd 100644
--- a/backends/vhost-user.c
+++ b/backends/vhost-user.c
@@ -108,7 +108,7 @@ vhost_user_backend_stop(VhostUserBackend *b)
          return 0;
      }
- ret = vhost_dev_stop(&b->dev, b->vdev, true);
+    ret = vhost_dev_stop(&b->dev, b->vdev, true, false);
if (k->set_guest_notifiers &&
          k->set_guest_notifiers(qbus->parent, b->dev.nvqs, false) < 0) {
diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst
index bfa75ff9a3..5b944322b4 100644
--- a/docs/interop/vhost-user.rst
+++ b/docs/interop/vhost-user.rst
@@ -1262,7 +1262,8 @@ Front-end message types
    specified vring before stopping it.
If the ``VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIGHT`` protocol
-  feature has been negotiated, the back-end may suspend in-flight I/O
+  feature has been negotiated, using request payload's *num* field,
+  when num is set to 1, QEMU can tell the back-end to suspend in-flight I/O
This changes the behavior of an existing feature bit. How can the
front-end detect that the back-end supports this new behavior?

Thanks for reply!

The protocol feature VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIGHT was added by me about a month ago, so I decided to fix it instead of adding another one.

It seemed to me to be the more correct solution, because it took a little time for someone to use it and adding a new "feature for a feature" looked too much for me.

Reply via email to