]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: move virt type / os type / arch validation to post-parse
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 26 Nov 2019 16:09:33 +0000 (16:09 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Mon, 9 Dec 2019 10:15:16 +0000 (10:15 +0000)
commit2578d74aee9bd647b1dbd43a9cca001c9adc7f4f
tree5208f725df55a5e90d1f67c0ade2ada6c96615ba
parent6430c00552298b2d52d5cb4e1f254cbdc595ddcd
conf: move virt type / os type / arch validation to post-parse

The XML parser currently calls virCapabilitiesDomainDataLookup during
parsing to find the domain capabilities matching the triple

  (virt type, os type, arch)

This is, however, bogus with the QEMU driver as it assumes that there
is an emulator known to the default driver capabilities that matches
this triple. It is entirely possible for the driver to be parsing an
XML file with a custom emulator path specified pointing to a binary
that doesn't exist in the default driver capabilities.  This will,
for example be the case on a RHEL host which only installs the host
native emulator to /usr/bin. The user can have built a custom QEMU
for non-native arches into $HOME and wish to use that.

Aside from validation, this call is also used to fill in a machine type
for the guest if not otherwise specified. Again, this data may be
incorrect for the QEMU driver because it is not taking account of
the emulator binary that is referenced.

To start fixing this, move the validation to the post-parse callbacks
where more intelligent driver specific logic can be applied.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
13 files changed:
src/bhyve/bhyve_domain.c
src/conf/capabilities.c
src/conf/capabilities.h
src/conf/domain_conf.c
src/libvirt_private.syms
src/libxl/libxl_domain.c
src/lxc/lxc_domain.c
src/openvz/openvz_conf.c
src/phyp/phyp_driver.c
src/qemu/qemu_domain.c
src/vmware/vmware_driver.c
src/vmx/vmx.c
src/vz/vz_driver.c