]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
libxl: use API 4.13 to support domUs with more than 4TB
authorOlaf Hering <olaf@aepfle.de>
Thu, 25 Mar 2021 16:26:12 +0000 (17:26 +0100)
committerJim Fehlig <jfehlig@suse.com>
Thu, 1 Apr 2021 20:01:06 +0000 (14:01 -0600)
To support domUs with more than 4TB memory it is required to use
LIBXL_API_VERSION >= 0x040800, which uses uint64_t for certained guest
memory related quantities.

Unfortunately this change is not straight forward. While most of the
code in libxl.h handles the various LIBXL_API_VERSION variants
correctly, the check for valid a LIBXL_API_VERSION at the beginning of
the file was broken between Xen 4.7 and 4.13 - it did not cover for
API changes introduced in Xen 4.7 and 4.8. This was fixed with
xen-project/xen@c3999835df, which for libvirt means in practice either
the libxl API from Xen 4.5 or 4.13+ can be used.

This change uses pkgconfig to decide which API can be safely selected.
Xen provides a pkgconfig file since Xen 4.6, which is also the lowest
version expected by libvirt.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
meson.build

index 3a664f343ad6f375854ddf11e44d23a4f3e8f73c..b827bd927535a76c6efcd69354925955b004f898 100644 (file)
@@ -1592,8 +1592,13 @@ if not get_option('driver_libxl').disabled() and conf.has('WITH_LIBVIRTD')
       xtl_link_dep = cc.find_library('xenctrl')
     endif
 
+    if libxl_dep.version().version_compare('>=4.13.0')
+      LIBXL_API_VERSION='0x041300'
+    else
+      LIBXL_API_VERSION='0x040500'
+    endif
     libxl_dep = declare_dependency(
-      compile_args: '-DLIBXL_API_VERSION=0x040500',
+      compile_args: '-DLIBXL_API_VERSION=' + LIBXL_API_VERSION,
       dependencies: [
         libxl_dep,
         xtl_link_dep,