You can configure vfio-user devices in a libvirt domain configuration:
-
Add
xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'to thedomainelement. -
Enable sharing of the guest's RAM:
<memoryBacking>
<source type='file'/>
<access mode='shared'/>
</memoryBacking>- Pass the vfio-user device:
<qemu:commandline>
<qemu:arg value='-device'/>
<qemu:arg value='{"driver":"vfio-user-pci","socket":{"path": "/tmp/vfio-user.sock", "type": "unix"}'/>
</qemu:commandline>