libvirt/libvirt-docs-document-using-passt-backend-with-interface-type-vhostuser.patch
Jiri Denemark 4a97ecd040 libvirt-10.10.0-7.el9
- qemu_migration: Refactor qemuMigrationSrcRestoreDomainState (RHEL-79168)
- qemu_migration: Do not automatically resume domain after I/O error (RHEL-79168)
- qemucapabilitiestest: Add data for the qemu-10.0 dev cycle on x86_64 (RHEL-79095)
- qemucapabilitiestest: Update 'caps_10.0.0_x86_64' to 'v9.2.0-1636-gffaf7f0376' (RHEL-79095)
- qemu: capabilies: Introduce QEMU_CAPS_BLOCKDEV_SET_ACTIVE (RHEL-79095)
- qemu: monitor: Add monitor backend for 'blockdev-set-active' (RHEL-79095)
- qemu: migration: Reactivate block nodes after migration if VM is left paused (RHEL-79095)
- conf: change virDomainHostdevInsert() to return void (RHEL-69455)
- qemu: fix qemu validation to forbid guest-side IP address for type='vdpa' (RHEL-69455)
- qemu: validate that model is virtio for vhostuser and vdpa interfaces in the same place (RHEL-69455)
- qemu: automatically set model type='virtio' for interface type='vhostuser' (RHEL-69455)
- qemu: do all vhostuser attribute validation in qemu driver (RHEL-69455)
- conf/qemu: make <source> element *almost* optional for type=vhostuser (RHEL-69455)
- qemu: use switch instead of if in qemuProcessPrepareDomainNetwork() (RHEL-69455)
- qemu: make qemuPasstCreateSocketPath() public (RHEL-69455)
- qemu: complete vhostuser + passt support (RHEL-69455)
- qemu: fail validation if a domain def has vhostuser/passt but no shared mem (RHEL-69455)
- docs: improve type='user' docs to higlight differences between SLIRP and passt (RHEL-69455)
- docs: document using passt backend with <interface type='vhostuser'> (RHEL-69455)
- utils: Canonicalize paths before comparing them (RHEL-79166)

Resolves: RHEL-69455, RHEL-79095, RHEL-79166, RHEL-79168
2025-02-17 21:30:50 +01:00

140 lines
6.2 KiB
Diff

