From nobody Tue Oct 28 08:17:00 2025 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=1760539256; cv=none; d=zohomail.com; s=zohoarc; b=HqO989hqKOYoELKN9nNJ806tryae6kqctSp7WGQaA2jrL7wAiABgjbWGCpWUc3WxXqKGe8/+YawfmYOIKjVkW44fyHk+AQIsXbQqLQnGyQVFPwfcX414fmSA4iTIyF9qxSiP78ppHmuRyXEKggonAprtw93YriI25kg3WBEJ6HM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1760539256; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZG7MBLKtWr7FDpexxGzgUyfecOn/If9nG1GsuFcJrDs=; b=THEM7UPw7NSWvsZLeY3oJ5WtKkF4eV0rTmvFx76GDOUxsjMO91YpqiJRqhfCSbYb910zArcnsUulh4h998akzlpCpF189I97a8JpVtW9B8eCnNzGBj1IRRqTwZVZHeF7VhCtHzm3G8cQY2NJRPG75Cb573WxRCUYyZqFvnKB3qM= 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 1760539255992620.3487389136895; Wed, 15 Oct 2025 07:40:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1v92fY-00006d-Kj; Wed, 15 Oct 2025 10:40:01 -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 1v92fW-00006O-8h for qemu-devel@nongnu.org; Wed, 15 Oct 2025 10:39:58 -0400 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 1v92fO-00062N-Dz for qemu-devel@nongnu.org; Wed, 15 Oct 2025 10:39:58 -0400 Received: from mail-nwsmtp-smtp-corp-main-34.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-34.sas.yp-c.yandex.net [IPv6:2a02:6b8:c21:2d8b:0:640:7d49:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id 60E8C889C2; Wed, 15 Oct 2025 17:39:44 +0300 (MSK) Received: from vsementsov-lin.. (unknown [2a02:6bf:8080:a94::1:15]) by mail-nwsmtp-smtp-corp-main-34.sas.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id gdRVCn3Foa60-sWVMuTAW; Wed, 15 Oct 2025 17:39:43 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1760539183; bh=ZG7MBLKtWr7FDpexxGzgUyfecOn/If9nG1GsuFcJrDs=; h=Message-ID:Date:Cc:Subject:To:From; b=kbJ1XNbthKNMpBOyoAMVWx7lL5K3WCAIWcMZe6o72tM8/TamogWRZt9DdjWkwSoDc Tx6k732K9vgLWhDBb4es2GkLvDCKeEmpRmjZt5GptKGyQ0SrIn6znfsIpQzrIw/Uv2 /SEgueaJdPBgZybV66O983zZH1xCrmlAsyboLu38= Authentication-Results: mail-nwsmtp-smtp-corp-main-34.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Vladimir Sementsov-Ogievskiy To: jasowang@redhat.com Cc: devel@lists.libvirt.org, eblake@redhat.com, armbru@redhat.com, farosas@suse.de, lvivier@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, vsementsov@yandex-team.ru Subject: [PATCH v4] qapi: net: deprecate vhostforce option Date: Wed, 15 Oct 2025 17:39:41 +0300 Message-ID: <20251015143941.1109499-1-vsementsov@yandex-team.ru> X-Mailer: git-send-email 2.48.1 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=vsementsov@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, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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: 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: 1760539262135154100 Content-Type: text/plain; charset="utf-8" This option for tap and vhost-user netdevs doesn't make sense since long ago (10 years!), starting from commits: 1e7398a140f7a6 ("vhost: enable vhost without without MSI-X") 24f938a682d934 ("vhost user:support vhost user nic for non msi guests") Prior these commits, to enable kernel vhost-net, or vhost-user-net for some specific kind of guests (that don't have MSI-X support), you should have set vhostforce=3Don. Now guest type doesn't matter, all guests are equal for these options logic. For tap the current logic is: vhost=3Don / vhost=3Doff : vhostforce ignored, doesn't make sense vhost unset : vhostforce counts, enabling vhost So you may enable vhost for tap several ways: - vhost=3Don - vhostforce=3Don - vhost=3Don + vhostforce=3Don - and even vhost=3Don + vhostforce=3Doff - they are all equal. For vhost-user we simply ignore the vhostforce option at all in the code. Let's finally deprecate the extra options. Also, fix @vhostforce documentation everywhere to show the real picture, and update vhost-user test to not use deprecated option. Signed-off-by: Vladimir Sementsov-Ogievskiy --- v4: - update documentation - deprecate also similar option for vhost-user net v3 was "[PATCH v3] qapi: net/tap: deprecate vhostforce option": Supersedes: <20250901153943.65235-1-vsementsov@yandex-team.ru> docs/about/deprecated.rst | 11 +++++++++++ qapi/net.json | 20 ++++++++++++++++---- qemu-options.hx | 13 +++++-------- tests/qtest/vhost-user-test.c | 2 +- 4 files changed, 33 insertions(+), 13 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 98361f5832..2882603b20 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -487,6 +487,17 @@ Stream ``reconnect`` (since 9.2) The ``reconnect`` option only allows specifying second granularity timeout= s, which is not enough for all types of use cases, use ``reconnect-ms`` inste= ad. =20 +TAP ``vhostforce`` (since 10.2) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The ``vhostforce`` option is redundant with the ``vhost`` option. +If they conflict, ``vhost`` takes precedence. Just use ``vhost``. + +Vhost-user ``vhostforce`` (since 10.2) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The ``vhostforce`` option is a no-op. Do not use it. + CPU device properties ''''''''''''''''''''' =20 diff --git a/qapi/net.json b/qapi/net.json index 60d196afe5..531b360e46 100644 --- a/qapi/net.json +++ b/qapi/net.json @@ -346,13 +346,20 @@ # @vhostfds: file descriptors of multiple already opened vhost net # devices # -# @vhostforce: vhost on for non-MSIX virtio guests +# @vhostforce: enable vhost-net network accelerator. Ignored when +# @vhost is set. # # @queues: number of queues to be created for multiqueue capable tap # # @poll-us: maximum number of microseconds that could be spent on busy # polling for tap (since 2.7) # +# Features: +# +# @deprecated: Member @vhostforce is deprecated. The @vhostforce +# option is redundant with the @vhost option. If they conflict, +# @vhost takes precedence. Just use @vhost. +# # Since: 1.2 ## { 'struct': 'NetdevTapOptions', @@ -369,7 +376,7 @@ '*vhost': 'bool', '*vhostfd': 'str', '*vhostfds': 'str', - '*vhostforce': 'bool', + '*vhostforce': { 'type': 'bool', 'features': [ 'deprecated' ] }, '*queues': 'uint32', '*poll-us': 'uint32'} } =20 @@ -606,17 +613,22 @@ # # @chardev: name of a unix socket chardev # -# @vhostforce: vhost on for non-MSIX virtio guests (default: false). +# @vhostforce: no-op (default: false). # # @queues: number of queues to be created for multiqueue vhost-user # (default: 1) (Since 2.5) # +# Features: +# +# @deprecated: Member @vhostforce is deprecated. The @vhostforce +# option is ignored in code and does nothing. Don't use it. +# # Since: 2.1 ## { 'struct': 'NetdevVhostUserOptions', 'data': { 'chardev': 'str', - '*vhostforce': 'bool', + '*vhostforce': { 'type': 'bool', 'features': [ 'deprecated' ] }, '*queues': 'int' } } =20 ## diff --git a/qemu-options.hx b/qemu-options.hx index 0223ceffeb..35a70096e8 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2882,7 +2882,7 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, #else "-netdev tap,id=3Dstr[,fd=3Dh][,fds=3Dx:y:...:z][,ifname=3Dname][,scri= pt=3Dfile][,downscript=3Ddfile]\n" " [,br=3Dbridge][,helper=3Dhelper][,sndbuf=3Dnbytes][,vnet_hdr= =3Don|off][,vhost=3Don|off]\n" - " [,vhostfd=3Dh][,vhostfds=3Dx:y:...:z][,vhostforce=3Don|off][= ,queues=3Dn]\n" + " [,vhostfd=3Dh][,vhostfds=3Dx:y:...:z][,queues=3Dn]\n" " [,poll-us=3Dn]\n" " configure a host TAP network backend with ID 'str'\n" " connected to a bridge (default=3D" DEFAULT_BRIDGE_INT= ERFACE ")\n" @@ -2898,9 +2898,7 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, " default is disabled 'sndbuf=3D0' to enable flow contr= ol set 'sndbuf=3D1048576')\n" " use vnet_hdr=3Doff to avoid enabling the IFF_VNET_HDR= tap flag\n" " use vnet_hdr=3Don to make the lack of IFF_VNET_HDR su= pport an error condition\n" - " use vhost=3Don to enable experimental in kernel accel= erator\n" - " (only has effect for virtio guests which use MSIX= )\n" - " use vhostforce=3Don to force vhost on for non-MSIX vi= rtio guests\n" + " use vhost=3Don to enable in kernel accelerator\n" " use 'vhostfd=3Dh' to connect to an already opened vho= st net device\n" " use 'vhostfds=3Dx:y:...:z to connect to multiple alre= ady opened vhost net devices\n" " use 'queues=3Dn' to specify the number of queues to b= e created for multiqueue TAP\n" @@ -2991,7 +2989,7 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, " use 'start-queue=3Dm' to specify the first queue that= should be used\n" #endif #ifdef CONFIG_POSIX - "-netdev vhost-user,id=3Dstr,chardev=3Ddev[,vhostforce=3Don|off]\n" + "-netdev vhost-user,id=3Dstr,chardev=3Ddev\n" " configure a vhost-user network, backed by a chardev '= dev'\n" #endif #ifdef __linux__ @@ -3882,12 +3880,11 @@ SRST for insertion into the socket map. The combination of 'map-path' and 'sock-fds' together is not supported. =20 -``-netdev vhost-user,chardev=3Did[,vhostforce=3Don|off][,queues=3Dn]`` +``-netdev vhost-user,chardev=3Did[,queues=3Dn]`` Establish a vhost-user netdev, backed by a chardev id. The chardev should be a unix domain socket backed one. The vhost-user uses a specifically defined protocol to pass vhost ioctl replacement - messages to an application on the other end of the socket. On - non-MSIX guests, the feature can be forced with vhostforce. Use + messages to an application on the other end of the socket. Use 'queues=3Dn' to specify the number of queues to be created for multiqueue vhost-user. =20 diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c index 609ff24059..a4862d7087 100644 --- a/tests/qtest/vhost-user-test.c +++ b/tests/qtest/vhost-user-test.c @@ -46,7 +46,7 @@ #define QEMU_CMD_SHM " -m %d -object memory-backend-shm,id=3Dmem,size= =3D%dM," \ " -numa node,memdev=3Dmem" #define QEMU_CMD_CHR " -chardev socket,id=3D%s,path=3D%s%s" -#define QEMU_CMD_NETDEV " -netdev vhost-user,id=3Dhs0,chardev=3D%s,vhostfo= rce=3Don" +#define QEMU_CMD_NETDEV " -netdev vhost-user,id=3Dhs0,chardev=3D%s" =20 #define HUGETLBFS_MAGIC 0x958458f6 =20 --=20 2.48.1