From nobody Sat May 30 17:45:57 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=1779452201; cv=none; d=zohomail.com; s=zohoarc; b=j48D76f7KVT5JvZAtmqi5pdR1MFE+LPid5jlIANdmJVsqGYjAZLm7Qrto4roCj0bk28vHjemck/PdwTy4QFIS1lJhfP/tKpJ5G3sDkoe2gqe9cqXZFs2vr8LxxT3UYtJ81O24PKiUhHiYJqWY9/girqnKgysE8DP8nQgFRdgTDo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1779452201; 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=jf/HDNqj9fvTM10qfGO8U49k1F47Q9tvVNIkSyHOG+c=; b=V7Ew4QDu4BfFrgDzfKOmw3kbpuK8r4GxIBKyQ3UiXy0qRjwDcu4APcIwb9opLW868zvHFWjpTkcyyd1RMec0qAWjxMQTaBwFXEdJuoj5gIOEdS6FoFcRHIXlOyXQ2FXzzcPsRS0KFChJ7VKOh6UAfDsBJGLDBQYw24E0fYFlpW8= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1779452201279648.6331695896924; Fri, 22 May 2026 05:16:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wQOnO-0006tG-OT; Fri, 22 May 2026 08:16:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wQOnJ-0006sl-JH for qemu-devel@nongnu.org; Fri, 22 May 2026 08:16:03 -0400 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 1wQOnG-0001H3-D8 for qemu-devel@nongnu.org; Fri, 22 May 2026 08:16:01 -0400 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 8892080745; Fri, 22 May 2026 15:15:53 +0300 (MSK) Received: from vsementsov-lin (unknown [2a02:6bf:8080:55c::1:1d]) by mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net (smtpcorp) with ESMTPSA id pFTUoH0f44Y0-kzQOzey7; Fri, 22 May 2026 15:15:52 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1779452153; bh=jf/HDNqj9fvTM10qfGO8U49k1F47Q9tvVNIkSyHOG+c=; h=Message-ID:Date:Cc:Subject:To:From; b=r3Q3amea26QDHsHuy4fmWySIx0OhaPaW56LGKSrRRmZGhGkHRJuTJcVDzUxjz3Cek CN+0C7nASNqqTTaLX90VFwd+AbvQi+hVyMDpVzbwL9v6Gy1o8ZzSNybOXuMceXYt/7 kqSRHuLIMAe3JGAPi0kMbTugPJ7ImZAFz7yqXR3E= 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 Cc: qemu-devel@nongnu.org, vsementsov@yandex-team.ru, Markus Armbruster , Pierrick Bouvier , Eric Blake , Fabiano Rosas , Laurent Vivier , Paolo Bonzini , devel@lists.libvirt.org (open list:Incompatible changes) Subject: [PATCH v7] qapi: net: deprecate vhostforce option Date: Fri, 22 May 2026 15:15:49 +0300 Message-ID: <20260522121549.81248-1-vsementsov@yandex-team.ru> X-Mailer: git-send-email 2.52.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=178.154.239.200; envelope-from=vsementsov@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: 1779452205007158500 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 Acked-by: Fabiano Rosas --- 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(-) v7: rebase on master (on top of "[PATCH v16 0/8] virtio-net: live-TAP local= migration") 01: update version 11.0 -> 11.1, keep r-b Based-on: <20260522120534.77653-1-vsementsov@yandex-team.ru> "[PATCH v16 0/8] virtio-net: live-TAP local migration" diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 95bf7613295..2c79cdb4eeb 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -384,6 +384,17 @@ Backend ``memory`` (since 9.0) ``memory`` is a deprecated synonym for ``ringbuf``. =20 =20 +TAP ``vhostforce`` (since 11.1) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The ``vhostforce`` option is redundant with the ``vhost`` option. +If they conflict, ``vhost`` takes precedence. Just use ``vhost``. + +Vhost-user ``vhostforce`` (since 11.1) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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 82ddbb51cd7..70a749a0e64 100644 --- a/qapi/net.json +++ b/qapi/net.json @@ -418,7 +418,8 @@ # @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 # @@ -432,6 +433,10 @@ # @downscript be explicitly set to nothing (empty string or "no") # (Since 11.1) # +# Features: +# +# @deprecated: Member @vhostforce is deprecated. Use @vhost instead. +# # Since: 1.2 ## { 'struct': 'NetdevTapOptions', @@ -448,7 +453,7 @@ '*vhost': 'bool', '*vhostfd': 'str', '*vhostfds': 'str', - '*vhostforce': 'bool', + '*vhostforce': { 'type': 'bool', 'features': [ 'deprecated' ] }, '*queues': 'uint32', '*poll-us': 'uint32', '*incoming-fds': 'bool' } } @@ -688,17 +693,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 96ae41f787b..f5a1ad6c577 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2969,7 +2969,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" @@ -2985,9 +2985,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" @@ -3078,7 +3076,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__ @@ -3978,12 +3976,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 c8b5f8ff714..ebeebde2281 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.52.0