| 1 | .. SPDX-License-Identifier: GPL-2.0-or-later |
| 2 | |
| 3 | ========= |
| 4 | vfio-user |
| 5 | ========= |
| 6 | |
| 7 | QEMU includes a ``vfio-user`` client. The ``vfio-user`` specification allows for |
| 8 | implementing (PCI) devices in userspace outside of QEMU; it is similar to |
| 9 | ``vhost-user`` in this respect (see :doc:`virtio/vhost-user`), but can emulate arbitrary |
| 10 | PCI devices, not just ``virtio``. Whereas ``vfio`` is handled by the host |
| 11 | kernel, ``vfio-user``, while similar in implementation, is handled entirely in |
| 12 | userspace. |
| 13 | |
| 14 | For example, SPDK includes a virtual PCI NVMe controller implementation; by |
| 15 | setting up a ``vfio-user`` UNIX socket between QEMU and SPDK, a VM can send NVMe |
| 16 | I/O to the SPDK process. |
| 17 | |
| 18 | Presuming a suitable ``vfio-user`` server has opened a socket at |
| 19 | ``/tmp/vfio-user.sock``, a device can be configured with for example: |
| 20 | |
| 21 | .. code-block:: console |
| 22 | |
| 23 | --device '{"driver": "vfio-user-pci","socket": {"path": "/tmp/vfio-user.sock", "type": "unix"}}' |
| 24 | |
| 25 | See `libvfio-user <https://github.com/nutanix/libvfio-user/>`_ for further |
| 26 | information. |