From nobody Fri Nov 14 18:23:12 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1763018305; cv=none; d=zohomail.com; s=zohoarc; b=NmXSGFhFNYdyKRaLGugzhoCmqjnQRGeitovBGd94zczji3wcCqQHhAD4kFiGWyPnAqCOh4XF+zp+SG+eTTPi+59rcpbXGmTD+F7RTft/halCUU3OgDv7i1oe63EkRlOYhQbQXKMCgomoJ4oN/EI/zPM63+nxGoMUhQnZGW7qZQ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1763018305; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=SJdZyzMHluf0Ew5sNfzkHEP/IoIgbACiyujPxDva4Ro=; b=mrmThC7SDrE8P7cFI41/d40J4b43ABne/z57YsvgHMEbohm+BC9ARkXfoDA9/9ntFa5S/QFIQsviZi2oikpqH9UdvS0r2tJvIjATsRvejY3yH0s19GXgBVjqUGFm1x62NWswTrvsXq59BLdmk1R3zyzLhR8t2byrzHykLw/sJpU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1763018305004284.9205188612458; Wed, 12 Nov 2025 23:18:25 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 1F3B044180; Thu, 13 Nov 2025 02:18:24 -0500 (EST) Received: from [172.19.199.29] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 649B7448B4; Thu, 13 Nov 2025 02:17:28 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 81F954417A; Thu, 13 Nov 2025 02:17:20 -0500 (EST) Received: from forwardcorp1d.mail.yandex.net (forwardcorp1d.mail.yandex.net [178.154.239.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 8474E44092 for ; Thu, 13 Nov 2025 02:17:18 -0500 (EST) Received: from mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net [IPv6:2a02:6b8:c42:65a0:0:640:e1de:0]) by forwardcorp1d.mail.yandex.net (Yandex) with ESMTPS id B411983383; Thu, 13 Nov 2025 10:17:16 +0300 (MSK) Received: from vsementsov-lin.. (unknown [2a02:6bf:8080:833::1:4]) by mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id DHKuRC0FNKo0-v1ZSn21v; Thu, 13 Nov 2025 10:17:15 +0300 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1763018236; bh=SJdZyzMHluf0Ew5sNfzkHEP/IoIgbACiyujPxDva4Ro=; h=Message-ID:Date:Cc:Subject:To:From; b=X0uOY9+86fwumzFjwQf8hq1pijU0d3kYoRHP3q7eio/73XDOeYN/ZzKbY3owZckH3 dBpLC73LzG09X3AGC1e+GjKECd9zcb/9zjwMkL327IAaHOEhFked9SoLdW4U8DKtpC h0gOm+tcL5jxYetyGhJCEFFghLha9DZX/wM5PDkA= Authentication-Results: mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Vladimir Sementsov-Ogievskiy To: jasowang@redhat.com Subject: [PATCH v6] qapi: net: deprecate vhostforce option Date: Thu, 13 Nov 2025 10:17:11 +0300 Message-ID: <20251113071711.349651-1-vsementsov@yandex-team.ru> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: A67FKZXNLJT2ATO4LBBXQMUDRVORRXHW X-Message-ID-Hash: A67FKZXNLJT2ATO4LBBXQMUDRVORRXHW X-MailFrom: vsementsov@yandex-team.ru X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header 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 X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1763018308541153000 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. While updating command line options, drop "experimental" word from "experimental in kernel accelerator". vhost-net is in production for years. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Markus Armbruster --- v6: - update numbers 10.2 -> 11.0 - add r-b by Markus docs/about/deprecated.rst | 11 +++++++++++ qapi/net.json | 18 ++++++++++++++---- qemu-options.hx | 13 +++++-------- tests/qtest/vhost-user-test.c | 2 +- 4 files changed, 31 insertions(+), 13 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 03e29915f0..3f97392a45 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -498,6 +498,17 @@ Backend ``memory`` (since 9.0) ``memory`` is a deprecated synonym for ``ringbuf``. =20 =20 +TAP ``vhostforce`` (since 11.0) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The ``vhostforce`` option is redundant with the ``vhost`` option. +If they conflict, ``vhost`` takes precedence. Just use ``vhost``. + +Vhost-user ``vhostforce`` (since 11.0) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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 118bd34965..9a00d578e9 100644 --- a/qapi/net.json +++ b/qapi/net.json @@ -348,13 +348,18 @@ # @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. Use @vhost instead. +# # Since: 1.2 ## { 'struct': 'NetdevTapOptions', @@ -371,7 +376,7 @@ '*vhost': 'bool', '*vhostfd': 'str', '*vhostfds': 'str', - '*vhostforce': 'bool', + '*vhostforce': { 'type': 'bool', 'features': [ 'deprecated' ] }, '*queues': 'uint32', '*poll-us': 'uint32'} } =20 @@ -610,17 +615,22 @@ # # @chardev: name of a unix socket chardev # -# @vhostforce: vhost on for non-MSIX virtio guests (default: false). +# @vhostforce: silently ignored, exists just for backward +# compatibility. # # @queues: number of queues to be created for multiqueue vhost-user # (default: 1) (Since 2.5) # +# Features: +# +# @deprecated: Member @vhostforce is deprecated. +# # 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 fca2b7bc74..414b762743 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 d2bb21d5b9..f977f50baf 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