libxl: choose an appropriate default for passthrough...
authorPaul Durrant <paul.durrant@citrix.com>
Tue, 1 Oct 2019 14:57:14 +0000 (15:57 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Wed, 2 Oct 2019 15:55:24 +0000 (16:55 +0100)
commitfa3a19188c3a0ef540e8ca40484aed4f609810c9
tree2ba1d56ac2651c5745bc057a1bc24f712fc4cece
parent4284b4163bb7338d3b75969f85a27d9380c75f38
libxl: choose an appropriate default for passthrough...

...if there is no IOMMU or it is globally disabled.

Without this patch, the following assertion may be hit:

xl: libxl_create.c:589: libxl__domain_make: Assertion `info->passthrough != LIBXL_PASSTHROUGH_UNKNOWN' failed.

This is because libxl__domain_create_info_setdefault() currently only sets
an appropriate value for 'passthrough' in the case that 'cap_hvm_directio'
is true, which is not the case unless an IOMMU is present and enabled in
the system. This is normally masked by xl choosing a default value, but
that will not happen if xl is not used (e.g. when using libvirt) or when
a stub domain is being created.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_create.c