From nobody Thu Apr 2 06:13:54 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=1774864445; cv=none; d=zohomail.com; s=zohoarc; b=hUrUdS8YQcIHknMZr2yj6SPUaPlxYdk4q2DvVHQQloapDvdeaspR0wG9QgB0E866FBtMSaTMdl2YWrcDtdCsQQNdIqb/NzsefQbf7OXlTvIg2HF645wUwC3lndI5LaaMJ+rwo3kIfwQbk7AD5nz/Hyjo0E933joJsqOs7FpF7wU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774864445; 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=cmwYlbRQeO8i6Sbb89Cm3qYzyWoFQi611UFOyJsDgVI=; b=d6QLfBi6zCA6ttJAIAWQRpTAI/JHFsSUKdNuTJr2TMIZUbPgI82NAdb91bDSOsx8rcu0cwN1ghBaOpSwiEOCgaEt5n5cvZoXwh5zZtAIA+gpkULjGr2DZjXCe8IFSM1NziUu2JGhMFKmxSKzN8PGlGLoPXOTOE/uLJUGl1pgGU8= 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 1774864444209118.28638317695072; Mon, 30 Mar 2026 02:54:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w79In-0005Ol-4r; Mon, 30 Mar 2026 05:52:57 -0400 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 1w79Ib-0005Mm-70; Mon, 30 Mar 2026 05:52:47 -0400 Received: from forwardcorp1a.mail.yandex.net ([2a02:6b8:c0e:500: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 1w79IY-000640-KD; Mon, 30 Mar 2026 05:52:44 -0400 Received: from mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net [IPv6:2a02:6b8:c2d:3530:0:640:eca4:0]) by forwardcorp1a.mail.yandex.net (Yandex) with ESMTPS id A3243C01E5; Mon, 30 Mar 2026 12:52:35 +0300 (MSK) Received: from dtalexundeer-nx.yandex-team.ru (unknown [2a02:6bf:8080:78d::1:13]) by mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id QqVNFG1Af4Y0-XlRxK0sQ; Mon, 30 Mar 2026 12:52:35 +0300 Precedence: bulk X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1774864355; bh=cmwYlbRQeO8i6Sbb89Cm3qYzyWoFQi611UFOyJsDgVI=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=YS9HkHhnegztKtTz0nTwS+9rSCTCeV51yUorWZj6rAvkmHG0dC/O771bPtoYTQNTd iaRneoCMFsgMmNDLwRZY0EZJk4Aqg7JxmJhDW5avvYQVHItxjroNADplU8tZDky6WL sJvNR7OKl6HTZvyBhFLqrcqpfLM3j2PrF9wz1HiI= Authentication-Results: mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Alexandr Moshkov To: qemu-devel@nongnu.org Cc: "Gonglei (Arei)" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Milan Zamazal , Raphael Norwitz , Paolo Bonzini , Jason Wang , qemu-block@nongnu.org, Fam Zheng , zhenwei pi , Hanna Reitz , virtio-fs@lists.linux.dev, Pierrick Bouvier , Stefano Garzarella , "Michael S. Tsirkin" , "yc-core@yandex-team.ru" , Kevin Wolf , Stefan Hajnoczi , Alexandr Moshkov , Vladimir Sementsov-Ogievskiy Subject: [PATCH v3 1/5] vhost-user.rst: fix typo Date: Mon, 30 Mar 2026 14:52:22 +0500 Message-Id: <20260330095226.158386-2-dtalexundeer@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260330095226.158386-1-dtalexundeer@yandex-team.ru> References: <20260330095226.158386-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:c0e:500:1:45:d181:df01; envelope-from=dtalexundeer@yandex-team.ru; helo=forwardcorp1a.mail.yandex.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_DNSWL_LOW=-0.7, 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 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: 1774864448678158500 Content-Type: text/plain; charset="utf-8" Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Stefan Hajnoczi Signed-off-by: Alexandr Moshkov --- 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 Thu Apr 2 06:13:54 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=1774864454; cv=none; d=zohomail.com; s=zohoarc; b=FEAywAsNOFwi+iTHHeTfYOLeAHTsQPadDVhDH55RUg8XelgyTNRqqMZQ0rhViLU9jraQRGkNA2qV8E3tVHe+HpDUQtNy4WFPqbQGAJrRzYZHsGbrVOnMyNd17yQfcS7mfqLw1EaAPCdqB8ZpH1LzGTM5epoxl19KLGchNeQn9Hk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774864454; 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=tvpetmyA7aRUautwgNAeiVLIXNe7ZPT4ooJEso7UfBg=; b=Ea1t8/n6WT1X3bs4WFbJm7m1rGOtV01sXWWgjXw6Em8cJtmKrOO0h4p+NJYolYk+9ciEI3cjbUTxYx9RBTjpxdtJv92rvaZyhtSg4XQ6u66orl2Of0yUGxT4oIM2jqlbluinD1YZKjjJVGB7AeVe+rwYgwZknSvmJ8wD9mlKSa4= 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 1774864454522986.4566599828192; Mon, 30 Mar 2026 02:54:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w79Ix-0005R7-KC; Mon, 30 Mar 2026 05:53:07 -0400 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 1w79Ic-0005N5-Jv; Mon, 30 Mar 2026 05:52:48 -0400 Received: from forwardcorp1a.mail.yandex.net ([2a02:6b8:c0e:500: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 1w79IY-00064A-UF; Mon, 30 Mar 2026 05:52:46 -0400 Received: from mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net [IPv6:2a02:6b8:c2d:3530:0:640:eca4:0]) by forwardcorp1a.mail.yandex.net (Yandex) with ESMTPS id 346B6C01FC; Mon, 30 Mar 2026 12:52:37 +0300 (MSK) Received: from dtalexundeer-nx.yandex-team.ru (unknown [2a02:6bf:8080:78d::1:13]) by mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id QqVNFG1Af4Y0-8tPIkIoj; Mon, 30 Mar 2026 12:52:36 +0300 Precedence: bulk X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1774864356; bh=tvpetmyA7aRUautwgNAeiVLIXNe7ZPT4ooJEso7UfBg=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=Y7StvfMdG2Y6ODvynRtmLOJJ7PI6ce07buwgUWgk8gxCFTlT0iKv59ZpsTAr32DFQ 2/L49NLbuwLuULrj2TAvCl2Tvh3fgZRadSVs++ACmgwjh+Rmew01tDqUrxHLpYgCHs DjjkY9wWZaSRmYddF1IAbhjXpWGtHGfKWLegbY0k= Authentication-Results: mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Alexandr Moshkov To: qemu-devel@nongnu.org Cc: "Gonglei (Arei)" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Milan Zamazal , Raphael Norwitz , Paolo Bonzini , Jason Wang , qemu-block@nongnu.org, Fam Zheng , zhenwei pi , Hanna Reitz , virtio-fs@lists.linux.dev, Pierrick Bouvier , Stefano Garzarella , "Michael S. Tsirkin" , "yc-core@yandex-team.ru" , Kevin Wolf , Stefan Hajnoczi , Alexandr Moshkov Subject: [PATCH v3 2/5] vhost-user-blk: make inflight-migration prop mutable Date: Mon, 30 Mar 2026 14:52:23 +0500 Message-Id: <20260330095226.158386-3-dtalexundeer@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260330095226.158386-1-dtalexundeer@yandex-team.ru> References: <20260330095226.158386-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:c0e:500:1:45:d181:df01; envelope-from=dtalexundeer@yandex-team.ru; helo=forwardcorp1a.mail.yandex.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_DNSWL_LOW=-0.7, 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 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: 1774864455962158500 Content-Type: text/plain; charset="utf-8" Now this property can be turned on or off using the qom-set Signed-off-by: Alexandr Moshkov --- hw/block/vhost-user-blk.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index c151e83677..179f027cb4 100644 --- a/hw/block/vhost-user-blk.c +++ b/hw/block/vhost-user-blk.c @@ -603,6 +603,8 @@ static const VMStateDescription vmstate_vhost_user_blk = =3D { } }; =20 +static PropertyInfo vhost_user_blk_inflight_migration_prop; + static const Property vhost_user_blk_properties[] =3D { DEFINE_PROP_CHR("chardev", VHostUserBlk, chardev), DEFINE_PROP_UINT16("num-queues", VHostUserBlk, num_queues, @@ -616,8 +618,9 @@ static const Property vhost_user_blk_properties[] =3D { VIRTIO_BLK_F_WRITE_ZEROES, true), DEFINE_PROP_BOOL("skip-get-vring-base-on-force-shutdown", VHostUserBlk, skip_get_vring_base_on_force_shutdown, false), - DEFINE_PROP_BOOL("inflight-migration", VHostUserBlk, - inflight_migration, false), + DEFINE_PROP("inflight-migration", VHostUserBlk, inflight_migration, + vhost_user_blk_inflight_migration_prop, bool, + .set_default =3D true, .defval.u =3D false), }; =20 static void vhost_user_blk_class_init(ObjectClass *klass, const void *data) @@ -649,6 +652,9 @@ static const TypeInfo vhost_user_blk_info =3D { =20 static void virtio_register_types(void) { + vhost_user_blk_inflight_migration_prop =3D qdev_prop_bool; + vhost_user_blk_inflight_migration_prop.realized_set_allowed =3D true; + type_register_static(&vhost_user_blk_info); } =20 --=20 2.34.1 From nobody Thu Apr 2 06:13:54 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=1774864452; cv=none; d=zohomail.com; s=zohoarc; b=apjok0xUdZon0VhwQAC0yQIPwNjClTNzbRcKXyyxenZeSl4cEpCZoiVRAsQJBM1I6GhgxcZodkAyGk7a3I8sJeFSTl3nvNvNRBdPQJyw+QJD0F/KQ2HChPXgsYO9mMyZyy+EkmGMwGpbT6A8UVOztuM6PZiwHvMpnq9Gi7maf3E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774864452; 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=vQGG90HeFkAMc6aN0TMc7niUql1S8+VMjbGjzs+duaQ=; b=FkFHsmPxvJgM1b9MVURKhKB0Y+uDxNUfaJ5Uh92Tt6eWxK8o7ndEzr9yI0RNsqXLISFn1nzxdcEaH9IG+z3GZEd4uA/bUoy2JMMHhKCjl1NpskXuvbKQmgtt5JR9tW7y0rzf6OBa7JQFOmJ3TdI0quy6JjOZ/QMeoPYpR0607mY= 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 1774864452575462.27065339705496; Mon, 30 Mar 2026 02:54:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w79Ix-0005R5-EH; Mon, 30 Mar 2026 05:53:07 -0400 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 1w79Ib-0005Mv-Lw; Mon, 30 Mar 2026 05:52:48 -0400 Received: from forwardcorp1a.mail.yandex.net ([178.154.239.72]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w79IY-00064H-KG; Mon, 30 Mar 2026 05:52:45 -0400 Received: from mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net [IPv6:2a02:6b8:c2d:3530:0:640:eca4:0]) by forwardcorp1a.mail.yandex.net (Yandex) with ESMTPS id BBA7DC01FD; Mon, 30 Mar 2026 12:52:38 +0300 (MSK) Received: from dtalexundeer-nx.yandex-team.ru (unknown [2a02:6bf:8080:78d::1:13]) by mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id QqVNFG1Af4Y0-vonzmI8G; Mon, 30 Mar 2026 12:52:38 +0300 Precedence: bulk X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1774864358; bh=vQGG90HeFkAMc6aN0TMc7niUql1S8+VMjbGjzs+duaQ=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=POzGlH0hrvukFhTvbX7ClBGoLdrEnALQ5Cnt8aP+wMnUR1UzL70cnIcFZUfnsdyDJ Y0go2EhHhMkSmGxKzmUzuXgaZS2Z90Fg/sRdm+ubxmk3j1LWLMCxXAdvCQmHCwhSF2 6yP3K0OccafyUJKkxgQSkeuNsGTINIwQp3snm7Ng= Authentication-Results: mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Alexandr Moshkov To: qemu-devel@nongnu.org Cc: "Gonglei (Arei)" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Milan Zamazal , Raphael Norwitz , Paolo Bonzini , Jason Wang , qemu-block@nongnu.org, Fam Zheng , zhenwei pi , Hanna Reitz , virtio-fs@lists.linux.dev, Pierrick Bouvier , Stefano Garzarella , "Michael S. Tsirkin" , "yc-core@yandex-team.ru" , Kevin Wolf , Stefan Hajnoczi , Alexandr Moshkov , Vladimir Sementsov-Ogievskiy Subject: [PATCH v3 3/5] vhost-user: add skip_drain param to do_vhost_virtqueue_stop Date: Mon, 30 Mar 2026 14:52:24 +0500 Message-Id: <20260330095226.158386-4-dtalexundeer@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260330095226.158386-1-dtalexundeer@yandex-team.ru> References: <20260330095226.158386-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.72; envelope-from=dtalexundeer@yandex-team.ru; helo=forwardcorp1a.mail.yandex.net X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.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, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1, RCVD_IN_VALIDITY_RPBL_BLOCKED=1, 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 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: 1774864454782154100 Content-Type: text/plain; charset="utf-8" Will be used in future commit for adding this param to GET_VRING_BASE Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Alexandr Moshkov --- backends/cryptodev-vhost.c | 2 +- backends/vhost-user.c | 2 +- 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 | 28 +++++++++++++++++++--------- include/hw/virtio/vhost.h | 7 +++++-- 12 files changed, 38 insertions(+), 24 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/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index 179f027cb4..718fc94a29 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..ac4d6fca73 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -23,6 +23,7 @@ #include "qemu/log.h" #include "standard-headers/linux/vhost_types.h" #include "hw/virtio/virtio-bus.h" +#include "hw/virtio/vhost-user.h" #include "hw/mem/memory-device.h" #include "migration/blocker.h" #include "migration/qemu-file-types.h" @@ -1387,8 +1388,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) { + if (skip_drain) { + assert(virtio_has_feature(dev->protocol_features, + VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIGHT)); + } 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, @@ -1439,9 +1445,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 +2227,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 +2243,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 +2270,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 +2291,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 Thu Apr 2 06:13:54 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=1774864453; cv=none; d=zohomail.com; s=zohoarc; b=jkFy8ZthwGZuEBfS9linu6RIgk1MdlLK9KtKXQ48fcFzwk/Uy61OBHnHhsvY704hbabyJxioJHWu239Zl3w8Njqhq8kRKU6Twsx3JG7WSOIVg5tYtGZ4GM//vfFkO0K0MB6wtUOhhC8iK91hCwX7oiCIIgGiHev1QniU7mYz3Dc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774864453; 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=cM/Vyd4WfmKyR8Aw4O7A4tlOTXfmYaFOA9HmSDbiY40=; b=KOmKFa7QTKnuWVovDOEmrVIAsoHydVcbrUZDZaH3nDEEme71d5AzfvWLWE49Il4iThI8jCxQGuKY/PnqfI52q2Tge7dvMZCEo+1IZ4wtX4QsenGzmUqUxcpKBU0owNYGt+ZM0Nk1yYRTb6GCsf13DTLloEid1VdCY+/xWwzNSz4= 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 1774864453908847.3651670603359; Mon, 30 Mar 2026 02:54:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w79Ix-0005R6-JW; Mon, 30 Mar 2026 05:53:07 -0400 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 1w79Ic-0005N4-Jz; Mon, 30 Mar 2026 05:52:48 -0400 Received: from forwardcorp1a.mail.yandex.net ([178.154.239.72]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w79IY-00064M-U7; Mon, 30 Mar 2026 05:52:46 -0400 Received: from mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net [IPv6:2a02:6b8:c2d:3530:0:640:eca4:0]) by forwardcorp1a.mail.yandex.net (Yandex) with ESMTPS id 2869AC0200; Mon, 30 Mar 2026 12:52:40 +0300 (MSK) Received: from dtalexundeer-nx.yandex-team.ru (unknown [2a02:6bf:8080:78d::1:13]) by mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id QqVNFG1Af4Y0-NyqoIar9; Mon, 30 Mar 2026 12:52:39 +0300 Precedence: bulk X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1774864359; bh=cM/Vyd4WfmKyR8Aw4O7A4tlOTXfmYaFOA9HmSDbiY40=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=ZKUQHXLHo2yvTB/D1//L80K+DCIDC4YhX3BOIYaiQnYJgdX9Z0ROKUXhgZzxHRv62 61u5kZZh7j43/8yk0VBSpPDmzcleK7YnjoJ24V9xg3u52qH1AEmH4QKFQcTuuqx1Kd Kxnc+vwbz2DR0lHjNE7KJygen5TvUD02xVYRONgQ= Authentication-Results: mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Alexandr Moshkov To: qemu-devel@nongnu.org Cc: "Gonglei (Arei)" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Milan Zamazal , Raphael Norwitz , Paolo Bonzini , Jason Wang , qemu-block@nongnu.org, Fam Zheng , zhenwei pi , Hanna Reitz , virtio-fs@lists.linux.dev, Pierrick Bouvier , Stefano Garzarella , "Michael S. Tsirkin" , "yc-core@yandex-team.ru" , Kevin Wolf , Stefan Hajnoczi , Alexandr Moshkov , Vladimir Sementsov-Ogievskiy Subject: [PATCH v3 4/5] vhost-user-blk: move inflight_needed higher Date: Mon, 30 Mar 2026 14:52:25 +0500 Message-Id: <20260330095226.158386-5-dtalexundeer@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260330095226.158386-1-dtalexundeer@yandex-team.ru> References: <20260330095226.158386-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.72; envelope-from=dtalexundeer@yandex-team.ru; helo=forwardcorp1a.mail.yandex.net X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.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, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1, RCVD_IN_VALIDITY_RPBL_BLOCKED=1, 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 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: 1774864454630154100 Content-Type: text/plain; charset="utf-8" Will be used in future commits for adding skip_drain param Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Alexandr Moshkov --- hw/block/vhost-user-blk.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index 718fc94a29..a3ecd83f54 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; +} + + static int vhost_user_blk_start(VirtIODevice *vdev, Error **errp) { VHostUserBlk *s =3D VHOST_USER_BLK(vdev); @@ -569,16 +580,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 From nobody Thu Apr 2 06:13:54 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=1774864425; cv=none; d=zohomail.com; s=zohoarc; b=FJQ3lkZby0n/QZtx7Q0EQdUYhMhxuFjAcxvPcTiSmfhBuzNacTkcW3AMEwlyFAYKiwBDoBAygBuYZGPZs21bupDhExp4OuNqBHchmEkqyn1JdZLnVOUZdC2cNhM89/zcGqANZ9tjKK/X49XLmck21InnHtaHOfmR68wBkZdhqvY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774864425; 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=Hh5LG4Doo1WyRSeiFJBSkiaSBS0yCBvqInUEe434a44=; b=fRvseiZv4jejDVC+8P7Twh6pzF9TXFRy0pk/jX5prKoZcUkyjxFDaLcrInYyQOSmu4x6vduZ539nM7tDraeh7mjeM/WS9TKVDwB84pAmQgJNOUBc3qj7bHhkJ0whZ4iLcwYu0HXjsAYT+GiPDOI6YotOlPfVN6I1gfJzDowp7RU= 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 1774864425350324.0161974175993; Mon, 30 Mar 2026 02:53:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w79Ip-0005P8-2Z; Mon, 30 Mar 2026 05:52:59 -0400 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 1w79Id-0005N7-3f; Mon, 30 Mar 2026 05:52:48 -0400 Received: from forwardcorp1a.mail.yandex.net ([2a02:6b8:c0e:500: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 1w79IZ-00064W-3x; Mon, 30 Mar 2026 05:52:46 -0400 Received: from mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net [IPv6:2a02:6b8:c2d:3530:0:640:eca4:0]) by forwardcorp1a.mail.yandex.net (Yandex) with ESMTPS id 9989EC0203; Mon, 30 Mar 2026 12:52:41 +0300 (MSK) Received: from dtalexundeer-nx.yandex-team.ru (unknown [2a02:6bf:8080:78d::1:13]) by mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id QqVNFG1Af4Y0-5AOJ86sv; Mon, 30 Mar 2026 12:52:40 +0300 Precedence: bulk X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1774864360; bh=Hh5LG4Doo1WyRSeiFJBSkiaSBS0yCBvqInUEe434a44=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=LRYxjwiMbBzC7+zDw44jqlEVvTVB+c0ttr229s8mU327X7ixmhIVuTrqLEJCWBxNz yy9sUmLKw/Q2lo8DBvyfs5owDPIiq1Ehbm8m/6MWqLYuvhz15/FYnpp1Jrno1mEr+z /Y3jybaki2fs06GZ1lg1SEmWrkIh6RYT+4tRBWdY= Authentication-Results: mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Alexandr Moshkov To: qemu-devel@nongnu.org Cc: "Gonglei (Arei)" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Milan Zamazal , Raphael Norwitz , Paolo Bonzini , Jason Wang , qemu-block@nongnu.org, Fam Zheng , zhenwei pi , Hanna Reitz , virtio-fs@lists.linux.dev, Pierrick Bouvier , Stefano Garzarella , "Michael S. Tsirkin" , "yc-core@yandex-team.ru" , Kevin Wolf , Stefan Hajnoczi , Alexandr Moshkov , Vladimir Sementsov-Ogievskiy Subject: [PATCH v3 5/5] vhost-user: add skip_drain param to GET_VRING_BASE Date: Mon, 30 Mar 2026 14:52:26 +0500 Message-Id: <20260330095226.158386-6-dtalexundeer@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260330095226.158386-1-dtalexundeer@yandex-team.ru> References: <20260330095226.158386-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:c0e:500:1:45:d181:df01; envelope-from=dtalexundeer@yandex-team.ru; helo=forwardcorp1a.mail.yandex.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_DNSWL_LOW=-0.7, 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 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: 1774864428737154100 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. In vhost-user-blk use inflight_migration param to enable skip_drain to suspend in-flight I/O requests, and then migrate them throught inflight subsection. Also now QEMU will always try to setup VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIGHT protocol featrue with backend. This will allow to use skip_drain parameter on GET_VRING_BASE message. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Alexandr Moshkov --- docs/interop/vhost-user.rst | 6 ++---- hw/block/vhost-user-blk.c | 30 ++++++++++++++++++++++++------ hw/virtio/vhost-user.c | 3 +-- hw/virtio/vhost.c | 1 + include/hw/virtio/vhost-user.h | 1 - 5 files changed, 28 insertions(+), 13 deletions(-) diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst index bfa75ff9a3..63efc87264 100644 --- a/docs/interop/vhost-user.rst +++ b/docs/interop/vhost-user.rst @@ -1255,14 +1255,12 @@ Front-end message types *suspended*, see :ref:`Suspended device state `. =20 - The request payload's *num* field is currently reserved and must be - set to 0. - By default, the back-end must complete all inflight I/O requests for the 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 a3ecd83f54..522e9d34b5 100644 --- a/hw/block/vhost-user-blk.c +++ b/hw/block/vhost-user-blk.c @@ -134,10 +134,7 @@ static bool vhost_user_blk_inflight_needed(void *opaqu= e) { struct VHostUserBlk *s =3D opaque; =20 - bool inflight_migration =3D virtio_has_feature(s->dev.protocol_feature= s, - VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIG= HT); - - return inflight_migration; + return s->inflight_migration; } =20 =20 @@ -232,11 +229,14 @@ static int vhost_user_blk_stop(VirtIODevice *vdev) return 0; } =20 + bool skip_drain =3D vhost_user_blk_inflight_needed(s) && + runstate_check(RUN_STATE_FINISH_MIGRATE); + 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); @@ -364,7 +364,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) { @@ -580,10 +579,29 @@ static struct vhost_dev *vhost_user_blk_get_vhost(Vir= tIODevice *vdev) return &s->dev; } =20 +static bool vhost_user_blk_pre_save(void *opaque, Error **errp) +{ + VHostUserBlk *s =3D VHOST_USER_BLK(opaque); + + bool inflight_migration_enabled =3D virtio_has_feature( + s->dev.protocol_features, + VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIGHT); + if (vhost_user_blk_inflight_needed(s) && !inflight_migration_enabled) { + error_setg(errp, "can't migrate vhost-user-blk device: " + "backend doesn't support " + "VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIGHT " + "protocol feature"); + return false; + } + + return true; +} + static const VMStateDescription vmstate_vhost_user_blk_inflight =3D { .name =3D "vhost-user-blk/inflight", .version_id =3D 1, .needed =3D vhost_user_blk_inflight_needed, + .pre_save_errp =3D vhost_user_blk_pre_save, .fields =3D (const VMStateField[]) { VMSTATE_VHOST_INFLIGHT_REGION(inflight, VHostUserBlk), VMSTATE_END_OF_LIST() 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/hw/virtio/vhost.c b/hw/virtio/vhost.c index ac4d6fca73..54e4ce2660 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -1398,6 +1398,7 @@ static int do_vhost_virtqueue_stop(struct vhost_dev *= dev, 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 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