libvfio-user is a C-language framework developed by Nutanix that enables the implementation of PCI devices entirely in userspace. The library provides an API for building servers that communicate with clients such as QEMU over a UNIX socket using the vfio-user protocol. Rather than requiring kernel involvement through the traditional VFIO mechanism, libvfio-user allows device emulation to occur entirely in userspace, eliminating the need for kernel components while maintaining compatibility with the VFIO ioctl interface model.
The core purpose of libvfio-user is to abstract the complexity of device representation by allowing applications to define device characteristics through region and interrupt information, then register callbacks that the library invokes when those regions are accessed. This design enables diverse use cases including prototyping novel devices, testing frameworks, implementing alternatives to QEMU's device emulation, and adapting device classes for network operation. The library handles the protocol-level details, allowing developers to focus on device-specific logic.
The framework supports memory mapping of device regions, enabling virtual machines to directly access parts of virtual devices such as PCI BARs. Applications implement an mmap callback that provides memory addresses whose backing pages satisfy the original mmap request. Interrupt handling is implemented through eventfds passed from the client and registered with the library, allowing consumers to trigger interrupts by writing to the eventfd.
Building libvfio-user requires meson version 0.53.0 or above, along with libjson-c-dev and libcmocka-dev libraries. The kernel headers are necessary because VFIO structures and definitions are reused from the kernel. The project includes documentation for integration with QEMU and libvirt, and SPDK uses libvfio-user to implement a virtual NVMe controller.
According to GitGenius activity tracking, the repository shows a median issue and pull request response latency of 3.4 hours across 32 tracked items, indicating active maintenance. The most frequently addressed issue category is bugs, with 9 tracked instances. Primary contributors include jlevon with 54 tracked events and tmakatos with 19 events. The repository shares contributors with kata-containers, meson, and redis projects, suggesting cross-project collaboration within the virtualization and systems software ecosystem.
The project originated as "muser," a proof-of-concept implementation of VFIO mediated devices in userspace that required a small kernel module for forwarding. The current libvfio-user implementation eliminates this kernel dependency entirely. Development is coordinated through the libvfio-user-devel mailing list and community channels including Slack and IRC, with contributions requiring Developer Certificate of Origin sign-off. The project employs continuous integration checks through GitHub CI and Coverity scanning post-merge.