From 3bcec68251696b1255be7dc2504378b927ef5123 Mon Sep 17 00:00:00 2001
Message-ID: <3bcec68251696b1255be7dc2504378b927ef5123.1739824250.git.jdenemar@redhat.com>
From: Laine Stump <laine@redhat.com>
Date: Fri, 14 Feb 2025 23:35:56 -0500
Subject: [PATCH] docs: document using passt backend with <interface
type='vhostuser'>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Almost everything is already there (in the section for using passt
with type='user'), so we just need to point to that from the
type='vhostuser' section (and vice versa), and add a bit of glue.
Also updated a few related details that have changed (e.g. default
model type for vhostuser is now 'virtio', and source type/mode are now
optional), and changed "vhost-user interface" to "vhost-user
connection" because the interface is a virtio interface, and
vhost-user is being used to connect that interface to the outside.
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 96fd17a99b514e585a94d43d40ab9a74907c7a5b)
https://issues.redhat.com/browse/RHEL-69455
Signed-off-by: Laine Stump <laine@redhat.com>
---
docs/formatdomain.rst | 73 ++++++++++++++++++++++++++++++++++++-------
1 file changed, 62 insertions(+), 11 deletions(-)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index 577366b934..c077c09a39 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -5131,6 +5131,15 @@ destined for the host toward the guest instead), and a socket between
passt and QEMU forwards that traffic on to the guest (and back out,
of course).
+*(:since:`Since 11.1.0 (QEMU and KVM only)` you may prefer to use the
+passt backend with the more efficient and performant type='vhostuser'
+rather than type='user'. All the options related to passt in the
+paragraphs below here also apply when using the passt backend with
+type='vhostuser'; any other details specific to vhostuser are
+described* `here
+<formatdomain.html#vhost-user-connection-with-passt-backend>`__.)
+
+
Similar to SLIRP, passt has an internal DHCP server that provides a
requesting guest with one ipv4 and one ipv6 address. There are default
values for both of these, or you can use the ``<ip>`` element
@@ -5823,7 +5832,7 @@ following attributes are available for the ``virtio`` NIC driver:
The optional ``queues`` attribute controls the number of queues to be used
for either `Multiqueue
virtio-net <https://www.linux-kvm.org/page/Multiqueue>`__ or vhost-user (See
- `vhost-user interface`_) network interfaces. Use of multiple packet
+ `vhost-user connection`_) network interfaces. Use of multiple packet
processing queues requires the interface having the
``<model type='virtio'/>`` element. Each queue will potentially be handled by
a different processor, resulting in much higher throughput.
@@ -6267,8 +6276,8 @@ similarly named elements used to configure the guest side of the interface
(described above).
-vhost-user interface
-^^^^^^^^^^^^^^^^^^^^
+vhost-user connection
+^^^^^^^^^^^^^^^^^^^^^
:since:`Since 1.2.7` the vhost-user enables the communication between a QEMU
virtual machine and other userspace process using the Virtio transport protocol.
@@ -6295,16 +6304,58 @@ plane is based on shared memory.
</devices>
...
-The ``<source>`` element has to be specified along with the type of char device.
-Currently, only type='unix' is supported, where the path (the directory path of
-the socket) and mode attributes are required. Both ``mode='server'`` and
-``mode='client'`` are supported. vhost-user requires the virtio model type, thus
-the ``<model>`` element is mandatory. :since:`Since 4.1.0` the element has an
-optional child element ``reconnect`` which configures reconnect timeout if the
-connection is lost. It has two attributes ``enabled`` (which accepts ``yes`` and
-``no``) and ``timeout`` which specifies the amount of seconds after which
+The ``<source>`` element has to be specified along with the type of
+char device. Currently, only type='unix' is supported, where the path
+(the directory path of the socket) and mode attributes are
+required. Both ``mode='server'`` and ``mode='client'`` are
+supported. (:since:`Since 11.1.0` the default source type for
+vhostuser interfaces is 'unix' and default mode is 'client', so those
+two attributes are now optional).
+
+The vhost-user protocol only works with the virtio guest driver, so
+the ``<model>`` element ``type`` attribute is mandatory (:since:`Since
+11.1.0` the default model type for vhostuser interfaces is now
+'virtio' so ``<model>`` is no longer mandatory). :since:`Since 4.1.0`
+the ``<source>`` element has an optional child element ``reconnect``
+which configures reconnect timeout if the connection is lost. It has
+two attributes ``enabled`` (which accepts ``yes`` and ``no``) and
+``timeout`` which specifies the amount of seconds after which
hypervisor tries to reconnect.
+
+vhost-user connection with passt backend
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+:since:`Since 11.1.0 (QEMU and KVM only)` passt can be used as the
+other end of the vhost-user connection. This is a compelling
+alternative, because passt provides all of its network connectivity
+without requiring any elevated privileges or capabilities, and
+vhost-user uses shared memory to make this unprivileged connection
+very high performance as well. You can set a type='vhostuser'
+interface to use passt as the backend by adding ``<backend
+type='passt'/>``. When passt is the backend, only a single driver
+queue is supported, and the ``<source>`` path/type/mode are all
+implied to be "matching the passt process" so **must not** be
+specified. All of the passt options `described here
+<formatdomain.html#userspace-connection-using-passt>`__, are also
+supported for ``type='vhostuser'`` with the passt backend, e.g.
+setting guest-side IP addresses with ``<ip>`` and port forwarding with
+``<portForward``.
+
+::
+
+ ...
+ <devices>
+ <interface type='vhostuser'>
+ <backend type='passt'/>
+ <mac address='52:54:00:3b:83:1a'/>
+ <source dev='enp1s0'/>
+ <ip address='10.30.0.5 prefix='24'/>
+ </interface>
+ </devices>
+ ...
+
+
Traffic filtering with NWFilter
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--
2.48.1