From nobody Sun Feb 8 15:46:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1594893969; cv=none; d=zohomail.com; s=zohoarc; b=FCJ6D6xV0G1LuVTwwYpJaBTY73ZDR/zhRC434Ruei6ukqve0zLn3iyWWziJuWp9WAHxNBJ0Hvv9FLpMic1sEhkaLj/K52y9KhvxmhIWGVKJHTto6BhZ7aKJfLH9M02RBWom51DeHAbS49Vwn2HtaOywyRud2WByl5UK0kK/+kM8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594893969; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nad2aP73KkMTXJJeEnuPvmBM7KX6Y8FDI7D31mqg85c=; b=nzXWk1tnWUy4t3KFI9I4+ljIjCDTkLN8kVP6taJ+TnSe5YdJ2892rqSz62Qm8LxIPnPK2RSxUl8GezMlUkIUy05KoG7VW5kcnPswhRTyFJCQtin6i1L0fvUcI2fyyR3q4n8mKg0jxVLuHbuD28/w3Q575SwvRs2cZO3ZKP39NgU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1594893969968314.73143702268044; Thu, 16 Jul 2020 03:06:09 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-195-Vf5hKxumOK-7pYNF7361oA-1; Thu, 16 Jul 2020 06:03:17 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 23DDC18A1E0C; Thu, 16 Jul 2020 10:02:51 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F0FC879503; Thu, 16 Jul 2020 10:02:50 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B7866180CB27; Thu, 16 Jul 2020 10:02:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06GA2iei016647 for ; Thu, 16 Jul 2020 06:02:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4BBBD2B6E2; Thu, 16 Jul 2020 10:02:44 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id BAA7C2B6DB for ; Thu, 16 Jul 2020 10:02:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594893968; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=nad2aP73KkMTXJJeEnuPvmBM7KX6Y8FDI7D31mqg85c=; b=JWWANF4EPULKHnCpSUh6g7YmiLDZ8oIxBiFuZc3SibqAQwS7B7n5HwtuZGZPqLFjj3xJ64 NWlkisf1kOIf/U80C7qY4dOdKtip7Wh9+hlkE5uS/72YkESzBK8ilr0/UP7yNVoHfwfvYn S7ZM7l8E2oUhimPx1vCBIozZCKkRJeQ= X-MC-Unique: Vf5hKxumOK-7pYNF7361oA-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 085/351] meson: add libxl driver build option Date: Thu, 16 Jul 2020 11:55:21 +0200 Message-Id: <064359f152ae09bbb52bbc5f844bf17a7516dc25.1594891445.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina --- configure.ac | 5 --- m4/virt-driver-libxl.m4 | 74 ----------------------------------------- meson.build | 52 +++++++++++++++++++++++++++++ meson_options.txt | 1 + 4 files changed, 53 insertions(+), 79 deletions(-) delete mode 100644 m4/virt-driver-libxl.m4 diff --git a/configure.ac b/configure.ac index 84cd16f4d95..4725050080f 100644 --- a/configure.ac +++ b/configure.ac @@ -91,7 +91,6 @@ AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" =3D "yes= "]) if test "$with_libvirtd" =3D "no" ; then with_qemu=3Dno with_lxc=3Dno - with_libxl=3Dno with_vbox=3Dno fi =20 @@ -112,7 +111,6 @@ dnl LIBVIRT_DRIVER_ARG_QEMU LIBVIRT_DRIVER_ARG_OPENVZ LIBVIRT_DRIVER_ARG_VMWARE -LIBVIRT_DRIVER_ARG_LIBXL LIBVIRT_DRIVER_ARG_VBOX LIBVIRT_DRIVER_ARG_LXC LIBVIRT_DRIVER_ARG_VZ @@ -123,7 +121,6 @@ LIBVIRT_DRIVER_ARG_INTERFACE LIBVIRT_DRIVER_CHECK_QEMU LIBVIRT_DRIVER_CHECK_OPENVZ LIBVIRT_DRIVER_CHECK_VMWARE -LIBVIRT_DRIVER_CHECK_LIBXL LIBVIRT_DRIVER_CHECK_VBOX LIBVIRT_DRIVER_CHECK_LXC LIBVIRT_DRIVER_CHECK_VZ @@ -327,7 +324,6 @@ LIBVIRT_DRIVER_RESULT_QEMU LIBVIRT_DRIVER_RESULT_OPENVZ LIBVIRT_DRIVER_RESULT_VMWARE LIBVIRT_DRIVER_RESULT_VBOX -LIBVIRT_DRIVER_RESULT_LIBXL LIBVIRT_DRIVER_RESULT_LXC LIBVIRT_DRIVER_RESULT_VZ LIBVIRT_DRIVER_RESULT_TEST @@ -361,7 +357,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_NSS LIBVIRT_RESULT_PM_UTILS LIBVIRT_RESULT_RBD diff --git a/m4/virt-driver-libxl.m4 b/m4/virt-driver-libxl.m4 deleted file mode 100644 index a958cb26fa6..00000000000 --- a/m4/virt-driver-libxl.m4 +++ /dev/null @@ -1,74 +0,0 @@ -dnl The libxl driver -dnl -dnl Copyright (C) 2016 Red Hat, Inc. -dnl -dnl This library is free software; you can redistribute it and/or -dnl modify it under the terms of the GNU Lesser General Public -dnl License as published by the Free Software Foundation; either -dnl version 2.1 of the License, or (at your option) any later version. -dnl -dnl This library is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl Lesser General Public License for more details. -dnl -dnl You should have received a copy of the GNU Lesser General Public -dnl License along with this library. If not, see -dnl . -dnl - -AC_DEFUN([LIBVIRT_DRIVER_ARG_LIBXL], [ - LIBVIRT_ARG_WITH_FEATURE([LIBXL], [libxenlight], [check]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBXL], [ - LIBXL_LIBS=3D"" - LIBXL_CFLAGS=3D"" - LIBXL_FIRMWARE_DIR=3D"" - LIBXL_EXECBIN_DIR=3D"" - LIBXL_API_VERSION=3D"-DLIBXL_API_VERSION=3D0x040500" - - dnl search for libxl, aka libxenlight - old_with_libxl=3D"$with_libxl" - LIBVIRT_CHECK_PKG([LIBXL], [xenlight], [4.6.0]) - if test "x$with_libxl" =3D "xyes" ; then - LIBXL_FIRMWARE_DIR=3D$($PKG_CONFIG --variable xenfirmwaredir xenlight) - LIBXL_EXECBIN_DIR=3D$($PKG_CONFIG --variable libexec_bin xenlight) - fi - - if test "$with_libxl" =3D "yes"; then - LIBXL_CFLAGS=3D"$LIBXL_CFLAGS $LIBXL_API_VERSION" - - dnl If building with libxl, use the libxl utility header and lib too - AC_CHECK_HEADERS([libxlutil.h]) - LIBXL_LIBS=3D"$LIBXL_LIBS -lxlutil" - if test "x$LIBXL_FIRMWARE_DIR" !=3D "x"; then - AC_DEFINE_UNQUOTED([LIBXL_FIRMWARE_DIR], ["$LIBXL_FIRMWARE_DIR"], [d= irectory containing Xen firmware blobs]) - fi - if test "x$LIBXL_EXECBIN_DIR" !=3D "x"; then - AC_DEFINE_UNQUOTED([LIBXL_EXECBIN_DIR], ["$LIBXL_EXECBIN_DIR"], [dir= ectory containing Xen libexec binaries]) - fi - dnl Check if the xtl_* infrastructure is in libxentoollog - dnl (since Xen 4.7) if not then assume it is in libxenctrl - dnl (as it was for 4.6 and earler) - AC_CHECK_LIB([xentoollog], [xtl_createlogger_stdiostream], [ - LIBXL_LIBS=3D"$LIBXL_LIBS -lxenstore -lxentoollog" - ],[ - LIBXL_LIBS=3D"$LIBXL_LIBS -lxenstore -lxenctrl" - ]) - fi - - dnl Check if Xen has support for PVH - AC_CHECK_DECL(LIBXL_DOMAIN_TYPE_PVH, [AC_DEFINE([HAVE_XEN_PVH], [1], [De= fine to 1 if Xen has PVH support.])], [], [#include ]) - - AC_SUBST([LIBXL_CFLAGS]) - AC_SUBST([LIBXL_LIBS]) -]) - -AC_DEFUN([LIBVIRT_RESULT_LIBXL], [ - LIBVIRT_RESULT_LIB([LIBXL]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_RESULT_LIBXL], [ - LIBVIRT_RESULT([libxl], [$with_libxl]) -]) diff --git a/meson.build b/meson.build index 3c1ccb8f600..813da0ff79e 100644 --- a/meson.build +++ b/meson.build @@ -1599,6 +1599,57 @@ elif get_option('driver_hyperv').enabled() error('openwsman is required for the Hyper-V driver') endif =20 +if not get_option('driver_libxl').disabled() and conf.has('WITH_LIBVIRTD') + libxl_version =3D '4.6.0' + libxl_dep =3D dependency('xenlight', version: '>=3D' + libxl_version, re= quired: get_option('driver_libxl')) + + if libxl_dep.found() + libxl_firmware_dir =3D libxl_dep.get_pkgconfig_variable('xenfirmwaredi= r') + libxl_execbin =3D libxl_dep.get_pkgconfig_variable('libexec_bin') + if libxl_firmware_dir !=3D '' + conf.set_quoted('LIBXL_FIRMWARE_DIR', libxl_firmware_dir) + endif + if libxl_execbin !=3D '' + conf.set_quoted('LIBXL_EXECBIN_DIR', libxl_execbin) + endif + + # If building with libxl, use the libxl utility header and lib too + if cc.has_header('libxlutil.h') + conf.set('HAVE_LIBXLUTIL_H', 1) + endif + xl_util_dep =3D cc.find_library('xlutil') + + xen_store_dep =3D cc.find_library('xenstore') + + # xtl_* infrastructure is in libxentoollog since Xen 4.7 previously + # it was in libxenctrl. + if libxl_dep.version().version_compare('>=3D4.7.0') + xtl_link_dep =3D cc.find_library('xentoollog') + else + xtl_link_dep =3D cc.find_library('xenctrl') + endif + + libxl_dep =3D declare_dependency( + compile_args: '-DLIBXL_API_VERSION=3D0x040500', + dependencies: [ + libxl_dep, + xtl_link_dep, + xl_util_dep, + xen_store_dep, + ], + ) + + # Check if Xen has support for PVH + if cc.has_header_symbol('libxl.h', 'LIBXL_DOMAIN_TYPE_PVH') + conf.set('HAVE_XEN_PVH', 1) + endif + + conf.set('WITH_LIBXL', 1) + endif +elif get_option('driver_libxl').enabled() + error('libvirtd is required for libxenlight') +endif + =20 # define top include directory =20 @@ -1619,6 +1670,7 @@ configure_file(output: 'meson-config.h', configuratio= n: conf) # print configuration summary =20 driver_summary =3D { + 'libxl': conf.has('WITH_LIBXL'), 'ESX': conf.has('WITH_ESX'), 'Hyper-V': conf.has('WITH_HYPERV'), 'Bhyve': conf.has('WITH_BHYVE'), diff --git a/meson_options.txt b/meson_options.txt index c64700fcc4e..5329fd4cd05 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -51,5 +51,6 @@ option('driver_bhyve', type: 'feature', value: 'auto', de= scription: 'BHyVe drive option('driver_esx', type: 'feature', value: 'enabled', description: 'esx = driver') option('driver_hyperv', type: 'feature', value: 'auto', description: 'Hype= r-V driver') option('driver_libvirtd', type: 'feature', value: 'auto', description: 'li= bvirtd driver') +option('driver_libxl', type: 'feature', value: 'auto', description: 'libxe= nlight driver') option('driver_remote', type: 'feature', value: 'enabled', description: 'r= emote driver') option('remote_default_mode', type: 'combo', choices: ['legacy', 'direct']= , value: 'legacy', description: 'remote driver default mode') --=20 2.26.2