mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
Libvirt native C API and daemons
8d5704e2c4
When multiple VFIO or VDPA devices are assigned to a guest, the guest can fail to start because the guest fails to map enough memory. For example, the case mentioned in https://bugzilla.redhat.com/show_bug.cgi?id=2111317 results in this failure: 2021-08-05T09:51:47.692578Z qemu-kvm: failed to write, fd=31, errno=14 (Bad address) 2021-08-05T09:51:47.692590Z qemu-kvm: vhost vdpa map fail! 2021-08-05T09:51:47.692594Z qemu-kvm: vhost-vdpa: DMA mapping failed, unable to continue The current memlock limit calculation does not work for scenarios where there are multiple such devices assigned to a guest. The root causes are a little bit different between VFIO and VDPA devices. For VFIO devices, the issue only occurs when a vIOMMU is present. In this scenario, each vfio device is assigned a separate AddressSpace fully mapping guest RAM. When there is no vIOMMU, the devices are all within the same AddressSpace so no additional memory limit is needed. For VDPA devices, each device requires the full memory to be mapped regardless of whether there is a vIOMMU or not. In order to enable these scenarios, we need to multiply memlock limit by the number of VDPA devices plus the number of VFIO devices for guests with a vIOMMU. This has the potential for pushing the memlock limit above the host physical memory and negating any protection that these locked memory limits are providing, but there is no other short-term solution. In the future, there should be have a revised userspace iommu interface (iommufd) that the VFIO and VDPA backends can make use of. This will be able to share locked memory limits between both vfio and vdpa use cases and address spaces and then we can disable these short term hacks. But this is still in development upstream. Resolves: https://bugzilla.redhat.com/2111317 Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Laine Stump <laine@redhat.com> |
||
---|---|---|
.ctags.d | ||
.github/workflows | ||
.gitlab/issue_templates | ||
build-aux | ||
ci | ||
docs | ||
examples | ||
include | ||
po | ||
scripts | ||
src | ||
tests | ||
tools | ||
.ctags | ||
.dir-locals.el | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.gitlab-ci.yml | ||
.gitmodules | ||
.gitpublish | ||
.mailmap | ||
AUTHORS.rst.in | ||
config.h | ||
configmake.h.in | ||
CONTRIBUTING.rst | ||
COPYING | ||
COPYING.LESSER | ||
gitdm.config | ||
libvirt-admin.pc.in | ||
libvirt-lxc.pc.in | ||
libvirt-qemu.pc.in | ||
libvirt.pc.in | ||
libvirt.spec.in | ||
meson_options.txt | ||
meson.build | ||
NEWS.rst | ||
README.rst | ||
run.in |
.. image:: https://gitlab.com/libvirt/libvirt/badges/master/pipeline.svg :target: https://gitlab.com/libvirt/libvirt/pipelines :alt: GitLab CI Build Status .. image:: https://bestpractices.coreinfrastructure.org/projects/355/badge :target: https://bestpractices.coreinfrastructure.org/projects/355 :alt: CII Best Practices .. image:: https://translate.fedoraproject.org/widgets/libvirt/-/libvirt/svg-badge.svg :target: https://translate.fedoraproject.org/engage/libvirt/ :alt: Translation status ============================== Libvirt API for virtualization ============================== Libvirt provides a portable, long term stable C API for managing the virtualization technologies provided by many operating systems. It includes support for QEMU, KVM, Xen, LXC, bhyve, Virtuozzo, VMware vCenter and ESX, VMware Desktop, Hyper-V, VirtualBox and the POWER Hypervisor. For some of these hypervisors, it provides a stateful management daemon which runs on the virtualization host allowing access to the API both by non-privileged local users and remote users. Layered packages provide bindings of the libvirt C API into other languages including Python, Perl, PHP, Go, Java, OCaml, as well as mappings into object systems such as GObject, CIM and SNMP. Further information about the libvirt project can be found on the website: https://libvirt.org License ======= The libvirt C API is distributed under the terms of GNU Lesser General Public License, version 2.1 (or later). Some parts of the code that are not part of the C library may have the more restrictive GNU General Public License, version 2.0 (or later). See the files ``COPYING.LESSER`` and ``COPYING`` for full license terms & conditions. Installation ============ Instructions on building and installing libvirt can be found on the website: https://libvirt.org/compiling.html Contributing ============ The libvirt project welcomes contributions in many ways. For most components the best way to contribute is to send patches to the primary development mailing list. Further guidance on this can be found on the website: https://libvirt.org/contribute.html Contact ======= The libvirt project has two primary mailing lists: * libvirt-users@redhat.com (**for user discussions**) * libvir-list@redhat.com (**for development only**) Further details on contacting the project are available on the website: https://libvirt.org/contact.html