On 30.01.26 14:44, Peter Krempa wrote:
On Fri, Jan 30, 2026 at 00:53:38 +0300, Vladimir Sementsov-Ogievskiy wrote:
They are the same as fds and vhostfds, except they accept only
one fd. Let's deprecate redundant options.
Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
---
Hi all!
after "[PATCH v2 00/12] net: refactoring and fixes" options fd
and vhostfd becomes redundant, fds and vhostfds may be used instead.
this patch also based on
"[PATCH v6] qapi: net: deprecate vhostforce option", that's why
it's sent separately.
Based-on: <[email protected]>
Based-on: <[email protected]>
docs/about/deprecated.rst | 6 ++++++
qapi/net.json | 9 +++++----
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index e8ff478583..9010f8ab07 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -451,6 +451,12 @@ TAP ``vhostforce`` (since 11.0)
The ``vhostforce`` option is redundant with the ``vhost`` option.
If they conflict, ``vhost`` takes precedence. Just use ``vhost``.
+TAP ``fd`` and ``vhostfd`` (since 11.0)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Use ``fds`` and ``vhostfds`` correspondingly, each set with one fd
+instead of ``fd`` and ``vhsotfd``.
Does this replacement apply/work on all versions supporting vhostfds/fd?
I'm asking because libvirt does have code to format the singlular vs
plural but none of the versions we support are lacking support for the
plural forms so we could replace this unconditionally if it works with
older versions.
Unfortunately, before "[PATCH v2 00/12] net: refactoring and fixes",
some things will not work, if use fds/vhostfds instead of fd/vhostfd
for one-queue TAP. Still, probably these cases are not used in Libvirt?
1. Prior the series, tap.c code has check:
/* QEMU hubs do not support multiqueue tap, in this case peer is set.
* For -netdev, peer is always NULL. */
if (peer && (tap->has_queues || tap->fds || tap->vhostfds)) {
error_setg(errp, "Multiqueue tap cannot be used with hubs");
return -1;
}
This is too restrictive: obviously queues may be set to 1, and fds/vhostfds
may contain only one FD, but QEMU doesn't check it.
So, this case require fd/vhostfd options, if you want to pass some fds.
What this "hub" actually is? As I can see, it's -net cmdline option except for
nic:
static int net_client_init1(const Netdev *netdev, bool is_netdev, Error **errp)
{
...
/* Do not add to a hub if it's a nic with a netdev= parameter. */
if (netdev->type != NET_CLIENT_DRIVER_NIC ||
!netdev->u.nic.netdev) {
peer = net_hub_add_port(0, NULL, NULL);
}
...
}
2. Prior the series, you may pass vhostfds only together with fds. If you want
to pass vhostfd for cases without fds, you have to use only vhostfd option.
Even for the case when you pass queues > 0, you can't provide vhostfds but only
vhostfd (and QEMU will try to reuse it for all queues, which (as I understand)
is a bug in current QEMU.
--
Best regards,
Vladimir