]> git.ipfire.org Git - thirdparty/libvirt.git/commit
tests: Adjust libxlxml2domconfigtest to work with Xen < 4.10
authorJim Fehlig <jfehlig@suse.com>
Thu, 24 Sep 2020 03:29:42 +0000 (21:29 -0600)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 24 Sep 2020 10:27:07 +0000 (12:27 +0200)
commitfcdc387410fadfb066b95395c5b5d2a6a16f7066
tree0f2e94eaa8f34841a769914c2074bfb01a797940
parent4a927468fb16d391579e24232bc5d7ca97805046
tests: Adjust libxlxml2domconfigtest to work with Xen < 4.10

Commit f253dc90f5 introduced a test regression in environments with
Xen < 4.10. The logic in libxl_conf.c correctly maps ACPI and APIC
from virDomainObj to libxl_domain_conf based on
LIBXL_HAVE_BUILDINFO_APIC, but the tests did not account for the
different libxl_domain_conf JSON representations.

One approach to fixing the test regression is to duplicate JSON test
data files, having one set for Xen <= 4.9 and another for Xen 4.10
and greater. To avoid duplicate data files, this patch takes the
approach of modifying the libxl_domain_conf object based on
LIBXL_HAVE_BUILDINFO_APIC, before retrieving the JSON representation.
It allows using the same test data files for all supported versions
of Xen by adjusting the intermediate form of libxl_domain_conf object
as needed.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/libxlxml2domconfigtest.c