From nobody Fri Apr 17 03:02:58 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1771919550; cv=none; d=zohomail.com; s=zohoarc; b=g7YMl1Dp63a2oIubkA6/4l9gvntviyMVxSqymA3sQRBmy+oIJbYmwf/HWfkmZ3cU0Mm+v4EbpokO3hU/TaA3Leq4v5Gl+IHfe3r6BI+eXIAkB+BhgUWDCk+J/PwLVOtjArnlopASgZXS1y/gULRGpOrt1JL73lgy0Y293YJNYvg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771919550; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eyqrprl6+xFGXQOmGuqrFJPUo2zVTAn+JMzLZkciUPY=; b=KwTus8QqVQ6x9x+xofpmtz1UZ1vjoNPuetZts6SQF09aEgK5fWLGusPLP06qZrlvl+ertFLHQ/QO/YHz7z36VrBHxq2Qb9sGuBKzdAf8StVwRTtjXjBv113kiIuR5qJI3A61jjyq0gCiUtqJtnB+oIzNcETuVtik/iebOjRNSTg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771919550455269.7364699229871; Mon, 23 Feb 2026 23:52:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vunCi-00040Z-M8; Tue, 24 Feb 2026 02:51:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vunCR-0003wj-Kv; Tue, 24 Feb 2026 02:51:21 -0500 Received: from forwardcorp1d.mail.yandex.net ([2a02:6b8:c41:1300:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vunCM-0006VV-RN; Tue, 24 Feb 2026 02:51:19 -0500 Received: from mail-nwsmtp-smtp-corp-main-80.iva.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-80.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:1e1e:0:640:c6a6:0]) by forwardcorp1d.mail.yandex.net (Yandex) with ESMTPS id E875A807FC; Tue, 24 Feb 2026 10:51:07 +0300 (MSK) Received: from dtalexundeer-nx.yandex-team.ru (unknown [2a02:6bf:8080:515::1:1d]) by mail-nwsmtp-smtp-corp-main-80.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id uoat9O6Am8c0-36JePDYd; Tue, 24 Feb 2026 10:51:07 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1771919467; bh=eyqrprl6+xFGXQOmGuqrFJPUo2zVTAn+JMzLZkciUPY=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=wh9D4PqZ16g7WPLO60Nkf8CUpfSD4UVzn7RAMBieQbTqwzeMa9RAwXgxlRliY1cHG CkkwJPckK5/5wsHyLFk0WjVWggl06cGFMjnHItW7NX69gofsJbFBF/zFEOgUYXlUTq viCe6C/28K2A/ZfNJsQSrxSjC3Kp+OkHVL/QX8Sk= Authentication-Results: mail-nwsmtp-smtp-corp-main-80.iva.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Alexandr Moshkov To: qemu-devel@nongnu.org Cc: Raphael Norwitz , virtio-fs@lists.linux.dev, Milan Zamazal , Stefan Hajnoczi , "Michael S. Tsirkin" , Jason Wang , zhenwei pi , "Gonglei (Arei)" , Pierrick Bouvier , Kevin Wolf , Hanna Reitz , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini , Stefano Garzarella , Fam Zheng , qemu-block@nongnu.org, Alexandr Moshkov Subject: [PATCH 1/4] vhost-user.rst: fix typo Date: Tue, 24 Feb 2026 12:50:52 +0500 Message-Id: <20260224075055.863068-2-dtalexundeer@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260224075055.863068-1-dtalexundeer@yandex-team.ru> References: <20260224075055.863068-1-dtalexundeer@yandex-team.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a02:6b8:c41:1300:1:45:d181:df01; envelope-from=dtalexundeer@yandex-team.ru; helo=forwardcorp1d.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1771919552851158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Alexandr Moshkov Reviewed-by: Stefan Hajnoczi --- docs/interop/vhost-user.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst index 137c9f3669..bfa75ff9a3 100644 --- a/docs/interop/vhost-user.rst +++ b/docs/interop/vhost-user.rst @@ -1268,7 +1268,7 @@ Front-end message types How to suspend an in-flight request depends on the implementation of the= back-end but it typically can be done by aborting or cancelling the underlying I/O request. The ``VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIGHT`` - protocol feature must only be neogotiated if + protocol feature must only be negotiated if ``VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD`` is also negotiated. =20 ``VHOST_USER_SET_VRING_KICK`` --=20 2.34.1 From nobody Fri Apr 17 03:02:58 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1771919551; cv=none; d=zohomail.com; s=zohoarc; b=F/JWSHi7yzGE/RXiRBiDoPTAI8zetQApgr08C12QCE++sO1ngU6iaIbuQ4UUpoAOslVano4LQRnqgslst3o5J9Pcrsk+qjypy+vrNzUrgDT2fwDmHRYMOCLkQP//M3Qk34Oks+lOcIEyojJyPAd7r5dhFpHj+oizJcb43SQzIZg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771919551; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2ZzQIAHg6yIDTPFmmDgHNA7F3Cjq6OORu0INsTAaSJc=; b=b7Oh847ORYn5TfSUEeLcn/PE3lqZ/bp9DAI6FedrrLAa5CfXb2HX9pt26m0cMa32ewZJAxyZiBgw6O4IcOrJHJWKqw7Sxy4kUb+tlgSZne+NOrSuhq88OZ02lwXJ52yuG+8ZMjxAAKydC8pLGSgxd9Jve4/CIysQ5PBzdUt6pCU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771919551117244.048754619747; Mon, 23 Feb 2026 23:52:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vunCj-00041I-Rn; Tue, 24 Feb 2026 02:51:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vunCU-0003yz-RI; Tue, 24 Feb 2026 02:51:25 -0500 Received: from forwardcorp1d.mail.yandex.net ([178.154.239.200]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vunCM-0006Vg-SE; Tue, 24 Feb 2026 02:51:21 -0500 Received: from mail-nwsmtp-smtp-corp-main-80.iva.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-80.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:1e1e:0:640:c6a6:0]) by forwardcorp1d.mail.yandex.net (Yandex) with ESMTPS id B0E4080829; Tue, 24 Feb 2026 10:51:11 +0300 (MSK) Received: from dtalexundeer-nx.yandex-team.ru (unknown [2a02:6bf:8080:515::1:1d]) by mail-nwsmtp-smtp-corp-main-80.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id uoat9O6Am8c0-btnanbvi; Tue, 24 Feb 2026 10:51:10 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1771919470; bh=2ZzQIAHg6yIDTPFmmDgHNA7F3Cjq6OORu0INsTAaSJc=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=f1iw81THHWHkVkLZxGK/CMrYZj7l3ZF3N/jm2691Gf+NiLtwq5qSBPdD8Las7XCF/ EkZM51tK8uSEsF9WciK+3ybPSeTG5MF89UkchtiaWWRWib/xWX+xS6TUy+4E4A2H4/ YbaISpaIHl5wdjofh609SO9pqK64Xe0Pb1kJxjeE= Authentication-Results: mail-nwsmtp-smtp-corp-main-80.iva.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Alexandr Moshkov To: qemu-devel@nongnu.org Cc: Raphael Norwitz , virtio-fs@lists.linux.dev, Milan Zamazal , Stefan Hajnoczi , "Michael S. Tsirkin" , Jason Wang , zhenwei pi , "Gonglei (Arei)" , Pierrick Bouvier , Kevin Wolf , Hanna Reitz , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini , Stefano Garzarella , Fam Zheng , qemu-block@nongnu.org, Alexandr Moshkov Subject: [PATCH 2/4] vhost-user: add skip_drain param to GET_VRING_BASE Date: Tue, 24 Feb 2026 12:50:53 +0500 Message-Id: <20260224075055.863068-3-dtalexundeer@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260224075055.863068-1-dtalexundeer@yandex-team.ru> References: <20260224075055.863068-1-dtalexundeer@yandex-team.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=178.154.239.200; envelope-from=dtalexundeer@yandex-team.ru; helo=forwardcorp1d.mail.yandex.net X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1.179, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.717, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1771919552781158500 Content-Type: text/plain; charset="utf-8" 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 --- 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); } =20 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; } =20 - ret =3D vhost_dev_stop(&b->dev, b->vdev, true); + ret =3D vhost_dev_stop(&b->dev, b->vdev, true, false); =20 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. =20 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 requests and record them as described in :ref:`Inflight I/O tracking ` instead of completing them before stopping the v= ring. How to suspend an in-flight request depends on the implementation of the= back-end diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index c151e83677..7f2067d6cf 100644 --- a/hw/block/vhost-user-blk.c +++ b/hw/block/vhost-user-blk.c @@ -225,7 +225,7 @@ static int vhost_user_blk_stop(VirtIODevice *vdev) qemu_force_shutdown_requested(); =20 ret =3D force_stop ? vhost_dev_force_stop(&s->dev, vdev, true) : - vhost_dev_stop(&s->dev, vdev, true); + vhost_dev_stop(&s->dev, vdev, true, false); =20 if (k->set_guest_notifiers(qbus->parent, s->dev.nvqs, false) < 0) { error_report("vhost guest notifier cleanup failed: %d", ret); diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index a8ee18a912..604f19e03a 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -384,7 +384,7 @@ fail: if (net->nc->info->poll) { net->nc->info->poll(net->nc, true); } - vhost_dev_stop(&net->dev, dev, false); + vhost_dev_stop(&net->dev, dev, false, false); fail_start: return r; } @@ -403,7 +403,7 @@ static void vhost_net_stop_one(struct vhost_net *net, if (net->nc->info->poll) { net->nc->info->poll(net->nc, true); } - vhost_dev_stop(&net->dev, dev, false); + vhost_dev_stop(&net->dev, dev, false, false); if (net->nc->info->stop) { net->nc->info->stop(net->nc); } @@ -641,7 +641,8 @@ void vhost_net_virtqueue_reset(VirtIODevice *vdev, NetC= lientState *nc, vhost_virtqueue_stop(&net->dev, vdev, net->dev.vqs + idx, - net->dev.vq_index + idx); + net->dev.vq_index + idx, + false); } =20 int vhost_net_virtqueue_restart(VirtIODevice *vdev, NetClientState *nc, @@ -691,7 +692,7 @@ err_start: assert(ret >=3D 0); } =20 - vhost_dev_stop(&net->dev, vdev, false); + vhost_dev_stop(&net->dev, vdev, false, false); =20 return r; } diff --git a/hw/scsi/vhost-scsi-common.c b/hw/scsi/vhost-scsi-common.c index 0bb4305de6..41c1e45aac 100644 --- a/hw/scsi/vhost-scsi-common.c +++ b/hw/scsi/vhost-scsi-common.c @@ -108,7 +108,7 @@ int vhost_scsi_common_stop(VHostSCSICommon *vsc) VirtioBusClass *k =3D VIRTIO_BUS_GET_CLASS(qbus); int ret =3D 0; =20 - ret =3D vhost_dev_stop(&vsc->dev, vdev, true); + ret =3D vhost_dev_stop(&vsc->dev, vdev, true, false); =20 if (k->set_guest_notifiers) { int r =3D k->set_guest_notifiers(qbus->parent, vsc->dev.nvqs, fals= e); diff --git a/hw/virtio/vdpa-dev.c b/hw/virtio/vdpa-dev.c index 4532d63653..7279f18442 100644 --- a/hw/virtio/vdpa-dev.c +++ b/hw/virtio/vdpa-dev.c @@ -301,7 +301,7 @@ static void vhost_vdpa_device_stop(VirtIODevice *vdev) return; } =20 - vhost_dev_stop(&s->dev, vdev, false); + vhost_dev_stop(&s->dev, vdev, false, false); =20 ret =3D k->set_guest_notifiers(qbus->parent, s->dev.nvqs, false); if (ret < 0) { diff --git a/hw/virtio/vhost-user-base.c b/hw/virtio/vhost-user-base.c index 01ab9ca56b..9d3875a04b 100644 --- a/hw/virtio/vhost-user-base.c +++ b/hw/virtio/vhost-user-base.c @@ -77,7 +77,7 @@ static int vub_stop(VirtIODevice *vdev) return 0; } =20 - ret =3D vhost_dev_stop(&vub->vhost_dev, vdev, true); + ret =3D vhost_dev_stop(&vub->vhost_dev, vdev, true, false); =20 if (k->set_guest_notifiers(qbus->parent, vub->vhost_dev.nvqs, false) <= 0) { error_report("vhost guest notifier cleanup failed: %d", ret); diff --git a/hw/virtio/vhost-user-fs.c b/hw/virtio/vhost-user-fs.c index ad6fcacf06..2f6f6df67f 100644 --- a/hw/virtio/vhost-user-fs.c +++ b/hw/virtio/vhost-user-fs.c @@ -111,7 +111,7 @@ static int vuf_stop(VirtIODevice *vdev) return 0; } =20 - ret =3D vhost_dev_stop(&fs->vhost_dev, vdev, true); + ret =3D vhost_dev_stop(&fs->vhost_dev, vdev, true, false); =20 if (k->set_guest_notifiers(qbus->parent, fs->vhost_dev.nvqs, false) < = 0) { error_report("vhost guest notifier cleanup failed: %d", ret); diff --git a/hw/virtio/vhost-user-scmi.c b/hw/virtio/vhost-user-scmi.c index f9264c4374..dbde342a6e 100644 --- a/hw/virtio/vhost-user-scmi.c +++ b/hw/virtio/vhost-user-scmi.c @@ -101,7 +101,7 @@ static int vu_scmi_stop(VirtIODevice *vdev) return 0; } =20 - ret =3D vhost_dev_stop(vhost_dev, vdev, true); + ret =3D vhost_dev_stop(vhost_dev, vdev, true, false); =20 if (k->set_guest_notifiers(qbus->parent, vhost_dev->nvqs, false) < 0) { error_report("vhost guest notifier cleanup failed: %d", ret); diff --git a/hw/virtio/vhost-vsock-common.c b/hw/virtio/vhost-vsock-common.c index b33def900a..3d086ed825 100644 --- a/hw/virtio/vhost-vsock-common.c +++ b/hw/virtio/vhost-vsock-common.c @@ -106,7 +106,7 @@ int vhost_vsock_common_stop(VirtIODevice *vdev) return 0; } =20 - ret =3D vhost_dev_stop(&vvc->vhost_dev, vdev, true); + ret =3D vhost_dev_stop(&vvc->vhost_dev, vdev, true, false); =20 if (k->set_guest_notifiers(qbus->parent, vvc->vhost_dev.nvqs, false) <= 0) { error_report("vhost guest notifier cleanup failed: %d", ret); diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index b4cdb7762f..c04bb53159 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -1387,11 +1387,13 @@ fail_alloc_desc: static int do_vhost_virtqueue_stop(struct vhost_dev *dev, struct VirtIODevice *vdev, struct vhost_virtqueue *vq, - unsigned idx, bool force) + unsigned idx, bool force, + bool skip_drain) { int vhost_vq_index =3D dev->vhost_ops->vhost_get_vq_index(dev, idx); struct vhost_vring_state state =3D { .index =3D vhost_vq_index, + .num =3D skip_drain, }; int r =3D 0; =20 @@ -1439,9 +1441,10 @@ static int do_vhost_virtqueue_stop(struct vhost_dev = *dev, int vhost_virtqueue_stop(struct vhost_dev *dev, struct VirtIODevice *vdev, struct vhost_virtqueue *vq, - unsigned idx) + unsigned idx, + bool skip_drain) { - return do_vhost_virtqueue_stop(dev, vdev, vq, idx, false); + return do_vhost_virtqueue_stop(dev, vdev, vq, idx, false, skip_drain); } =20 static int vhost_virtqueue_set_busyloop_timeout(struct vhost_dev *dev, @@ -2220,7 +2223,8 @@ fail_vq: vhost_virtqueue_stop(hdev, vdev, hdev->vqs + i, - hdev->vq_index + i); + hdev->vq_index + i, + false); } =20 fail_mem: @@ -2235,7 +2239,7 @@ fail_features: =20 /* Host notifiers must be enabled at this point. */ static int do_vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev, - bool vrings, bool force) + bool vrings, bool force, bool skip_drain) { int i; int rc =3D 0; @@ -2262,7 +2266,8 @@ static int do_vhost_dev_stop(struct vhost_dev *hdev, = VirtIODevice *vdev, vdev, hdev->vqs + i, hdev->vq_index + i, - force); + force, + skip_drain); } if (hdev->vhost_ops->vhost_reset_status) { hdev->vhost_ops->vhost_reset_status(hdev); @@ -2282,15 +2287,16 @@ static int do_vhost_dev_stop(struct vhost_dev *hdev= , VirtIODevice *vdev, return rc; } =20 -int vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev, bool vrings) +int vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev, bool vrings, + bool skip_drain) { - return do_vhost_dev_stop(hdev, vdev, vrings, false); + return do_vhost_dev_stop(hdev, vdev, vrings, false, skip_drain); } =20 int vhost_dev_force_stop(struct vhost_dev *hdev, VirtIODevice *vdev, bool vrings) { - return do_vhost_dev_stop(hdev, vdev, vrings, true); + return do_vhost_dev_stop(hdev, vdev, vrings, true, false); } =20 int vhost_net_set_backend(struct vhost_dev *hdev, diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h index 89817bd848..3881f6784b 100644 --- a/include/hw/virtio/vhost.h +++ b/include/hw/virtio/vhost.h @@ -233,6 +233,7 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevic= e *vdev, bool vrings); * @hdev: common vhost_dev structure * @vdev: the VirtIODevice structure * @vrings: true to have vrings disabled in this call + * @skip_drain: true to notice back-end to skip draining all in-flight req= uests * * Stop the vhost device. After the device is stopped the notifiers * can be disabled (@vhost_dev_disable_notifiers) and the device can @@ -240,7 +241,8 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevic= e *vdev, bool vrings); * * Return: 0 on success, !=3D 0 on error when stopping dev. */ -int vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev, bool vrings= ); +int vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev, bool vrings, + bool skip_drain); =20 /** * vhost_dev_force_stop() - force stop the vhost device @@ -398,7 +400,8 @@ int vhost_device_iotlb_miss(struct vhost_dev *dev, uint= 64_t iova, int write); int vhost_virtqueue_start(struct vhost_dev *dev, struct VirtIODevice *vdev, struct vhost_virtqueue *vq, unsigned idx); int vhost_virtqueue_stop(struct vhost_dev *dev, struct VirtIODevice *vdev, - struct vhost_virtqueue *vq, unsigned idx); + struct vhost_virtqueue *vq, unsigned idx, + bool skip_drain); =20 void vhost_dev_reset_inflight(struct vhost_inflight *inflight); void vhost_dev_free_inflight(struct vhost_inflight *inflight); --=20 2.34.1 From nobody Fri Apr 17 03:02:58 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1771919549; cv=none; d=zohomail.com; s=zohoarc; b=hAYw2MiJnEB2mv9Zxv64KAFS97oRDrWLv+zgq0m4r5heCqnnJ7aJ5EZjlxMYqbRkS3NRFAmS+HLLj1jPkmeA8ioAX+ZWV1yqQ4WidGaNFEH1M6BKAotJ6pA6g3tHDZ+CHJeH33bEvMk/gM3jTGvZ3XjQlABD8FujfC+MlBBg94U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771919549; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7BwEi0N5bhclfTU/Whp0ocf3J6F4S950hO77GBpR7Y8=; b=CqrxzPp7/VkVhTGuvR+CGNA/Pf1m7xTpOJF5LkGdDqBlAOFwyT0PDQxlr7tpxRJCOwArC+8zkKRhqKd/Q0ZfQyKb7+A+gtm6E5SgYT0bpyEdgqOpLneYwMDM89x7/Mzo/nhNN9Hjl+TfHCAYOY3faYVpb+1E3LHvyH/3oy4U4uw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771919549386947.7274729318817; Mon, 23 Feb 2026 23:52:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vunCi-00040o-Vn; Tue, 24 Feb 2026 02:51:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vunCU-0003yy-Qv; Tue, 24 Feb 2026 02:51:25 -0500 Received: from forwardcorp1b.mail.yandex.net ([178.154.239.136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vunCP-0006Vk-Eq; Tue, 24 Feb 2026 02:51:20 -0500 Received: from mail-nwsmtp-smtp-corp-main-80.iva.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-80.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:1e1e:0:640:c6a6:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id EA26D808DB; Tue, 24 Feb 2026 10:51:13 +0300 (MSK) Received: from dtalexundeer-nx.yandex-team.ru (unknown [2a02:6bf:8080:515::1:1d]) by mail-nwsmtp-smtp-corp-main-80.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id uoat9O6Am8c0-79t5wvt0; Tue, 24 Feb 2026 10:51:13 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1771919473; bh=7BwEi0N5bhclfTU/Whp0ocf3J6F4S950hO77GBpR7Y8=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=DG95l+r2JowgIzTQm1X6kCMDqPVI6qiGYEem8D+IIuRqx3GVIfPlZbs7gLmghg8Zs jr+vTRnrPfFEB37n4PbYmr+PbDBKl55f5KnC1GU6Uz2KrV/7AaDR/SJzUPuwJOukNP lvBx7waYf8h+GE/auvKYF0/GDhDnr7Jz8DXd0k30= Authentication-Results: mail-nwsmtp-smtp-corp-main-80.iva.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Alexandr Moshkov To: qemu-devel@nongnu.org Cc: Raphael Norwitz , virtio-fs@lists.linux.dev, Milan Zamazal , Stefan Hajnoczi , "Michael S. Tsirkin" , Jason Wang , zhenwei pi , "Gonglei (Arei)" , Pierrick Bouvier , Kevin Wolf , Hanna Reitz , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini , Stefano Garzarella , Fam Zheng , qemu-block@nongnu.org, Alexandr Moshkov Subject: [PATCH 3/4] vhost-user: remove supports_inflight_migration Date: Tue, 24 Feb 2026 12:50:54 +0500 Message-Id: <20260224075055.863068-4-dtalexundeer@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260224075055.863068-1-dtalexundeer@yandex-team.ru> References: <20260224075055.863068-1-dtalexundeer@yandex-team.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=178.154.239.136; envelope-from=dtalexundeer@yandex-team.ru; helo=forwardcorp1b.mail.yandex.net X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1.179, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.717, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1771919552846158500 Content-Type: text/plain; charset="utf-8" Now QEMU will always try to setup VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFL= IGHT protocol feature with backend. This will allow to use skip_drain parameter on GET_VRING_BASE message. Signed-off-by: Alexandr Moshkov --- hw/block/vhost-user-blk.c | 1 - hw/virtio/vhost-user.c | 3 +-- include/hw/virtio/vhost-user.h | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index 7f2067d6cf..3421145f23 100644 --- a/hw/block/vhost-user-blk.c +++ b/hw/block/vhost-user-blk.c @@ -353,7 +353,6 @@ static int vhost_user_blk_connect(DeviceState *dev, Err= or **errp) vhost_dev_set_config_notifier(&s->dev, &blk_ops); =20 s->vhost_user.supports_config =3D true; - s->vhost_user.supports_inflight_migration =3D s->inflight_migration; ret =3D vhost_dev_init(&s->dev, &s->vhost_user, VHOST_BACKEND_TYPE_USE= R, 0, errp); if (ret < 0) { diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index bb8f8eab77..ed95ec7523 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -2225,8 +2225,7 @@ static int vhost_user_backend_init(struct vhost_dev *= dev, void *opaque, } } =20 - if (!u->user->supports_inflight_migration || - !virtio_has_feature(protocol_features, + if (!virtio_has_feature(protocol_features, VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD)) { protocol_features &=3D ~(1ULL << VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIG= HT); diff --git a/include/hw/virtio/vhost-user.h b/include/hw/virtio/vhost-user.h index 53fe996686..c95bad5ddc 100644 --- a/include/hw/virtio/vhost-user.h +++ b/include/hw/virtio/vhost-user.h @@ -69,7 +69,6 @@ typedef struct VhostUserState { GPtrArray *notifiers; int memory_slots; bool supports_config; - bool supports_inflight_migration; } VhostUserState; =20 /** --=20 2.34.1 From nobody Fri Apr 17 03:02:58 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1771919551; cv=none; d=zohomail.com; s=zohoarc; b=LDiP9MXAgPqs8ddOiaaFJnChmPvZSGiAlODsfV6MLTVS7TZRupE9eaBk2OCPbDe+t6Kg7poGLJBvgs+CSQdwnNrqFzQrvxrUdug6Rtf0BGX/I7O0Jwt/nsUgMkBWtjZl9iqiVS7e2/pcZEN3ieXAsUZ8BCqbyp9mDMBtZXMxwiM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771919551; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=s8Mhu3rvPCe/9cEIkSGWUVgs1v5Ac7g2d4QYfePZHl0=; b=D0nUN9VnLP411g5SrElyzPYkIB8EoeBcKH1ppMfEZke+j4S2jgVPQqDi9JQ61HtFQw8e8j9ZGVb7oHGGmO8QZ86r/0FBu/9amDNxYC5FDoCu8N247wzZFG0xU1pGpSltHhuOwST3n3zB9Ghxix3g0UpKzWQDSszQ3xCRY7rDDvI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771919551066506.76988606594205; Mon, 23 Feb 2026 23:52:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vunCk-00041s-EN; Tue, 24 Feb 2026 02:51:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vunCU-0003yx-QU; Tue, 24 Feb 2026 02:51:25 -0500 Received: from forwardcorp1b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vunCQ-0006Vs-9q; Tue, 24 Feb 2026 02:51:20 -0500 Received: from mail-nwsmtp-smtp-corp-main-80.iva.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-80.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:1e1e:0:640:c6a6:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id D6054808F0; Tue, 24 Feb 2026 10:51:15 +0300 (MSK) Received: from dtalexundeer-nx.yandex-team.ru (unknown [2a02:6bf:8080:515::1:1d]) by mail-nwsmtp-smtp-corp-main-80.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id uoat9O6Am8c0-fCWuIHaQ; Tue, 24 Feb 2026 10:51:15 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1771919475; bh=s8Mhu3rvPCe/9cEIkSGWUVgs1v5Ac7g2d4QYfePZHl0=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=sSvSIg8UZRftLLnu+vBW3EChK0wvh7wAxUqA4VUNLJT/C/V9B4u39YAtGnELlGoT5 RAZiae8j25ReAfcKXtLzC3e8L4L3nMpPM1c1J2mK/tghy7vvtvF+JyLBXdfIFquCpO WDfk9VBAQm6lZbrXY0tnDBqfLNTjsa1Qt/vuFXI0= Authentication-Results: mail-nwsmtp-smtp-corp-main-80.iva.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Alexandr Moshkov To: qemu-devel@nongnu.org Cc: Raphael Norwitz , virtio-fs@lists.linux.dev, Milan Zamazal , Stefan Hajnoczi , "Michael S. Tsirkin" , Jason Wang , zhenwei pi , "Gonglei (Arei)" , Pierrick Bouvier , Kevin Wolf , Hanna Reitz , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini , Stefano Garzarella , Fam Zheng , qemu-block@nongnu.org, Alexandr Moshkov Subject: [PATCH 4/4] vhost-user-blk: make inflight migration throught skip_drain Date: Tue, 24 Feb 2026 12:50:55 +0500 Message-Id: <20260224075055.863068-5-dtalexundeer@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260224075055.863068-1-dtalexundeer@yandex-team.ru> References: <20260224075055.863068-1-dtalexundeer@yandex-team.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a02:6b8:c02:900:1:45:d181:df01; envelope-from=dtalexundeer@yandex-team.ru; helo=forwardcorp1b.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1771919552853158500 Content-Type: text/plain; charset="utf-8" Use skip_drain on GET_VRING_BASE to suspend in-flight I/O requests, and then migrate them throught inflight subsection. Signed-off-by: Alexandr Moshkov --- hw/block/vhost-user-blk.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index 3421145f23..4e606fd0fc 100644 --- a/hw/block/vhost-user-blk.c +++ b/hw/block/vhost-user-blk.c @@ -130,6 +130,17 @@ const VhostDevConfigOps blk_ops =3D { .vhost_dev_config_notifier =3D vhost_user_blk_handle_config_change, }; =20 +static bool vhost_user_blk_inflight_needed(void *opaque) +{ + struct VHostUserBlk *s =3D opaque; + + bool inflight_migration =3D virtio_has_feature(s->dev.protocol_feature= s, + VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIG= HT); + + return inflight_migration && s->inflight_migration; +} + + static int vhost_user_blk_start(VirtIODevice *vdev, Error **errp) { VHostUserBlk *s =3D VHOST_USER_BLK(vdev); @@ -221,11 +232,13 @@ static int vhost_user_blk_stop(VirtIODevice *vdev) return 0; } =20 + bool skip_drain =3D vhost_user_blk_inflight_needed(s); + force_stop =3D s->skip_get_vring_base_on_force_shutdown && qemu_force_shutdown_requested(); =20 ret =3D force_stop ? vhost_dev_force_stop(&s->dev, vdev, true) : - vhost_dev_stop(&s->dev, vdev, true, false); + vhost_dev_stop(&s->dev, vdev, true, skip_drain); =20 if (k->set_guest_notifiers(qbus->parent, s->dev.nvqs, false) < 0) { error_report("vhost guest notifier cleanup failed: %d", ret); @@ -568,16 +581,6 @@ static struct vhost_dev *vhost_user_blk_get_vhost(Virt= IODevice *vdev) return &s->dev; } =20 -static bool vhost_user_blk_inflight_needed(void *opaque) -{ - struct VHostUserBlk *s =3D opaque; - - bool inflight_migration =3D virtio_has_feature(s->dev.protocol_feature= s, - VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIG= HT); - - return inflight_migration; -} - static const VMStateDescription vmstate_vhost_user_blk_inflight =3D { .name =3D "vhost-user-blk/inflight", .version_id =3D 1, --=20 2.34.1