From nobody Sat Feb 7 15:26:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1569582742; cv=none; d=zoho.com; s=zohoarc; b=TPDNNXIWZGUDqW63P1UmbCpXjZLn3M7iE3z9F2hbBMblV0QXIcgQh37OQXjjFY7odb4dYdQ78fU5D+1x7YJqymFSjUs5hCka9XjCuM7/3fGj2+gATdFTyJ6ZfStjcm84qpHolAdHNflrLL1T0VrhKSJV6hW/tI3KuOVXq8/J/zM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569582742; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=lWXjAkczCztiCxm7zl/SIadLqaj12vmzDdWCXTWzL84=; b=l/+udFVx02w21LeT+9WGenWJ/xzbVSPI+Uxjcne9p7gWb30sU+2b9TOPJwzjCmdO6CDrFucR6ejifx+ATfaUaR8nMp/Fve8YkEk+dcIgFZjMDB6uUyzHQ5Bu10dUP4Nm/qU2zDCaI3bBTy/CiZ+5FweDzdLJ8rg1qa5lslskFzw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569582742003887.8196847197661; Fri, 27 Sep 2019 04:12:22 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 34D3789811C; Fri, 27 Sep 2019 11:12:20 +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 06BF26092F; Fri, 27 Sep 2019 11:12:20 +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 B0E08180BA9C; Fri, 27 Sep 2019 11:12:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8RBCGev028276 for ; Fri, 27 Sep 2019 07:12:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 566BF60BF3; Fri, 27 Sep 2019 11:12:16 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (dhcp-94.gsslab.fab.redhat.com [10.33.9.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A14660F9E; Fri, 27 Sep 2019 11:12:13 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 27 Sep 2019 12:11:56 +0100 Message-Id: <20190927111158.20653-10-berrange@redhat.com> In-Reply-To: <20190927111158.20653-1-berrange@redhat.com> References: <20190927111158.20653-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Pavel Hrdina Subject: [libvirt] [PATCH 09/11] build: use meson for building virt-host-validate 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Fri, 27 Sep 2019 11:12:20 +0000 (UTC) Switch over to using meson for building the virt-host-validate tool Signed-off-by: Daniel P. Berrang=C3=A9 --- configure.ac | 3 -- m4/virt-host-validate.m4 | 43 ----------------------------- meson.build | 4 +++ meson_options.txt | 2 ++ src/meson.build | 11 ++++++++ tools/Makefile.am | 52 ----------------------------------- tools/meson.build | 59 ++++++++++++++++++++++++++++++++++++++++ 7 files changed, 76 insertions(+), 98 deletions(-) delete mode 100644 m4/virt-host-validate.m4 diff --git a/configure.ac b/configure.ac index f5c6fabc6d..412ac4b94b 100644 --- a/configure.ac +++ b/configure.ac @@ -512,7 +512,6 @@ LIBVIRT_ARG_CHRDEV_LOCK_FILES LIBVIRT_ARG_DEFAULT_EDITOR LIBVIRT_ARG_LOADER_NVRAM LIBVIRT_ARG_LOGIN_SHELL -LIBVIRT_ARG_HOST_VALIDATE LIBVIRT_ARG_TLS_PRIORITY LIBVIRT_ARG_SYSCTL_CONFIG =20 @@ -525,7 +524,6 @@ LIBVIRT_CHECK_CHRDEV_LOCK_FILES LIBVIRT_CHECK_DEFAULT_EDITOR LIBVIRT_CHECK_LOADER_NVRAM LIBVIRT_CHECK_LOGIN_SHELL -LIBVIRT_CHECK_HOST_VALIDATE LIBVIRT_CHECK_TLS_PRIORITY LIBVIRT_CHECK_SYSCTL_CONFIG LIBVIRT_CHECK_NSS @@ -1063,7 +1061,6 @@ LIBVIRT_RESULT_CHRDEV_LOCK_FILES LIBVIRT_RESULT_DEFAULT_EDITOR LIBVIRT_RESULT_LOADER_NVRAM LIBVIRT_RESULT_LOGIN_SHELL -LIBVIRT_RESULT_HOST_VALIDATE LIBVIRT_RESULT_TLS_PRIORITY AC_MSG_NOTICE([]) AC_MSG_NOTICE([Developer Tools]) diff --git a/m4/virt-host-validate.m4 b/m4/virt-host-validate.m4 deleted file mode 100644 index e43cec5366..0000000000 --- a/m4/virt-host-validate.m4 +++ /dev/null @@ -1,43 +0,0 @@ -dnl Copyright (C) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. -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 . - -AC_DEFUN([LIBVIRT_ARG_HOST_VALIDATE], [ - LIBVIRT_ARG_WITH([HOST_VALIDATE], [build virt-host-validate], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_HOST_VALIDATE], [ - if test "x$with_host_validate" !=3D "xno"; then - if test "x$with_win" =3D "xyes"; then - if test "x$with_host_validate" =3D "xyes"; then - AC_MSG_ERROR([virt-host-validate is not supported on Windows]) - else - with_host_validate=3Dno; - fi - else - with_host_validate=3Dyes; - fi - fi - - if test "x$with_host_validate" =3D "xyes" ; then - AC_DEFINE_UNQUOTED([WITH_HOST_VALIDATE], 1, [whether virt-host-valid= ate is built]) - fi - AM_CONDITIONAL([WITH_HOST_VALIDATE], [test "x$with_host_validate" =3D "x= yes"]) -]) - -AC_DEFUN([LIBVIRT_RESULT_HOST_VALIDATE], [ - LIBVIRT_RESULT([virt-host-validate], [$with_host_validate]) -]) diff --git a/meson.build b/meson.build index 53ee9e331f..4e759d147b 100644 --- a/meson.build +++ b/meson.build @@ -24,6 +24,7 @@ gnulib_inc_dir =3D include_directories('gnulib/lib') top_inc_dir =3D include_directories('.') =20 cc =3D meson.get_compiler('c') +pod2man =3D find_program('pod2man') =20 gnulib =3D cc.find_library('libgnu', dirs: [meson.build_root() / 'gnulib' = / 'lib' / '.libs']) gnulib_dep =3D declare_dependency( @@ -34,7 +35,10 @@ gnulib_dep =3D declare_dependency( meson.add_dist_script('build-aux' / 'dist.py', meson.source_root(), meson.= build_root()) =20 yajl_min_version =3D '>=3D 2.0.3' +libxml_min_version =3D '>=3D 2.9.1' + yajl_dep =3D dependency('yajl', version: yajl_min_version) +libxml_dep =3D dependency('libxml-2.0', version: libxml_min_version) =20 subdir('src') subdir('examples') diff --git a/meson_options.txt b/meson_options.txt index 4667fa6580..92062f5d63 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -21,3 +21,5 @@ option('with-driver-nodedev', type: 'boolean', value: tru= e, description: 'Enable option('with-driver-nwfilter', type: 'boolean', value: true, description: = 'Enable nwfilter driver') option('with-driver-secret', type: 'boolean', value: true, description: 'E= nable secret driver') option('with-driver-storage', type: 'boolean', value: true, description: '= Enable storage driver') + +option('with-tools-host-validate', type: 'boolean', value: true, descripti= on: 'Enable virt-host-validate tool') diff --git a/src/meson.build b/src/meson.build index 71b42baf22..7393a86796 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,4 +1,15 @@ =20 +src_inc_dir =3D include_directories('.') +util_inc_dir =3D include_directories('util') +common_inc_dir =3D [ + gnulib_inc_dir, + public_inc_dir, + top_inc_dir, + src_inc_dir, + util_inc_dir, +] + + libvirt =3D cc.find_library('libvirt', dirs: [meson.build_root() / 'src' /= '.libs']) libvirt_admin =3D cc.find_library('libvirt-admin', dirs: [meson.build_root= () / 'src' / '.libs']) libvirt_qemu =3D cc.find_library('libvirt-qemu', dirs: [meson.build_root()= / 'src' / '.libs']) diff --git a/tools/Makefile.am b/tools/Makefile.am index a294224a99..749eaa12ff 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -53,7 +53,6 @@ ICON_FILES =3D \ =20 PODFILES =3D \ virt-admin.pod \ - virt-host-validate.pod \ virt-login-shell.pod \ virt-pki-validate.pod \ virt-sanlock-cleanup.pod \ @@ -63,7 +62,6 @@ PODFILES =3D \ =20 MANINFILES =3D \ virt-admin.1.in \ - virt-host-validate.1.in \ virt-login-shell.1.in \ virt-pki-validate.1.in \ virt-sanlock-cleanup.8.in \ @@ -116,11 +114,6 @@ libexec_PROGRAMS =3D virt-login-shell-helper man1_MANS +=3D virt-login-shell.1 endif WITH_LOGIN_SHELL =20 -if WITH_HOST_VALIDATE -bin_PROGRAMS +=3D virt-host-validate -man1_MANS +=3D virt-host-validate.1 -endif WITH_HOST_VALIDATE - virt-xml-validate: virt-xml-validate.in Makefile $(AM_V_GEN)sed -e 's|[@]schemadir@|$(pkgdatadir)/schemas|g' \ -e 's|[@]VERSION@|$(VERSION)|g' \ @@ -156,51 +149,6 @@ libvirt_shell_la_SOURCES =3D \ vsh.c vsh.h \ vsh-table.c vsh-table.h =20 -virt_host_validate_SOURCES =3D \ - virt-host-validate.c \ - virt-host-validate-common.c virt-host-validate-common.h - -VIRT_HOST_VALIDATE_QEMU =3D \ - virt-host-validate-qemu.c \ - virt-host-validate-qemu.h -VIRT_HOST_VALIDATE_LXC =3D \ - virt-host-validate-lxc.c \ - virt-host-validate-lxc.h -VIRT_HOST_VALIDATE_BHYVE =3D \ - virt-host-validate-bhyve.c \ - virt-host-validate-bhyve.h -if WITH_QEMU -virt_host_validate_SOURCES +=3D $(VIRT_HOST_VALIDATE_QEMU) -else ! WITH_QEMU -EXTRA_DIST +=3D $(VIRT_HOST_VALIDATE_QEMU) -endif ! WITH_QEMU - -if WITH_LXC -virt_host_validate_SOURCES +=3D $(VIRT_HOST_VALIDATE_LXC) -else ! WITH_LXC -EXTRA_DIST +=3D $(VIRT_HOST_VALIDATE_LXC) -endif ! WITH_LXC - -if WITH_BHYVE -virt_host_validate_SOURCES +=3D $(VIRT_HOST_VALIDATE_BHYVE) -else ! WITH_BHYVE -EXTRA_DIST +=3D $(VIRT_HOST_VALIDATE_BHYVE) -endif ! WITH_BHYVE - -virt_host_validate_LDFLAGS =3D \ - $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ - $(NULL) - -virt_host_validate_LDADD =3D \ - ../src/libvirt.la \ - ../gnulib/lib/libgnu.la \ - $(NULL) - -virt_host_validate_CFLAGS =3D \ - $(AM_CFLAGS) \ - $(NULL) =20 # virt-login-shell will be setuid, and must not link to anything # except glibc. It wil scrub the environment and then invoke the diff --git a/tools/meson.build b/tools/meson.build index dd2da4adc7..fdc3549411 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -1,2 +1,61 @@ =20 subdir('nss') + +with_tools_host_validate =3D get_option('with-tools-host-validate') +if not (with_driver_qemu or with_driver_lxc or with_driver_bhyve) + with_tools_host_validate =3D false +endif + +if with_tools_host_validate + virt_host_validate_src =3D [ + 'virt-host-validate.c', + 'virt-host-validate-common.c', + 'virt-host-validate-common.h', + ] + + if with_driver_qemu + virt_host_validate_src +=3D [ + 'virt-host-validate-qemu.c', + 'virt-host-validate-qemu.h', + ] + endif + + if with_driver_lxc + virt_host_validate_src +=3D [ + 'virt-host-validate-lxc.c', + 'virt-host-validate-lxc.h', + ] + endif + + if with_driver_bhyve + virt_host_validate_src +=3D [ + 'virt-host-validate-bhyve.c', + 'virt-host-validate-bhyve.h', + ] + endif + + virt_host_validate_inc =3D common_inc_dir + virt_host_validate_libs =3D [libvirt_dep, libxml_dep, gnulib_dep] + virt_host_validate =3D executable( + 'virt-host-validate', + install: true, + sources: virt_host_validate_src, + include_directories: virt_host_validate_inc, + dependencies: virt_host_validate_libs + ) + + virt_host_validate_man =3D custom_target( + 'virt_host_validate_man', + output : 'virt-host-validate.1', + input : 'virt-host-validate.pod', + command : [ + pod2man, + '--section=3D1', + '--center=3DVirtualization Support', + '--release=3Dlibvirt @0@'.format(meson.project_version()), + '@INPUT@', '@OUTPUT@' + ], + install : true, + install_dir : join_paths(get_option('mandir'), 'man1') + ) +endif --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list