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.
Go to file
Laine Stump 9363c1cb69 xen: explicitly set hostdev driver.name at runtime, not in postparse
Xen only supports a single type of PCI hostdev assignment, so it is
superfluous to have <driver name='xen'/> peppered throughout the
config. It *is* necessary to have the driver type explicitly set in
the hostdev object before calling into the hypervisor-agnostic "hostdev
manager" though (otherwise the hostdev manager doesn't know whether it
should do Xen-specific setup, or VFIO-specific setup).

Historically, the Xen driver has checked for "default" driver name
(i.e. not set in the XML), and set it to "xen', during the XML
postparse, thus guaranteeing that it will be set by the time the
object is sent to the hostdev manager at runtime, but also setting it
so early that a simple round-trip of parse-format results in the XML
always containing an explicit <driver name='xen'/>, even if that
wasn't specified in the original XML.

The QEMU driver *doesn't* set driver.name during postparse though;
instead, it waits until domain startup time (or device attach time for
hotplug), and sets the driver.name then. The result is that a
parse-format round trip of the XML in the QEMU driver *doesn't* add in
the <driver name='vfio'/>.

This patch modifies the Xen driver to behave similarly to the QEMU
driver - the PostParse just checks for a driver.name that isn't
supported by the Xen driver, and any explicit setting to "xen" is
deferred until domain runtime rather than during the postparse, thus
Xen domain XML also doesn't get extraneous <driver name='xen'/>.

This delayed setting of driver.name of course results in slightly
different xml2xml parse-format results, so the unit test data is
modified accordingly.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-01-07 23:59:00 -05:00
.ctags.d
.github/workflows
.gitlab/issue_templates
build-aux syntax-check: Forbid use of qsort() 2023-11-24 09:53:14 +01:00
ci ci: Update Alpine and Fedora and regenerate 2024-01-03 17:24:11 +01:00
docs docs: fix typo in qemu-passthrough-security 2024-01-03 16:05:03 +00:00
examples examples: Fix printf format string in event-test.c 2023-10-20 10:22:34 +02:00
include virDomainBlockResize: Introduce VIR_DOMAIN_BLOCK_RESIZE_CAPACITY 2023-12-14 16:09:05 +01:00
po Translated using Weblate (Georgian) 2024-01-01 12:37:07 +01:00
scripts rpcgen: Skip generator tests on macOS 2023-12-01 13:50:19 +01:00
src xen: explicitly set hostdev driver.name at runtime, not in postparse 2024-01-07 23:59:00 -05:00
subprojects Move src/keycodemapdb -> subprojects/keycodemapdb 2023-04-17 15:02:38 +02:00
tests xen: explicitly set hostdev driver.name at runtime, not in postparse 2024-01-07 23:59:00 -05:00
tools conf: move/rename hostdev PCI driver type enum to device_conf.h 2024-01-07 23:57:09 -05:00
.ctags
.dir-locals.el
.editorconfig
.gitattributes
.gitignore
.gitlab-ci.yml ci: Build RPMs on MinGW 2023-11-23 18:32:03 +01:00
.gitmodules Move src/keycodemapdb -> subprojects/keycodemapdb 2023-04-17 15:02:38 +02:00
.gitpublish gitpublish: Tweak prefix 2023-12-05 11:48:28 +01:00
.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 libvirt.spec: Fix nbdkit selection logic on mingw and old rhel 2024-01-05 11:08:41 +01:00
meson_options.txt qemu: add runtime config option for nbdkit 2024-01-04 14:34:40 -06:00
meson.build qemu: add runtime config option for nbdkit 2024-01-04 14:34:40 -06:00
NEWS.rst NEWS: Fix indentation 2023-12-01 16:58:35 +01:00
README.rst docs: update docs pointing to old mailing list addrs 2023-10-31 10:04:27 +00:00
run.in run: add ability to set selinux context 2023-08-23 14:22:36 -05:00

GitLab CI Build Status

CII Best Practices

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:

Further details on contacting the project are available on the website:

https://libvirt.org/contact.html