[libvirt PATCH 000/351] port libvirt to Meson build system

So I was finally able to produce the patches to port libvirt to Meson. Obviously, it is a lot of changes. It might look that some of the patches could be squashed together but I would rather have it as separated as possible to make the review not that difficult. Once we are done with review I suggest to squash all patches to single patch as it doesn't make sense to keep them separated as it will not be possible to build complete libvirt code by any of the build systems. Trying to achieve that would be even more challenging and the review would me more difficult. The reasoning behind taking this approach is to have 1:1 conversion from autotools to Meson where each patch removes that part from autotools. It serves as a check that nothing is skipped and to make sure that the conversion is complete. As probably most of us know Meson is completely different build system and one of the most challenging things was to deal with the fact that meson doesn't allow user functions and that everything has to be defined before it is used. Patches are available in my Gitlab repo as well: git clone -b meson https://gitlab.com/phrdina/libvirt.git and link to Giltab pipeline: https://gitlab.com/phrdina/libvirt/-/pipelines/167276632 The pipeline is not for the latest version is I tweaked some commit messages. Pavel Hrdina (351): meson: ci: increase git clone depth to 1000 meson: remove automake specific directives meson: drop driver_module configure argument meson: drop loader_nvram build option meson: Makefile: drop cov target meson: syntax-check: drop Makefile and m4 related checks meson: m4: drop not relevant m4 files meson: src/util/virfile: rewrite virFileActivateDirOverrideForProg meson: tests: remove '.libs' from all relevant paths meson: introduce meson build files meson: build everything with PIE meson: move content from config-post.h to config.h meson: set windows variables for AI_ADDRCONFIG meson: generate configmake.h meson: add packager build options meson: add test_suite build option meson: add expensive_tests build option meson: add test_coverage build option meson: add static analysis detection meson: add manywarnings meson: add compiler warnings meson: add linker checks meson: add scripts directory meson: add include directory meson: add functions check meson: add headers check meson: add symbols check meson: add types check meson: add members check meson: add sizeof check meson: add programs checks meson: add iscsiadm as optional program meson: add acl build dependency meson: add AppArmor build dependency meson: add attr build option meson: add audit build dependency meson: add readline build option meson: add bash_completion build options meson: add blkid build dependency meson: add capng build dependency meson: add curl build dependency meson: add dbus build dependency meson: add devmapper build dependency meson: add dlopen build dependency meson: add firewalld build option meson: add firewalld_zone build option meson: add fuse build dependency meson: add GLib dependency meson: add glusterfs build dependency meson: add GnuTLS build dependency meson: add hal build dependency meson: add kvm build dependency meson: add libiscsi build dependency meson: add macvtap build option meson: add libnl build dependency meson: add libparted dependency meson: add libpcap build option meson: add libssh build dependency meson: add libssh2 build dependency meson: add libxml build dependency meson: add netcf build options meson: add nls build dependency meson: add numactl build dependency meson: add openwsman build dependency meson: add parallels-sdk build check meson: add pciaccess build option meson: add polkit build option meson: add rbd build dependency meson: add sanlock build option meson: add sasl build dependency meson: add SELinux build dependency meson: add thread build dependency meson: add udev build options meson: add util build dependency meson: add virtualport build dependency meson: add win32 build dependency meson: add wireshark build dependency meson: add xdr build dependency meson: add yajl build dependency meson: add driver_remote build option meson: add libvirtd driver build option meson: add BHyVe build option meson: add ESX driver build option meson: add Hyper-V driver build option meson: add libxl driver build option meson: add LXC driver build option meson: add OpenVZ driver build option meson: add qemu driver build options meson: add test driver build option meson: add vbox driver build options meson: add VMWare driver build option meson: add Virtuozzo driver build option meson: add secdriver build options meson: add network driver build option meson: add interface driver build option meson: add secrets driver build option meson: add node_device driver check meson: add storage build check meson: add storage dir build option meson: add storage disk build option meson: add storage fs driver build option meson: add storage gluster build option meson: add storage iscsi build option meson: add storage iscsi-direct build option meson: add storage lvm build options meson: add storage mpath build options meson: add storage rbd build option meson: add storage SCSI build option meson: add storage sheepdog build option meson: add storage vstorage build option meson: add storage ZFS build option meson: add chrdev_lock_files build option meson: add debug_logs build option meson: add default_editor build option meson: add driver_modules build check meson: add dtrace build dependency meson: add host_validate build option meson: add init_script build option meson: add login_shell build option meson: add nss build option meson: add numad build option meson: add nwfilter build check meson: add pm_utils build option meson: add sysctl_config build option meson: add tls_priority option meson: add runutf8 env vars and meson-python.sh script meson: introduce src directory meson: src: define secdriver_dep meson: src: build dtrace files meson: src: build libvirt_util.a static lib meson: src: build libvirt_conf.a static lib meson: src: build libvirt_rpc static libs meson: src: build libvirt_access.a static library meson: src: build libvirt_driver_admin.a static lib meson: src: build libvirt_cpu.a static library meson: src: build libvirt_vmx.a static library meson: src: build libvirt_vmware.a static library meson: src: build libvirt_driver_esx.a static library meson: src: build libvirt_driver_hyperv.a static library meson: src: build libvirt_hypervisor.a static library meson: src: build libvirt_openvz.a static library meson: src: build libvirt_test.a static library meson: src: build libvirt_driver_lock.a static library meson: src: build libvirt_driver_log.a static library meson: src: build libvirt_driver_remote.a static library meson: src: build libvirt_security_manager.a static library meson: introduce datatypes sources meson: src: build libvirt_driver.a static library meson: scripts: introduce gen-def-files.sh script meson: scripts: introduce gen-sym-files.sh script meson: src: build libvirt.syms and libvirt.def symbol files meson: src: build libvirt.so library meson: src: install cpu_map data meson: src: build libvirt-qemu.so library meson: src: build libvirt-lxc.so library meson: src: build libvirt-admin.so library meson: src: build libvirt_driver_bhyve_impl.a static library meson: src: build libvirt_driver_libxl_impl.a static library meson: src: build liblockd_impl.a static library meson: src: build libvirt_driver_lxc_impl.a static library meson: src: build libvirt_driver_network_impl.a static library meson: src: build libvirt_driver_nodedev_impl.a static library meson: src: build libvirt_driver_nwfilter_impl.a static library meson: src: build libvirt_driver_qemu_impl.a static library meson: src: build libvirt_storage_driver_impl.a static library meson: src: build libvirt_driver_vbox_impl.a static library meson: src: build libvirt_driver_vz_impl.a static library meson: src: add code to build shared modules meson: src: build libvirt_driver_bhyve.so shared module meson: src: build libvirt_driver_interface.so shared module meson: src: build libvirt_driver_libxl.so shared module meson: src: build libvirt_driver_lxc.so shared module meson: src: build libvirt_driver_network.so shared module meson: src: build libvirt_driver_nodedev.so shared module meson: src: build libvirt_driver_nwfilter.so shared module meson: src: build libvirt_driver_qemu.so shared module meson: src: build libvirt_driver_secret.so shared module meson: src: build libvirt_driver_vbox.so shared module meson: src: build libvirt_driver_vz.so shared module meson: src: build lockd.so shared module meson: src: build sanlock.so shared module meson: src: build libvirt_storage_driver.so shared module meson: src: build libvirt_storage_backedn_fs.so shared module meson: src: build libvirt_storage_file_fs.so shared module meson: src: build libvirt_storage_backend_logical.so shared module meson: src: build libvirt_storage_backend_iscsi.so shared module meson: src: build libvirt_storage_backend_iscsi_direct.so shared module meson: src: build libvirt_storage_backend_scsi.so shared module meson: src: build libvirt_storage_backend_mpath.so shared module meson: src: build libvirt_storage_backend_disk.so shared module meson: src: build libvirt_storage_backend_rbd.so shared module meson: src: build libvirt_storage_backend_sheepdog.so shared module meson: src: build libvirt_storage_*_gluster.so shared modules meson: src: build libvirt_storage_backend_zfs.so shared module meson: src: build libvirt_storage_backend_vstorage.so shared module meson: src: prepare sources for libvirt daemons meson: src: add support for building daemon binaries meson: src: build virtbhyved daemon binary meson: src: build virtinterfaced daemon binary meson: src: build virtxend daemon binary meson: src: build virtlockd daemon binary meson: src: build virtlogd daemon binary meson: src: build virtlxcd daemon binary meson: src: build virtnetworkd daemon binary meson: src: build virtnodedevd daemon binary meson: src: build virtnwfilterd daemon binary meson: src: build virtqemud daemon binary meson: src: build libvirtd daemon binary meson: src: build virtproxyd daemon binary meson: src: build virtsecretd daemon binary meson: src: build virtstoraged daemon binary meson: src: build virtvboxd daemon binary meson: src: build virtvzd daemon binary meson: src: add support for building helpers meson: src: build libvirt_sanlock_helper binary meson: src: build libvirt_lxc binary meson: src: build libvirt_leaseshelper binary meson: src: build virt-qemu-run binary meson: src: build virt-aa-helper binary meson: src: build libvirt_parthelper binary meson: src: build libvirt_iohelper binary meson: src: add support for installing libvirt conf and augeas files meson: src: install libvirt daemon conf and augeas files meson: src: generate libvirt daemon augeas test files meson: src: generate libvirt daemon conf and augeas files meson: src: generate systemd unit files for libvirt daemons meson: src: generate openrc init files meson: src: install libvirt daemon sysconf files meson: src: install empty directories meson: src: generate logrotate files meson: src/access: generate org.libvirt.api.policy meson: src/access: generate libvirt_access*.xml files meson: src/network: install default network xml meson: src/network: install firewalld zone file meson: src/nwfilter: install nwfilter XML files meson: src/remote: install libvirt sysctl config file meson: src/remote: install polkit files meson: src/remote: install libvirtd sasl file meson: src/security: install apparmor profile files meson: src: add check-symfile test meson: src: add check-symsorting meson: src: add check-drivername test meson: src: add check-driverimpls test meson: src: add check-aclrules test meson: src/access: add check-aclperms test meson: src: add check-augeas test meson: src: build libvirt_functions.stp meson: src: add check*protocol tests meson: src: add check-admin-symfile test meson: src: add check-admin-symsorting test meson: src: add check-admin-drivername test meson: src: configure pkg-config files used by run script meson: add tools directory meson: tools: build libvirt_shell.a static library meson: tools: build virt-host-validate binary meson: tools: build virt-login-shell binary meson: tools: build virt-login-shell-helper binary meson: tools: build virsh_win_icon object file meson: tools: build virsh binary meson: tools: build virt-admin binary meson: tools: generate virt-xml-validate script meson: tools: generate virt-pki-validate script meson: tools: generate virt-sanlock-cleanup script meson: tools: generate libvirt-guests.sh script meson: tools: install virt-login-shell.conf meson: tools: install libvirt-guests sysconf file meson: tools: generate libvirt-guests.service systemd unit meson: tools: install bash-completion files meson: tools: introduce nss directory meson: tools: build libnss_libvirt_impl.a static library meson: tools: build libnss_libvirt_guest_impl.a static library meson: tools: build libnss_libvirt.so shared library meson: tools: build libnss_libvirt_guest.so shared_library meson: tools: introduce wireshark directory meson: tools: modify genxdrstub to work with meson meson: tools/wireshark: generate protocol header files meson: tools/wireshark: build libvirt.so wireshark module meson: introduce tests directory meson: tests: build mock shared modules meson: tests: built utils static libraries meson: tests: build commandhelper binary meson: tests: build fake ssh binary meson: tests: add test environment variables meson: tests: build shared libraries meson: tests: add test binaries build support meson: tests: introduce generic tests meson: tests: add linux specific tests meson: tests: add bhyve specific tests meson: tests: add dbus specific tests meson: tests: add ESX specific tests meson: tests: add libvirtd specific tests meson: tests: add libxl specific tests meson: tests: add lxc specific tests meson: tests: add network specific tests meson: tests: add node device specific tests meson: tests: add nss specific tests meson: tests: add nwfilter specific tests meson: tests: add openvz specific tests meson: tests: add qemu specific tests meson: tests: add remote specific tests meson: tests: add selinux specific tests meson: tests: add storage specific tests meson: tests: add storage_fs specific tests meson: tests: add storage_sheepdog specific tests meson: tests: add vbox specific tests meson: tests: add vmware specific tests meson: tests: add vmx specific tests meson: tests: add yajl specific tests meson: tests: add helper binaries build support meson: tests: build helper binaries meson: tests: add test scripts meson: tests: add file access test setup meson: tests: add valgrind test setup meson: examples: build and install example files meson: po: introduce libvirt translation meson: docs: introduce docs directory meson: docs: build api XML files meson: docs: generate docs timestamp meson: docs: generate aclperms.htmlinc meson: docs: introduce docs_rst2html_gen generator meson: docs: introduce meson-html-gen.py helper meson: docs: introduce XSL files meson: docs: build *.html files from *.html.in files meson: docs: build *.html files from *.rst files meson: docs: build hvsupport.html meson: docs: build news.html from news.xml meson: docs: copy asset data to build dir meson: docs/fonts: install font files meson: docs/html: generate libvirt API documentation meson: docs/html: generate admin,lxc and qemu API documentation meson: docs/internals: build html files meson: docs/js: install javascript files meson: docs/kbase: build html files meson: docs/logos: install logo files meson: docs/manpages: install man pages meson: docs/schemas: install RNG schemas meson: docs/html: add html test meson: install pkgconfig files meson: generate and distribute spec files and AUTHORS meson: generate run helper meson: generate developer tooling files meson: add syntax-check meson: update spec file to use meson meson: add rule to build and install only web documentation meson: drop remaining bits from Makefile.am meson: remove unused bits from GNUmakefile meson: drop all unused bits from configure.ac meson: now we can drop all autoconf related gitignore lines meson: adjust our documentation to mention meson instead of autoconf meson: update .gitlab-ci.yml file meson: .gitlab-ci.yml: switch armv7l build to Debian 10 .gitignore | 21 - .gitlab-ci.yml | 71 +- CONTRIBUTING.rst | 9 +- GNUmakefile | 74 - Makefile.am | 180 -- autogen.sh | 53 - build-aux/Makefile.in | 9 + .../Makefile.nonreentrant | 0 build-aux/meson.build | 30 + build-aux/syntax-check.mk | 120 +- ci/aarch64-linux-gnu.meson | 11 + ci/arm-linux-gnueabi.meson | 11 + ci/arm-linux-gnueabihf.meson | 11 + ci/cirrus/build.yml | 12 +- ci/cirrus/libvirt-freebsd-12.vars | 4 +- ci/cirrus/libvirt-macos-1015.vars | 4 +- ci/containers/libvirt-centos-7.Dockerfile | 2 +- ci/containers/libvirt-centos-8.Dockerfile | 4 +- .../libvirt-centos-stream.Dockerfile | 4 +- ...libvirt-debian-10-cross-aarch64.Dockerfile | 5 +- .../libvirt-debian-10-cross-armv6l.Dockerfile | 6 +- .../libvirt-debian-10-cross-armv7l.Dockerfile | 6 +- .../libvirt-debian-10-cross-i686.Dockerfile | 5 +- .../libvirt-debian-10-cross-mips.Dockerfile | 5 +- ...ibvirt-debian-10-cross-mips64el.Dockerfile | 5 +- .../libvirt-debian-10-cross-mipsel.Dockerfile | 5 +- ...libvirt-debian-10-cross-ppc64le.Dockerfile | 5 +- .../libvirt-debian-10-cross-s390x.Dockerfile | 5 +- ci/containers/libvirt-debian-10.Dockerfile | 4 +- ...ibvirt-debian-sid-cross-aarch64.Dockerfile | 5 +- ...libvirt-debian-sid-cross-armv6l.Dockerfile | 6 +- ...libvirt-debian-sid-cross-armv7l.Dockerfile | 6 +- .../libvirt-debian-sid-cross-i686.Dockerfile | 5 +- ...bvirt-debian-sid-cross-mips64el.Dockerfile | 5 +- ...libvirt-debian-sid-cross-mipsel.Dockerfile | 6 +- ...ibvirt-debian-sid-cross-ppc64le.Dockerfile | 5 +- .../libvirt-debian-sid-cross-s390x.Dockerfile | 5 +- ci/containers/libvirt-debian-sid.Dockerfile | 4 +- ci/containers/libvirt-fedora-31.Dockerfile | 4 +- ci/containers/libvirt-fedora-32.Dockerfile | 4 +- ...rt-fedora-rawhide-cross-mingw32.Dockerfile | 4 +- ...rt-fedora-rawhide-cross-mingw64.Dockerfile | 4 +- .../libvirt-fedora-rawhide.Dockerfile | 4 +- ci/containers/libvirt-opensuse-151.Dockerfile | 2 +- ci/containers/libvirt-ubuntu-1804.Dockerfile | 2 +- ci/containers/libvirt-ubuntu-2004.Dockerfile | 4 +- ci/i686-linux-gnu.meson | 11 + ci/mips-linux-gnu.meson | 11 + ci/mips64el-linux-gnuabi64.meson | 11 + ci/mipsel-linux-gnu.meson | 11 + ci/powerpc64le-linux-gnu.meson | 11 + ci/s390x-linux-gnu.meson | 11 + config-post.h => config.h | 25 +- configmake.h.in | 16 + configure.ac | 1063 ------- docs/Makefile.am | 522 ---- docs/advanced-tests.rst | 14 +- docs/best-practices.rst | 2 +- docs/committer-guidelines.rst | 6 +- docs/compiling.html.in | 40 +- docs/fonts/meson.build | 24 + docs/hacking.rst | 4 +- docs/html/meson.build | 101 + docs/internals/meson.build | 35 + docs/js/meson.build | 13 + docs/kbase/meson.build | 44 + docs/logging.html.in | 2 +- docs/logos/meson.build | 31 + docs/manpages/{index.rst => index.rst.in} | 0 .../{libvirtd.rst => libvirtd.rst.in} | 0 docs/manpages/meson.build | 129 + docs/manpages/{virsh.rst => virsh.rst.in} | 0 .../{virt-admin.rst => virt-admin.rst.in} | 0 ...validate.rst => virt-host-validate.rst.in} | 0 ...ogin-shell.rst => virt-login-shell.rst.in} | 0 ...-validate.rst => virt-pki-validate.rst.in} | 0 ...virt-qemu-run.rst => virt-qemu-run.rst.in} | 0 ...leanup.rst => virt-sanlock-cleanup.rst.in} | 0 ...-validate.rst => virt-xml-validate.rst.in} | 0 .../{virtlockd.rst => virtlockd.rst.in} | 0 .../{virtlogd.rst => virtlogd.rst.in} | 0 docs/meson.build | 319 +++ docs/schemas/meson.build | 26 + docs/strategy.html.in | 27 +- docs/windows.html.in | 18 +- examples/Makefile.am | 135 - examples/c/admin/meson.build | 27 + examples/c/domain/meson.build | 24 + examples/c/meson.build | 3 + examples/c/misc/meson.build | 22 + examples/meson.build | 7 + examples/polkit/meson.build | 1 + examples/sh/meson.build | 1 + examples/systemtap/lock-debug.stp | 2 +- examples/systemtap/meson.build | 9 + examples/xml/meson.build | 2 + examples/xml/storage/meson.build | 15 + examples/xml/test/meson.build | 14 + include/libvirt/Makefile.am | 28 - include/libvirt/meson.build | 36 + include/meson.build | 3 + libvirt.spec.in | 203 +- m4/virt-acl.m4 | 37 - m4/virt-apparmor.m4 | 41 - m4/virt-arg.m4 | 154 -- m4/virt-attr.m4 | 13 - m4/virt-audit.m4 | 31 - m4/virt-bash-completion.m4 | 70 - m4/virt-blkid.m4 | 30 - m4/virt-capng.m4 | 30 - m4/virt-chrdev-lock-files.m4 | 52 - m4/virt-compile-pie.m4 | 35 - m4/virt-compile-warnings.m4 | 255 -- m4/virt-curl.m4 | 38 - m4/virt-dbus.m4 | 41 - m4/virt-debug.m4 | 33 - m4/virt-default-editor.m4 | 32 - m4/virt-devmapper.m4 | 32 - m4/virt-dlopen.m4 | 45 - m4/virt-driver-bhyve.m4 | 56 - m4/virt-driver-esx.m4 | 57 - m4/virt-driver-hyperv.m4 | 47 - m4/virt-driver-interface.m4 | 49 - m4/virt-driver-libvirtd.m4 | 33 - m4/virt-driver-libxl.m4 | 74 - m4/virt-driver-lxc.m4 | 74 - m4/virt-driver-modules.m4 | 53 - m4/virt-driver-network.m4 | 51 - m4/virt-driver-openvz.m4 | 42 - m4/virt-driver-qemu.m4 | 132 - m4/virt-driver-remote.m4 | 48 - m4/virt-driver-test.m4 | 33 - m4/virt-driver-vbox.m4 | 44 - m4/virt-driver-vmware.m4 | 33 - m4/virt-driver-vz.m4 | 47 - m4/virt-dtrace.m4 | 45 - m4/virt-external-programs.m4 | 106 - m4/virt-firewalld-zone.m4 | 45 - m4/virt-firewalld.m4 | 43 - m4/virt-fuse.m4 | 30 - m4/virt-glib.m4 | 36 - m4/virt-gluster.m4 | 32 - m4/virt-gnutls.m4 | 30 - m4/virt-hal.m4 | 30 - m4/virt-host-validate.m4 | 43 - m4/virt-init-script.m4 | 61 - m4/virt-lib.m4 | 386 --- m4/virt-libiscsi.m4 | 30 - m4/virt-libnl.m4 | 47 - m4/virt-libpcap.m4 | 62 - m4/virt-libssh.m4 | 51 - m4/virt-libxml.m4 | 36 - m4/virt-linker-no-indirect.m4 | 32 - m4/virt-linker-no-undefined.m4 | 32 - m4/virt-linker-relro.m4 | 35 - m4/virt-loader-nvram.m4 | 49 - m4/virt-login-shell.m4 | 43 - m4/virt-macvtap.m4 | 56 - m4/virt-manywarnings.m4 | 339 --- m4/virt-netcf.m4 | 30 - m4/virt-nls.m4 | 72 - m4/virt-nss.m4 | 86 - m4/virt-numactl.m4 | 34 - m4/virt-numad.m4 | 58 - m4/virt-nwfilter.m4 | 32 - m4/virt-openwsman.m4 | 30 - m4/virt-parted.m4 | 38 - m4/virt-pciaccess.m4 | 30 - m4/virt-pm-utils.m4 | 45 - m4/virt-polkit.m4 | 62 - m4/virt-pthread.m4 | 58 - m4/virt-readline.m4 | 86 - m4/virt-result.m4 | 42 - m4/virt-sanlock.m4 | 47 - m4/virt-sasl.m4 | 30 - m4/virt-secdriver-apparmor.m4 | 50 - m4/virt-secdriver-selinux.m4 | 43 - m4/virt-selinux.m4 | 47 - m4/virt-ssh2.m4 | 30 - m4/virt-storage-dir.m4 | 33 - m4/virt-storage-disk.m4 | 58 - m4/virt-storage-fs.m4 | 89 - m4/virt-storage-gluster.m4 | 43 - m4/virt-storage-iscsi-direct.m4 | 44 - m4/virt-storage-iscsi.m4 | 50 - m4/virt-storage-lvm.m4 | 90 - m4/virt-storage-mpath.m4 | 53 - m4/virt-storage-rbd.m4 | 62 - m4/virt-storage-scsi.m4 | 36 - m4/virt-storage-sheepdog.m4 | 56 - m4/virt-storage-vstorage.m4 | 73 - m4/virt-storage-zfs.m4 | 56 - m4/virt-sysctl.m4 | 43 - m4/virt-tls-priority.m4 | 33 - m4/virt-udev.m4 | 36 - m4/virt-virtualport.m4 | 65 - m4/virt-warnings.m4 | 115 - m4/virt-win-common.m4 | 42 - m4/virt-win-mingw.m4 | 28 - m4/virt-win-symbols.m4 | 40 - m4/virt-win-windres.m4 | 36 - m4/virt-wireshark.m4 | 71 - m4/virt-xdr.m4 | 40 - m4/virt-yajl.m4 | 42 - meson.build | 2461 +++++++++++++++++ meson_options.txt | 104 + po/Makefile.am | 94 - po/meson.build | 35 + run.in | 4 +- scripts/apibuild.py | 26 +- scripts/check-augeas.sh | 12 + scripts/check-file-access.py | 24 +- scripts/check-remote-protocol.py | 75 +- scripts/gen-def-files.sh | 5 + scripts/gen-sym-files.sh | 15 + scripts/install-dirs.sh | 5 + scripts/install-symlink.sh | 7 + scripts/meson-change-perms.sh | 6 + scripts/meson-dist.sh | 6 + scripts/meson-gen-authors.sh | 4 + scripts/meson-html-gen.py | 49 + scripts/meson-install-web.py | 10 + scripts/meson-python.sh | 3 + scripts/meson-timestamp.sh | 8 + scripts/meson.build | 40 + src/Makefile.am | 693 ----- src/access/Makefile.inc.am | 153 - src/access/meson.build | 121 + src/admin/Makefile.inc.am | 146 - src/admin/meson.build | 114 + src/bhyve/Makefile.inc.am | 106 - src/bhyve/meson.build | 62 + src/conf/Makefile.inc.am | 191 -- src/conf/meson.build | 110 + src/cpu/Makefile.inc.am | 27 - src/cpu/meson.build | 21 + src/cpu_map/Makefile.inc.am | 80 - src/cpu_map/meson.build | 75 + src/driver.c | 2 +- src/esx/Makefile.inc.am | 91 - src/esx/meson.build | 67 + src/hyperv/Makefile.inc.am | 59 - src/hyperv/meson.build | 43 + src/hypervisor/Makefile.inc.am | 20 - src/hypervisor/meson.build | 23 + src/interface/Makefile.inc.am | 125 - src/interface/meson.build | 64 + src/libvirt-lxc.pc.in | 2 +- src/libvirt-qemu.pc.in | 2 +- src/libvirt.pc.in | 2 +- src/libxl/Makefile.inc.am | 163 -- src/libxl/meson.build | 89 + src/locking/Makefile.inc.am | 298 -- src/locking/lock_manager.c | 2 +- src/locking/meson.build | 249 ++ src/logging/Makefile.inc.am | 147 - src/logging/meson.build | 100 + src/lxc/Makefile.inc.am | 293 -- src/lxc/meson.build | 190 ++ src/meson.build | 969 +++++++ src/network/Makefile.inc.am | 197 -- src/network/{default.xml => default.xml.in} | 0 src/network/meson.build | 129 + src/node_device/Makefile.inc.am | 151 - src/node_device/meson.build | 77 + src/nwfilter/Makefile.inc.am | 134 - src/nwfilter/meson.build | 73 + src/nwfilter/xml/meson.build | 22 + src/openvz/Makefile.inc.am | 30 - src/openvz/meson.build | 28 + src/qemu/Makefile.inc.am | 268 -- src/{ => qemu}/libvirt_qemu_probes.d | 0 src/qemu/meson.build | 173 ++ src/remote/Makefile.inc.am | 490 ---- src/remote/meson.build | 288 ++ ...n.target.in => virt-guest-shutdown.target} | 0 src/rpc/Makefile.inc.am | 144 - src/rpc/meson.build | 136 + src/secret/Makefile.inc.am | 110 - src/secret/meson.build | 53 + src/security/Makefile.inc.am | 142 - src/security/apparmor/meson.build | 38 + .../usr.lib.libvirt.virt-aa-helper.local | 1 + src/security/meson.build | 57 + src/storage/Makefile.inc.am | 476 ---- src/storage/meson.build | 306 ++ src/storage/storage_backend.c | 2 +- src/test/Makefile.inc.am | 28 - src/test/meson.build | 26 + src/util/Makefile.inc.am | 318 --- src/util/meson.build | 212 ++ src/util/virfile.c | 34 +- src/util/virstoragefilebackend.c | 2 +- src/vbox/Makefile.inc.am | 138 - src/vbox/meson.build | 78 + src/vmware/Makefile.inc.am | 29 - src/vmware/meson.build | 26 + src/vmx/Makefile.inc.am | 24 - src/vmx/meson.build | 28 + src/vz/Makefile.inc.am | 117 - src/vz/meson.build | 68 + tests/Makefile.am | 1571 ----------- tests/meson.build | 686 +++++ tests/securityselinuxlabeltest.c | 2 +- tests/securityselinuxtest.c | 2 +- tests/shunloadtest.c | 4 +- tests/testutils.c | 2 +- tests/testutils.h | 2 +- tests/viridentitytest.c | 2 +- tests/virsh-optparse | 58 +- tests/virsh-schedinfo | 12 +- tests/virt-aa-helper-test | 2 +- tests/virtestmock.c | 2 +- tools/Makefile.am | 529 ---- tools/bash-completion/meson.build | 13 + tools/meson.build | 292 ++ tools/nss/meson.build | 92 + tools/wireshark/meson.build | 3 + tools/wireshark/src/libvirt/meson.build | 20 + tools/wireshark/src/meson.build | 17 + tools/wireshark/util/genxdrstub.pl | 9 +- 321 files changed, 9526 insertions(+), 15979 deletions(-) delete mode 100644 GNUmakefile delete mode 100644 Makefile.am delete mode 100755 autogen.sh create mode 100644 build-aux/Makefile.in rename Makefile.nonreentrant => build-aux/Makefile.nonreentrant (100%) create mode 100644 build-aux/meson.build create mode 100644 ci/aarch64-linux-gnu.meson create mode 100644 ci/arm-linux-gnueabi.meson create mode 100644 ci/arm-linux-gnueabihf.meson create mode 100644 ci/i686-linux-gnu.meson create mode 100644 ci/mips-linux-gnu.meson create mode 100644 ci/mips64el-linux-gnuabi64.meson create mode 100644 ci/mipsel-linux-gnu.meson create mode 100644 ci/powerpc64le-linux-gnu.meson create mode 100644 ci/s390x-linux-gnu.meson rename config-post.h => config.h (65%) create mode 100644 configmake.h.in delete mode 100644 configure.ac delete mode 100644 docs/Makefile.am create mode 100644 docs/fonts/meson.build create mode 100644 docs/html/meson.build create mode 100644 docs/internals/meson.build create mode 100644 docs/js/meson.build create mode 100644 docs/kbase/meson.build create mode 100644 docs/logos/meson.build rename docs/manpages/{index.rst => index.rst.in} (100%) rename docs/manpages/{libvirtd.rst => libvirtd.rst.in} (100%) create mode 100644 docs/manpages/meson.build rename docs/manpages/{virsh.rst => virsh.rst.in} (100%) rename docs/manpages/{virt-admin.rst => virt-admin.rst.in} (100%) rename docs/manpages/{virt-host-validate.rst => virt-host-validate.rst.in} (100%) rename docs/manpages/{virt-login-shell.rst => virt-login-shell.rst.in} (100%) rename docs/manpages/{virt-pki-validate.rst => virt-pki-validate.rst.in} (100%) rename docs/manpages/{virt-qemu-run.rst => virt-qemu-run.rst.in} (100%) rename docs/manpages/{virt-sanlock-cleanup.rst => virt-sanlock-cleanup.rst.in} (100%) rename docs/manpages/{virt-xml-validate.rst => virt-xml-validate.rst.in} (100%) rename docs/manpages/{virtlockd.rst => virtlockd.rst.in} (100%) rename docs/manpages/{virtlogd.rst => virtlogd.rst.in} (100%) create mode 100644 docs/meson.build create mode 100644 docs/schemas/meson.build delete mode 100644 examples/Makefile.am create mode 100644 examples/c/admin/meson.build create mode 100644 examples/c/domain/meson.build create mode 100644 examples/c/meson.build create mode 100644 examples/c/misc/meson.build create mode 100644 examples/meson.build create mode 100644 examples/polkit/meson.build create mode 100644 examples/sh/meson.build create mode 100644 examples/systemtap/meson.build create mode 100644 examples/xml/meson.build create mode 100644 examples/xml/storage/meson.build create mode 100644 examples/xml/test/meson.build delete mode 100644 include/libvirt/Makefile.am create mode 100644 include/libvirt/meson.build create mode 100644 include/meson.build delete mode 100644 m4/virt-acl.m4 delete mode 100644 m4/virt-apparmor.m4 delete mode 100644 m4/virt-arg.m4 delete mode 100644 m4/virt-attr.m4 delete mode 100644 m4/virt-audit.m4 delete mode 100644 m4/virt-bash-completion.m4 delete mode 100644 m4/virt-blkid.m4 delete mode 100644 m4/virt-capng.m4 delete mode 100644 m4/virt-chrdev-lock-files.m4 delete mode 100644 m4/virt-compile-pie.m4 delete mode 100644 m4/virt-compile-warnings.m4 delete mode 100644 m4/virt-curl.m4 delete mode 100644 m4/virt-dbus.m4 delete mode 100644 m4/virt-debug.m4 delete mode 100644 m4/virt-default-editor.m4 delete mode 100644 m4/virt-devmapper.m4 delete mode 100644 m4/virt-dlopen.m4 delete mode 100644 m4/virt-driver-bhyve.m4 delete mode 100644 m4/virt-driver-esx.m4 delete mode 100644 m4/virt-driver-hyperv.m4 delete mode 100644 m4/virt-driver-interface.m4 delete mode 100644 m4/virt-driver-libvirtd.m4 delete mode 100644 m4/virt-driver-libxl.m4 delete mode 100644 m4/virt-driver-lxc.m4 delete mode 100644 m4/virt-driver-modules.m4 delete mode 100644 m4/virt-driver-network.m4 delete mode 100644 m4/virt-driver-openvz.m4 delete mode 100644 m4/virt-driver-qemu.m4 delete mode 100644 m4/virt-driver-remote.m4 delete mode 100644 m4/virt-driver-test.m4 delete mode 100644 m4/virt-driver-vbox.m4 delete mode 100644 m4/virt-driver-vmware.m4 delete mode 100644 m4/virt-driver-vz.m4 delete mode 100644 m4/virt-dtrace.m4 delete mode 100644 m4/virt-external-programs.m4 delete mode 100644 m4/virt-firewalld-zone.m4 delete mode 100644 m4/virt-firewalld.m4 delete mode 100644 m4/virt-fuse.m4 delete mode 100644 m4/virt-glib.m4 delete mode 100644 m4/virt-gluster.m4 delete mode 100644 m4/virt-gnutls.m4 delete mode 100644 m4/virt-hal.m4 delete mode 100644 m4/virt-host-validate.m4 delete mode 100644 m4/virt-init-script.m4 delete mode 100644 m4/virt-lib.m4 delete mode 100644 m4/virt-libiscsi.m4 delete mode 100644 m4/virt-libnl.m4 delete mode 100644 m4/virt-libpcap.m4 delete mode 100644 m4/virt-libssh.m4 delete mode 100644 m4/virt-libxml.m4 delete mode 100644 m4/virt-linker-no-indirect.m4 delete mode 100644 m4/virt-linker-no-undefined.m4 delete mode 100644 m4/virt-linker-relro.m4 delete mode 100644 m4/virt-loader-nvram.m4 delete mode 100644 m4/virt-login-shell.m4 delete mode 100644 m4/virt-macvtap.m4 delete mode 100644 m4/virt-manywarnings.m4 delete mode 100644 m4/virt-netcf.m4 delete mode 100644 m4/virt-nls.m4 delete mode 100644 m4/virt-nss.m4 delete mode 100644 m4/virt-numactl.m4 delete mode 100644 m4/virt-numad.m4 delete mode 100644 m4/virt-nwfilter.m4 delete mode 100644 m4/virt-openwsman.m4 delete mode 100644 m4/virt-parted.m4 delete mode 100644 m4/virt-pciaccess.m4 delete mode 100644 m4/virt-pm-utils.m4 delete mode 100644 m4/virt-polkit.m4 delete mode 100644 m4/virt-pthread.m4 delete mode 100644 m4/virt-readline.m4 delete mode 100644 m4/virt-result.m4 delete mode 100644 m4/virt-sanlock.m4 delete mode 100644 m4/virt-sasl.m4 delete mode 100644 m4/virt-secdriver-apparmor.m4 delete mode 100644 m4/virt-secdriver-selinux.m4 delete mode 100644 m4/virt-selinux.m4 delete mode 100644 m4/virt-ssh2.m4 delete mode 100644 m4/virt-storage-dir.m4 delete mode 100644 m4/virt-storage-disk.m4 delete mode 100644 m4/virt-storage-fs.m4 delete mode 100644 m4/virt-storage-gluster.m4 delete mode 100644 m4/virt-storage-iscsi-direct.m4 delete mode 100644 m4/virt-storage-iscsi.m4 delete mode 100644 m4/virt-storage-lvm.m4 delete mode 100644 m4/virt-storage-mpath.m4 delete mode 100644 m4/virt-storage-rbd.m4 delete mode 100644 m4/virt-storage-scsi.m4 delete mode 100644 m4/virt-storage-sheepdog.m4 delete mode 100644 m4/virt-storage-vstorage.m4 delete mode 100644 m4/virt-storage-zfs.m4 delete mode 100644 m4/virt-sysctl.m4 delete mode 100644 m4/virt-tls-priority.m4 delete mode 100644 m4/virt-udev.m4 delete mode 100644 m4/virt-virtualport.m4 delete mode 100644 m4/virt-warnings.m4 delete mode 100644 m4/virt-win-common.m4 delete mode 100644 m4/virt-win-mingw.m4 delete mode 100644 m4/virt-win-symbols.m4 delete mode 100644 m4/virt-win-windres.m4 delete mode 100644 m4/virt-wireshark.m4 delete mode 100644 m4/virt-xdr.m4 delete mode 100644 m4/virt-yajl.m4 create mode 100644 meson.build create mode 100644 meson_options.txt delete mode 100644 po/Makefile.am create mode 100644 po/meson.build create mode 100644 scripts/check-augeas.sh create mode 100755 scripts/gen-def-files.sh create mode 100755 scripts/gen-sym-files.sh create mode 100644 scripts/install-dirs.sh create mode 100644 scripts/install-symlink.sh create mode 100644 scripts/meson-change-perms.sh create mode 100755 scripts/meson-dist.sh create mode 100755 scripts/meson-gen-authors.sh create mode 100755 scripts/meson-html-gen.py create mode 100755 scripts/meson-install-web.py create mode 100755 scripts/meson-python.sh create mode 100755 scripts/meson-timestamp.sh create mode 100644 scripts/meson.build delete mode 100644 src/Makefile.am delete mode 100644 src/access/Makefile.inc.am create mode 100644 src/access/meson.build delete mode 100644 src/admin/Makefile.inc.am create mode 100644 src/admin/meson.build delete mode 100644 src/bhyve/Makefile.inc.am create mode 100644 src/bhyve/meson.build delete mode 100644 src/conf/Makefile.inc.am create mode 100644 src/conf/meson.build delete mode 100644 src/cpu/Makefile.inc.am create mode 100644 src/cpu/meson.build delete mode 100644 src/cpu_map/Makefile.inc.am create mode 100644 src/cpu_map/meson.build delete mode 100644 src/esx/Makefile.inc.am create mode 100644 src/esx/meson.build delete mode 100644 src/hyperv/Makefile.inc.am create mode 100644 src/hyperv/meson.build delete mode 100644 src/hypervisor/Makefile.inc.am create mode 100644 src/hypervisor/meson.build delete mode 100644 src/interface/Makefile.inc.am create mode 100644 src/interface/meson.build delete mode 100644 src/libxl/Makefile.inc.am create mode 100644 src/libxl/meson.build delete mode 100644 src/locking/Makefile.inc.am create mode 100644 src/locking/meson.build delete mode 100644 src/logging/Makefile.inc.am create mode 100644 src/logging/meson.build delete mode 100644 src/lxc/Makefile.inc.am create mode 100644 src/lxc/meson.build create mode 100644 src/meson.build delete mode 100644 src/network/Makefile.inc.am rename src/network/{default.xml => default.xml.in} (100%) create mode 100644 src/network/meson.build delete mode 100644 src/node_device/Makefile.inc.am create mode 100644 src/node_device/meson.build delete mode 100644 src/nwfilter/Makefile.inc.am create mode 100644 src/nwfilter/meson.build create mode 100644 src/nwfilter/xml/meson.build delete mode 100644 src/openvz/Makefile.inc.am create mode 100644 src/openvz/meson.build delete mode 100644 src/qemu/Makefile.inc.am rename src/{ => qemu}/libvirt_qemu_probes.d (100%) create mode 100644 src/qemu/meson.build delete mode 100644 src/remote/Makefile.inc.am create mode 100644 src/remote/meson.build rename src/remote/{virt-guest-shutdown.target.in => virt-guest-shutdown.target} (100%) delete mode 100644 src/rpc/Makefile.inc.am create mode 100644 src/rpc/meson.build delete mode 100644 src/secret/Makefile.inc.am create mode 100644 src/secret/meson.build delete mode 100644 src/security/Makefile.inc.am create mode 100644 src/security/apparmor/meson.build create mode 100644 src/security/apparmor/usr.lib.libvirt.virt-aa-helper.local create mode 100644 src/security/meson.build delete mode 100644 src/storage/Makefile.inc.am create mode 100644 src/storage/meson.build delete mode 100644 src/test/Makefile.inc.am create mode 100644 src/test/meson.build delete mode 100644 src/util/Makefile.inc.am create mode 100644 src/util/meson.build delete mode 100644 src/vbox/Makefile.inc.am create mode 100644 src/vbox/meson.build delete mode 100644 src/vmware/Makefile.inc.am create mode 100644 src/vmware/meson.build delete mode 100644 src/vmx/Makefile.inc.am create mode 100644 src/vmx/meson.build delete mode 100644 src/vz/Makefile.inc.am create mode 100644 src/vz/meson.build delete mode 100644 tests/Makefile.am create mode 100644 tests/meson.build delete mode 100644 tools/Makefile.am create mode 100644 tools/bash-completion/meson.build create mode 100644 tools/meson.build create mode 100644 tools/nss/meson.build create mode 100644 tools/wireshark/meson.build create mode 100644 tools/wireshark/src/libvirt/meson.build create mode 100644 tools/wireshark/src/meson.build -- 2.26.2

Having limit set to 100 is in most cases perfect but sometimes there can be a larger series that will have more than 100 patches and it will make the check-dco job fail. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- .gitlab-ci.yml | 2 +- ci/cirrus/build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 702198ec8e4..c997dc6df25 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ variables: - GIT_DEPTH: 100 + GIT_DEPTH: 1000 stages: - sanity_checks diff --git a/ci/cirrus/build.yml b/ci/cirrus/build.yml index 893e13d7241..49e90b6d67b 100644 --- a/ci/cirrus/build.yml +++ b/ci/cirrus/build.yml @@ -14,7 +14,7 @@ build_task: install_script: - @INSTALL_COMMAND@ @PKGS@ clone_script: - - git clone --depth 100 "$CI_REPOSITORY_URL" . + - git clone --depth 1000 "$CI_REPOSITORY_URL" . - git fetch origin "$CI_COMMIT_REF_NAME" - git reset --hard "$CI_COMMIT_SHA" build_script: -- 2.26.2

On a Thursday in 2020, Pavel Hrdina wrote:
Having limit set to 100 is in most cases perfect but sometimes there can be a larger series that will have more than 100 patches and it will make the check-dco job fail.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- .gitlab-ci.yml | 2 +- ci/cirrus/build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 702198ec8e4..c997dc6df25 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ variables: - GIT_DEPTH: 100 + GIT_DEPTH: 1000
stages: - sanity_checks diff --git a/ci/cirrus/build.yml b/ci/cirrus/build.yml index 893e13d7241..49e90b6d67b 100644 --- a/ci/cirrus/build.yml +++ b/ci/cirrus/build.yml @@ -14,7 +14,7 @@ build_task: install_script: - @INSTALL_COMMAND@ @PKGS@ clone_script: - - git clone --depth 100 "$CI_REPOSITORY_URL" . + - git clone --depth 1000 "$CI_REPOSITORY_URL" .
Does cirrus run the dco-check too or is this just for consistency?
- git fetch origin "$CI_COMMIT_REF_NAME" - git reset --hard "$CI_COMMIT_SHA" build_script:
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

On Wed, Jul 22, 2020 at 10:21:43 +0200, Ján Tomko wrote:
On a Thursday in 2020, Pavel Hrdina wrote:
Having limit set to 100 is in most cases perfect but sometimes there can be a larger series that will have more than 100 patches and it will make the check-dco job fail.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- .gitlab-ci.yml | 2 +- ci/cirrus/build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 702198ec8e4..c997dc6df25 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ variables: - GIT_DEPTH: 100 + GIT_DEPTH: 1000
stages: - sanity_checks diff --git a/ci/cirrus/build.yml b/ci/cirrus/build.yml index 893e13d7241..49e90b6d67b 100644 --- a/ci/cirrus/build.yml +++ b/ci/cirrus/build.yml @@ -14,7 +14,7 @@ build_task: install_script: - @INSTALL_COMMAND@ @PKGS@ clone_script: - - git clone --depth 100 "$CI_REPOSITORY_URL" . + - git clone --depth 1000 "$CI_REPOSITORY_URL" .
Does cirrus run the dco-check too or is this just for consistency?
- git fetch origin "$CI_COMMIT_REF_NAME" - git reset --hard "$CI_COMMIT_SHA" build_script:
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Do we really want to merge this in the end?

On Wed, Jul 22, 2020 at 10:35:43AM +0200, Peter Krempa wrote:
On Wed, Jul 22, 2020 at 10:21:43 +0200, Ján Tomko wrote:
On a Thursday in 2020, Pavel Hrdina wrote:
Having limit set to 100 is in most cases perfect but sometimes there can be a larger series that will have more than 100 patches and it will make the check-dco job fail.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- .gitlab-ci.yml | 2 +- ci/cirrus/build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 702198ec8e4..c997dc6df25 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ variables: - GIT_DEPTH: 100 + GIT_DEPTH: 1000
stages: - sanity_checks diff --git a/ci/cirrus/build.yml b/ci/cirrus/build.yml index 893e13d7241..49e90b6d67b 100644 --- a/ci/cirrus/build.yml +++ b/ci/cirrus/build.yml @@ -14,7 +14,7 @@ build_task: install_script: - @INSTALL_COMMAND@ @PKGS@ clone_script: - - git clone --depth 100 "$CI_REPOSITORY_URL" . + - git clone --depth 1000 "$CI_REPOSITORY_URL" .
Does cirrus run the dco-check too or is this just for consistency?
- git fetch origin "$CI_COMMIT_REF_NAME" - git reset --hard "$CI_COMMIT_SHA" build_script:
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Do we really want to merge this in the end?
We don't have to merge this patch as we don't run it in post-merge pipeline. However, if we ever move to merge request workflow we I think we will eventually need to modify the depth size for DCO check. I'll fix this patch to change the git depth only for DCO check job as Dan suggested. Thanks Pavel

On a Wednesday in 2020, Pavel Hrdina wrote:
On Wed, Jul 22, 2020 at 10:35:43AM +0200, Peter Krempa wrote:
On Wed, Jul 22, 2020 at 10:21:43 +0200, Ján Tomko wrote:
On a Thursday in 2020, Pavel Hrdina wrote:
Having limit set to 100 is in most cases perfect but sometimes there can be a larger series that will have more than 100 patches and it will make the check-dco job fail.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- .gitlab-ci.yml | 2 +- ci/cirrus/build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 702198ec8e4..c997dc6df25 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ variables: - GIT_DEPTH: 100 + GIT_DEPTH: 1000
stages: - sanity_checks diff --git a/ci/cirrus/build.yml b/ci/cirrus/build.yml index 893e13d7241..49e90b6d67b 100644 --- a/ci/cirrus/build.yml +++ b/ci/cirrus/build.yml @@ -14,7 +14,7 @@ build_task: install_script: - @INSTALL_COMMAND@ @PKGS@ clone_script: - - git clone --depth 100 "$CI_REPOSITORY_URL" . + - git clone --depth 1000 "$CI_REPOSITORY_URL" .
Does cirrus run the dco-check too or is this just for consistency?
- git fetch origin "$CI_COMMIT_REF_NAME" - git reset --hard "$CI_COMMIT_SHA" build_script:
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Do we really want to merge this in the end?
We don't have to merge this patch as we don't run it in post-merge pipeline. However, if we ever move to merge request workflow we I think we will eventually need to modify the depth size for DCO check.
Given all the downsides of the merge request workflow, I doubt that will ever happen. Jano
I'll fix this patch to change the git depth only for DCO check job as Dan suggested.
Thanks
Pavel

On Wed, 2020-07-22 at 10:21 +0200, Ján Tomko wrote:
+++ b/ci/cirrus/build.yml @@ -14,7 +14,7 @@ build_task: install_script: - @INSTALL_COMMAND@ @PKGS@ clone_script: - - git clone --depth 100 "$CI_REPOSITORY_URL" . + - git clone --depth 1000 "$CI_REPOSITORY_URL" .
Does cirrus run the dco-check too or is this just for consistency?
It does not, so I think we should drop this hunk in order not to introduce unnecessary delays for Cirrus CI jobs. -- Andrea Bolognani / Red Hat / Virtualization

On Thu, Jul 16, 2020 at 11:53:57AM +0200, Pavel Hrdina wrote:
Having limit set to 100 is in most cases perfect but sometimes there can be a larger series that will have more than 100 patches and it will make the check-dco job fail.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- .gitlab-ci.yml | 2 +- ci/cirrus/build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 702198ec8e4..c997dc6df25 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ variables: - GIT_DEPTH: 100 + GIT_DEPTH: 1000
If its only for the DCO job, then just override the GIT_DEPTH variable only in the DCO job definition, leaving all the others at 100 for speed.
stages: - sanity_checks diff --git a/ci/cirrus/build.yml b/ci/cirrus/build.yml index 893e13d7241..49e90b6d67b 100644 --- a/ci/cirrus/build.yml +++ b/ci/cirrus/build.yml @@ -14,7 +14,7 @@ build_task: install_script: - @INSTALL_COMMAND@ @PKGS@ clone_script: - - git clone --depth 100 "$CI_REPOSITORY_URL" . + - git clone --depth 1000 "$CI_REPOSITORY_URL" .
Seems redundant per the subject goal
- git fetch origin "$CI_COMMIT_REF_NAME" - git reset --hard "$CI_COMMIT_SHA" build_script:
Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

EXTRA_DIST is not relevant because meson makes a git copy when creating dist archive so everything tracked by git is part of dist tarball. BUILD_SOURCES is not relevant as all dependencies should be explicitly tracked. The remaining ones are not converted to meson files as they are automatically tracked by meson. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 62 +---------- docs/Makefile.am | 51 --------- examples/Makefile.am | 8 -- include/libvirt/Makefile.am | 2 - po/Makefile.am | 7 -- src/Makefile.am | 55 ---------- src/access/Makefile.inc.am | 18 --- src/admin/Makefile.inc.am | 12 -- src/bhyve/Makefile.inc.am | 9 -- src/cpu_map/Makefile.inc.am | 2 - src/esx/Makefile.inc.am | 14 --- src/hyperv/Makefile.inc.am | 13 --- src/interface/Makefile.inc.am | 7 -- src/libxl/Makefile.inc.am | 10 -- src/locking/Makefile.inc.am | 26 ----- src/logging/Makefile.inc.am | 16 --- src/lxc/Makefile.inc.am | 15 --- src/network/Makefile.inc.am | 9 -- src/node_device/Makefile.inc.am | 7 -- src/nwfilter/Makefile.inc.am | 5 - src/openvz/Makefile.inc.am | 2 - src/qemu/Makefile.inc.am | 20 ---- src/remote/Makefile.inc.am | 31 ------ src/rpc/Makefile.inc.am | 25 ----- src/secret/Makefile.inc.am | 5 - src/security/Makefile.inc.am | 14 --- src/storage/Makefile.inc.am | 20 ---- src/test/Makefile.inc.am | 5 - src/util/Makefile.inc.am | 8 -- src/vbox/Makefile.inc.am | 11 -- src/vmware/Makefile.inc.am | 2 - src/vmx/Makefile.inc.am | 2 - src/vz/Makefile.inc.am | 2 - tests/Makefile.am | 187 -------------------------------- tools/Makefile.am | 47 -------- 35 files changed, 1 insertion(+), 728 deletions(-) diff --git a/Makefile.am b/Makefile.am index ad1edee76f4..310a9d90276 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,54 +31,6 @@ export XZ_OPT ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = \ - config-post.h \ - libvirt.spec libvirt.spec.in \ - mingw-libvirt.spec.in \ - libvirt.pc.in \ - libvirt-qemu.pc.in \ - libvirt-lxc.pc.in \ - libvirt-admin.pc.in \ - Makefile.nonreentrant \ - autogen.sh \ - GNUmakefile \ - run.in \ - README.rst \ - AUTHORS.in \ - CONTRIBUTING.rst \ - NEWS.rst \ - scripts/apibuild.py \ - scripts/augeas-gentest.py \ - build-aux/check-spacing.pl \ - scripts/check-aclperms.py \ - scripts/check-aclrules.py \ - scripts/check-drivername.py \ - scripts/check-driverimpls.py \ - scripts/check-file-access.py \ - scripts/check-remote-protocol.py \ - scripts/check-symfile.py \ - scripts/check-symsorting.py \ - scripts/dtrace2systemtap.py \ - scripts/esx_vi_generator.py \ - scripts/genaclperms.py \ - scripts/genpolkit.py \ - scripts/gensystemtap.py \ - scripts/group-qemu-caps.py \ - scripts/header-ifdef.py \ - scripts/hvsupport.py \ - scripts/hyperv_wmi_generator.py \ - scripts/mock-noinline.py \ - scripts/prohibit-duplicate-header.py \ - scripts/test-wrap-argv.py \ - build-aux/syntax-check.mk \ - build-aux/useless-if-before-free \ - build-aux/vc-list-files \ - ci/Makefile \ - ci/build.sh \ - ci/list-images.sh \ - ci/prepare.sh \ - $(NULL) - pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libvirt.pc libvirt-qemu.pc libvirt-lxc.pc libvirt-admin.pc @@ -93,7 +45,7 @@ check-local: all tests check-access: all @($(MAKE) $(AM_MAKEFLAGS) -C tests check-access) -cov: clean-cov +cov: $(MKDIR_P) $(top_builddir)/coverage $(LCOV) -c -o $(top_builddir)/coverage/libvirt.info.tmp \ -d $(top_builddir)/src \ @@ -104,18 +56,6 @@ cov: clean-cov $(GENHTML) --show-details -t "libvirt" -o $(top_builddir)/coverage \ --legend $(top_builddir)/coverage/libvirt.info -clean-cov: - rm -rf $(top_builddir)/coverage - -MAINTAINERCLEANFILES = .git-module-status - -BUILT_SOURCES = configmake.h -CLEANFILES = configmake.h - -distclean-local: clean-GNUmakefile -clean-GNUmakefile: - test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile - dist-hook: gen-AUTHORS .PHONY: gen-AUTHORS diff --git a/docs/Makefile.am b/docs/Makefile.am index a480123e33f..6d4fcdc831a 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -53,16 +53,6 @@ vpathhack: test -e $$file || ln -s $(srcdir)/$$file $$file ; \ done -clean-local: - for dir in fonts js logos; \ - do \ - rm -f $$dir ; \ - done - for file in $(assets); \ - do \ - rm -f $$file ; \ - done - apihtml = \ html/index.html \ $(apihtml_generated) @@ -343,53 +333,15 @@ api_DATA = \ libvirt-lxc-api.xml \ libvirt-admin-api.xml -svg = \ - libvirt-daemon-arch.svg \ - libvirt-driver-arch.svg \ - libvirt-object-model.svg \ - migration-managed-direct.svg \ - migration-managed-p2p.svg \ - migration-native.svg \ - migration-tunnel.svg \ - migration-unmanaged-direct.svg - schemadir = $(pkgdatadir)/schemas schema_DATA = $(wildcard $(srcdir)/schemas/*.rng) -EXTRA_DIST= \ - site.xsl subsite.xsl newapi.xsl page.xsl \ - $(dot_html_in) $(dot_rst) $(apipng) \ - $(svg) $(assets) \ - $(javascript) $(logofiles) \ - $(internals_html_in) $(internals_rst) $(fonts) \ - $(kbase_html_in) $(kbase_rst) \ - $(manpages_rst) \ - aclperms.htmlinc \ - $(schema_DATA) - acl_generated = aclperms.htmlinc aclperms.htmlinc: $(top_srcdir)/src/access/viraccessperm.h \ $(top_srcdir)/scripts/genaclperms.py Makefile.am $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/genaclperms.py $< > $@ -CLEANFILES = \ - $(dot_html) \ - $(apihtml) \ - $(apiadminhtml) \ - $(apiqemuhtml) \ - $(apilxchtml) \ - $(internals_html) \ - $(kbase_html) \ - $(manpages_html) \ - $(man1_MANS) \ - $(man7_MANS) \ - $(manpages7_rst) \ - $(man8_MANS) \ - $(api_DATA) \ - $(dot_html_generated_in) \ - aclperms.htmlinc - timestamp="$(shell if test -n "$$SOURCE_DATE_EPOCH"; \ then \ date -u --date="@$$SOURCE_DATE_EPOCH"; \ @@ -417,8 +369,6 @@ news.html.in: $(top_srcdir)/NEWS.rst $(AM_V_GEN)$(MKDIR_P) `dirname $@` && \ $(RST2HTML) --strict $< > $@ || { rm $@ && exit 1; } -CLEANFILES += news.html.in - %.html.in: %.rst $(AM_V_GEN)$(MKDIR_P) `dirname $@` && \ $(RST2HTML) --strict $< > $@ || { rm $@ && exit 1; } @@ -476,7 +426,6 @@ python_generated_files = $(api_DATA) APIBUILD=$(top_srcdir)/scripts/apibuild.py APIBUILD_STAMP=apibuild.py.stamp -CLEANFILES += $(APIBUILD_STAMP) $(python_generated_files): $(APIBUILD_STAMP) diff --git a/examples/Makefile.am b/examples/Makefile.am index ad635bdcc05..15ff897cf1f 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -48,14 +48,6 @@ TEST_XML_EXAMPLES = \ $(wildcard $(srcdir)/xml/test/*.xml) \ $(NULL) -EXTRA_DIST = \ - $(POLKIT_EXAMPLES) \ - $(SH_EXAMPLES) \ - $(STORAGE_XML_EXAMPLES) \ - $(SYSTEMTAP_EXAMPLES) \ - $(TEST_XML_EXAMPLES) \ - $(NULL) - AM_CPPFLAGS = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ diff --git a/include/libvirt/Makefile.am b/include/libvirt/Makefile.am index d7114c34622..e447a5d37da 100644 --- a/include/libvirt/Makefile.am +++ b/include/libvirt/Makefile.am @@ -22,7 +22,5 @@ allheaders = $(wildcard $(srcdir)/*.h) virinc_HEADERS = $(filter-out $(srcdir)/libvirt-common.h, $(allheaders)) nodist_virinc_HEADERS = libvirt-common.h -EXTRA_DIST = libvirt-common.h.in - install-exec-hook: $(mkinstalldirs) $(DESTDIR)$(virincdir) diff --git a/po/Makefile.am b/po/Makefile.am index f0698b455ba..ff73ead6f72 100644 --- a/po/Makefile.am +++ b/po/Makefile.am @@ -14,13 +14,6 @@ POTFILE := $(DOMAIN).pot POFILES := $(LANGS:%=%.po) GMOFILES := $(LANGS:%=%.gmo) -CLEANFILES = $(GMOFILES) POTFILES - -EXTRA_DIST = \ - LINGUAS \ - $(POTFILES_IN) \ - $(POFILES) - if HAVE_GNU_GETTEXT_TOOLS XGETTEXT_ARGS = \ diff --git a/src/Makefile.am b/src/Makefile.am index 834e356b68b..c2bb7d0083b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -48,12 +48,6 @@ AM_LDFLAGS_MOD = \ $(AM_LDFLAGS) AM_LDFLAGS_MOD_NOUNDEF = $(AM_LDFLAGS_MOD) $(NO_UNDEFINED_LDFLAGS) -EXTRA_DIST = $(conf_DATA) - -BUILT_SOURCES = -CLEANFILES = -DISTCLEANFILES = -MAINTAINERCLEANFILES = nodist_conf_DATA = DRIVER_SOURCE_FILES = STATEFUL_DRIVER_SOURCE_FILES = @@ -145,15 +139,10 @@ moddir = $(libdir)/libvirt/connection-driver confdir = $(sysconfdir)/libvirt conf_DATA += libvirt.conf -CLEANFILES += $(nodist_conf_DATA) -BUILT_SOURCES += $(nodist_conf_DATA) - augeasdir = $(datadir)/augeas/lenses augeastestdir = $(datadir)/augeas/lenses/tests -CLEANFILES += $(augeastest_DATA) - # Internal generic driver infrastructure DATATYPES_SOURCES = datatypes.h datatypes.c DRIVER_SOURCES += \ @@ -252,7 +241,6 @@ else !WITH_REMOTE # re-generated when configured --without-remote. check-protocol: endif !WITH_REMOTE -EXTRA_DIST += $(PROTOCOL_STRUCTS) DRIVERS = \ $(srcdir)/driver-hypervisor.h \ @@ -392,15 +380,6 @@ else ! WITH_LIBSSH SYM_FILES += $(srcdir)/libvirt_libssh.syms endif ! WITH_LIBSSH -EXTRA_DIST += \ - libvirt_public.syms \ - libvirt_lxc.syms \ - libvirt_qemu.syms \ - $(SYM_FILES) \ - $(NULL) - -BUILT_SOURCES += $(GENERATED_SYM_FILES) - libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \ $(ACCESS_DRIVER_SYM_FILES) \ $(top_builddir)/config.status @@ -450,9 +429,6 @@ libvirt_la_BUILT_LIBADD += libvirt_probes.lo libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o nodist_libvirt_la_SOURCES = libvirt_probes.h -BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp - - tapsetdir = $(datadir)/systemtap/tapset tapset_DATA += libvirt_probes.stp libvirt_functions.stp @@ -489,12 +465,8 @@ libvirt_functions.stp: $(RPC_PROBE_FILES) $(top_srcdir)/scripts/gensystemtap.py $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/dtrace2systemtap.py \ $(bindir) $(sbindir) $(libdir) $< > $@ -CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \ - libvirt_functions.stp libvirt_probes.stp endif WITH_DTRACE_PROBES -EXTRA_DIST += libvirt_probes.d - libvirt_qemu_la_SOURCES = libvirt-qemu.c libvirt_qemu_la_LDFLAGS = \ $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \ @@ -515,10 +487,6 @@ libvirt_lxc_la_LDFLAGS = \ libvirt_lxc_la_CFLAGS = $(AM_CFLAGS) libvirt_lxc_la_LIBADD = libvirt.la -EXTRA_DIST += \ - $(SYSCONF_FILES) \ - $(OPENRC_CONF_FILES) - install-sysconfig: $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig for f in $(SYSCONF_FILES:%.sysconf=%) ; \ @@ -557,11 +525,6 @@ uninstall-openrc-conf: LOGROTATE_FILES := $(LOGROTATE_FILES_IN:remote/%.in=%) -EXTRA_DIST += $(LOGROTATE_FILES_IN) - -BUILT_SOURCES += $(LOGROTATE_FILES) -CLEANFILES += $(LOGROTATE_FILES) - %.logrotate: remote/%.logrotate.in $(AM_V_GEN)sed \ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ @@ -587,20 +550,11 @@ UNINSTALL_LOCAL += uninstall-logrotate endif WITH_LIBVIRTD -EXTRA_DIST += \ - $(SYSTEMD_UNIT_FILES_IN) \ - $(OPENRC_INIT_FILES_IN) \ - $(NULL) - - if WITH_LIBVIRTD if LIBVIRT_INIT_SCRIPT_SYSTEMD SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system -BUILT_SOURCES += $(SYSTEMD_UNIT_FILES) -DISTCLEANFILES += $(SYSTEMD_UNIT_FILES) - install-systemd: $(SYSTEMD_UNIT_FILES) install-sysconfig $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR) for f in $(SYSTEMD_UNIT_FILES); \ @@ -620,9 +574,6 @@ if LIBVIRT_INIT_SCRIPT_OPENRC OPENRC_INIT_DIR = $(sysconfdir)/init.d -BUILT_SOURCES += $(OPENRC_INIT_FILES) -DISTCLEANFILES += $(OPENRC_INIT_FILES) - install-openrc: $(OPENRC_INIT_FILES) install-openrc-conf $(MKDIR_P) $(DESTDIR)$(OPENRC_INIT_DIR) for f in $(OPENRC_INIT_FILES:%.init=%) ; \ @@ -671,9 +622,6 @@ libvirt_iohelper_CFLAGS = \ endif WITH_LIBVIRTD -generated-sources: $(BUILT_SOURCES) - - install-data-local: $(INSTALL_DATA_LOCAL) \ $(INSTALL_DATA_DIRS:%=install-data-%) $(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt" @@ -688,6 +636,3 @@ uninstall-local: $(UNINSTALL_LOCAL) \ rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||: rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||: rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||: - -CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s -DISTCLEANFILES += $(GENERATED_SYM_FILES) diff --git a/src/access/Makefile.inc.am b/src/access/Makefile.inc.am index 11f87c6aa74..d58d5166bef 100644 --- a/src/access/Makefile.inc.am +++ b/src/access/Makefile.inc.am @@ -42,10 +42,6 @@ ACCESS_DRIVER_POLKIT_POLICY = access/org.libvirt.api.policy GENERATED_SYM_FILES += $(ACCESS_DRIVER_SYM_FILES) -EXTRA_DIST += \ - $(NULL) - - libvirt_driver_access_la_SOURCES = \ $(ACCESS_DRIVER_SOURCES) \ $(NULL) @@ -76,23 +72,9 @@ polkitactiondir = $(datadir)/polkit-1/actions if WITH_LIBVIRTD polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY) endif WITH_LIBVIRTD - -CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY) -BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY) -else ! WITH_POLKIT -EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES) endif ! WITH_POLKIT -BUILT_SOURCES += \ - $(ACCESS_DRIVER_GENERATED) \ - $(ACCESS_DRIVER_API_FILES) \ - $(NULL) -CLEANFILES += \ - $(ACCESS_DRIVER_GENERATED) \ - $(ACCESS_DRIVER_API_FILES) \ - $(NULL) - libvirt_access.syms: $(srcdir)/rpc/gendispatch.pl \ $(REMOTE_PROTOCOL) Makefile.am $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclsym \ diff --git a/src/admin/Makefile.inc.am b/src/admin/Makefile.inc.am index 8556a3b8523..2d94ead73e1 100644 --- a/src/admin/Makefile.inc.am +++ b/src/admin/Makefile.inc.am @@ -9,10 +9,6 @@ ADMIN_PROTOCOL_GENERATED = \ admin/admin_server_dispatch_stubs.h \ $(NULL) -EXTRA_DIST += $(ADMIN_PROTOCOL) -BUILT_SOURCES += $(ADMIN_PROTOCOL_GENERATED) -CLEANFILES += $(ADMIN_PROTOCOL_GENERATED) - admin/admin_server_dispatch.c: admin/admin_server_dispatch_stubs.h noinst_LTLIBRARIES += libvirt_driver_admin.la @@ -44,14 +40,6 @@ GENERATED_SYM_FILES += admin/libvirt_admin.syms admin/libvirt_admin.def ADMIN_SYM_FILES = $(srcdir)/admin/libvirt_admin_private.syms -# admin/admin_remote.c is being included in admin/libvirt-admin.c, so we -# need to include it in the dist -EXTRA_DIST += \ - admin/admin_remote.c \ - admin/libvirt_admin_public.syms \ - $(ADMIN_SYM_FILES) \ - $(NULL) - conf_DATA += admin/libvirt-admin.conf lib_LTLIBRARIES += libvirt-admin.la diff --git a/src/bhyve/Makefile.inc.am b/src/bhyve/Makefile.inc.am index 2536d12ab35..f75194fd3c8 100644 --- a/src/bhyve/Makefile.inc.am +++ b/src/bhyve/Makefile.inc.am @@ -25,8 +25,6 @@ BHYVE_DRIVER_SOURCES = \ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(BHYVE_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(BHYVE_DRIVER_SOURCES)) -EXTRA_DIST += $(BHYVE_DRIVER_SOURCES) - if WITH_BHYVE noinst_LTLIBRARIES += libvirt_driver_bhyve_impl.la @@ -54,7 +52,6 @@ sbin_PROGRAMS += virtbhyved nodist_conf_DATA += bhyve/virtbhyved.conf augeas_DATA += bhyve/virtbhyved.aug augeastest_DATA += bhyve/test_virtbhyved.aug -CLEANFILES += bhyve/virtbhyved.aug virtbhyved_SOURCES = $(REMOTE_DAEMON_SOURCES) nodist_virtbhyved_SOURCES = $(REMOTE_DAEMON_GENERATED) @@ -98,9 +95,3 @@ bhyve/test_libvirtd_bhyve.aug: bhyve/test_libvirtd_bhyve.aug.in \ $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/bhyve/bhyve.conf $< > $@ endif WITH_BHYVE - -EXTRA_DIST += \ - bhyve/bhyve.conf \ - bhyve/libvirtd_bhyve.aug \ - bhyve/test_libvirtd_bhyve.aug.in \ - $(NULL) diff --git a/src/cpu_map/Makefile.inc.am b/src/cpu_map/Makefile.inc.am index 62403d2ed01..d3ccb880733 100644 --- a/src/cpu_map/Makefile.inc.am +++ b/src/cpu_map/Makefile.inc.am @@ -76,5 +76,3 @@ cpumap_DATA = \ cpu_map/x86_Westmere.xml \ cpu_map/x86_Westmere-IBRS.xml \ $(NULL) - -EXTRA_DIST += $(cpumap_DATA) diff --git a/src/esx/Makefile.inc.am b/src/esx/Makefile.inc.am index d53cef15150..89e7b18d344 100644 --- a/src/esx/Makefile.inc.am +++ b/src/esx/Makefile.inc.am @@ -40,22 +40,10 @@ ESX_DRIVER_GENERATED = \ esx/esx_vi.generated.h \ $(NULL) -ESX_DRIVER_EXTRA_DIST = \ - esx/README \ - esx/esx_vi_generator.input \ - $(NULL) - ESX_GENERATED_STAMP = .esx_vi_generator.stamp DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(ESX_DRIVER_SOURCES)) -EXTRA_DIST += \ - $(ESX_DRIVER_SOURCES) \ - $(ESX_DRIVER_EXTRA_DIST) \ - $(NULL) - -BUILT_SOURCES += $(ESX_DRIVER_GENERATED) - $(ESX_DRIVER_GENERATED): $(ESX_GENERATED_STAMP) $(ESX_GENERATED_STAMP): $(srcdir)/esx/esx_vi_generator.input \ @@ -64,8 +52,6 @@ $(ESX_GENERATED_STAMP): $(srcdir)/esx/esx_vi_generator.input \ $(top_srcdir)/scripts/esx_vi_generator.py \ $(srcdir) $(builddir) && touch $@ -CLEANFILES += $(ESX_DRIVER_GENERATED) $(ESX_GENERATED_STAMP) - if WITH_ESX USED_SYM_FILES += $(srcdir)/libvirt_esx.syms else ! WITH_ESX diff --git a/src/hyperv/Makefile.inc.am b/src/hyperv/Makefile.inc.am index 672b42763ae..6e15f0682d9 100644 --- a/src/hyperv/Makefile.inc.am +++ b/src/hyperv/Makefile.inc.am @@ -21,19 +21,8 @@ HYPERV_DRIVER_GENERATED = \ HYPERV_GENERATED_STAMP = .hyperv_wmi_generator.stamp -HYPERV_DRIVER_EXTRA_DIST = \ - hyperv/hyperv_wmi_generator.input \ - $(NULL) - DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(HYPERV_DRIVER_SOURCES)) -EXTRA_DIST += \ - $(HYPERV_DRIVER_SOURCES) \ - $(HYPERV_DRIVER_EXTRA_DIST) \ - $(NULL) - -BUILT_SOURCES += $(HYPERV_DRIVER_GENERATED) - $(HYPERV_DRIVER_GENERATED): $(HYPERV_GENERATED_STAMP) $(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \ @@ -42,8 +31,6 @@ $(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \ $(top_srcdir)/scripts/hyperv_wmi_generator.py $(srcdir) $(builddir) \ && touch $@ -CLEANFILES += $(HYPERV_DRIVER_GENERATED) $(HYPERV_GENERATED_STAMP) - if WITH_HYPERV noinst_LTLIBRARIES += libvirt_driver_hyperv.la libvirt_la_BUILT_LIBADD += libvirt_driver_hyperv.la diff --git a/src/interface/Makefile.inc.am b/src/interface/Makefile.inc.am index 46a43e61db1..deff49fa65d 100644 --- a/src/interface/Makefile.inc.am +++ b/src/interface/Makefile.inc.am @@ -12,12 +12,6 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(INTERFACE_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(INTERFACE_DRIVER_SOURCES)) -EXTRA_DIST += \ - $(INTERFACE_DRIVER_SOURCES) \ - $(INTERFACE_DRIVER_NETCF_SOURCES) \ - $(INTERFACE_DRIVER_UDEV_SOURCES) \ - $(NULL) - if WITH_INTERFACE mod_LTLIBRARIES += libvirt_driver_interface.la libvirt_driver_interface_la_CFLAGS = \ @@ -49,7 +43,6 @@ sbin_PROGRAMS += virtinterfaced nodist_conf_DATA += interface/virtinterfaced.conf augeas_DATA += interface/virtinterfaced.aug augeastest_DATA += interface/test_virtinterfaced.aug -CLEANFILES += interface/virtinterfaced.aug virtinterfaced_SOURCES = $(REMOTE_DAEMON_SOURCES) nodist_virtinterfaced_SOURCES = $(REMOTE_DAEMON_GENERATED) diff --git a/src/libxl/Makefile.inc.am b/src/libxl/Makefile.inc.am index 9037ba61ef3..db1f51e3ef8 100644 --- a/src/libxl/Makefile.inc.am +++ b/src/libxl/Makefile.inc.am @@ -24,9 +24,6 @@ LIBXL_DRIVER_SOURCES = \ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(LIBXL_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(LIBXL_DRIVER_SOURCES)) -EXTRA_DIST += \ - $(LIBXL_DRIVER_SOURCES) \ - $(NULL) if WITH_LIBXL noinst_LTLIBRARIES += libvirt_driver_libxl_impl.la @@ -60,7 +57,6 @@ sbin_PROGRAMS += virtxend nodist_conf_DATA += libxl/virtxend.conf augeas_DATA += libxl/virtxend.aug augeastest_DATA += libxl/test_virtxend.aug -CLEANFILES += libxl/virtxend.aug virtxend_SOURCES = $(REMOTE_DAEMON_SOURCES) nodist_virtxend_SOURCES = $(REMOTE_DAEMON_GENERATED) @@ -155,9 +151,3 @@ uninstall-data-libxl: rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||: endif WITH_LIBXL - -EXTRA_DIST += \ - libxl/libxl.conf \ - libxl/libvirtd_libxl.aug \ - libxl/test_libvirtd_libxl.aug.in \ - $(NULL) diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index ab01d8e0482..ab0822dda35 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -41,32 +41,6 @@ LOCK_DAEMON_SOURCES = \ locking/lock_daemon_dispatch.h \ $(NULL) -EXTRA_DIST += \ - $(LOCK_PROTOCOL) \ - $(LOCK_DAEMON_SOURCES) \ - $(LOCK_DRIVER_LOCKD_SOURCES) \ - $(LOCK_DRIVER_SOURCES) \ - locking/sanlock.conf \ - locking/libvirt_sanlock.aug \ - locking/test_libvirt_sanlock.aug.in \ - locking/lockd.conf \ - locking/libvirt_lockd.aug \ - locking/test_libvirt_lockd.aug.in \ - locking/virtlockd.aug \ - locking/virtlockd.conf \ - locking/test_virtlockd.aug.in \ - $(NULL) - -BUILT_SOURCES += \ - $(LOCK_PROTOCOL_GENERATED) \ - $(LOCK_DAEMON_GENERATED) \ - $(NULL) - -CLEANFILES += \ - $(LOCK_PROTOCOL_GENERATED) \ - $(LOCK_DAEMON_GENERATED) \ - $(NULL) - RPC_PROBE_FILES += $(srcdir)/locking/lock_protocol.x SYSCONF_FILES += locking/virtlockd.sysconf diff --git a/src/logging/Makefile.inc.am b/src/logging/Makefile.inc.am index 873e6029dd5..74987c63845 100644 --- a/src/logging/Makefile.inc.am +++ b/src/logging/Makefile.inc.am @@ -27,22 +27,6 @@ LOG_DAEMON_SOURCES = \ LOG_PROTOCOL = $(srcdir)/logging/log_protocol.x -EXTRA_DIST += \ - $(LOG_PROTOCOL) \ - $(LOG_DAEMON_SOURCES) \ - logging/virtlogd.aug \ - logging/virtlogd.conf \ - logging/test_virtlogd.aug.in \ - $(NULL) -BUILT_SOURCES += \ - $(LOG_PROTOCOL_GENERATED) \ - $(LOG_DAEMON_GENERATED) \ - $(NULL) -CLEANFILES += \ - $(LOG_PROTOCOL_GENERATED) \ - $(LOG_DAEMON_GENERATED) \ - $(NULL) - SYSCONF_FILES += logging/virtlogd.sysconf VIRTLOGD_UNIT_FILES_IN = \ diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am index b8c2e1eb3db..c9201110071 100644 --- a/src/lxc/Makefile.inc.am +++ b/src/lxc/Makefile.inc.am @@ -66,14 +66,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ $(LXC_MONITOR_PROTOCOL_GENERATED) \ $(LXC_MONITOR_GENERATED) \ $(addprefix $(srcdir)/,$(LXC_DRIVER_SOURCES)) -EXTRA_DIST += \ - $(LXC_DRIVER_SOURCES) \ - $(LXC_MONITOR_PROTOCOL) \ - $(LXC_CONTROLLER_SOURCES) \ - $(NULL) - -BUILT_SOURCES += $(LXC_GENERATED) -CLEANFILES += $(LXC_GENERATED) if WITH_LXC @@ -124,7 +116,6 @@ sbin_PROGRAMS += virtlxcd nodist_conf_DATA += lxc/virtlxcd.conf augeas_DATA += lxc/virtlxcd.aug augeastest_DATA += lxc/test_virtlxcd.aug -CLEANFILES += lxc/virtlxcd.aug virtlxcd_SOURCES = $(REMOTE_DAEMON_SOURCES) nodist_virtlxcd_SOURCES = $(REMOTE_DAEMON_GENERATED) @@ -285,9 +276,3 @@ lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \ install-data-lxc \ uninstall-data-lxc \ $(NULL) - -EXTRA_DIST += \ - lxc/lxc.conf \ - lxc/libvirtd_lxc.aug \ - lxc/test_libvirtd_lxc.aug.in \ - $(NULL) diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am index 196a30e16cd..9a1a3717073 100644 --- a/src/network/Makefile.inc.am +++ b/src/network/Makefile.inc.am @@ -20,12 +20,6 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(NETWORK_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(NETWORK_DRIVER_SOURCES)) -EXTRA_DIST += \ - $(NETWORK_DRIVER_SOURCES) \ - $(NETWORK_DRIVER_PLATFORM_INC) \ - $(NETWORK_LEASES_HELPER_SOURCES) \ - $(NULL) - if WITH_NETWORK @@ -57,7 +51,6 @@ sbin_PROGRAMS += virtnetworkd nodist_conf_DATA += network/virtnetworkd.conf augeas_DATA += network/virtnetworkd.aug augeastest_DATA += network/test_virtnetworkd.aug -CLEANFILES += network/virtnetworkd.aug virtnetworkd_SOURCES = $(REMOTE_DAEMON_SOURCES) nodist_virtnetworkd_SOURCES = $(REMOTE_DAEMON_GENERATED) @@ -189,8 +182,6 @@ endif WITH_FIREWALLD_ZONE endif WITH_NETWORK -EXTRA_DIST += network/default.xml network/libvirt.zone - .PHONY: \ install-data-network \ uninstall-data-network \ diff --git a/src/node_device/Makefile.inc.am b/src/node_device/Makefile.inc.am index f0f419317f9..8a8bbea01e9 100644 --- a/src/node_device/Makefile.inc.am +++ b/src/node_device/Makefile.inc.am @@ -25,12 +25,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(NODE_DEVICE_DRIVER_SOURCES)) \ $(NULL) -EXTRA_DIST += \ - $(NODE_DEVICE_DRIVER_SOURCES) \ - $(NODE_DEVICE_DRIVER_HAL_SOURCES) \ - $(NODE_DEVICE_DRIVER_UDEV_SOURCES) \ - $(NULL) - if WITH_NODE_DEVICES # Needed to keep automake quiet about conditionals @@ -75,7 +69,6 @@ sbin_PROGRAMS += virtnodedevd nodist_conf_DATA += node_device/virtnodedevd.conf augeas_DATA += node_device/virtnodedevd.aug augeastest_DATA += node_device/test_virtnodedevd.aug -CLEANFILES += node_device/virtnodedevd.aug virtnodedevd_SOURCES = $(REMOTE_DAEMON_SOURCES) nodist_virtnodedevd_SOURCES = $(REMOTE_DAEMON_GENERATED) diff --git a/src/nwfilter/Makefile.inc.am b/src/nwfilter/Makefile.inc.am index 20db8090e06..758370e1a74 100644 --- a/src/nwfilter/Makefile.inc.am +++ b/src/nwfilter/Makefile.inc.am @@ -2,8 +2,6 @@ NWFILTER_XML_FILES = $(wildcard $(srcdir)/nwfilter/xml/*.xml) -EXTRA_DIST += $(NWFILTER_XML_FILES) - NWFILTER_DRIVER_SOURCES = \ nwfilter/nwfilter_driver.h \ nwfilter/nwfilter_driver.c \ @@ -22,8 +20,6 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(NWFILTER_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(NWFILTER_DRIVER_SOURCES)) -EXTRA_DIST += $(NWFILTER_DRIVER_SOURCES) - if WITH_NWFILTER nwfilterxmldir = $(sysconfdir)/libvirt/nwfilter @@ -58,7 +54,6 @@ sbin_PROGRAMS += virtnwfilterd nodist_conf_DATA += nwfilter/virtnwfilterd.conf augeas_DATA += nwfilter/virtnwfilterd.aug augeastest_DATA += nwfilter/test_virtnwfilterd.aug -CLEANFILES += nwfilter/virtnwfilterd.aug virtnwfilterd_SOURCES = $(REMOTE_DAEMON_SOURCES) nodist_virtnwfilterd_SOURCES = $(REMOTE_DAEMON_GENERATED) diff --git a/src/openvz/Makefile.inc.am b/src/openvz/Makefile.inc.am index 7ceb4e6095e..65b750b35af 100644 --- a/src/openvz/Makefile.inc.am +++ b/src/openvz/Makefile.inc.am @@ -11,8 +11,6 @@ OPENVZ_DRIVER_SOURCES = \ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(OPENVZ_DRIVER_SOURCES)) -EXTRA_DIST += $(OPENVZ_DRIVER_SOURCES) - if WITH_OPENVZ noinst_LTLIBRARIES += libvirt_driver_openvz.la libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am index 9e1d6192f5e..5aee568ed90 100644 --- a/src/qemu/Makefile.inc.am +++ b/src/qemu/Makefile.inc.am @@ -82,7 +82,6 @@ QEMU_DRIVER_SOURCES = \ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES)) -EXTRA_DIST += $(QEMU_DRIVER_SOURCES) if WITH_QEMU noinst_LTLIBRARIES += libvirt_driver_qemu_impl.la @@ -119,17 +118,9 @@ libvirt_driver_qemu_impl_la_SOURCES = $(QEMU_DRIVER_SOURCES) if WITH_DTRACE_PROBES libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.lo nodist_libvirt_driver_qemu_la_SOURCES = libvirt_qemu_probes.h -BUILT_SOURCES += libvirt_qemu_probes.h tapset_DATA += libvirt_qemu_probes.stp -CLEANFILES += \ - libvirt_qemu_probes.h \ - libvirt_qemu_probes.o \ - libvirt_qemu_probes.lo \ - libvirt_qemu_probes.stp \ - $(NULL) - endif WITH_DTRACE_PROBES sbin_PROGRAMS += virtqemud @@ -137,7 +128,6 @@ sbin_PROGRAMS += virtqemud nodist_conf_DATA += qemu/virtqemud.conf augeas_DATA += qemu/virtqemud.aug augeastest_DATA += qemu/test_virtqemud.aug -CLEANFILES += qemu/virtqemud.aug virtqemud_SOURCES = $(REMOTE_DAEMON_SOURCES) nodist_virtqemud_SOURCES = $(REMOTE_DAEMON_GENERATED) @@ -243,18 +233,8 @@ endif WITH_QEMU uninstall-data-qemu \ $(NULL) -EXTRA_DIST += \ - qemu/qemu.conf \ - qemu/libvirtd_qemu.aug \ - qemu/test_libvirtd_qemu.aug.in \ - qemu/THREADS.txt \ - libvirt_qemu_probes.d \ - $(NULL) - QEMU_SHIM_SOURCES = qemu/qemu_shim.c -EXTRA_DIST += $(QEMU_SHIM_SOURCES) - if WITH_QEMU bin_PROGRAMS += virt-qemu-run diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 80f4aad7828..165a7cced60 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -150,32 +150,6 @@ DRIVER_SOURCE_FILES += \ $(REMOTE_DRIVER_GENERATED) \ $(addprefix $(srcdir)/,$(REMOTE_DRIVER_SOURCES)) -EXTRA_DIST += \ - $(REMOTE_DRIVER_PROTOCOL) \ - $(REMOTE_DRIVER_SOURCES) \ - $(REMOTE_DAEMON_SOURCES) \ - remote/test_libvirtd.aug.in \ - remote/libvirtd.aug.in \ - remote/libvirtd.conf.in \ - remote/libvirtd.policy \ - remote/libvirtd.rules \ - remote/libvirtd.sasl \ - remote/libvirtd.sysctl \ - $(NULL) - -# Needed to build libvirt.pot, so must be listed outside -# the WITH_REMOTE/WITH_LIBVIRTD conditionals -BUILT_SOURCES += \ - $(REMOTE_DRIVER_GENERATED) \ - $(REMOTE_DAEMON_GENERATED) \ - $(NULL) -CLEANFILES += \ - $(REMOTE_DRIVER_GENERATED) \ - $(REMOTE_DAEMON_GENERATED) \ - remote/libvirtd.conf \ - remote/virtproxyd.conf \ - $(NULL) - if WITH_REMOTE noinst_LTLIBRARIES += libvirt_driver_remote.la libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la @@ -230,11 +204,6 @@ nodist_conf_DATA += \ remote/virtproxyd.conf \ $(NULL) -CLEANFILES += \ - remote/libvirtd.aug \ - remote/virtproxyd.aug \ - $(NULL) - libvirtd_SOURCES = $(REMOTE_DAEMON_SOURCES) nodist_libvirtd_SOURCES = $(REMOTE_DAEMON_GENERATED) diff --git a/src/rpc/Makefile.inc.am b/src/rpc/Makefile.inc.am index 0e154d9c69d..fe23b17a62b 100644 --- a/src/rpc/Makefile.inc.am +++ b/src/rpc/Makefile.inc.am @@ -1,12 +1,5 @@ # vim: filetype=automake -EXTRA_DIST += \ - rpc/gendispatch.pl \ - rpc/genprotocol.pl \ - rpc/virnetprotocol.x \ - rpc/virkeepaliveprotocol.x \ - $(NULL) - VIR_NET_RPC_GENERATED = \ rpc/virnetprotocol.h \ rpc/virnetprotocol.c \ @@ -14,9 +7,6 @@ VIR_NET_RPC_GENERATED = \ rpc/virkeepaliveprotocol.c \ $(NULL) -BUILT_SOURCES += $(VIR_NET_RPC_GENERATED) -CLEANFILES += $(VIR_NET_RPC_GENERATED) - noinst_LTLIBRARIES += \ libvirt-net-rpc.la \ libvirt-net-rpc-server.la \ @@ -49,11 +39,6 @@ libvirt_net_rpc_la_SOURCES += \ rpc/virnetsshsession.h \ rpc/virnetsshsession.c \ $(NULL) -else ! WITH_SSH2 -EXTRA_DIST += \ - rpc/virnetsshsession.h \ - rpc/virnetsshsession.c \ - $(NULL) endif ! WITH_SSH2 if WITH_SASL @@ -61,11 +46,6 @@ libvirt_net_rpc_la_SOURCES += \ rpc/virnetsaslcontext.h \ rpc/virnetsaslcontext.c \ $(NULL) -else ! WITH_SASL -EXTRA_DIST += \ - rpc/virnetsaslcontext.h \ - rpc/virnetsaslcontext.c \ - $(NULL) endif ! WITH_SASL if WITH_LIBSSH @@ -73,11 +53,6 @@ libvirt_net_rpc_la_SOURCES += \ rpc/virnetlibsshsession.h \ rpc/virnetlibsshsession.c \ $(NULL) -else ! WITH_LIBSSH -EXTRA_DIST += \ - rpc/virnetlibsshsession.h \ - rpc/virnetlibsshsession.c \ - $(NULL) endif ! WITH_LIBSSH libvirt_net_rpc_la_CFLAGS = \ diff --git a/src/secret/Makefile.inc.am b/src/secret/Makefile.inc.am index a8390f82652..586e6e372fd 100644 --- a/src/secret/Makefile.inc.am +++ b/src/secret/Makefile.inc.am @@ -10,10 +10,6 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(SECRET_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(SECRET_DRIVER_SOURCES)) -EXTRA_DIST += \ - $(SECRET_DRIVER_SOURCES) \ - $(NULL) - if WITH_SECRETS mod_LTLIBRARIES += libvirt_driver_secret.la @@ -35,7 +31,6 @@ sbin_PROGRAMS += virtsecretd nodist_conf_DATA += secret/virtsecretd.conf augeas_DATA += secret/virtsecretd.aug augeastest_DATA += secret/test_virtsecretd.aug -CLEANFILES += secret/virtsecretd.aug virtsecretd_SOURCES = $(REMOTE_DAEMON_SOURCES) nodist_virtsecretd_SOURCES = $(REMOTE_DAEMON_GENERATED) diff --git a/src/security/Makefile.inc.am b/src/security/Makefile.inc.am index 5f2f4c8e2de..871245a035f 100644 --- a/src/security/Makefile.inc.am +++ b/src/security/Makefile.inc.am @@ -48,20 +48,6 @@ security/apparmor/%: $(srcdir)/security/apparmor/%.in -e 's|[@]libexecdir[@]|@libexecdir@|' \ $< > $@ -BUILT_SOURCES += $(SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES) -CLEANFILES += $(SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES) - -EXTRA_DIST += \ - $(SECURITY_DRIVER_SELINUX_SOURCES) \ - $(SECURITY_DRIVER_APPARMOR_SOURCES) \ - $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES) \ - $(SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES_IN) \ - security/apparmor/TEMPLATE.qemu \ - security/apparmor/TEMPLATE.lxc \ - security/apparmor/libvirt-qemu \ - security/apparmor/libvirt-lxc \ - $(NULL) - libvirt_security_manager_la_SOURCES = $(SECURITY_DRIVER_SOURCES) noinst_LTLIBRARIES += libvirt_security_manager.la libvirt_la_BUILT_LIBADD += libvirt_security_manager.la diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index 5e98a7ef5c5..43010ee9664 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -92,25 +92,6 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(STORAGE_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(STORAGE_DRIVER_SOURCES)) -EXTRA_DIST += \ - $(STORAGE_DRIVER_SOURCES) \ - $(STORAGE_DRIVER_FS_SOURCES) \ - $(STORAGE_FILE_FS_SOURCES) \ - $(STORAGE_DRIVER_LVM_SOURCES) \ - $(STORAGE_DRIVER_ISCSI_SOURCES) \ - $(STORAGE_DRIVER_ISCSI_DIRECT_SOURCES) \ - $(STORAGE_DRIVER_SCSI_SOURCES) \ - $(STORAGE_DRIVER_MPATH_SOURCES) \ - $(STORAGE_DRIVER_DISK_SOURCES) \ - $(STORAGE_DRIVER_RBD_SOURCES) \ - $(STORAGE_DRIVER_SHEEPDOG_SOURCES) \ - $(STORAGE_DRIVER_GLUSTER_SOURCES) \ - $(STORAGE_FILE_GLUSTER_SOURCES) \ - $(STORAGE_DRIVER_ZFS_SOURCES) \ - $(STORAGE_DRIVER_VSTORAGE_SOURCES) \ - $(STORAGE_HELPER_DISK_SOURCES) \ - $(NULL) - storagebackenddir = $(libdir)/libvirt/storage-backend storagebackend_LTLIBRARIES = @@ -149,7 +130,6 @@ sbin_PROGRAMS += virtstoraged nodist_conf_DATA += storage/virtstoraged.conf augeas_DATA += storage/virtstoraged.aug augeastest_DATA += storage/test_virtstoraged.aug -CLEANFILES += storage/virtstoraged.aug virtstoraged_SOURCES = $(REMOTE_DAEMON_SOURCES) nodist_virtstoraged_SOURCES = $(REMOTE_DAEMON_GENERATED) diff --git a/src/test/Makefile.inc.am b/src/test/Makefile.inc.am index b84ab520bb6..c209414745e 100644 --- a/src/test/Makefile.inc.am +++ b/src/test/Makefile.inc.am @@ -8,11 +8,6 @@ TEST_DRIVER_ASSETS = test/test-screenshot.png DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(TEST_DRIVER_SOURCES)) -EXTRA_DIST += \ - $(TEST_DRIVER_SOURCES) \ - $(TEST_DRIVER_ASSETS) \ - $(NULL) - if WITH_TEST driver_test_asset_DATA = $(TEST_DRIVER_ASSETS) diff --git a/src/util/Makefile.inc.am b/src/util/Makefile.inc.am index eca7e7e0a1e..ca25f983090 100644 --- a/src/util/Makefile.inc.am +++ b/src/util/Makefile.inc.am @@ -239,11 +239,6 @@ UTIL_SOURCES = \ $(NULL) -EXTRA_DIST += \ - $(srcdir)/keycodemapdb/data/keymaps.csv \ - $(srcdir)/keycodemapdb/tools/keymap-gen \ - $(NULL) - # Sync with docs/ KEYCODES = linux osx atset1 atset2 atset3 xtkbd usb win32 qnum KEYNAMES = linux osx win32 @@ -253,9 +248,6 @@ KEYTABLES = \ $(KEYNAMES:%=util/virkeynametable_%.h) \ $(NULL) -BUILT_SOURCES += $(KEYTABLES) -CLEANFILES += $(KEYTABLES) - UTIL_IO_HELPER_SOURCES = util/iohelper.c noinst_LTLIBRARIES += libvirt_util.la diff --git a/src/vbox/Makefile.inc.am b/src/vbox/Makefile.inc.am index c5c6d538e71..8acbdc84609 100644 --- a/src/vbox/Makefile.inc.am +++ b/src/vbox/Makefile.inc.am @@ -21,21 +21,11 @@ VBOX_DRIVER_SOURCES = \ vbox/vbox_XPCOMCGlue.h \ $(NULL) -VBOX_DRIVER_EXTRA_DIST = \ - vbox/vbox_tmpl.c \ - vbox/README \ - $(NULL) - DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(VBOX_DRIVER_SOURCES)) \ $(srcdir)/vbox/vbox_tmpl.c \ $(NULL) -EXTRA_DIST += \ - $(VBOX_DRIVER_SOURCES) \ - $(VBOX_DRIVER_EXTRA_DIST) \ - $(NULL) - if WITH_VBOX noinst_LTLIBRARIES += libvirt_driver_vbox_impl.la libvirt_driver_vbox_la_SOURCES = @@ -65,7 +55,6 @@ sbin_PROGRAMS += virtvboxd nodist_conf_DATA += vbox/virtvboxd.conf augeas_DATA += vbox/virtvboxd.aug augeastest_DATA += vbox/test_virtvboxd.aug -CLEANFILES += vbox/virtvboxd.aug virtvboxd_SOURCES = $(REMOTE_DAEMON_SOURCES) nodist_virtvboxd_SOURCES = $(REMOTE_DAEMON_GENERATED) diff --git a/src/vmware/Makefile.inc.am b/src/vmware/Makefile.inc.am index 10057343a6f..3caa6340daf 100644 --- a/src/vmware/Makefile.inc.am +++ b/src/vmware/Makefile.inc.am @@ -9,8 +9,6 @@ VMWARE_DRIVER_SOURCES = \ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(VMWARE_DRIVER_SOURCES)) -EXTRA_DIST += $(VMWARE_DRIVER_SOURCES) - if WITH_VMWARE noinst_LTLIBRARIES += libvirt_driver_vmware.la libvirt_la_BUILT_LIBADD += libvirt_driver_vmware.la diff --git a/src/vmx/Makefile.inc.am b/src/vmx/Makefile.inc.am index 429bdfe51ef..88df423fed5 100644 --- a/src/vmx/Makefile.inc.am +++ b/src/vmx/Makefile.inc.am @@ -5,8 +5,6 @@ VMX_SOURCES = \ vmx/vmx.h \ $(NULL) -EXTRA_DIST += $(VMX_SOURCES) - if WITH_VMX noinst_LTLIBRARIES += libvirt_vmx.la libvirt_la_BUILT_LIBADD += libvirt_vmx.la diff --git a/src/vz/Makefile.inc.am b/src/vz/Makefile.inc.am index f60f73bf06f..7782fd89d75 100644 --- a/src/vz/Makefile.inc.am +++ b/src/vz/Makefile.inc.am @@ -12,7 +12,6 @@ VZ_DRIVER_SOURCES = \ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(VZ_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(VZ_DRIVER_SOURCES)) -EXTRA_DIST += $(VZ_DRIVER_SOURCES) if WITH_VZ @@ -44,7 +43,6 @@ sbin_PROGRAMS += virtvzd nodist_conf_DATA += vz/virtvzd.conf augeas_DATA += vz/virtvzd.aug augeastest_DATA += vz/test_virtvzd.aug -CLEANFILES += vz/virtvzd.aug virtvzd_SOURCES = $(REMOTE_DAEMON_SOURCES) nodist_virtvzd_SOURCES = $(REMOTE_DAEMON_GENERATED) diff --git a/tests/Makefile.am b/tests/Makefile.am index c87b12d28c3..1b384f3d0c2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -74,102 +74,6 @@ LDADDS = \ MOCKLIBS_LIBS = \ ../src/libvirt.la -EXTRA_DIST = \ - .valgrind.supp \ - bhyvexml2argvdata \ - bhyveargv2xmldata \ - bhyvexml2xmloutdata \ - capabilityschemadata \ - commanddata \ - cputestdata \ - domaincapsdata \ - domainbackupxml2xmlin \ - domainbackupxml2xmlout \ - domainconfdata \ - domainschemadata \ - fchostdata \ - genericxml2xmlindata \ - genericxml2xmloutdata \ - interfaceschemadata \ - libxlxml2domconfigdata \ - lxcconf2xmldata \ - lxcxml2xmldata \ - lxcxml2xmloutdata \ - networkxml2confdata \ - networkxml2firewalldata \ - networkxml2xmlin \ - networkxml2xmlout \ - networkxml2xmlupdatein \ - networkxml2xmlupdateout \ - nodedevschemadata \ - nodedevmdevctldata \ - virhostcpudata \ - nssdata \ - nwfilterxml2firewalldata \ - nwfilterxml2xmlin \ - nwfilterxml2xmlout \ - qemuagentdata \ - qemublocktestdata \ - qemucapabilitiesdata \ - qemucaps2xmloutdata \ - qemudomaincheckpointxml2xmlin \ - qemudomaincheckpointxml2xmlout \ - qemudomainsnapshotxml2xmlin \ - qemudomainsnapshotxml2xmlout \ - qemuhotplugtestcpus \ - qemuhotplugtestdevices \ - qemuhotplugtestdomains \ - qemumigparamsdata \ - qemumonitorjsondata \ - qemuxml2argvdata \ - qemuxml2xmloutdata \ - qemustatusxml2xmldata \ - qemumemlockdata \ - qemufirmwaredata \ - qemuvhostuserdata \ - secretxml2xmlin \ - securityselinuxhelperdata \ - securityselinuxlabeldata \ - storagepoolcapsschemadata \ - storagepoolschemadata \ - storagepoolxml2xmlin \ - storagepoolxml2xmlout \ - storagepoolxml2argvdata \ - storagevolschemadata \ - storagevolxml2argvdata \ - storagevolxml2xmlin \ - storagevolxml2xmlout \ - sysinfodata \ - test-lib.sh \ - vboxsnapshotxmldata \ - vircaps2xmldata \ - vircgroupdata \ - virconfdata \ - virfiledata \ - virjsondata \ - virmacmaptestdata \ - virmock.h \ - virmockstathelpers.c \ - virnetdaemondata \ - virnetdevtestdata \ - virnetdevopenvswitchdata \ - virnetworkportxml2xmldata \ - virnwfilterbindingxml2xmldata \ - virpcitestdata \ - virscsidata \ - virsh-uriprecedence \ - virusbtestdata \ - vmwareverdata \ - vmx2xmldata \ - xlconfigdata \ - xmconfigdata \ - xml2vmxdata \ - virsh-auth.xml \ - virstorageutildata \ - virfilecachedata \ - virresctrldata \ - $(NULL) - test_helpers = commandhelper ssh test_programs = virshtest sockettest \ virhostcputest virbuftest \ @@ -437,8 +341,6 @@ test_programs += \ eventtest \ virdrivermoduletest \ virdriverconnvalidatetest -else ! WITH_LIBVIRTD -EXTRA_DIST += $(libvirtd_test_scripts) endif ! WITH_LIBVIRTD test_programs += objecteventtest @@ -448,9 +350,6 @@ if WITH_LIBVIRTD test_scripts += virt-aa-helper-test endif WITH_LIBVIRTD endif WITH_SECDRIVER_APPARMOR -EXTRA_DIST += virt-aa-helper-test - -EXTRA_DIST += $(test_scripts) if WITH_LINUX check-access: file-access-clean @@ -463,9 +362,6 @@ file-access-clean: > test_file_access.txt endif WITH_LINUX -EXTRA_DIST += \ - permitted_file_access.txt - if WITH_TESTS noinst_PROGRAMS = $(test_programs) $(test_helpers) noinst_LTLIBRARIES = $(test_libraries) @@ -533,10 +429,6 @@ libxlmock_la_SOURCES = \ libxlmock_la_CFLAGS = $(LIBXL_CFLAGS) $(LIBXML_CFLAGS) $(GLIB_CFLAGS) libxlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) libxlmock_la_LIBADD = $(MOCKLIBS_LIBS) - -else ! WITH_LIBXL -EXTRA_DIST += xlconfigtest.c \ - xmconfigtest.c libxlxml2domconfigtest.c endif ! WITH_LIBXL QEMUMONITORTESTUTILS_SOURCES = \ @@ -707,24 +599,6 @@ qemuvhostusertest_SOURCES = \ virfilewrapper.c virfilewrapper.h \ $(NULL) qemuvhostusertest_LDADD = $(qemu_LDADDS) - -else ! WITH_QEMU -EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c \ - qemudomaincheckpointxml2xmltest.c qemudomainsnapshotxml2xmltest.c \ - testutilsqemu.c testutilsqemu.h \ - testutilsqemuschema.c testutilsqemuschema.h \ - qemumonitorjsontest.c qemuhotplugtest.c \ - qemuagenttest.c qemucapabilitiestest.c \ - qemucaps2xmltest.c qemucommandutiltest.c \ - qemumemlocktest.c qemucpumock.c testutilshostcpus.h \ - qemublocktest.c \ - qemumigparamstest.c \ - qemusecuritytest.c qemusecuritytest.h \ - qemusecuritymock.c \ - qemufirmwaretest.c \ - qemuvhostusertest.c \ - qemuhotplugmock.c \ - $(QEMUMONITORTESTUTILS_SOURCES) endif ! WITH_QEMU if WITH_LXC @@ -743,8 +617,6 @@ lxcconf2xmltest_SOURCES = \ lxcconf2xmltest.c testutilslxc.c testutilslxc.h \ testutils.c testutils.h lxcconf2xmltest_LDADD = $(lxc_LDADDS) -else ! WITH_LXC -EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h endif ! WITH_LXC if WITH_OPENVZ @@ -753,10 +625,7 @@ openvzutilstest_SOURCES = \ testutils.c testutils.h openvzutilstest_LDADD = $(LDADDS) \ ../src/libvirt_driver_openvz.la -else ! WITH_OPENVZ -EXTRA_DIST += openvzutilstest.c endif ! WITH_OPENVZ -EXTRA_DIST += openvzutilstest.conf if WITH_ESX esxutilstest_SOURCES = \ @@ -766,8 +635,6 @@ esxutilstest_LDADD = $(LDADDS) esxutilstest_CFLAGS = \ -I$(top_builddir)/src/esx \ $(AM_CFLAGS) -else ! WITH_ESX -EXTRA_DIST += esxutilstest.c endif ! WITH_ESX if WITH_VBOX @@ -776,8 +643,6 @@ vboxsnapshotxmltest_SOURCES = \ testutils.c testutils.h vbox_LDADDS = ../src/libvirt_driver_vbox_impl.la vboxsnapshotxmltest_LDADD = $(LDADDS) $(vbox_LDADDS) -else ! WITH_VBOX -EXTRA_DIST += vboxsnapshotxmltest.c endif ! WITH_VBOX if WITH_VMX @@ -790,8 +655,6 @@ xml2vmxtest_SOURCES = \ xml2vmxtest.c \ testutils.c testutils.h xml2vmxtest_LDADD = $(LDADDS) -else ! WITH_VMX -EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c endif ! WITH_VMX if WITH_VMWARE @@ -799,8 +662,6 @@ vmwarevertest_SOURCES = \ vmwarevertest.c \ testutils.c testutils.h vmwarevertest_LDADD = $(LDADDS) -else ! WITH_VMWARE -EXTRA_DIST += vmwarevertest.c endif ! WITH_VMWARE if WITH_BHYVE @@ -832,13 +693,6 @@ bhyveargv2xmltest_SOURCES = \ bhyveargv2xmltest.c \ testutils.c testutils.h bhyveargv2xmltest_LDADD = $(bhyve_LDADDS) -else ! WITH_BHYVE -EXTRA_DIST += \ - bhyvexml2argvtest.c \ - bhyveargv2xmltest.c \ - bhyvexml2xmltest.c \ - bhyvexml2argvmock.c \ - bhyveargv2xmlmock.c endif ! WITH_BHYVE networkxml2xmlupdatetest_SOURCES = \ @@ -866,9 +720,6 @@ networkxml2firewalltest_SOURCES = \ networkxml2firewalltest.c \ testutils.c testutils.h networkxml2firewalltest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS) - -else ! WITH_NETWORK -EXTRA_DIST += networkxml2xmltest.c networkxml2conftest.c endif ! WITH_NETWORK if WITH_STORAGE_SHEEPDOG @@ -879,8 +730,6 @@ storagebackendsheepdogtest_LDADD = \ ../src/libvirt_storage_backend_sheepdog_priv.la \ ../src/libvirt_driver_storage_impl.la \ $(LDADDS) -else ! WITH_STORAGE_SHEEPDOG -EXTRA_DIST += storagebackendsheepdogtest.c endif ! WITH_STORAGE_SHEEPDOG nwfilterxml2xmltest_SOURCES = \ @@ -955,13 +804,6 @@ storagepoolxml2xmltest_LDADD = $(LDADDS) \ storagepoolcapstest_SOURCES = \ storagepoolcapstest.c testutils.h testutils.c storagepoolcapstest_LDADD = $(LDADDS) - -else ! WITH_STORAGE -EXTRA_DIST += storagevolxml2argvtest.c -EXTRA_DIST += virstorageutiltest.c -EXTRA_DIST += storagepoolxml2argvtest.c -EXTRA_DIST += storagepoolxml2xmltest.c -EXTRA_DIST += storagepoolcapstest.c endif ! WITH_STORAGE storagevolxml2xmltest_SOURCES = \ @@ -1137,8 +979,6 @@ virnettlscontexttest_SOURCES += pkix_asn1_tab.c virnettlscontexttest_LDADD += -ltasn1 virnettlssessiontest_SOURCES += pkix_asn1_tab.c virnettlssessiontest_LDADD += -ltasn1 -else ! HAVE_LIBTASN1 -EXTRA_DIST += pkix_asn1_tab.c endif ! HAVE_LIBTASN1 virtimetest_SOURCES = \ @@ -1265,9 +1105,6 @@ libvirfilemock_la_SOURCES = \ virfilemock.c libvirfilemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) libvirfilemock_la_LIBADD = $(MOCKLIBS_LIBS) -else ! WITH_LINUX -EXTRA_DIST += vircaps2xmltest.c virnumamock.c virfilewrapper.c \ - virfilewrapper.h virresctrltest.c virfilemock.c endif ! WITH_LINUX if WITH_NSS @@ -1311,8 +1148,6 @@ nssguestlinktest_CFLAGS = \ -I$(top_srcdir)/tools/nss nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la nssguestlinktest_LDFLAGS = $(NULL) -else ! WITH_NSS -EXTRA_DIST += nsstest.c nssmock.c nsslinktest.c endif ! WITH_NSS libvirdeterministichashmock_la_SOURCES = \ @@ -1334,10 +1169,6 @@ virnetdevopenvswitchtest_LDADD = $(LDADDS) test_programs += \ virmacmaptest \ virnetdevopenvswitchtest -else ! WITH_YAJL -EXTRA_DIST += \ - virmacmaptest.c \ - virnetdevopenvswitchtest.c endif ! WITH_YAJL virnetdevtest_SOURCES = \ @@ -1382,10 +1213,6 @@ libvirtestmock_la_LIBADD = \ $(MOCKLIBS_LIBS) \ $(PROBES_O) \ ../src/libvirt_util.la -else ! WITH_LINUX - EXTRA_DIST += virusbtest.c virusbmock.c \ - virnetdevbandwidthtest.c virnetdevbandwidthmock.c \ - virtestmock.c endif ! WITH_LINUX if WITH_DBUS @@ -1409,9 +1236,6 @@ virsystemdtest_SOURCES = \ virsystemdtest.c testutils.h testutils.c virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS) virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS) - -else ! WITH_DBUS -EXTRA_DIST += virdbustest.c virdbusmock.c virsystemdtest.c endif ! WITH_DBUS viruritest_SOURCES = \ @@ -1458,8 +1282,6 @@ securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \ endif WITH_QEMU endif WITH_ATTR endif WITH_SECDRIVER_SELINUX -EXTRA_DIST += securityselinuxtest.c securityselinuxlabeltest.c \ - securityselinuxhelper.c virbuftest_SOURCES = \ virbuftest.c testutils.h testutils.c @@ -1553,19 +1375,10 @@ fchosttest_LDADD = $(LDADDS) scsihosttest_SOURCES = \ scsihosttest.c testutils.h testutils.c scsihosttest_LDADD = $(LDADDS) - -else ! WITH_LINUX -EXTRA_DIST += fchosttest.c -EXTRA_DIST += scsihosttest.c endif ! WITH_LINUX if WITH_LINUX virscsitest_SOURCES = \ virscsitest.c testutils.h testutils.c virscsitest_LDADD = $(LDADDS) - -else ! WITH_LINUX -EXTRA_DIST += virscsitest.c endif ! WITH_LINUX - -CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda diff --git a/tools/Makefile.am b/tools/Makefile.am index eb8f269b486..0530e439a8b 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -49,24 +49,6 @@ ICON_FILES = \ libvirt_win_icon_64x64.ico \ virsh_win_icon.rc -EXTRA_DIST = \ - $(ICON_FILES) \ - $(conf_DATA) \ - virt-xml-validate.in \ - virt-pki-validate.in \ - virt-sanlock-cleanup.in \ - libvirt-guests.sysconf \ - virt-login-shell.conf \ - virsh-edit.c \ - bash-completion/vsh \ - libvirt_recover_xattrs.sh \ - $(NULL) - - -CLEANFILES = -DISTCLEANFILES = -MAINTAINERCLEANFILES = - confdir = $(sysconfdir)/libvirt conf_DATA = @@ -76,7 +58,6 @@ libexec_SCRIPTS = libvirt-guests.sh if WITH_SANLOCK sbin_SCRIPTS = virt-sanlock-cleanup -DISTCLEANFILES += virt-sanlock-cleanup endif WITH_SANLOCK if WITH_LOGIN_SHELL @@ -139,20 +120,14 @@ VIRT_HOST_VALIDATE_BHYVE = \ virt-host-validate-bhyve.h if WITH_QEMU virt_host_validate_SOURCES += $(VIRT_HOST_VALIDATE_QEMU) -else ! WITH_QEMU -EXTRA_DIST += $(VIRT_HOST_VALIDATE_QEMU) endif ! WITH_QEMU if WITH_LXC virt_host_validate_SOURCES += $(VIRT_HOST_VALIDATE_LXC) -else ! WITH_LXC -EXTRA_DIST += $(VIRT_HOST_VALIDATE_LXC) endif ! WITH_LXC if WITH_BHYVE virt_host_validate_SOURCES += $(VIRT_HOST_VALIDATE_BHYVE) -else ! WITH_BHYVE -EXTRA_DIST += $(VIRT_HOST_VALIDATE_BHYVE) endif ! WITH_BHYVE virt_host_validate_LDFLAGS = \ @@ -260,7 +235,6 @@ virt_admin_LDADD = \ virt_admin_CFLAGS = \ $(AM_CFLAGS) \ $(READLINE_CFLAGS) -BUILT_SOURCES = if WITH_WIN_ICON virsh_LDADD += virsh_win_icon.$(OBJEXT) @@ -303,8 +277,6 @@ uninstall-sysconfig: rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests rmdir $(DESTDIR)$(sysconfdir)/sysconfig ||: -EXTRA_DIST += libvirt-guests.sh.in - libvirt-guests.sh: libvirt-guests.sh.in $(top_builddir)/config.status $(AM_V_GEN)sed \ -e 's|[@]PACKAGE[@]|$(PACKAGE)|g' \ @@ -316,9 +288,7 @@ libvirt-guests.sh: libvirt-guests.sh.in $(top_builddir)/config.status < $< > $@-t && \ chmod a+x $@-t && \ mv $@-t $@ -BUILT_SOURCES += libvirt-guests.sh -EXTRA_DIST += libvirt-guests.service.in SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system if LIBVIRT_INIT_SCRIPT_SYSTEMD @@ -331,8 +301,6 @@ uninstall-systemd: uninstall-sysconfig rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) ||: -BUILT_SOURCES += libvirt-guests.service - else ! LIBVIRT_INIT_SCRIPT_SYSTEMD install-systemd: uninstall-systemd: @@ -372,8 +340,6 @@ uninstall-bash-completion: endif ! WITH_BASH_COMPLETION -EXTRA_DIST += wireshark/util/genxdrstub.pl - if WITH_WIRESHARK_DISSECTOR ws_plugin_LTLIBRARIES = wireshark/src/libvirt.la @@ -514,16 +480,3 @@ lib_LTLIBRARIES = \ nss/libnss_libvirt_guest.la endif WITH_NSS - -EXTRA_DIST += $(LIBVIRT_NSS_SOURCES) \ - $(srcdir)/nss/libvirt_nss.syms \ - $(srcdir)/nss/libvirt_nss_bsd.syms \ - $(srcdir)/nss/libvirt_guest_nss.syms - -clean-local: - -rm -rf wireshark/src/libvirt - -CLEANFILES += $(bin_SCRIPTS) -CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s - -DISTCLEANFILES += $(BUILT_SOURCES) -- 2.26.2

On a Thursday in 2020, Pavel Hrdina wrote:
EXTRA_DIST is not relevant because meson makes a git copy when creating dist archive so everything tracked by git is part of dist tarball.
BUILD_SOURCES is not relevant as all dependencies should be explicitly tracked.
The remaining ones are not converted to meson files as they are automatically tracked by meson.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 62 +---------- docs/Makefile.am | 51 --------- examples/Makefile.am | 8 -- include/libvirt/Makefile.am | 2 - po/Makefile.am | 7 -- src/Makefile.am | 55 ---------- src/access/Makefile.inc.am | 18 --- src/admin/Makefile.inc.am | 12 -- src/bhyve/Makefile.inc.am | 9 -- src/cpu_map/Makefile.inc.am | 2 - src/esx/Makefile.inc.am | 14 --- src/hyperv/Makefile.inc.am | 13 --- src/interface/Makefile.inc.am | 7 -- src/libxl/Makefile.inc.am | 10 -- src/locking/Makefile.inc.am | 26 ----- src/logging/Makefile.inc.am | 16 --- src/lxc/Makefile.inc.am | 15 --- src/network/Makefile.inc.am | 9 -- src/node_device/Makefile.inc.am | 7 -- src/nwfilter/Makefile.inc.am | 5 - src/openvz/Makefile.inc.am | 2 - src/qemu/Makefile.inc.am | 20 ---- src/remote/Makefile.inc.am | 31 ------ src/rpc/Makefile.inc.am | 25 ----- src/secret/Makefile.inc.am | 5 - src/security/Makefile.inc.am | 14 --- src/storage/Makefile.inc.am | 20 ---- src/test/Makefile.inc.am | 5 - src/util/Makefile.inc.am | 8 -- src/vbox/Makefile.inc.am | 11 -- src/vmware/Makefile.inc.am | 2 - src/vmx/Makefile.inc.am | 2 - src/vz/Makefile.inc.am | 2 - tests/Makefile.am | 187 -------------------------------- tools/Makefile.am | 47 -------- 35 files changed, 1 insertion(+), 728 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Building without driver_module is not supported anymore so drop the option before switching to meson as we will not introduce it there. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 1 - m4/virt-driver-modules.m4 | 17 +---------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/configure.ac b/configure.ac index 0ab9bf9721d..97dbfe9ec2b 100644 --- a/configure.ac +++ b/configure.ac @@ -796,7 +796,6 @@ LIBVIRT_WIN_CHECK_WINDRES dnl Driver-Modules library support -LIBVIRT_ARG_DRIVER_MODULES LIBVIRT_CHECK_DRIVER_MODULES diff --git a/m4/virt-driver-modules.m4 b/m4/virt-driver-modules.m4 index 54b75e09739..f7902283884 100644 --- a/m4/virt-driver-modules.m4 +++ b/m4/virt-driver-modules.m4 @@ -17,25 +17,10 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. dnl -AC_DEFUN([LIBVIRT_ARG_DRIVER_MODULES], [ - LIBVIRT_ARG_WITH([DRIVER_MODULES], [build drivers as loadable modules], - [yes]) -]) - AC_DEFUN([LIBVIRT_CHECK_DRIVER_MODULES], [ AC_REQUIRE([LIBVIRT_CHECK_DLOPEN]) - if test "$with_libvirtd" = "no" ; then - with_driver_modules=no - else - if test "$with_driver_modules" = "no"; then - AC_MSG_ERROR([Building without driver modules is not supported anymore]) - fi - - if test "$with_driver_modules" = "check"; then - with_driver_modules=yes - fi - fi + with_driver_modules=$with_libvirtd DRIVER_MODULES_CFLAGS= if test "$with_driver_modules" = "yes"; then -- 2.26.2

On a Thursday in 2020, Pavel Hrdina wrote:
Building without driver_module is not supported anymore so drop the option before switching to meson as we will not introduce it there.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 1 - m4/virt-driver-modules.m4 | 17 +---------------- 2 files changed, 1 insertion(+), 17 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> This can be merged independently, the option is safely ignored. Jano

On Thu, Jul 16, 2020 at 02:55:47PM +0200, Ján Tomko wrote:
On a Thursday in 2020, Pavel Hrdina wrote:
Building without driver_module is not supported anymore so drop the option before switching to meson as we will not introduce it there.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 1 - m4/virt-driver-modules.m4 | 17 +---------------- 2 files changed, 1 insertion(+), 17 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This can be merged independently, the option is safely ignored.
Thanks, some of the cleanup patches can be pushed separately but they may break someone scripts so I would like to push them together with meson where we will definitely break scripts and more. I know that we have no promise to not break build tools but it's nice to avoid it if possible. Pavel

On a Thursday in 2020, Pavel Hrdina wrote:
On Thu, Jul 16, 2020 at 02:55:47PM +0200, Ján Tomko wrote:
On a Thursday in 2020, Pavel Hrdina wrote:
Building without driver_module is not supported anymore so drop the option before switching to meson as we will not introduce it there.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 1 - m4/virt-driver-modules.m4 | 17 +---------------- 2 files changed, 1 insertion(+), 17 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This can be merged independently, the option is safely ignored.
Thanks, some of the cleanup patches can be pushed separately but they may break someone scripts so I would like to push them together with meson where we will definitely break scripts and more.
This one won't break anything though. Jano
I know that we have no promise to not break build tools but it's nice to avoid it if possible.
Pavel

With the switch to meson it should be safe to drop this build option. We don't have any deprecation policy so let's take the opportunity when everything will break current users. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-loader-nvram.m4 | 49 ----------------------------------------- 2 files changed, 52 deletions(-) delete mode 100644 m4/virt-loader-nvram.m4 diff --git a/configure.ac b/configure.ac index 97dbfe9ec2b..23074d3badd 100644 --- a/configure.ac +++ b/configure.ac @@ -515,7 +515,6 @@ LIBVIRT_ARG_NUMAD LIBVIRT_ARG_INIT_SCRIPT 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 @@ -528,7 +527,6 @@ LIBVIRT_CHECK_NUMAD LIBVIRT_CHECK_INIT_SCRIPT 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 @@ -1047,7 +1045,6 @@ LIBVIRT_RESULT_NUMAD LIBVIRT_RESULT_INIT_SCRIPT 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 diff --git a/m4/virt-loader-nvram.m4 b/m4/virt-loader-nvram.m4 deleted file mode 100644 index ed2ae0cf27b..00000000000 --- a/m4/virt-loader-nvram.m4 +++ /dev/null @@ -1,49 +0,0 @@ -dnl The loader:nvram list check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_LOADER_NVRAM], [ - LIBVIRT_ARG_WITH([LOADER_NVRAM], - [Pass list of pairs of <loader>:<nvram> paths. - Both pairs and list items are separated by a colon.], - ['']) -]) - -AC_DEFUN([LIBVIRT_CHECK_LOADER_NVRAM], [ - if test "x$with_loader_nvram" != "xno" && \ - test "x$with_loader_nvram" != "x" ; then - l=$(echo $with_loader_nvram | tr ':' '\n' | wc -l) - if test $(expr $l % 2) -ne 0 ; then - AC_MSG_ERROR([Malformed --with-loader-nvram argument]) - elif test $l -gt 0 ; then - AC_MSG_WARN([Note that --with-loader-nvram is obsolete and will be removed soon]) - fi - AC_DEFINE_UNQUOTED([DEFAULT_LOADER_NVRAM], ["$with_loader_nvram"], - [List of loader:nvram pairs]) - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_LOADER_NVRAM], [ - if test "x$with_loader_nvram" != "xno" && \ - test "x$with_loader_nvram" != "x" ; then - LIBVIRT_RESULT([Loader/NVRAM], [$with_loader_nvram], - [!!! Using this configure option is strongly discouraged !!!]) - else - LIBVIRT_RESULT([Loader/NVRAM], [$with_loader_nvram]) - fi -]) -- 2.26.2

On a Thursday in 2020, Pavel Hrdina wrote:
With the switch to meson it should be safe to drop this build option. We don't have any deprecation policy so let's take the opportunity when everything will break current users.
The commit message does not mention that this option is deprecated or why it's safe to drop it. Also, this is another patch that can be pushed separately.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-loader-nvram.m4 | 49 ----------------------------------------- 2 files changed, 52 deletions(-) delete mode 100644 m4/virt-loader-nvram.m4
diff --git a/configure.ac b/configure.ac index 97dbfe9ec2b..23074d3badd 100644 --- a/configure.ac +++ b/configure.ac @@ -515,7 +515,6 @@ LIBVIRT_ARG_NUMAD LIBVIRT_ARG_INIT_SCRIPT 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 @@ -528,7 +527,6 @@ LIBVIRT_CHECK_NUMAD LIBVIRT_CHECK_INIT_SCRIPT 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 @@ -1047,7 +1045,6 @@ LIBVIRT_RESULT_NUMAD LIBVIRT_RESULT_INIT_SCRIPT 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 diff --git a/m4/virt-loader-nvram.m4 b/m4/virt-loader-nvram.m4 deleted file mode 100644 index ed2ae0cf27b..00000000000 --- a/m4/virt-loader-nvram.m4 +++ /dev/null @@ -1,49 +0,0 @@ -dnl The loader:nvram list check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_LOADER_NVRAM], [ - LIBVIRT_ARG_WITH([LOADER_NVRAM], - [Pass list of pairs of <loader>:<nvram> paths. - Both pairs and list items are separated by a colon.], - ['']) -]) - -AC_DEFUN([LIBVIRT_CHECK_LOADER_NVRAM], [ - if test "x$with_loader_nvram" != "xno" && \ - test "x$with_loader_nvram" != "x" ; then - l=$(echo $with_loader_nvram | tr ':' '\n' | wc -l) - if test $(expr $l % 2) -ne 0 ; then - AC_MSG_ERROR([Malformed --with-loader-nvram argument]) - elif test $l -gt 0 ; then - AC_MSG_WARN([Note that --with-loader-nvram is obsolete and will be removed soon]) - fi - AC_DEFINE_UNQUOTED([DEFAULT_LOADER_NVRAM], ["$with_loader_nvram"], - [List of loader:nvram pairs])
This makes any #ifdef DEFAULT_LOADER_NVRAM dead code. Is libxl okay with this change? There does not seem to be any reading of firmware descriptor files in libxl code. Jano
- fi -]) - -AC_DEFUN([LIBVIRT_RESULT_LOADER_NVRAM], [ - if test "x$with_loader_nvram" != "xno" && \ - test "x$with_loader_nvram" != "x" ; then - LIBVIRT_RESULT([Loader/NVRAM], [$with_loader_nvram], - [!!! Using this configure option is strongly discouraged !!!]) - else - LIBVIRT_RESULT([Loader/NVRAM], [$with_loader_nvram]) - fi -]) -- 2.26.2

On Thu, Jul 16, 2020 at 04:12:31PM +0200, Ján Tomko wrote:
On a Thursday in 2020, Pavel Hrdina wrote:
With the switch to meson it should be safe to drop this build option. We don't have any deprecation policy so let's take the opportunity when everything will break current users.
The commit message does not mention that this option is deprecated or why it's safe to drop it.
Also, this is another patch that can be pushed separately.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-loader-nvram.m4 | 49 ----------------------------------------- 2 files changed, 52 deletions(-) delete mode 100644 m4/virt-loader-nvram.m4
diff --git a/configure.ac b/configure.ac index 97dbfe9ec2b..23074d3badd 100644 --- a/configure.ac +++ b/configure.ac @@ -515,7 +515,6 @@ LIBVIRT_ARG_NUMAD LIBVIRT_ARG_INIT_SCRIPT 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 @@ -528,7 +527,6 @@ LIBVIRT_CHECK_NUMAD LIBVIRT_CHECK_INIT_SCRIPT 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 @@ -1047,7 +1045,6 @@ LIBVIRT_RESULT_NUMAD LIBVIRT_RESULT_INIT_SCRIPT 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 diff --git a/m4/virt-loader-nvram.m4 b/m4/virt-loader-nvram.m4 deleted file mode 100644 index ed2ae0cf27b..00000000000 --- a/m4/virt-loader-nvram.m4 +++ /dev/null @@ -1,49 +0,0 @@ -dnl The loader:nvram list check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_LOADER_NVRAM], [ - LIBVIRT_ARG_WITH([LOADER_NVRAM], - [Pass list of pairs of <loader>:<nvram> paths. - Both pairs and list items are separated by a colon.], - ['']) -]) - -AC_DEFUN([LIBVIRT_CHECK_LOADER_NVRAM], [ - if test "x$with_loader_nvram" != "xno" && \ - test "x$with_loader_nvram" != "x" ; then - l=$(echo $with_loader_nvram | tr ':' '\n' | wc -l) - if test $(expr $l % 2) -ne 0 ; then - AC_MSG_ERROR([Malformed --with-loader-nvram argument]) - elif test $l -gt 0 ; then - AC_MSG_WARN([Note that --with-loader-nvram is obsolete and will be removed soon]) - fi - AC_DEFINE_UNQUOTED([DEFAULT_LOADER_NVRAM], ["$with_loader_nvram"], - [List of loader:nvram pairs])
This makes any #ifdef DEFAULT_LOADER_NVRAM dead code.
Is libxl okay with this change? There does not seem to be any reading of firmware descriptor files in libxl code.
Good point, I'm OK with adding this option into meson as well, it's fairly simple. Michal, what do you think about it? Pavel

On Thu, Jul 16, 2020 at 04:23:31PM +0200, Pavel Hrdina wrote:
On Thu, Jul 16, 2020 at 04:12:31PM +0200, Ján Tomko wrote:
On a Thursday in 2020, Pavel Hrdina wrote:
With the switch to meson it should be safe to drop this build option. We don't have any deprecation policy so let's take the opportunity when everything will break current users.
The commit message does not mention that this option is deprecated or why it's safe to drop it.
Also, this is another patch that can be pushed separately.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-loader-nvram.m4 | 49 ----------------------------------------- 2 files changed, 52 deletions(-) delete mode 100644 m4/virt-loader-nvram.m4
diff --git a/configure.ac b/configure.ac index 97dbfe9ec2b..23074d3badd 100644 --- a/configure.ac +++ b/configure.ac @@ -515,7 +515,6 @@ LIBVIRT_ARG_NUMAD LIBVIRT_ARG_INIT_SCRIPT 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 @@ -528,7 +527,6 @@ LIBVIRT_CHECK_NUMAD LIBVIRT_CHECK_INIT_SCRIPT 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 @@ -1047,7 +1045,6 @@ LIBVIRT_RESULT_NUMAD LIBVIRT_RESULT_INIT_SCRIPT 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 diff --git a/m4/virt-loader-nvram.m4 b/m4/virt-loader-nvram.m4 deleted file mode 100644 index ed2ae0cf27b..00000000000 --- a/m4/virt-loader-nvram.m4 +++ /dev/null @@ -1,49 +0,0 @@ -dnl The loader:nvram list check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_LOADER_NVRAM], [ - LIBVIRT_ARG_WITH([LOADER_NVRAM], - [Pass list of pairs of <loader>:<nvram> paths. - Both pairs and list items are separated by a colon.], - ['']) -]) - -AC_DEFUN([LIBVIRT_CHECK_LOADER_NVRAM], [ - if test "x$with_loader_nvram" != "xno" && \ - test "x$with_loader_nvram" != "x" ; then - l=$(echo $with_loader_nvram | tr ':' '\n' | wc -l) - if test $(expr $l % 2) -ne 0 ; then - AC_MSG_ERROR([Malformed --with-loader-nvram argument]) - elif test $l -gt 0 ; then - AC_MSG_WARN([Note that --with-loader-nvram is obsolete and will be removed soon]) - fi - AC_DEFINE_UNQUOTED([DEFAULT_LOADER_NVRAM], ["$with_loader_nvram"], - [List of loader:nvram pairs])
This makes any #ifdef DEFAULT_LOADER_NVRAM dead code.
Is libxl okay with this change? There does not seem to be any reading of firmware descriptor files in libxl code.
Good point, I'm OK with adding this option into meson as well, it's fairly simple. Michal, what do you think about it?
I think libxl needs to be updated to use the firmware descriptors for the same reason we use them in QEMU. Until that happens though, I think we have to keep the args, as we can't arbitrarily break libxl just because QEMU has been converted. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Thu, Jul 16, 2020 at 03:52:22PM +0100, Daniel P. Berrangé wrote:
On Thu, Jul 16, 2020 at 04:23:31PM +0200, Pavel Hrdina wrote:
On Thu, Jul 16, 2020 at 04:12:31PM +0200, Ján Tomko wrote:
On a Thursday in 2020, Pavel Hrdina wrote:
With the switch to meson it should be safe to drop this build option. We don't have any deprecation policy so let's take the opportunity when everything will break current users.
The commit message does not mention that this option is deprecated or why it's safe to drop it.
Also, this is another patch that can be pushed separately.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-loader-nvram.m4 | 49 ----------------------------------------- 2 files changed, 52 deletions(-) delete mode 100644 m4/virt-loader-nvram.m4
diff --git a/configure.ac b/configure.ac index 97dbfe9ec2b..23074d3badd 100644 --- a/configure.ac +++ b/configure.ac @@ -515,7 +515,6 @@ LIBVIRT_ARG_NUMAD LIBVIRT_ARG_INIT_SCRIPT 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 @@ -528,7 +527,6 @@ LIBVIRT_CHECK_NUMAD LIBVIRT_CHECK_INIT_SCRIPT 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 @@ -1047,7 +1045,6 @@ LIBVIRT_RESULT_NUMAD LIBVIRT_RESULT_INIT_SCRIPT 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 diff --git a/m4/virt-loader-nvram.m4 b/m4/virt-loader-nvram.m4 deleted file mode 100644 index ed2ae0cf27b..00000000000 --- a/m4/virt-loader-nvram.m4 +++ /dev/null @@ -1,49 +0,0 @@ -dnl The loader:nvram list check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_LOADER_NVRAM], [ - LIBVIRT_ARG_WITH([LOADER_NVRAM], - [Pass list of pairs of <loader>:<nvram> paths. - Both pairs and list items are separated by a colon.], - ['']) -]) - -AC_DEFUN([LIBVIRT_CHECK_LOADER_NVRAM], [ - if test "x$with_loader_nvram" != "xno" && \ - test "x$with_loader_nvram" != "x" ; then - l=$(echo $with_loader_nvram | tr ':' '\n' | wc -l) - if test $(expr $l % 2) -ne 0 ; then - AC_MSG_ERROR([Malformed --with-loader-nvram argument]) - elif test $l -gt 0 ; then - AC_MSG_WARN([Note that --with-loader-nvram is obsolete and will be removed soon]) - fi - AC_DEFINE_UNQUOTED([DEFAULT_LOADER_NVRAM], ["$with_loader_nvram"], - [List of loader:nvram pairs])
This makes any #ifdef DEFAULT_LOADER_NVRAM dead code.
Is libxl okay with this change? There does not seem to be any reading of firmware descriptor files in libxl code.
Good point, I'm OK with adding this option into meson as well, it's fairly simple. Michal, what do you think about it?
I think libxl needs to be updated to use the firmware descriptors for the same reason we use them in QEMU. Until that happens though, I think we have to keep the args, as we can't arbitrarily break libxl just because QEMU has been converted.
I did not realize that libxl driver is that behind where we don't even have nvram in libxl.conf so this is basically the only way how to configure firmware for libxl. I'll drop this patch and add that option into Meson. Thanks Pavel

Coverage functionality is provided directly by meson so there is no need to convert it into meson. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/Makefile.am b/Makefile.am index 310a9d90276..fbb3cb09ff1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,9 +16,6 @@ ## License along with this library. If not, see ## <http://www.gnu.org/licenses/>. -LCOV = lcov -GENHTML = genhtml - # when building from tarball -Werror isn't auto enabled # so force it explicitly DISTCHECK_CONFIGURE_FLAGS = --enable-werror @@ -45,17 +42,6 @@ check-local: all tests check-access: all @($(MAKE) $(AM_MAKEFLAGS) -C tests check-access) -cov: - $(MKDIR_P) $(top_builddir)/coverage - $(LCOV) -c -o $(top_builddir)/coverage/libvirt.info.tmp \ - -d $(top_builddir)/src \ - -d $(top_builddir)/tests - $(LCOV) -r $(top_builddir)/coverage/libvirt.info.tmp \ - -o $(top_builddir)/coverage/libvirt.info - rm $(top_builddir)/coverage/libvirt.info.tmp - $(GENHTML) --show-details -t "libvirt" -o $(top_builddir)/coverage \ - --legend $(top_builddir)/coverage/libvirt.info - dist-hook: gen-AUTHORS .PHONY: gen-AUTHORS -- 2.26.2

On a Thursday in 2020, Pavel Hrdina wrote:
Coverage functionality is provided directly by meson so there is no need to convert it into meson.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 14 -------------- 1 file changed, 14 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Rewrite to meson will eliminate most of the Makefile and all of m4 files so there is no need to check them. We still need to ignore mk files otherwise syntax-check.mk would be considered as well. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- build-aux/syntax-check.mk | 58 ++------------------------------------- 1 file changed, 2 insertions(+), 56 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index bf229c42a74..3d7b644f01f 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -785,14 +785,6 @@ sc_spec_indentation: echo '$(ME): skipping test $@: cppi not installed' 1>&2; \ fi -# Nested conditionals are easier to understand if we enforce that endifs -# can be paired back to the if -sc_makefile_conditionals: - @prohibit='(else|endif)($$| *#)' \ - in_vc_files='Makefile\.am' \ - halt='match "if FOO" with "endif FOO" in Makefiles' \ - $(_sc_search_regexp) - # Long lines can be harder to diff; too long, and git send-email chokes. # For now, only enforce line length on files where we have intentionally # fixed things and don't want to regress. @@ -801,10 +793,6 @@ sc_prohibit_long_lines: in_vc_files='\.arg[sv]' \ halt='Wrap long lines in expected output files' \ $(_sc_search_regexp) - @prohibit='.{80}' \ - in_vc_files='Makefile(\.inc)?\.am' \ - halt='Wrap long lines in Makefiles' \ - $(_sc_search_regexp) sc_copyright_format: @require='Copyright .*Red 'Hat', Inc\.' \ @@ -1793,40 +1781,6 @@ sc_const_long_option: halt='add "const" to the above declarations' \ $(_sc_search_regexp) -# Ensure that we use only the standard $(VAR) notation, -# not @...@ in Makefile.am, now that we can rely on automake -# to emit a definition for each substituted variable. -# However, there is still one case in which @VAR@ use is not just -# legitimate, but actually required: when augmenting an automake-defined -# variable with a prefix. For example, gettext uses this: -# MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@ -# otherwise, makeinfo would put German or French (current locale) -# navigation hints in the otherwise-English documentation. -# -# Allow the package to add exceptions via a hook in syntax-check.mk; -# for example, @PRAGMA_SYSTEM_HEADER@ can be permitted by -# setting this to ' && !/PRAGMA_SYSTEM_HEADER/'. -_makefile_at_at_check_exceptions ?= -sc_makefile_at_at_check: - @perl -ne '/\@\w+\@/' \ - -e ' && !/(\w+)\s+=.*\@\1\@$$/' \ - -e ''$(_makefile_at_at_check_exceptions) \ - -e 'and (print "$$ARGV:$$.: $$_"), $$m=1; END {exit !$$m}' \ - $$($(VC_LIST_EXCEPT) | $(GREP) -E '(^|/)(Makefile\.am|[^/]+\.mk)$$') \ - && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || : - -sc_makefile_TAB_only_indentation: - @prohibit='^ [ ]{8}' \ - in_vc_files='akefile|\.mk$$' \ - halt='found TAB-8-space indentation' \ - $(_sc_search_regexp) - -sc_m4_quote_check: - @prohibit='(AC_DEFINE(_UNQUOTED)?|AC_DEFUN)\([^[]' \ - in_vc_files='(^configure\.ac|\.m4)$$' \ - halt='quote the first arg to AC_DEF*' \ - $(_sc_search_regexp) - gen_source_files: $(MAKE) -C src generated-sources @@ -1839,8 +1793,8 @@ perl_translatable_files_list_ = \ -e 'foreach $$file (@ARGV) {' \ -e ' \# Consider only file extensions with one or two letters' \ -e ' $$file =~ /\...?$$/ or next;' \ - -e ' \# Ignore m4 and mk files' \ - -e ' $$file =~ /\.m[4k]$$/ and next;' \ + -e ' \# Ignore mk files' \ + -e ' $$file =~ /\.mk$$/ and next;' \ -e ' \# Ignore a .c or .h file with a corresponding .l or .y file' \ -e ' $$file =~ /(.+)\.[ch]$$/ && (-e "$${1}.l" || -e "$${1}.y")' \ -e ' and next;' \ @@ -1993,12 +1947,6 @@ exclude_file_name_regexp--sc_po_check = ^(docs/|src/rpc/gendispatch\.pl$$|tests/ exclude_file_name_regexp--sc_prohibit_VIR_ERR_NO_MEMORY = \ ^(build-aux/syntax-check\.mk|include/libvirt/virterror\.h|src/remote/remote_daemon_dispatch\.c|src/util/virerror\.c|docs/internals/oomtesting\.html\.in)$$ -exclude_file_name_regexp--sc_makefile_TAB_only_indentation = \ - ^build-aux/syntax-check\.mk$$ - -exclude_file_name_regexp--sc_makefile_at_at_check = \ - ^build-aux/syntax-check\.mk$$ - exclude_file_name_regexp--sc_prohibit_PATH_MAX = \ ^build-aux/syntax-check\.mk$$ @@ -2076,8 +2024,6 @@ exclude_file_name_regexp--sc_size_of_brackets = build-aux/syntax-check\.mk exclude_file_name_regexp--sc_correct_id_types = \ (^src/locking/lock_protocol.x$$) -exclude_file_name_regexp--sc_m4_quote_check = m4/virt-lib.m4 - exclude_file_name_regexp--sc_prohibit_include_public_headers_quote = \ ^(src/internal\.h$$|tools/wireshark/src/packet-libvirt.c$$) -- 2.26.2

On a Thursday in 2020, Pavel Hrdina wrote:
Rewrite to meson will eliminate most of the Makefile and all of m4 files so there is no need to check them.
We still need to ignore mk files otherwise syntax-check.mk would be considered as well.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- build-aux/syntax-check.mk | 58 ++------------------------------------- 1 file changed, 2 insertions(+), 56 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

These will not be ported to meson since the function provided by them is available by meson directly. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-arg.m4 | 154 ------------------ m4/virt-lib.m4 | 386 ---------------------------------------------- m4/virt-result.m4 | 42 ----- 3 files changed, 582 deletions(-) delete mode 100644 m4/virt-arg.m4 delete mode 100644 m4/virt-lib.m4 delete mode 100644 m4/virt-result.m4 diff --git a/m4/virt-arg.m4 b/m4/virt-arg.m4 deleted file mode 100644 index d626d72a6c1..00000000000 --- a/m4/virt-arg.m4 +++ /dev/null @@ -1,154 +0,0 @@ -dnl -dnl virt-arg.m4: Helper macros for adding configure arguments -dnl -dnl Copyright (C) 2012-2014 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 <http://www.gnu.org/licenses/>. -dnl - - -dnl -dnl To be used instead of AC_ARG_WITH -dnl -dnl See LIBVIRT_ARG_WITH_FEATURE if the argument you're adding is going to -dnl be used for switching a feature on and off. -dnl -dnl LIBVIRT_ARG_WITH([CHECK_NAME], [HELP_DESC], [DEFAULT_ACTION]) -dnl -dnl CHECK_NAME: Suffix/prefix used for variables/flags, in uppercase. -dnl HELP_DESC: Description that will appear in configure --help -dnl DEFAULT_ACTION: Default configure action -dnl -dnl LIBVIRT_ARG_WITH([PACKAGER], [Extra packager name], [no]) -dnl LIBVIRT_ARG_WITH([HTML_DIR], [path to base html directory], [$(datadir)/doc]) -dnl -AC_DEFUN([LIBVIRT_ARG_WITH], [ - m4_pushdef([check_name], [$1]) - m4_pushdef([help_desc], [[$2]]) - m4_pushdef([default_action], [$3]) - - m4_pushdef([check_name_lc], m4_tolower(check_name)) - m4_pushdef([check_name_dash], m4_translit(check_name_lc, [_], [-])) - - m4_pushdef([arg_var], [with-]check_name_dash) - m4_pushdef([with_var], [with_]check_name_lc) - - m4_divert_text([DEFAULTS], [with_var][[=]][default_action]) - AC_ARG_WITH([check_name_lc], - [AS_HELP_STRING([[--]arg_var], - ]m4_dquote(help_desc)[[ @<:@default=]]m4_dquote(default_action)[[@:>@])]) - - m4_popdef([with_var]) - m4_popdef([arg_var]) - - m4_popdef([check_name_dash]) - m4_popdef([check_name_lc]) - - m4_popdef([default_action]) - m4_popdef([help_desc]) - m4_popdef([check_name]) -]) - -dnl -dnl To be used instead of AC_ARG_WITH -dnl -dnl The difference between LIBVIRT_ARG_WITH and this macro is that the former -dnl is mostly an enhanced drop-in replacement for AC_ARG_WITH, whereas the -dnl latter is tailored for adding an argument that is going to be used to -dnl switch a feature on and off: as a consequence, it optionally supports -dnl specifying the minimum version for libraries the feature depends on and -dnl automatically builds a suitable description from the feature name. -dnl -dnl LIBVIRT_ARG_WITH_FEATURE([CHECK_NAME], [HELP_NAME], [DEFAULT_ACTION], [MIN_VERSION]) -dnl -dnl CHECK_NAME: Suffix/prefix used for variables/flags, in uppercase. -dnl HELP_NAME: Name that will appear in configure --help -dnl DEFAULT_ACTION: Default configure action -dnl MIN_VERSION: Specify minimal version that will be added to -dnl configure --help (optional) -dnl -dnl LIBVIRT_ARG_WITH_FEATURE([SELINUX], [SeLinux], [check]) -dnl LIBVIRT_ARG_WITH_FEATURE([GLUSTERFS], [glusterfs], [check], [3.4.1]) -dnl -AC_DEFUN([LIBVIRT_ARG_WITH_FEATURE], [ - m4_pushdef([check_name], [$1]) - m4_pushdef([help_name], [[$2]]) - m4_pushdef([default_action], [$3]) - m4_pushdef([min_version], [$4]) - - m4_pushdef([check_name_lc], m4_tolower(check_name)) - m4_pushdef([check_name_dash], m4_translit(check_name_lc, [_], [-])) - - m4_pushdef([arg_var], [with-]check_name_dash) - m4_pushdef([with_var], [with_]check_name_lc) - - m4_pushdef([version_text], m4_ifnblank(min_version, [[ (>= ]]min_version[[)]])) - - m4_divert_text([DEFAULTS], [with_var][[=]][default_action]) - AC_ARG_WITH([check_name_lc], - [AS_HELP_STRING([[--]arg_var], - [with ]]m4_dquote(help_name)m4_dquote(version_text)[[ support @<:@default=]]m4_dquote(default_action)[[@:>@])]) - - m4_popdef([version_text]) - - m4_popdef([with_var]) - m4_popdef([arg_var]) - - m4_popdef([check_name_dash]) - m4_popdef([check_name_lc]) - - m4_popdef([min_version]) - m4_popdef([default_action]) - m4_popdef([help_name]) - m4_popdef([check_name]) -]) - -dnl -dnl To be used instead of AC_ARG_ENABLE -dnl -dnl LIBVIRT_ARG_ENABLE([CHECK_NAME], [HELP_DESC], [DEFAULT_ACTION]) -dnl -dnl CHECK_NAME: Suffix/prefix used for variables/flags, in uppercase. -dnl HELP_DESC: Description that will appear in configure --help -dnl DEFAULT_ACTION: Default configure action -dnl -dnl LIBVIRT_ARG_ENABLE([DEBUG], [enable debugging output], [yes]) -dnl -AC_DEFUN([LIBVIRT_ARG_ENABLE], [ - m4_pushdef([check_name], [$1]) - m4_pushdef([help_desc], [[$2]]) - m4_pushdef([default_action], [$3]) - - m4_pushdef([check_name_lc], m4_tolower(check_name)) - m4_pushdef([check_name_dash], m4_translit(check_name_lc, [_], [-])) - - m4_pushdef([arg_var], [enable-]check_name_dash) - m4_pushdef([enable_var], [enable_]check_name_lc) - - m4_divert_text([DEFAULTS], [enable_var][[=]][default_action]) - AC_ARG_ENABLE([check_name_lc], - [AS_HELP_STRING([[--]arg_var], - ]m4_dquote(help_desc)[[ @<:@default=]]m4_dquote(default_action)[[@:>@])]) - - m4_popdef([enable_var]) - m4_popdef([arg_var]) - - m4_popdef([check_name_dash]) - m4_popdef([check_name_lc]) - - m4_popdef([default_action]) - m4_popdef([help_desc]) - m4_popdef([check_name]) -]) diff --git a/m4/virt-lib.m4 b/m4/virt-lib.m4 deleted file mode 100644 index daa9f801231..00000000000 --- a/m4/virt-lib.m4 +++ /dev/null @@ -1,386 +0,0 @@ -dnl -dnl virt-lib.m4: Helper macros for checking for libraries -dnl -dnl Copyright (C) 2012-2014 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 <http://www.gnu.org/licenses/>. -dnl - - -dnl Probe for existence of libXXXX and set WITH_XXX -dnl config header var, WITH_XXXX make conditional and -dnl with_XXX configure shell var. -dnl -dnl LIBVIRT_CHECK_LIB([CHECK_NAME], [LIBRARY_NAME], -dnl [FUNCTION_NAME], [HEADER_NAME], -dnl [FAIL_ACTION]) -dnl -dnl CHECK_NAME: Suffix/prefix used for variables / flags, in uppercase. -dnl Used to set -dnl config.h: WITH_XXX macro -dnl Makefile: WITH_XXX conditional -dnl Makefile: XXX_CFLAGS, XXX_LIBS variables -dnl configure: --with-xxx argument -dnl configure: with_xxx variable -dnl -dnl LIBRARY_NAME: base name of library to check for eg libXXX.so -dnl FUNCTION_NAME: function to check for in libXXX.so -dnl HEADER_NAME: header file to check for -dnl FAIL_ACTION: overrides the default fail action -dnl -dnl -dnl e.g. -dnl -dnl LIBVIRT_CHECK_LIB([SELINUX], [selinux], -dnl [getfilecon], [selinux/selinux.h]) -dnl LIBVIRT_CHECK_LIB([SANLOCK], [sanlock_client], -dnl [sanlock_init], [sanlock.h]) -dnl LIBVIRT_CHECK_LIB([LIBATTR], [attr], -dnl [getxattr], [attr/attr.h]) -dnl -AC_DEFUN([LIBVIRT_CHECK_LIB],[ - m4_pushdef([check_name], [$1]) - m4_pushdef([library_name], [$2]) - m4_pushdef([function_name], [$3]) - m4_pushdef([header_name], [$4]) - m4_pushdef([fail_action], [$5]) - - m4_pushdef([check_name_lc], m4_tolower(check_name)) - - m4_pushdef([config_var], [WITH_]check_name) - m4_pushdef([make_var], [WITH_]check_name) - m4_pushdef([cflags_var], check_name[_CFLAGS]) - m4_pushdef([libs_var], check_name[_LIBS]) - m4_pushdef([with_var], [with_]check_name_lc) - - old_LIBS=$LIBS - old_CFLAGS=$CFLAGS - cflags_var= - libs_var= - - fail=0 - if test "x$with_var" != "xno" ; then - if test "x$with_var" != "xyes" && test "x$with_var" != "xcheck" ; then - cflags_var="-I$with_var/include" - libs_var="-L$with_var/lib" - fi - CFLAGS="$CFLAGS $cflags_var" - LIBS="$LIBS $libs_var" - AC_CHECK_LIB(library_name, function_name, [],[ - if test "x$with_var" != "xcheck"; then - fail=1 - fi - with_var=no - ]) - if test "$fail" = "0" && test "x$with_var" != "xno" ; then - AC_CHECK_HEADER(header_name, [ - with_var=yes - ],[ - if test "x$with_var" != "xcheck"; then - fail=1 - fi - with_var=no - ]) - fi - fi - - LIBS=$old_LIBS - CFLAGS=$old_CFLAGS - - if test $fail = 1; then - m4_default(fail_action, - [AC_MSG_ERROR([You must install the lib]library_name[ library & headers to compile libvirt])]) - else - if test "x$with_var" = "xyes" ; then - if test "x$libs_var" = 'x' ; then - libs_var="-l[]library_name" - else - libs_var="$libs_var -l[]library_name" - fi - AC_DEFINE_UNQUOTED(config_var, 1, [whether lib]library_name[ is available]) - fi - - AM_CONDITIONAL(make_var, [test "x$with_var" = "xyes"]) - - AC_SUBST(cflags_var) - AC_SUBST(libs_var) - fi - - m4_popdef([with_var]) - m4_popdef([libs_var]) - m4_popdef([cflags_var]) - m4_popdef([make_var]) - m4_popdef([config_var]) - - m4_popdef([check_name_lc]) - - m4_popdef([fail_action]) - m4_popdef([header_name]) - m4_popdef([function_name]) - m4_popdef([library_name]) - m4_popdef([check_name]) -]) - -dnl Probe for existence of libXXXX and set WITH_XXX -dnl config header var, WITH_XXXX make conditional and -dnl with_XXX configure shell var. -dnl -dnl LIBVIRT_CHECK_LIB_ALT([CHECK_NAME], [LIBRARY_NAME], -dnl [FUNCTION_NAME], [HEADER_NAME], -dnl [CHECK_NAME_ALT, [LIBRARY_NAME_ALT], -dnl [FUNCTION_NAME_ALT], [HEADER_NAME_ALT], -dnl [FAIL_ACTION]) -dnl -dnl CHECK_NAME: Suffix/prefix used for variables / flags, in uppercase. -dnl Used to set -dnl config.h: WITH_XXX macro -dnl Makefile: WITH_XXX conditional -dnl Makefile: XXX_CFLAGS, XXX_LIBS variables -dnl configure: --with-xxx argument -dnl configure: with_xxx variable -dnl -dnl LIBRARY_NAME: base name of library to check for eg libXXX.so -dnl FUNCTION_NAME: function to check for in libXXX.so -dnl HEADER_NAME: header file to check for -dnl -dnl CHECK_NAME_ALT: Suffix/prefix used to set additional -dnl variables if alternative check succeeds -dnl config.h: WITH_XXX macro -dnl Makefile: WITH_XXX conditional -dnl NB all vars for CHECK_NAME are also set -dnl LIBRARY_NAME_ALT: alternative library name to check for -dnl FUNCTION_NAME_ALT: alternative function name to check for -dnl HEADER_NAME_ALT: alternative header file to check for -dnl FAIL_ACTION: overrides the default fail action -dnl -dnl e.g. -dnl -dnl LIBVIRT_CHECK_LIB([YAJL], [yajl], -dnl [yajl_parse_complete], [yajl/yajl_common.h], -dnl [YAJL2], [yajl], -dnl [yajl_tree_parse], [yajl/yajl_common.h]) -dnl -AC_DEFUN([LIBVIRT_CHECK_LIB_ALT],[ - m4_pushdef([check_name], [$1]) - m4_pushdef([library_name], [$2]) - m4_pushdef([function_name], [$3]) - m4_pushdef([header_name], [$4]) - m4_pushdef([check_name_alt], [$5]) - m4_pushdef([library_name_alt], [$6]) - m4_pushdef([function_name_alt], [$7]) - m4_pushdef([header_name_alt], [$8]) - m4_pushdef([fail_action], [$9]) - - m4_pushdef([check_name_lc], m4_tolower(check_name)) - - m4_pushdef([config_var], [WITH_]check_name) - m4_pushdef([make_var], [WITH_]check_name) - m4_pushdef([cflags_var], check_name[_CFLAGS]) - m4_pushdef([libs_var], check_name[_LIBS]) - m4_pushdef([with_var], [with_]check_name_lc) - m4_pushdef([config_var_alt], [WITH_]check_name_alt) - m4_pushdef([make_var_alt], [WITH_]check_name_alt) - - old_LIBS=$LIBS - old_CFLAGS=$CFLAGS - cflags_var= - libs_var= - - fail=0 - alt=0 - if test "x$with_var" != "xno" ; then - if test "x$with_var" != "xyes" && test "x$with_var" != "xcheck" ; then - cflags_var="-I$with_var/include" - libs_var="-L$with_var/lib" - fi - CFLAGS="$CFLAGS $cflags_var" - LIBS="$LIBS $libs_var" - AC_CHECK_LIB(library_name, function_name, [],[ - AC_CHECK_LIB(library_name_alt, function_name_alt, [ - alt=1 - ],[ - if test "x$with_var" != "xcheck"; then - fail=1 - fi - with_var=no - ]) - ]) - if test "$fail" = "0" && test "x$with_var" != "xno" ; then - AC_CHECK_HEADER(header_name, [ - with_var=yes - ],[ - AC_CHECK_HEADER(header_name_alt, [ - with_var=yes - ],[ - if test "x$with_var" != "xcheck"; then - fail=1 - fi - with_var=no - ]) - ]) - fi - fi - - LIBS=$old_LIBS - CFLAGS=$old_CFLAGS - - if test $fail = 1; then - m4_default(fail_action, - [AC_MSG_ERROR([You must install the lib]library_name[ library & headers to compile libvirt])]) - else - if test "x$with_var" = "xyes" ; then - if test "x$libs_var" = 'x' ; then - libs_var="-l[]library_name" - else - libs_var="$libs_var -l[]library_name" - fi - - AC_DEFINE_UNQUOTED(config_var, 1, [whether lib]library_name[ is available]) - if test "$alt" = "1" ; then - AC_DEFINE_UNQUOTED(config_var_alt, 1, [whether lib]library_name[ is available]) - fi - fi - - AM_CONDITIONAL(make_var, [test "x$with_var" = "xyes"]) - AM_CONDITIONAL(make_var_alt, [test "x$with_var" = "xyes" && test "$alt" = "1"]) - - AC_SUBST(cflags_var) - AC_SUBST(libs_var) - fi - - m4_popdef([make_var_alt]) - m4_popdef([config_var_alt]) - m4_popdef([with_var]) - m4_popdef([libs_var]) - m4_popdef([cflags_var]) - m4_popdef([make_var]) - m4_popdef([config_var]) - - m4_popdef([check_name_lc]) - - m4_popdef([fail_action]) - m4_popdef([header_name_alt]) - m4_popdef([function_name_alt]) - m4_popdef([library_name_alt]) - m4_popdef([header_name]) - m4_popdef([function_name]) - m4_popdef([library_name]) - m4_popdef([check_name]) -]) - -dnl -dnl Probe for existence of libXXXX and set WITH_XXX -dnl config header var, WITH_XXXX make conditional and -dnl with_XXX configure shell var. -dnl -dnl LIBVIRT_CHECK_PKG([CHECK_NAME], [PC_NAME], [PC_VERSION], -dnl [FAIL_ACTION]) -dnl -dnl CHECK_NAME: Suffix/prefix used for variables / flags, in uppercase. -dnl Used to set -dnl config.h: WITH_XXX macro -dnl Makefile: WITH_XXX conditional -dnl Makefile: XXX_CFLAGS, XXX_LIBS variables -dnl configure: --with-xxx argument -dnl configure: with_xxx variable -dnl PC_NAME: Name of the pkg-config module -dnl PC_VERSION: Version of the pkg-config module -dnl FAIL_ACTION: overrides the default fail action -dnl -dnl eg -dnl -dnl LIBVIRT_CHECK_PKG([NETCF], [netcf], [0.1.4]) -dnl -AC_DEFUN([LIBVIRT_CHECK_PKG],[ - m4_pushdef([check_name], [$1]) - m4_pushdef([pc_name], [$2]) - m4_pushdef([pc_version], [$3]) - m4_pushdef([fail_action], [$4]) - - m4_pushdef([check_name_lc], m4_tolower(check_name)) - - m4_pushdef([config_var], [WITH_]check_name) - m4_pushdef([make_var], [WITH_]check_name) - m4_pushdef([cflags_var], check_name[_CFLAGS]) - m4_pushdef([libs_var], check_name[_LIBS]) - m4_pushdef([with_var], [with_]check_name_lc) - - fail=0 - if test "x$with_var" != "xno" ; then - PKG_CHECK_MODULES(check_name, pc_name[ >= ]pc_version, [ - with_var=yes - ],[ - if test "x$with_var" != "xcheck"; then - fail=1 - fi - with_var=no - ]) - fi - - if test $fail = 1; then - m4_default(fail_action, - [AC_MSG_ERROR([You must install the ]pc_name[ >= ]pc_version[ pkg-config module to compile libvirt])]) - fi - - if test "x$with_var" = "xyes" ; then - AC_DEFINE_UNQUOTED(config_var, 1, [whether ]pc_name[ >= ]pc_version[ is available]) - fi - - AM_CONDITIONAL(make_var, [test "x$with_var" = "xyes"]) - - m4_popdef([with_var]) - m4_popdef([libs_var]) - m4_popdef([cflags_var]) - m4_popdef([make_var]) - m4_popdef([config_var]) - - m4_popdef([check_name_lc]) - - m4_popdef([fail_action]) - m4_popdef([pc_version]) - m4_popdef([pc_name]) - m4_popdef([check_name]) -]) - -dnl -dnl To be used after a call to LIBVIRT_CHECK_LIB, -dnl LIBVIRT_CHECK_LIB_ALT or LIBVIRT_CHECK_PKG -dnl to print the result status -dnl -dnl LIBVIRT_RESULT_LIB([CHECK_NAME]) -dnl -dnl CHECK_NAME: Suffix/prefix used for variables / flags, in uppercase. -dnl -dnl LIBVIRT_RESULT_LIB([SELINUX]) -dnl -AC_DEFUN([LIBVIRT_RESULT_LIB],[ - m4_pushdef([check_name], [$1]) - - m4_pushdef([check_name_lc], m4_tolower(check_name)) - - m4_pushdef([cflags_var], check_name[_CFLAGS]) - m4_pushdef([libs_var], check_name[_LIBS]) - m4_pushdef([with_var], [with_]check_name_lc) - - LIBVIRT_RESULT(check_name_lc, [$with_var], [CFLAGS='$cflags_var' LIBS='$libs_var']) - - m4_popdef([with_var]) - m4_popdef([libs_var]) - m4_popdef([cflags_var]) - - m4_popdef([check_name_lc]) - - m4_popdef([check_name]) -]) diff --git a/m4/virt-result.m4 b/m4/virt-result.m4 deleted file mode 100644 index 36973ba0b54..00000000000 --- a/m4/virt-result.m4 +++ /dev/null @@ -1,42 +0,0 @@ -dnl -dnl virt-result.m4: Helper macros for checking for libraries -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -dnl -dnl To be used to print the results of a conditional test -dnl -dnl LIBVIRT_RESULT(CHECK_NAME, STATUS, DETAILS) -dnl -dnl CHECK_NAME: Name of the item being checked -dnl STATUS: 'yes' or 'no' result of check -dnl DETAILS: Details of result eg compiler flags -dnl -dnl eg -dnl -dnl LIBVIRT_RESULT([yajl], [yes], [-I/opt/yajl/include -lyajl]) -dnl -AC_DEFUN([LIBVIRT_RESULT], [ - if test "$2" = "no" || test -z "$3" ; then - STR=`printf "%20s: %s" "$1" "$2"` - else - STR=`printf "%20s: %s (%s)" "$1" "$2" "$3"` - fi - - AC_MSG_NOTICE([$STR]) -]) -- 2.26.2

On a Thursday in 2020, Pavel Hrdina wrote:
These will not be ported to meson since the function provided by them is available by meson directly.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-arg.m4 | 154 ------------------ m4/virt-lib.m4 | 386 ---------------------------------------------- m4/virt-result.m4 | 42 ----- 3 files changed, 582 deletions(-) delete mode 100644 m4/virt-arg.m4 delete mode 100644 m4/virt-lib.m4 delete mode 100644 m4/virt-result.m4
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

With meson we no longer have .libs directory with the actual binary so we have to take a different approach to detect if running from build directory. This is not as robust as for autotools because if you select --prefix in the build directory it will incorrectly enable the override as well but nobody should do that. We have to modify some of the tests to not add current build path into PATH variable and use the full path for virsh instead. Otherwise it would be impossible to figure out that we are running virsh from build directory. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/util/virfile.c | 34 ++++++++++++++++++------- tests/virsh-optparse | 58 +++++++++++++++++++------------------------ tests/virsh-schedinfo | 12 +++------ 3 files changed, 54 insertions(+), 50 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 213acdbcaa2..4542a38278e 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -1781,21 +1781,37 @@ virFileFindResource(const char *filename, * virFileActivateDirOverrideForProg: * @argv0: argv[0] of the calling program * - * Look at @argv0 and try to detect if running from - * a build directory, by looking for a 'lt-' prefix - * on the binary name, or '/.libs/' in the path + * Combine $PWD and @argv0, canonicalize it and check if abs_top_builddir + * matches as prefix in the path. */ void virFileActivateDirOverrideForProg(const char *argv0) { - char *file = strrchr(argv0, '/'); - if (!file || file[1] == '\0') + const char *pwd = g_getenv("PWD"); + g_autofree char *fullPath = NULL; + g_autofree char *canonPath = NULL; + const char *path = NULL; + + if (!pwd) return; - file++; - if (STRPREFIX(file, "lt-") || - strstr(argv0, "/.libs/")) { + + if (argv0[0] != '/') { + fullPath = g_strdup_printf("%s/%s", pwd, argv0); + canonPath = virFileCanonicalizePath(fullPath); + + if (!canonPath) { + VIR_DEBUG("Failed to get canonicalized path errno=%d", errno); + return; + } + + path = canonPath; + } else { + path = argv0; + } + + if (STRPREFIX(path, abs_top_builddir)) { useDirOverride = true; - VIR_DEBUG("Activating build dir override for %s", argv0); + VIR_DEBUG("Activating build dir override for %s", path); } } diff --git a/tests/virsh-optparse b/tests/virsh-optparse index d9c8f3c731b..fed71a8509e 100755 --- a/tests/virsh-optparse +++ b/tests/virsh-optparse @@ -21,17 +21,11 @@ test_expensive -# If $abs_top_builddir/tools is not early in $PATH, put it there, -# so that we can safely invoke "virsh" simply with its name. -case $PATH in - $abs_top_builddir/tools/src:$abs_top_builddir/tools:*) ;; - $abs_top_builddir/tools:*) ;; - *) PATH=$abs_top_builddir/tools:$PATH; export PATH ;; -esac +VIRSH=$abs_top_builddir/tools/virsh if test "$VERBOSE" = yes; then set -x - virsh --version + $VIRSH --version fi cat <<\EOF > exp-out || framework_failure @@ -63,7 +57,7 @@ for args in \ '--count 2 test' \ '--count=2 test' \ ; do - virsh -k0 -d0 -c $test_url setvcpus $args >out 2>>err || fail=1 + $VIRSH -k0 -d0 -c $test_url setvcpus $args >out 2>>err || fail=1 LC_ALL=C sort out | compare exp-out - || fail=1 done @@ -81,7 +75,7 @@ cat <<\EOF > exp-out || framework_failure </domainsnapshot> EOF -virsh -q -c $test_url snapshot-create-as --print-xml test \ +$VIRSH -q -c $test_url snapshot-create-as --print-xml test \ --diskspec 'vda,file=a&b,,c,snapshot=external' --description '1<2' \ --diskspec vdb --memspec file=d,,e >out 2>>err || fail=1 compare exp-out out || fail=1 @@ -96,7 +90,7 @@ cat <<\EOF > exp-out || framework_failure </domainsnapshot> EOF -virsh -q -c $test_url snapshot-create-as --print-xml test name vda vdb \ +$VIRSH -q -c $test_url snapshot-create-as --print-xml test name vda vdb \
out 2>>err || fail=1 compare exp-out out || fail=1
@@ -120,7 +114,7 @@ for args in \ '--description desc --name name --domain test vda vdb' \ '--description desc --diskspec vda --name name --domain test vdb' \ ; do - virsh -q -c $test_url snapshot-create-as --print-xml $args \ + $VIRSH -q -c $test_url snapshot-create-as --print-xml $args \ >out 2>>err || fail=1 compare exp-out out || fail=1 done @@ -131,7 +125,7 @@ test -s err && fail=1 cat <<\EOF > exp-err || framework_failure error: this function is not supported by the connection driver: virDomainQemuMonitorCommand EOF -virsh -q -c $test_url qemu-monitor-command test a >out 2>err && fail=1 +$VIRSH -q -c $test_url qemu-monitor-command test a >out 2>err && fail=1 test -s out && fail=1 compare exp-err err || fail=1 @@ -141,7 +135,7 @@ compare exp-err err || fail=1 cat <<\EOF > exp-err || framework_failure error: Numeric value 'abc' for <start> option is malformed or out of range EOF -virsh -q -c $test_url cpu-stats test --start abc >out 2>err && fail=1 +$VIRSH -q -c $test_url cpu-stats test --start abc >out 2>err && fail=1 test -s out && fail=1 compare exp-err err || fail=1 @@ -149,7 +143,7 @@ compare exp-err err || fail=1 cat <<\EOF > exp-err || framework_failure error: Numeric value '42WB' for <start> option is malformed or out of range EOF -virsh -q -c $test_url cpu-stats test --start 42WB >out 2>err && fail=1 +$VIRSH -q -c $test_url cpu-stats test --start 42WB >out 2>err && fail=1 test -s out && fail=1 compare exp-err err || fail=1 @@ -158,7 +152,7 @@ compare exp-err err || fail=1 cat <<\EOF > exp-err || framework_failure error: Numeric value '42MB' for <start> option is malformed or out of range EOF -virsh -q -c $test_url cpu-stats test --start 42MB >out 2>err && fail=1 +$VIRSH -q -c $test_url cpu-stats test --start 42MB >out 2>err && fail=1 test -s out && fail=1 compare exp-err err || fail=1 @@ -166,7 +160,7 @@ compare exp-err err || fail=1 cat <<\EOF > exp-err || framework_failure error: Numeric value '2147483648' for <start> option is malformed or out of range EOF -virsh -q -c $test_url cpu-stats test --start 2147483648 >out 2>err && fail=1 +$VIRSH -q -c $test_url cpu-stats test --start 2147483648 >out 2>err && fail=1 test -s out && fail=1 compare exp-err err || fail=1 @@ -175,7 +169,7 @@ compare exp-err err || fail=1 cat <<\EOF > exp-err || framework_failure error: Invalid value for start CPU EOF -virsh -q -c $test_url cpu-stats test --start -1 >out 2>err && fail=1 +$VIRSH -q -c $test_url cpu-stats test --start -1 >out 2>err && fail=1 test -s out && fail=1 compare exp-err err || fail=1 @@ -185,7 +179,7 @@ compare exp-err err || fail=1 cat <<\EOF > exp-err || framework_failure error: Scaled numeric value 'abc' for <size> option is malformed or out of range EOF -virsh -q -c $test_url setmaxmem test abc >out 2>err && fail=1 +$VIRSH -q -c $test_url setmaxmem test abc >out 2>err && fail=1 test -s out && fail=1 compare exp-err err || fail=1 @@ -194,18 +188,18 @@ cat <<\EOF > exp-err || framework_failure error: Scaled numeric value '42WB' for <size> option is malformed or out of range error: invalid argument: unknown suffix 'WB' EOF -virsh -q -c $test_url setmaxmem test 42WB >out 2>err && fail=1 +$VIRSH -q -c $test_url setmaxmem test 42WB >out 2>err && fail=1 test -s out && fail=1 compare exp-err err || fail=1 # Numeric value with valid suffix -virsh -q -c $test_url setmaxmem test 42MB --config >out 2>err || fail=1 +$VIRSH -q -c $test_url setmaxmem test 42MB --config >out 2>err || fail=1 test -s out && fail=1 test -s err && fail=1 # Numeric value bigger than INT_MAX. No failure here because # scaled numeric values are unsigned long long -virsh -q -c $test_url setmaxmem test 2147483648 --config >out 2>err || fail=1 +$VIRSH -q -c $test_url setmaxmem test 2147483648 --config >out 2>err || fail=1 test -s out && fail=1 test -s err && fail=1 @@ -213,7 +207,7 @@ test -s err && fail=1 cat <<\EOF > exp-err || framework_failure error: Scaled numeric value '-1' for <size> option is malformed or out of range EOF -virsh -q -c $test_url setmaxmem test -1 >out 2>err && fail=1 +$VIRSH -q -c $test_url setmaxmem test -1 >out 2>err && fail=1 test -s out && fail=1 compare exp-err err || fail=1 @@ -223,12 +217,12 @@ cat <<\EOF > exp-err || framework_failure error: Unable to change MaxMemorySize error: memory in virDomainSetMaxMemory must not be zero EOF -virsh -q -c $test_url setmaxmem test 0 >out 2>err && fail=1 +$VIRSH -q -c $test_url setmaxmem test 0 >out 2>err && fail=1 test -s out && fail=1 compare exp-err err || fail=1 # Numeric value -virsh -q -c $test_url setmaxmem test 42 --config >out 2>err || fail=1 +$VIRSH -q -c $test_url setmaxmem test 42 --config >out 2>err || fail=1 test -s out && fail=1 test -s err && fail=1 @@ -238,7 +232,7 @@ test -s err && fail=1 cat <<\EOF > exp-err || framework_failure error: Numeric value 'abc' for <timeout> option is malformed or out of range EOF -virsh -q -c $test_url event --all --timeout abc >out 2>err && fail=1 +$VIRSH -q -c $test_url event --all --timeout abc >out 2>err && fail=1 test -s out && fail=1 compare exp-err err || fail=1 @@ -247,7 +241,7 @@ compare exp-err err || fail=1 cat <<\EOF > exp-err || framework_failure error: Numeric value '2147484' for <timeout> option is malformed or out of range EOF -virsh -q -c $test_url event --all --timeout 2147484 >out 2>err && fail=1 +$VIRSH -q -c $test_url event --all --timeout 2147484 >out 2>err && fail=1 test -s out && fail=1 compare exp-err err || fail=1 @@ -255,7 +249,7 @@ compare exp-err err || fail=1 cat <<\EOF > exp-err || framework_failure error: Numeric value '42WB' for <timeout> option is malformed or out of range EOF -virsh -q -c $test_url event --all --timeout 42WB >out 2>err && fail=1 +$VIRSH -q -c $test_url event --all --timeout 42WB >out 2>err && fail=1 test -s out && fail=1 compare exp-err err || fail=1 @@ -264,7 +258,7 @@ compare exp-err err || fail=1 cat <<\EOF > exp-err || framework_failure error: Numeric value '42MB' for <timeout> option is malformed or out of range EOF -virsh -q -c $test_url event --all --timeout 42MB >out 2>err && fail=1 +$VIRSH -q -c $test_url event --all --timeout 42MB >out 2>err && fail=1 test -s out && fail=1 compare exp-err err || fail=1 @@ -272,7 +266,7 @@ compare exp-err err || fail=1 cat <<\EOF > exp-err || framework_failure error: Numeric value '-1' for <timeout> option is malformed or out of range EOF -virsh -q -c $test_url event --all --timeout -1 >out 2>err && fail=1 +$VIRSH -q -c $test_url event --all --timeout -1 >out 2>err && fail=1 test -s out && fail=1 compare exp-err err || fail=1 @@ -281,7 +275,7 @@ compare exp-err err || fail=1 cat <<\EOF > exp-err || framework_failure error: Numeric value '0' for <timeout> option is malformed or out of range EOF -virsh -q -c $test_url event --all --timeout 0 >out 2>err && fail=1 +$VIRSH -q -c $test_url event --all --timeout 0 >out 2>err && fail=1 test -s out && fail=1 compare exp-err err || fail=1 @@ -291,7 +285,7 @@ cat <<\EOF > exp-out || framework_failure event loop timed out events received: 0 EOF -virsh -q -c $test_url event --all --timeout 1 >out 2>err && fail=1 +$VIRSH -q -c $test_url event --all --timeout 1 >out 2>err && fail=1 test -s err && fail=1 compare exp-out out || fail=1 diff --git a/tests/virsh-schedinfo b/tests/virsh-schedinfo index d6d9ac2d59e..e4e2509f762 100755 --- a/tests/virsh-schedinfo +++ b/tests/virsh-schedinfo @@ -19,17 +19,11 @@ . "$(dirname $0)/test-lib.sh" -# If $abs_top_builddir/tools is not early in $PATH, put it there, -# so that we can safely invoke "virsh" simply with its name. -case $PATH in - $abs_top_builddir/tools/src:$abs_top_builddir/tools:*) ;; - $abs_top_builddir/tools:*) ;; - *) PATH=$abs_top_builddir/tools:$PATH; export PATH ;; -esac +VIRSH=$abs_top_builddir/tools/virsh if test "$VERBOSE" = yes; then set -x - virsh --version + $VIRSH --version fi printf 'Scheduler : fair\n\n' > exp-out || framework_failure @@ -39,7 +33,7 @@ fail=0 test_url=test:///default -virsh -c $test_url schedinfo 1 --set j=k >out 2>err && fail=1 +$VIRSH -c $test_url schedinfo 1 --set j=k >out 2>err && fail=1 compare exp-out out || fail=1 compare exp-err err || fail=1 -- 2.26.2

On Thu, Jul 16, 2020 at 11:54:04 +0200, Pavel Hrdina wrote:
With meson we no longer have .libs directory with the actual binary so we have to take a different approach to detect if running from build directory.
This is not as robust as for autotools because if you select --prefix in the build directory it will incorrectly enable the override as well but nobody should do that.
This wouldn't be that much of a problem as it would end up pointing to the same files. More of a problem is if we falsely assume that the override is not necessary. Fortunately it's mostly a problem for developers.
We have to modify some of the tests to not add current build path into PATH variable and use the full path for virsh instead. Otherwise it would be impossible to figure out that we are running virsh from build directory.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/util/virfile.c | 34 ++++++++++++++++++------- tests/virsh-optparse | 58 +++++++++++++++++++------------------------ tests/virsh-schedinfo | 12 +++------ 3 files changed, 54 insertions(+), 50 deletions(-)
diff --git a/src/util/virfile.c b/src/util/virfile.c index 213acdbcaa2..4542a38278e 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -1781,21 +1781,37 @@ virFileFindResource(const char *filename, * virFileActivateDirOverrideForProg: * @argv0: argv[0] of the calling program * - * Look at @argv0 and try to detect if running from - * a build directory, by looking for a 'lt-' prefix - * on the binary name, or '/.libs/' in the path + * Combine $PWD and @argv0, canonicalize it and check if abs_top_builddir + * matches as prefix in the path. */ void virFileActivateDirOverrideForProg(const char *argv0) { - char *file = strrchr(argv0, '/'); - if (!file || file[1] == '\0') + const char *pwd = g_getenv("PWD");
Could you please justify why you chose to use the PWD env variable instead of e.g. 'getcwd()' or a glib equivalent? The environment variable requires to be set by the shell, while the working directory is a property of the process.
+ g_autofree char *fullPath = NULL; + g_autofree char *canonPath = NULL; + const char *path = NULL; + + if (!pwd) return; - file++; - if (STRPREFIX(file, "lt-") || - strstr(argv0, "/.libs/")) { + + if (argv0[0] != '/') { + fullPath = g_strdup_printf("%s/%s", pwd, argv0); + canonPath = virFileCanonicalizePath(fullPath); + + if (!canonPath) { + VIR_DEBUG("Failed to get canonicalized path errno=%d", errno); + return; + } + + path = canonPath; + } else { + path = argv0; + } + + if (STRPREFIX(path, abs_top_builddir)) {
Since this hardcodes the full build directory path, this will not work in cases when the build-directory is shared to a different host e.g. via a container or NFS and mounted in a different path. I think we should create a sentinel file in the build directory and check whether the directory where the executable resides has that file which would not be installed afterwards obviously.
useDirOverride = true; - VIR_DEBUG("Activating build dir override for %s", argv0); + VIR_DEBUG("Activating build dir override for %s", path); } }

On a Wednesday in 2020, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:54:04 +0200, Pavel Hrdina wrote:
With meson we no longer have .libs directory with the actual binary so we have to take a different approach to detect if running from build directory.
This is not as robust as for autotools because if you select --prefix in the build directory it will incorrectly enable the override as well but nobody should do that.
This wouldn't be that much of a problem as it would end up pointing to the same files.
More of a problem is if we falsely assume that the override is not necessary.
That's why I'd rather drop this "override-by-binary-path" approach and use the env variable in the "run" script for this. You'd only get the override if you asked for it.
Fortunately it's mostly a problem for developers.
We have to modify some of the tests to not add current build path into PATH variable and use the full path for virsh instead. Otherwise it would be impossible to figure out that we are running virsh from build directory.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/util/virfile.c | 34 ++++++++++++++++++------- tests/virsh-optparse | 58 +++++++++++++++++++------------------------ tests/virsh-schedinfo | 12 +++------
The test changes can be separated out of this patch.
3 files changed, 54 insertions(+), 50 deletions(-)
Jano

On Wed, Jul 22, 2020 at 10:33:58 +0200, Ján Tomko wrote:
On a Wednesday in 2020, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:54:04 +0200, Pavel Hrdina wrote:
With meson we no longer have .libs directory with the actual binary so we have to take a different approach to detect if running from build directory.
This is not as robust as for autotools because if you select --prefix in the build directory it will incorrectly enable the override as well but nobody should do that.
This wouldn't be that much of a problem as it would end up pointing to the same files.
More of a problem is if we falsely assume that the override is not necessary.
That's why I'd rather drop this "override-by-binary-path" approach and use the env variable in the "run" script for this.
That would mandate using ./run even in situations where it was not required before. Similarly to what libtool did with the shell script overlay file, meson links the binaries with local versions of the .so's compiled by the project. This means that the binary can still be run without using ./run. (It's relinked on install I presume). Thus I'd prefer if we still keep the possibility to exec binaries without invoking ./run, but the overrides for dynamicaly loaded files will still work.

On a Wednesday in 2020, Peter Krempa wrote:
On Wed, Jul 22, 2020 at 10:33:58 +0200, Ján Tomko wrote:
On a Wednesday in 2020, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:54:04 +0200, Pavel Hrdina wrote:
With meson we no longer have .libs directory with the actual binary so we have to take a different approach to detect if running from build directory.
This is not as robust as for autotools because if you select --prefix in the build directory it will incorrectly enable the override as well but nobody should do that.
This wouldn't be that much of a problem as it would end up pointing to the same files.
More of a problem is if we falsely assume that the override is not necessary.
That's why I'd rather drop this "override-by-binary-path" approach and use the env variable in the "run" script for this.
That would mandate using ./run even in situations where it was not required before.
Yes, that's what I meant. Jano
Similarly to what libtool did with the shell script overlay file, meson links the binaries with local versions of the .so's compiled by the project. This means that the binary can still be run without using ./run. (It's relinked on install I presume).
Thus I'd prefer if we still keep the possibility to exec binaries without invoking ./run, but the overrides for dynamicaly loaded files will still work.

On Wed, Jul 22, 2020 at 11:32:07 +0200, Ján Tomko wrote:
On a Wednesday in 2020, Peter Krempa wrote:
On Wed, Jul 22, 2020 at 10:33:58 +0200, Ján Tomko wrote:
On a Wednesday in 2020, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:54:04 +0200, Pavel Hrdina wrote:
With meson we no longer have .libs directory with the actual binary so we have to take a different approach to detect if running from build directory.
This is not as robust as for autotools because if you select --prefix in the build directory it will incorrectly enable the override as well but nobody should do that.
This wouldn't be that much of a problem as it would end up pointing to the same files.
More of a problem is if we falsely assume that the override is not necessary.
That's why I'd rather drop this "override-by-binary-path" approach and use the env variable in the "run" script for this.
That would mandate using ./run even in situations where it was not required before.
Yes, that's what I meant.
I strongly disagree with doing that. Meson tries hard to make the files in the build directory work out of the box. This would make it partially and magically fail in many cases which is imo very bad.

On Wed, Jul 22, 2020 at 11:43:09AM +0200, Peter Krempa wrote:
On Wed, Jul 22, 2020 at 11:32:07 +0200, Ján Tomko wrote:
On a Wednesday in 2020, Peter Krempa wrote:
On Wed, Jul 22, 2020 at 10:33:58 +0200, Ján Tomko wrote:
On a Wednesday in 2020, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:54:04 +0200, Pavel Hrdina wrote:
With meson we no longer have .libs directory with the actual binary so we have to take a different approach to detect if running from build directory.
This is not as robust as for autotools because if you select --prefix in the build directory it will incorrectly enable the override as well but nobody should do that.
This wouldn't be that much of a problem as it would end up pointing to the same files.
More of a problem is if we falsely assume that the override is not necessary.
That's why I'd rather drop this "override-by-binary-path" approach and use the env variable in the "run" script for this.
That would mandate using ./run even in situations where it was not required before.
Yes, that's what I meant.
I strongly disagree with doing that. Meson tries hard to make the files in the build directory work out of the box. This would make it partially and magically fail in many cases which is imo very bad.
I agree with Peter here, since meson already does some magic to correctly point to compiled libraries within the project it would be nice to keep this functionality. I'll try the sentinel file approach that Peter suggested to see if it works and if it's not too ugly. Thanks Pavel

On Wed, Jul 22, 2020 at 12:13:18PM +0200, Pavel Hrdina wrote:
On Wed, Jul 22, 2020 at 11:43:09AM +0200, Peter Krempa wrote:
On Wed, Jul 22, 2020 at 11:32:07 +0200, Ján Tomko wrote:
On a Wednesday in 2020, Peter Krempa wrote:
On Wed, Jul 22, 2020 at 10:33:58 +0200, Ján Tomko wrote:
On a Wednesday in 2020, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:54:04 +0200, Pavel Hrdina wrote: > With meson we no longer have .libs directory with the actual binary so > we have to take a different approach to detect if running from build > directory. > > This is not as robust as for autotools because if you select --prefix > in the build directory it will incorrectly enable the override as well > but nobody should do that.
This wouldn't be that much of a problem as it would end up pointing to the same files.
More of a problem is if we falsely assume that the override is not necessary.
That's why I'd rather drop this "override-by-binary-path" approach and use the env variable in the "run" script for this.
That would mandate using ./run even in situations where it was not required before.
Yes, that's what I meant.
I strongly disagree with doing that. Meson tries hard to make the files in the build directory work out of the box. This would make it partially and magically fail in many cases which is imo very bad.
I agree with Peter here, since meson already does some magic to correctly point to compiled libraries within the project it would be nice to keep this functionality.
I'll try the sentinel file approach that Peter suggested to see if it works and if it's not too ugly.
When I was looking into using sentinel file I realized that it is pointless to use it. The argument about NFS or mounting it into container is a good point but irrelevant in our case. If we detect somehow that we need to override the path our code has hard-coded abs_top_srcdir or abs_top_builddir as part of the new path so it would not work in these cases even with the sentinel file. In addition not only our code hard-codes the absolute path, meson does the same for libraries. So I'll keep the detection based on canonicalized path and abs_top_builddir prefix match including some cleanup and not using PWD directly. Pavel

Meson doesn't use .libs directory, everything is placed directly into directories where meson.build file is used. In order to have working tests we need to fix all the paths pointing '.libs' directory. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/logging.html.in | 2 +- examples/systemtap/lock-debug.stp | 2 +- run.in | 2 +- src/driver.c | 2 +- src/libvirt-lxc.pc.in | 2 +- src/libvirt-qemu.pc.in | 2 +- src/libvirt.pc.in | 2 +- src/locking/lock_manager.c | 2 +- src/storage/storage_backend.c | 2 +- src/util/virstoragefilebackend.c | 2 +- tests/securityselinuxlabeltest.c | 2 +- tests/securityselinuxtest.c | 2 +- tests/shunloadtest.c | 4 ++-- tests/testutils.h | 2 +- tests/viridentitytest.c | 2 +- tests/virt-aa-helper-test | 2 +- 16 files changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/logging.html.in b/docs/logging.html.in index 3ff0dd3eb67..b4e7d0c3864 100644 --- a/docs/logging.html.in +++ b/docs/logging.html.in @@ -209,7 +209,7 @@ $ journalctl MESSAGE_ID=8ae2f3fb-2dbe-498e-8fbd-012d40afa361 --output=json "LIBVIRT_QEMU_BINARY" : "/bin/qemu-system-xtensa", "MESSAGE" : "Failed to probe capabilities for /bin/qemu-system-xtensa:" \ "internal error: Child process (LC_ALL=C LD_LIBRARY_PATH=/home/berrange" \ - "/src/virt/libvirt/src/.libs PATH=/usr/lib64/ccache:/usr/local/sbin:" \ + "/src/virt/libvirt/src PATH=/usr/lib64/ccache:/usr/local/sbin:" \ "/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin HOME=/root " \ "USER=root LOGNAME=root /bin/qemu-system-xtensa -help) unexpected " \ "exit status 127: /bin/qemu-system-xtensa: error while loading shared " \ diff --git a/examples/systemtap/lock-debug.stp b/examples/systemtap/lock-debug.stp index 0c9cc386924..a68a3855695 100644 --- a/examples/systemtap/lock-debug.stp +++ b/examples/systemtap/lock-debug.stp @@ -12,7 +12,7 @@ # source git directory, it should be only slight modification to the following: # # ./run stap --ldd -c src/libvirtd -d src/libvirtd -# examples/systemtap/lock-debug.stp src/.libs/libvirt.so +# examples/systemtap/lock-debug.stp src/libvirt.so # # Debug RWLock mechanisms as well. # diff --git a/run.in b/run.in index d508e648020..1a0dee4d9ee 100644 --- a/run.in +++ b/run.in @@ -50,7 +50,7 @@ prepend() # Find this script. b=@abs_builddir@ -prepend LD_LIBRARY_PATH "$b/src/.libs" +prepend LD_LIBRARY_PATH "$b/src" export LD_LIBRARY_PATH prepend PKG_CONFIG_PATH "$b/src" diff --git a/src/driver.c b/src/driver.c index e7452106ed9..37bf9de3921 100644 --- a/src/driver.c +++ b/src/driver.c @@ -56,7 +56,7 @@ virDriverLoadModule(const char *name, if (!(modfile = virFileFindResourceFull(name, "libvirt_driver_", ".so", - abs_top_builddir "/src/.libs", + abs_top_builddir "/src", DEFAULT_DRIVER_DIR, "LIBVIRT_DRIVER_DIR"))) return -1; diff --git a/src/libvirt-lxc.pc.in b/src/libvirt-lxc.pc.in index 9243bcf9034..f6d4dd71e7e 100644 --- a/src/libvirt-lxc.pc.in +++ b/src/libvirt-lxc.pc.in @@ -4,7 +4,7 @@ prefix=@abs_top_builddir@ exec_prefix=@abs_top_builddir@ -libdir=@abs_top_builddir@/src/.libs +libdir=@abs_top_builddir@/src includedir=@abs_top_builddir@/include source_includedir=@abs_top_srcdir@/include datarootdir=@abs_top_builddir@ diff --git a/src/libvirt-qemu.pc.in b/src/libvirt-qemu.pc.in index a4f9e65c03e..b224679d7e3 100644 --- a/src/libvirt-qemu.pc.in +++ b/src/libvirt-qemu.pc.in @@ -4,7 +4,7 @@ prefix=@abs_top_builddir@ exec_prefix=@abs_top_builddir@ -libdir=@abs_top_builddir@/src/.libs +libdir=@abs_top_builddir@/src includedir=@abs_top_builddir@/include source_includedir=@abs_top_srcdir@/include datarootdir=@abs_top_builddir@ diff --git a/src/libvirt.pc.in b/src/libvirt.pc.in index a16e4552105..93a42a457b4 100644 --- a/src/libvirt.pc.in +++ b/src/libvirt.pc.in @@ -4,7 +4,7 @@ prefix=@abs_top_builddir@ exec_prefix=@abs_top_builddir@ -libdir=@abs_top_builddir@/src/.libs +libdir=@abs_top_builddir@/src includedir=@abs_top_builddir@/include source_includedir=@abs_top_srcdir@/include datarootdir=@abs_top_builddir@ diff --git a/src/locking/lock_manager.c b/src/locking/lock_manager.c index 07318fb53f0..39e482f11cd 100644 --- a/src/locking/lock_manager.c +++ b/src/locking/lock_manager.c @@ -139,7 +139,7 @@ virLockManagerPluginPtr virLockManagerPluginNew(const char *name, if (!(modfile = virFileFindResourceFull(name, NULL, ".so", - abs_top_builddir "/src/.libs", + abs_top_builddir "/src", LIBDIR "/libvirt/lock-driver", "LIBVIRT_LOCK_MANAGER_PLUGIN_DIR"))) goto cleanup; diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index e9f6663e6d1..1f83236f2fc 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -92,7 +92,7 @@ virStorageDriverLoadBackendModule(const char *name, if (!(modfile = virFileFindResourceFull(name, "libvirt_storage_backend_", ".so", - abs_top_builddir "/src/.libs", + abs_top_builddir "/src", STORAGE_BACKEND_MODULE_DIR, "LIBVIRT_STORAGE_BACKEND_DIR"))) return -1; diff --git a/src/util/virstoragefilebackend.c b/src/util/virstoragefilebackend.c index f362436d9ba..bf452a1dc5d 100644 --- a/src/util/virstoragefilebackend.c +++ b/src/util/virstoragefilebackend.c @@ -57,7 +57,7 @@ virStorageFileLoadBackendModule(const char *name, if (!(modfile = virFileFindResourceFull(name, "libvirt_storage_file_", ".so", - abs_top_builddir "/src/.libs", + abs_top_builddir "/src", STORAGE_FILE_MODULE_DIR, "LIBVIRT_STORAGE_FILE_DIR"))) return -1; diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabeltest.c index 50b447c1637..2989a668b75 100644 --- a/tests/securityselinuxlabeltest.c +++ b/tests/securityselinuxlabeltest.c @@ -374,4 +374,4 @@ mymain(void) VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("domaincaps"), - abs_builddir "/.libs/libsecurityselinuxhelper.so") + abs_builddir "/libsecurityselinuxhelper.so") diff --git a/tests/securityselinuxtest.c b/tests/securityselinuxtest.c index 3f069c2d6be..ae4b08b9d8a 100644 --- a/tests/securityselinuxtest.c +++ b/tests/securityselinuxtest.c @@ -339,4 +339,4 @@ mymain(void) return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/libsecurityselinuxhelper.so") +VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/libsecurityselinuxhelper.so") diff --git a/tests/shunloadtest.c b/tests/shunloadtest.c index b377c07294f..d4ab3cd5acf 100644 --- a/tests/shunloadtest.c +++ b/tests/shunloadtest.c @@ -105,8 +105,8 @@ int main(int argc G_GNUC_UNUSED, char **argv) fprintf(stderr, " .%*s 1 ", 39, ""); signal(SIGSEGV, sigHandler); - if (!(lib = dlopen("./.libs/libshunload.so", RTLD_LAZY))) { - fprintf(stderr, "Cannot load ./.libs/libshunload.so %s\n", dlerror()); + if (!(lib = dlopen(abs_builddir "/libshunload.so", RTLD_LAZY))) { + fprintf(stderr, "Cannot load ./libshunload.so %s\n", dlerror()); return 1; } if (!(startup = dlsym(lib, "shunloadStart"))) { diff --git a/tests/testutils.h b/tests/testutils.h index 3f32aa72002..ff5c98a0785 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -140,7 +140,7 @@ int virTestMain(int argc, return virTestMain(argc, argv, func, __VA_ARGS__, NULL); \ } -#define VIR_TEST_MOCK(mock) (abs_builddir "/.libs/lib" mock "mock" MOCK_EXT) +#define VIR_TEST_MOCK(mock) (abs_builddir "/lib" mock "mock" MOCK_EXT) virCapsPtr virTestGenericCapsInit(void); virCapsHostNUMAPtr virTestCapsBuildNUMATopology(int seq); diff --git a/tests/viridentitytest.c b/tests/viridentitytest.c index 9a8c8914d36..fd01eeaa80b 100644 --- a/tests/viridentitytest.c +++ b/tests/viridentitytest.c @@ -158,7 +158,7 @@ mymain(void) } #if WITH_SELINUX -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/libsecurityselinuxhelper.so") +VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/libsecurityselinuxhelper.so") #else VIR_TEST_MAIN(mymain) #endif diff --git a/tests/virt-aa-helper-test b/tests/virt-aa-helper-test index 6a6703ecf5c..8dbe82a6b98 100755 --- a/tests/virt-aa-helper-test +++ b/tests/virt-aa-helper-test @@ -15,7 +15,7 @@ fi output="/dev/null" use_valgrind="" -ld_library_path="../src/.libs/" +ld_library_path="../src/" if [ ! -z "$1" ] && [ "$1" = "-d" ]; then output="/dev/stdout" shift -- 2.26.2

On a Thursday in 2020, Pavel Hrdina wrote:
Meson doesn't use .libs directory, everything is placed directly into directories where meson.build file is used.
In order to have working tests we need to fix all the paths pointing '.libs' directory.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/logging.html.in | 2 +- examples/systemtap/lock-debug.stp | 2 +- run.in | 2 +- src/driver.c | 2 +- src/libvirt-lxc.pc.in | 2 +- src/libvirt-qemu.pc.in | 2 +- src/libvirt.pc.in | 2 +- src/locking/lock_manager.c | 2 +- src/storage/storage_backend.c | 2 +- src/util/virstoragefilebackend.c | 2 +- tests/securityselinuxlabeltest.c | 2 +- tests/securityselinuxtest.c | 2 +- tests/shunloadtest.c | 4 ++-- tests/testutils.h | 2 +- tests/viridentitytest.c | 2 +- tests/virt-aa-helper-test | 2 +- 16 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/docs/logging.html.in b/docs/logging.html.in index 3ff0dd3eb67..b4e7d0c3864 100644 --- a/docs/logging.html.in +++ b/docs/logging.html.in @@ -209,7 +209,7 @@ $ journalctl MESSAGE_ID=8ae2f3fb-2dbe-498e-8fbd-012d40afa361 --output=json "LIBVIRT_QEMU_BINARY" : "/bin/qemu-system-xtensa", "MESSAGE" : "Failed to probe capabilities for /bin/qemu-system-xtensa:" \ "internal error: Child process (LC_ALL=C LD_LIBRARY_PATH=/home/berrange" \ - "/src/virt/libvirt/src/.libs PATH=/usr/lib64/ccache:/usr/local/sbin:" \ + "/src/virt/libvirt/src PATH=/usr/lib64/ccache:/usr/local/sbin:" \ "/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin HOME=/root " \ "USER=root LOGNAME=root /bin/qemu-system-xtensa -help) unexpected " \ "exit status 127: /bin/qemu-system-xtensa: error while loading shared " \
This is just an example error message from a past version of libvirt, no need to rewrite history here.
diff --git a/examples/systemtap/lock-debug.stp b/examples/systemtap/lock-debug.stp index 0c9cc386924..a68a3855695 100644 --- a/examples/systemtap/lock-debug.stp +++ b/examples/systemtap/lock-debug.stp @@ -12,7 +12,7 @@ # source git directory, it should be only slight modification to the following: # # ./run stap --ldd -c src/libvirtd -d src/libvirtd -# examples/systemtap/lock-debug.stp src/.libs/libvirt.so +# examples/systemtap/lock-debug.stp src/libvirt.so
This does not account for the separate builddir change, but that's out of scope here. Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

The PACKAGE* variables are defined by AC_INIT so we have to define explicitly with meson. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- autogen.sh | 53 ------------------ config.h | 1 + configure.ac | 96 --------------------------------- meson.build | 134 ++++++++++++++++++++++++++++++++++++++++++++++ meson_options.txt | 3 ++ 5 files changed, 138 insertions(+), 149 deletions(-) delete mode 100755 autogen.sh create mode 100644 config.h create mode 100644 meson.build create mode 100644 meson_options.txt diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 389f07ef4d2..00000000000 --- a/autogen.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -# Run this to generate all the initial makefiles, etc. -# -# THe following options must come first. All other or subsequent -# arguments are passed to configure: -# --no-git skip `git submodule update --init` - -test -n "$srcdir" || srcdir=$(dirname "$0") -test -n "$srcdir" || srcdir=. - -olddir=$(pwd) - -cd "$srcdir" - -(test -f src/libvirt.c) || { - echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" - echo " top-level libvirt directory" - exit 1 -} - -if [ "x$1" = x--no-git ]; then - shift -else - git submodule update --init || exit 1 -fi - -autoreconf --verbose --force --install || exit 1 - -if test "x$1" = "x--system"; then - shift - prefix=/usr - libdir=$prefix/lib - sysconfdir=/etc - localstatedir=/var - if [ -d /usr/lib64 ]; then - libdir=$prefix/lib64 - fi - EXTRA_ARGS="--prefix=$prefix --sysconfdir=$sysconfdir --localstatedir=$localstatedir --libdir=$libdir" -fi - -cd "$olddir" - -if [ "$NOCONFIGURE" = "" ]; then - $srcdir/configure $EXTRA_ARGS "$@" || exit 1 - - if [ "$1" = "--help" ]; then - exit 0 - else - echo "Now type 'make' to compile libvirt" || exit 1 - fi -else - echo "Skipping configure process." -fi diff --git a/config.h b/config.h new file mode 100644 index 00000000000..05cd1507f45 --- /dev/null +++ b/config.h @@ -0,0 +1 @@ +#include <meson-config.h> diff --git a/configure.ac b/configure.ac index 23074d3badd..a91ed590edd 100644 --- a/configure.ac +++ b/configure.ac @@ -16,16 +16,7 @@ dnl You should have received a copy of the GNU Lesser General Public dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. -AC_INIT([libvirt], [6.6.0], [libvir-list@redhat.com], [], [https://libvirt.org]) - -if test $srcdir = "." -then - AC_MSG_ERROR([Build directory must be different from source directory]) -fi - -AC_CONFIG_SRCDIR([src/libvirt.c]) AC_CONFIG_AUX_DIR([build-aux]) -AC_CONFIG_HEADERS([config.h]) AH_BOTTOM([#include <config-post.h>]) AC_CONFIG_MACRO_DIR([m4]) dnl Make automake keep quiet about wildcards & other GNUmake-isms @@ -50,61 +41,6 @@ m4_ifndef([AM_SILENT_RULES], AC_CANONICAL_HOST -AC_USE_SYSTEM_EXTENSIONS - -# First extract pieces from the version number string -LIBVIRT_MAJOR_VERSION=`echo $VERSION | awk -F. '{print $1}'` -LIBVIRT_MINOR_VERSION=`echo $VERSION | awk -F. '{print $2}'` -LIBVIRT_MICRO_VERSION=`echo $VERSION | awk -F. '{print $3}'` -LIBVIRT_VERSION=$LIBVIRT_MAJOR_VERSION.$LIBVIRT_MINOR_VERSION.$LIBVIRT_MICRO_VERSION$LIBVIRT_MICRO_VERSION_SUFFIX -LIBVIRT_VERSION_NUMBER=`expr $LIBVIRT_MAJOR_VERSION \* 1000000 + $LIBVIRT_MINOR_VERSION \* 1000 + $LIBVIRT_MICRO_VERSION` - -# In libtool terminology we need to figure out: -# -# CURRENT -# The most recent interface number that this library implements. -# -# REVISION -# The implementation number of the CURRENT interface. -# -# AGE -# The difference between the newest and oldest interfaces that this -# library implements. -# -# In other words, the library implements all the interface numbers -# in the range from number `CURRENT - AGE' to `CURRENT'. -# -# Libtool assigns the soname version from `CURRENT - AGE', and we -# don't want that to ever change in libvirt. ie it must always be -# zero, to produce libvirt.so.0. -# -# We would, however, like the libvirt version number reflected -# in the so version'd symlinks, and this is based on AGE.REVISION -# eg libvirt.so.0.AGE.REVISION -# -# Assuming we do ever want to break soname version, this can -# toggled. But seriously, don't ever touch this. -LIBVIRT_SONUM=0 - -# The following examples show what libtool will do -# -# Input: 0.9.14 -> libvirt.so.0.9.14 -# Input: 1.0.0 -> libvirt.so.0.1000.0 -# Input: 2.5.8 -> libvirt.so.0.2005.8 -# -AGE=`expr $LIBVIRT_MAJOR_VERSION '*' 1000 + $LIBVIRT_MINOR_VERSION` -REVISION=$LIBVIRT_MICRO_VERSION -CURRENT=`expr $LIBVIRT_SONUM + $AGE` -LIBVIRT_VERSION_INFO=$CURRENT:$REVISION:$AGE - -AC_SUBST([LIBVIRT_MAJOR_VERSION]) -AC_SUBST([LIBVIRT_MINOR_VERSION]) -AC_SUBST([LIBVIRT_MICRO_VERSION]) -AC_SUBST([LIBVIRT_SONUM]) -AC_SUBST([LIBVIRT_VERSION]) -AC_SUBST([LIBVIRT_VERSION_INFO]) -AC_SUBST([LIBVIRT_VERSION_NUMBER]) - LIBVIRT_ARG_WITH([PACKAGER], [Extra packager name], [no]) LIBVIRT_ARG_WITH([PACKAGER_VERSION], [Extra packager version], [no]) if test "x$with_packager" != "xno" @@ -126,27 +62,6 @@ AC_PROG_CC AC_PROG_INSTALL AC_PROG_CPP -dnl autoconf 2.70 adds a --runstatedir option so that downstreams -dnl can point to /run instead of the historic /var/run, but -dnl autoconf hasn't had a release since 2012. -if test "x$runstatedir" = x; then - AC_SUBST([runstatedir], ['${localstatedir}/run']) -fi - -dnl we introduce --with-runstatedir and then overwrite the -dnl value of $runstatedir so configmake.h is more useful -AC_ARG_WITH( - [runstatedir], - [AS_HELP_STRING( - [--with-runstatedir], - [State directory for temporary sockets, pid files, etc])]) - -if test -n "$with_runstatedir" -then - runstatedir=$with_runstatedir -fi - - dnl get 64-int interfaces on 32-bit platforms AC_SYS_LARGEFILE @@ -450,17 +365,6 @@ dnl LIBVIRT_CHECK_EXTERNAL_PROGRAMS -dnl if --prefix is /usr, don't use /usr/var for localstatedir -dnl or /usr/etc for sysconfdir -dnl as this makes a lot of things break in testing situations - -if test "$prefix" = "/usr" && test "$localstatedir" = '${prefix}/var' ; then - localstatedir='/var' -fi -if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc' ; then - sysconfdir='/etc' -fi - dnl dnl Virtualization drivers check dnl diff --git a/meson.build b/meson.build new file mode 100644 index 00000000000..12a6a14ee58 --- /dev/null +++ b/meson.build @@ -0,0 +1,134 @@ +project( + 'libvirt', 'c', + version: '6.6.0', + license: 'LGPLv2+', + meson_version: '>= 0.54.0', + default_options: [ + 'buildtype=debugoptimized', + 'c_std=gnu99', + ], +) + + +# figure out if we are building from git + +git = run_command('test', '-d', '.git').returncode() == 0 + +if git and not get_option('no-git') + run_command('git', 'submodule', 'update', '--init') +endif + + +# prepare build configuration data + +conf = configuration_data() + +conf.set('_GNU_SOURCE', 1) +conf.set_quoted('abs_top_builddir', meson.build_root()) +conf.set_quoted('abs_top_srcdir', meson.source_root()) +conf.set_quoted('PACKAGE', meson.project_name()) +conf.set_quoted('PACKAGE_NAME', meson.project_name()) +conf.set_quoted('PACKAGE_VERSION', meson.project_version()) +conf.set_quoted('VERSION', meson.project_version()) + + +# set various paths + +if get_option('system') + prefix = '/usr' + libdir = prefix / 'lib64' + if run_command('test', '-d', libdir).returncode() != 0 + libdir = prefix / 'lib' + endif + localstatedir = '/var' + sysconfdir = '/etc' +else + prefix = get_option('prefix') + libdir = prefix / get_option('libdir') + localstatedir = prefix / get_option('localstatedir') + sysconfdir = prefix / get_option('sysconfdir') +endif + +# if --prefix is /usr, don't use /usr/var for localstatedir or /usr/etc for +# sysconfdir as this makes a lot of things break in testing situations +if prefix == '/usr' + if localstatedir == '/usr/var' + localstatedir = '/var' + endif + if sysconfdir == '/usr/etc' + sysconfdir = '/etc' + endif +endif + +runstatedir = get_option('runstatedir') +if runstatedir == '' + runstatedir = localstatedir / 'run' +endif + +bindir = prefix / get_option('bindir') +datadir = prefix / get_option('datadir') +includedir = prefix / get_option('includedir') +infodir = prefix / get_option('infodir') +libexecdir = prefix / get_option('libexecdir') +localedir = prefix / get_option('localedir') +mandir = prefix / get_option('mandir') +sbindir = prefix / get_option('sbindir') +sharedstatedir = prefix / get_option('sharedstatedir') + +confdir = sysconfdir / meson.project_name() +docdir = datadir / 'doc' / meson.project_name() +pkgdatadir = datadir / meson.project_name() + + +# figure out libvirt version strings + +arr_version = meson.project_version().split('.') +libvirt_version_number = 1000000 * arr_version[0].to_int() + 1000 * arr_version[1].to_int() + arr_version[2].to_int() + +conf.set('LIBVIRT_VERSION_NUMBER', libvirt_version_number) + +# In libtool terminology we need to figure out: +# +# CURRENT +# The most recent interface number that this library implements. +# +# REVISION +# The implementation number of the CURRENT interface. +# +# AGE +# The difference between the newest and oldest interfaces that this +# library implements. +# +# In other words, the library implements all the interface numbers +# in the range from number `CURRENT - AGE' to `CURRENT'. +# +# Libtool assigns the soname version from `CURRENT - AGE', and we +# don't want that to ever change in libvirt. ie it must always be +# zero, to produce libvirt.so.0. +# +# We would, however, like the libvirt version number reflected +# in the so version'd symlinks, and this is based on AGE.REVISION +# eg libvirt.so.0.AGE.REVISION +# +# The following examples show what libtool will do +# +# Input: 0.9.14 -> libvirt.so.0.9.14 +# Input: 1.0.0 -> libvirt.so.0.1000.0 +# Input: 2.5.8 -> libvirt.so.0.2005.8 +# +# Assuming we do ever want to break soname version, this can +# toggled. But seriously, don't ever touch this. + +libvirt_so_version = 0 +libvirt_age = 1000 * arr_version[0].to_int() + arr_version[1].to_int() +libvirt_revision = arr_version[2].to_int() +libvirt_lib_version = '@0@.@1@.@2@'.format(libvirt_so_version, libvirt_age, libvirt_revision) + + +# define top include directory + +top_inc_dir = include_directories('.') + + +# generate meson-config.h file +configure_file(output: 'meson-config.h', configuration: conf) diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 00000000000..5338ee89b9a --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,3 @@ +option('no-git', type: 'boolean', value: false, description: 'Disable git submodule update') +option('system', type: 'boolean', value: false, description: 'Set install paths to system ones') +option('runstatedir', type: 'string', value: '', description: 'State directory for temporary sockets, pid files, etc') -- 2.26.2

On a Thursday in 2020, Pavel Hrdina wrote:
The PACKAGE* variables are defined by AC_INIT so we have to define explicitly with meson.
Interesting, it also defines PACKAGE_BUGREPORT, but instead we hardcode libvir-list@redhat.com in a few error messages.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- autogen.sh | 53 ------------------ config.h | 1 + configure.ac | 96 --------------------------------- meson.build | 134 ++++++++++++++++++++++++++++++++++++++++++++++ meson_options.txt | 3 ++ 5 files changed, 138 insertions(+), 149 deletions(-) delete mode 100755 autogen.sh create mode 100644 config.h create mode 100644 meson.build create mode 100644 meson_options.txt
+# In libtool terminology we need to figure out:
This is one of the few mentions of libtool left after this series...
+# +# CURRENT +# The most recent interface number that this library implements. +# +# REVISION +# The implementation number of the CURRENT interface. +# +# AGE +# The difference between the newest and oldest interfaces that this +# library implements. +# +# In other words, the library implements all the interface numbers +# in the range from number `CURRENT - AGE' to `CURRENT'. +# +# Libtool assigns the soname version from `CURRENT - AGE', and we +# don't want that to ever change in libvirt. ie it must always be +# zero, to produce libvirt.so.0. +# +# We would, however, like the libvirt version number reflected +# in the so version'd symlinks, and this is based on AGE.REVISION +# eg libvirt.so.0.AGE.REVISION +# +# The following examples show what libtool will do +# +# Input: 0.9.14 -> libvirt.so.0.9.14 +# Input: 1.0.0 -> libvirt.so.0.1000.0 +# Input: 2.5.8 -> libvirt.so.0.2005.8 +# +# Assuming we do ever want to break soname version, this can +# toggled. But seriously, don't ever touch this.
... but this comment is very convicning. :)
+ +libvirt_so_version = 0 +libvirt_age = 1000 * arr_version[0].to_int() + arr_version[1].to_int() +libvirt_revision = arr_version[2].to_int() +libvirt_lib_version = '@0@.@1@.@2@'.format(libvirt_so_version, libvirt_age, libvirt_revision)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 1 - m4/virt-compile-pie.m4 | 35 ----------------------------------- meson.build | 1 + src/Makefile.am | 2 -- src/locking/Makefile.inc.am | 4 ---- src/logging/Makefile.inc.am | 2 -- src/lxc/Makefile.inc.am | 2 -- src/network/Makefile.inc.am | 2 -- src/remote/Makefile.inc.am | 2 -- src/security/Makefile.inc.am | 2 -- src/storage/Makefile.inc.am | 2 -- tools/Makefile.am | 6 ------ 12 files changed, 1 insertion(+), 60 deletions(-) delete mode 100644 m4/virt-compile-pie.m4 diff --git a/configure.ac b/configure.ac index a91ed590edd..84e63063e43 100644 --- a/configure.ac +++ b/configure.ac @@ -180,7 +180,6 @@ fi # Check for compiler and library settings. LIBVIRT_COMPILE_WARNINGS -LIBVIRT_COMPILE_PIE LIBVIRT_LINKER_RELRO LIBVIRT_LINKER_NO_INDIRECT LIBVIRT_LINKER_NO_UNDEFINED diff --git a/m4/virt-compile-pie.m4 b/m4/virt-compile-pie.m4 deleted file mode 100644 index da5cdf57b75..00000000000 --- a/m4/virt-compile-pie.m4 +++ /dev/null @@ -1,35 +0,0 @@ -dnl -dnl Check for support for position independent executables -dnl -dnl Copyright (C) 2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_COMPILE_PIE],[ - PIE_CFLAGS= - PIE_LDFLAGS= - case "$host" in - *-*-mingw* ) - ;; dnl All code is position independent on Win32 target - *) - gl_COMPILER_OPTION_IF([-fPIE -DPIE -pie], [ - PIE_CFLAGS="-fPIE -DPIE" - PIE_LDFLAGS="-pie" - ]) - esac - AC_SUBST([PIE_CFLAGS]) - AC_SUBST([PIE_LDFLAGS]) -]) diff --git a/meson.build b/meson.build index 12a6a14ee58..88a163e2ee6 100644 --- a/meson.build +++ b/meson.build @@ -5,6 +5,7 @@ project( meson_version: '>= 0.54.0', default_options: [ 'buildtype=debugoptimized', + 'b_pie=true', 'c_std=gnu99', ], ) diff --git a/src/Makefile.am b/src/Makefile.am index c2bb7d0083b..6cf23bb0bdf 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -603,7 +603,6 @@ libexec_PROGRAMS += libvirt_iohelper libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES) libvirt_iohelper_LDFLAGS = \ $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ $(NULL) libvirt_iohelper_LDADD = \ libvirt.la \ @@ -615,7 +614,6 @@ endif WITH_DTRACE_PROBES libvirt_iohelper_CFLAGS = \ $(AM_CFLAGS) \ - $(PIE_CFLAGS) \ $(NULL) diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index ab0822dda35..b75588f9fce 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -130,12 +130,10 @@ virtlockd_CFLAGS = \ -I$(builddir)/locking \ -I$(builddir)/rpc \ $(AM_CFLAGS) \ - $(PIE_CFLAGS) \ $(XDR_CFLAGS) \ $(NULL) virtlockd_LDFLAGS = \ $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ $(XDR_LIBS) \ $(NO_UNDEFINED_LDFLAGS) \ $(NULL) @@ -182,11 +180,9 @@ libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES) libvirt_sanlock_helper_CFLAGS = \ -I$(srcdir)/conf \ $(AM_CFLAGS) \ - $(PIE_CFLAGS) \ $(NULL) libvirt_sanlock_helper_LDFLAGS = \ $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ $(NULL) libvirt_sanlock_helper_LDADD = \ libvirt.la \ diff --git a/src/logging/Makefile.inc.am b/src/logging/Makefile.inc.am index 74987c63845..9aa634b126b 100644 --- a/src/logging/Makefile.inc.am +++ b/src/logging/Makefile.inc.am @@ -76,12 +76,10 @@ virtlogd_CFLAGS = \ -I$(builddir)/logging \ -I$(builddir)/rpc \ $(AM_CFLAGS) \ - $(PIE_CFLAGS) \ $(XDR_CFLAGS) \ $(NULL) virtlogd_LDFLAGS = \ $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ $(XDR_LIBS) \ $(NO_UNDEFINED_LDFLAGS) \ $(NULL) diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am index c9201110071..031aed14203 100644 --- a/src/lxc/Makefile.inc.am +++ b/src/lxc/Makefile.inc.am @@ -197,7 +197,6 @@ nodist_libvirt_lxc_SOURCES = \ $(NULL) libvirt_lxc_LDFLAGS = \ $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ $(CAPNG_LIBS) \ $(LIBXML_LIBS) \ $(GLIB_LIBS) \ @@ -217,7 +216,6 @@ libvirt_lxc_CFLAGS = \ -I$(builddir)/rpc \ -I$(srcdir)/hypervisor \ $(AM_CFLAGS) \ - $(PIE_CFLAGS) \ $(CAPNG_CFLAGS) \ $(LIBXML_CFLAGS) \ $(GLIB_CFLAGS) \ diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am index 9a1a3717073..5a5d1630a08 100644 --- a/src/network/Makefile.inc.am +++ b/src/network/Makefile.inc.am @@ -126,7 +126,6 @@ libexec_PROGRAMS += libvirt_leaseshelper libvirt_leaseshelper_SOURCES = $(NETWORK_LEASES_HELPER_SOURCES) libvirt_leaseshelper_LDFLAGS = \ $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ $(NULL) libvirt_leaseshelper_LDADD = \ libvirt.la \ @@ -138,7 +137,6 @@ endif WITH_DTRACE_PROBES libvirt_leaseshelper_CFLAGS = \ $(AM_CFLAGS) \ - $(PIE_CFLAGS) \ $(NULL) INSTALL_DATA_DIRS += network diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 165a7cced60..341f429b773 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -41,7 +41,6 @@ REMOTE_DAEMON_CFLAGS = \ $(XDR_CFLAGS) \ $(DBUS_CFLAGS) \ $(LIBNL_CFLAGS) \ - $(PIE_CFLAGS) \ -I$(srcdir)/access \ -I$(builddir)/access \ -I$(srcdir)/conf \ @@ -52,7 +51,6 @@ REMOTE_DAEMON_CFLAGS = \ REMOTE_DAEMON_LD_FLAGS = \ $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ $(NO_UNDEFINED_LDFLAGS) \ $(NULL) diff --git a/src/security/Makefile.inc.am b/src/security/Makefile.inc.am index 871245a035f..ec24931a80a 100644 --- a/src/security/Makefile.inc.am +++ b/src/security/Makefile.inc.am @@ -74,7 +74,6 @@ virt_aa_helper_SOURCES = $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES) virt_aa_helper_LDFLAGS = \ $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ $(NULL) virt_aa_helper_LDADD = \ libvirt.la \ @@ -89,7 +88,6 @@ virt_aa_helper_CFLAGS = \ -I$(top_srcdir)/src/hypervisor \ -I$(srcdir)/security \ $(AM_CFLAGS) \ - $(PIE_CFLAGS) \ $(NULL) endif WITH_LIBVIRTD endif WITH_SECDRIVER_APPARMOR diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index 43010ee9664..e201b9938d9 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -437,7 +437,6 @@ libexec_PROGRAMS += libvirt_parthelper libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES) libvirt_parthelper_LDFLAGS = \ $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ $(NULL) libvirt_parthelper_LDADD = \ $(LIBPARTED_LIBS) \ @@ -451,6 +450,5 @@ endif WITH_DTRACE_PROBES libvirt_parthelper_CFLAGS = \ $(LIBPARTED_CFLAGS) \ $(AM_CFLAGS) \ - $(PIE_CFLAGS) \ $(NULL) endif WITH_STORAGE_DISK diff --git a/tools/Makefile.am b/tools/Makefile.am index 0530e439a8b..19c3b88777c 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -31,7 +31,6 @@ STANDALONE_CPPFLAGS = -I$(top_srcdir) AM_CFLAGS = \ $(WARN_CFLAGS) \ $(COVERAGE_CFLAGS) \ - $(PIE_CFLAGS) \ $(LIBXML_CFLAGS) \ $(GLIB_CFLAGS) \ $(NULL) @@ -92,7 +91,6 @@ libvirt_shell_la_CFLAGS = \ $(NULL) libvirt_shell_la_LDFLAGS = \ $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ $(COVERAGE_LDFLAGS) \ $(NULL) libvirt_shell_la_LIBADD = \ @@ -132,7 +130,6 @@ endif ! WITH_BHYVE virt_host_validate_LDFLAGS = \ $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ $(COVERAGE_LDFLAGS) \ $(NULL) @@ -158,7 +155,6 @@ virt_login_shell_helper_SOURCES = \ virt_login_shell_helper_LDFLAGS = \ $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ $(COVERAGE_LDFLAGS) \ $(NULL) virt_login_shell_helper_LDADD = \ @@ -204,7 +200,6 @@ virsh_SOURCES = \ virsh_LDFLAGS = \ $(AM_LDFLAGS) \ - $(PIE_LDFLAGS) \ $(COVERAGE_LDFLAGS) \ $(NULL) virsh_LDADD = \ @@ -225,7 +220,6 @@ virt_admin_LDFLAGS = \ $(AM_LDFLAGS) \ $(COVERAGE_LDFLAGS) \ $(STATIC_BINARIES) \ - $(PIE_LDFLAGS) \ $(NULL) virt_admin_LDADD = \ ../src/libvirt-admin.la \ -- 2.26.2

On a Thursday in 2020, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 1 - m4/virt-compile-pie.m4 | 35 ----------------------------------- meson.build | 1 + src/Makefile.am | 2 -- src/locking/Makefile.inc.am | 4 ---- src/logging/Makefile.inc.am | 2 -- src/lxc/Makefile.inc.am | 2 -- src/network/Makefile.inc.am | 2 -- src/remote/Makefile.inc.am | 2 -- src/security/Makefile.inc.am | 2 -- src/storage/Makefile.inc.am | 2 -- tools/Makefile.am | 6 ------ 12 files changed, 1 insertion(+), 60 deletions(-) delete mode 100644 m4/virt-compile-pie.m4
https://i.imgflip.com/491cxg.jpg Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

With meson we generate meson-config.h into the build directory and include it in config.h so there is no need to have separate config-post.h file. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- config-post.h | 58 --------------------------------------------------- config.h | 41 ++++++++++++++++++++++++++++++++++++ configure.ac | 1 - 3 files changed, 41 insertions(+), 59 deletions(-) delete mode 100644 config-post.h diff --git a/config-post.h b/config-post.h deleted file mode 100644 index 4a49cd4194d..00000000000 --- a/config-post.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2013 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * <http://www.gnu.org/licenses/>. - */ - -#ifndef __GNUC__ -# error "Libvirt requires GCC >= 4.8, or CLang" -#endif - -/* - * Define __GNUC_PREREQ to a sane default if it isn't yet defined. - * This is done here so that it's included as early as possible; - */ -#ifndef __GNUC_PREREQ -# define __GNUC_PREREQ(maj, min) \ - ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) -#endif - -#if defined(__clang_major__) && defined(__clang_minor__) -# ifdef __apple_build_version__ -# if __clang_major__ < 5 || (__clang_major__ == 5 && __clang_minor__ < 1) -# error You need at least XCode Clang v5.1 to compile QEMU -# endif -# else -# if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 4) -# error You need at least Clang v3.4 to compile QEMU -# endif -# endif -#elif defined(__GNUC__) && defined(__GNUC_MINOR__) -# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8) -# error You need at least GCC v4.8 to compile QEMU -# endif -#else -# error You either need at least GCC 4.8 or Clang 3.4 or XCode Clang 5.1 to compile libvirt -#endif - -/* Ask for warnings for anything that was marked deprecated in - * the defined version, or before. It is a candidate for rewrite. - */ -#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_48 - -/* Ask for warnings if code tries to use function that did not - * exist in the defined version. These risk breaking builds - */ -#define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_2_48 diff --git a/config.h b/config.h index 05cd1507f45..9c433ad4c0f 100644 --- a/config.h +++ b/config.h @@ -1 +1,42 @@ #include <meson-config.h> + +#ifndef __GNUC__ +# error "Libvirt requires GCC >= 4.8, or CLang" +#endif + +/* + * Define __GNUC_PREREQ to a sane default if it isn't yet defined. + * This is done here so that it's included as early as possible; + */ +#ifndef __GNUC_PREREQ +# define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +#endif + +#if defined(__clang_major__) && defined(__clang_minor__) +# ifdef __apple_build_version__ +# if __clang_major__ < 5 || (__clang_major__ == 5 && __clang_minor__ < 1) +# error You need at least XCode Clang v5.1 to compile QEMU +# endif +# else +# if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 4) +# error You need at least Clang v3.4 to compile QEMU +# endif +# endif +#elif defined(__GNUC__) && defined(__GNUC_MINOR__) +# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8) +# error You need at least GCC v4.8 to compile QEMU +# endif +#else +# error You either need at least GCC 4.8 or Clang 3.4 or XCode Clang 5.1 to compile libvirt +#endif + +/* Ask for warnings for anything that was marked deprecated in + * the defined version, or before. It is a candidate for rewrite. + */ +#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_48 + +/* Ask for warnings if code tries to use function that did not + * exist in the defined version. These risk breaking builds + */ +#define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_2_48 diff --git a/configure.ac b/configure.ac index 84e63063e43..7294b61bc46 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,6 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. AC_CONFIG_AUX_DIR([build-aux]) -AH_BOTTOM([#include <config-post.h>]) AC_CONFIG_MACRO_DIR([m4]) dnl Make automake keep quiet about wildcards & other GNUmake-isms AM_INIT_AUTOMAKE([ -- 2.26.2

On a Thursday in 2020, Pavel Hrdina wrote:
With meson we generate meson-config.h into the build directory and include it in config.h so there is no need to have separate config-post.h file.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- config-post.h | 58 --------------------------------------------------- config.h | 41 ++++++++++++++++++++++++++++++++++++ configure.ac | 1 - 3 files changed, 41 insertions(+), 59 deletions(-) delete mode 100644 config-post.h
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 ---- meson.build | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 7294b61bc46..445a44f2e79 100644 --- a/configure.ac +++ b/configure.ac @@ -154,10 +154,6 @@ AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" = "yes"]) if test "$with_win" = "yes" ; then # We don't support the daemon yet with_libvirtd=no - - # For AI_ADDRCONFIG - AC_DEFINE([_WIN32_WINNT], [0x0600], [Win Vista / Server 2008]) - AC_DEFINE([WINVER], [0x0600], [Win Vista / Server 2008]) fi # The daemon requires remote support. Likewise, if we are not using diff --git a/meson.build b/meson.build index 88a163e2ee6..3b149e829d3 100644 --- a/meson.build +++ b/meson.build @@ -32,6 +32,12 @@ conf.set_quoted('PACKAGE_NAME', meson.project_name()) conf.set_quoted('PACKAGE_VERSION', meson.project_version()) conf.set_quoted('VERSION', meson.project_version()) +if host_machine.system() == 'windows' + # For AI_ADDRCONFIG + conf.set('_WIN32_WINNT', '0x0600') # Win Vista / Server 2008 + conf.set('WINVER', '0x0600') # Win Vista / Server 2008 +endif + # set various paths -- 2.26.2

On a Thursday in 2020, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 ---- meson.build | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

We don't use all of the defines so copy only the ones actually used. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 41 ----------------------------------------- configmake.h.in | 16 ++++++++++++++++ meson.build | 23 +++++++++++++++++++++++ 3 files changed, 39 insertions(+), 41 deletions(-) create mode 100644 configmake.h.in diff --git a/Makefile.am b/Makefile.am index fbb3cb09ff1..82ccbac6f91 100644 --- a/Makefile.am +++ b/Makefile.am @@ -63,44 +63,3 @@ gen-AUTHORS: ci-%: $(MAKE) -C $(srcdir)/ci/ $@ - -# Listed in the same order as the GNU makefile conventions, and -# provided by autoconf 2.59c+ or 2.70. -# The Automake-defined pkg* macros are appended, in the order -# listed in the Automake 1.10a+ documentation. -configmake.h: Makefile - $(AM_V_GEN)rm -f $@-t && \ - { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - echo '#if WIN32'; \ - echo '# include <winsock2.h> /* avoid mingw pollution on DATADIR */'; \ - echo '#endif'; \ - echo '#define PREFIX "$(prefix)"'; \ - echo '#define EXEC_PREFIX "$(exec_prefix)"'; \ - echo '#define BINDIR "$(bindir)"'; \ - echo '#define SBINDIR "$(sbindir)"'; \ - echo '#define LIBEXECDIR "$(libexecdir)"'; \ - echo '#define DATAROOTDIR "$(datarootdir)"'; \ - echo '#define DATADIR "$(datadir)"'; \ - echo '#define SYSCONFDIR "$(sysconfdir)"'; \ - echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \ - echo '#define LOCALSTATEDIR "$(localstatedir)"'; \ - echo '#define RUNSTATEDIR "$(runstatedir)"'; \ - echo '#define INCLUDEDIR "$(includedir)"'; \ - echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \ - echo '#define DOCDIR "$(docdir)"'; \ - echo '#define INFODIR "$(infodir)"'; \ - echo '#define HTMLDIR "$(htmldir)"'; \ - echo '#define DVIDIR "$(dvidir)"'; \ - echo '#define PDFDIR "$(pdfdir)"'; \ - echo '#define PSDIR "$(psdir)"'; \ - echo '#define LIBDIR "$(libdir)"'; \ - echo '#define LISPDIR "$(lispdir)"'; \ - echo '#define LOCALEDIR "$(localedir)"'; \ - echo '#define MANDIR "$(mandir)"'; \ - echo '#define MANEXT "$(manext)"'; \ - echo '#define PKGDATADIR "$(pkgdatadir)"'; \ - echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \ - echo '#define PKGLIBDIR "$(pkglibdir)"'; \ - echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \ - } | sed '/""/d' > $@-t && \ - mv -f $@-t $@ diff --git a/configmake.h.in b/configmake.h.in new file mode 100644 index 00000000000..c9930b60493 --- /dev/null +++ b/configmake.h.in @@ -0,0 +1,16 @@ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +#if WIN32 +# include <winsock2.h> /* avoid mingw pollution on DATADIR */ +#endif +#mesondefine BINDIR +#mesondefine DATADIR +#mesondefine LIBDIR +#mesondefine LIBEXECDIR +#mesondefine LOCALEDIR +#mesondefine LOCALSTATEDIR +#mesondefine MANDIR +#mesondefine PKGDATADIR +#mesondefine PREFIX +#mesondefine RUNSTATEDIR +#mesondefine SBINDIR +#mesondefine SYSCONFDIR diff --git a/meson.build b/meson.build index 3b149e829d3..07dacf92009 100644 --- a/meson.build +++ b/meson.build @@ -87,6 +87,29 @@ docdir = datadir / 'doc' / meson.project_name() pkgdatadir = datadir / meson.project_name() +# generate configmake.h header + +configmake_conf = configuration_data() +configmake_conf.set_quoted('BINDIR', bindir) +configmake_conf.set_quoted('DATADIR', datadir) +configmake_conf.set_quoted('LIBDIR', libdir) +configmake_conf.set_quoted('LIBEXECDIR', libexecdir) +configmake_conf.set_quoted('LOCALEDIR', localedir) +configmake_conf.set_quoted('LOCALSTATEDIR', localstatedir) +configmake_conf.set_quoted('MANDIR', mandir) +configmake_conf.set_quoted('PKGDATADIR', pkgdatadir) +configmake_conf.set_quoted('PREFIX', prefix) +configmake_conf.set_quoted('RUNSTATEDIR', runstatedir) +configmake_conf.set_quoted('SBINDIR', sbindir) +configmake_conf.set_quoted('SYSCONFDIR', sysconfdir) + +configure_file( + input: 'configmake.h.in', + output: 'configmake.h', + configuration: configmake_conf, +) + + # figure out libvirt version strings arr_version = meson.project_version().split('.') -- 2.26.2

On a Thursday in 2020, Pavel Hrdina wrote:
We don't use all of the defines so copy only the ones actually used.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 41 ----------------------------------------- configmake.h.in | 16 ++++++++++++++++ meson.build | 23 +++++++++++++++++++++++ 3 files changed, 39 insertions(+), 41 deletions(-) create mode 100644 configmake.h.in
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 13 ------------- meson.build | 14 ++++++++++++++ meson_options.txt | 2 ++ 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index 445a44f2e79..66fc88bd014 100644 --- a/configure.ac +++ b/configure.ac @@ -40,19 +40,6 @@ m4_ifndef([AM_SILENT_RULES], AC_CANONICAL_HOST -LIBVIRT_ARG_WITH([PACKAGER], [Extra packager name], [no]) -LIBVIRT_ARG_WITH([PACKAGER_VERSION], [Extra packager version], [no]) -if test "x$with_packager" != "xno" -then - AC_DEFINE_UNQUOTED([PACKAGER], ["$with_packager"], - [Extra package name]) -fi -if test "x$with_packager_version" != "xno" -then - AC_DEFINE_UNQUOTED([PACKAGER_VERSION], ["$with_packager_version"], - [Extra package version]) -fi - dnl Where we look for daemons and admin binaries during configure LIBVIRT_SBIN_PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin" diff --git a/meson.build b/meson.build index 07dacf92009..633db2df51a 100644 --- a/meson.build +++ b/meson.build @@ -110,6 +110,20 @@ configure_file( ) +# packager options + +packager = get_option('packager') +packager_version = get_option('packager_version') + +if packager != '' + conf.set_quoted('PACKAGER', packager) +endif + +if packager_version != '' + conf.set_quoted('PACKAGER_VERSION', packager_version) +endif + + # figure out libvirt version strings arr_version = meson.project_version().split('.') diff --git a/meson_options.txt b/meson_options.txt index 5338ee89b9a..2281faec429 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,5 @@ option('no-git', type: 'boolean', value: false, description: 'Disable git submodule update') +option('packager', type: 'string', value: '', description: 'Extra packager name') +option('packager_version', type: 'string', value: '', description: 'Extra packager version') option('system', type: 'boolean', value: false, description: 'Set install paths to system ones') option('runstatedir', type: 'string', value: '', description: 'State directory for temporary sockets, pid files, etc') -- 2.26.2

On a Thursday in 2020, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 13 ------------- meson.build | 14 ++++++++++++++ meson_options.txt | 2 ++ 3 files changed, 16 insertions(+), 13 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

With autoconf this option controlled if the test suite is compiled by default or not with the fact that it will be compiled later when running `make check`. With meson it is not possible to compile it later when running `ninja test` as it will be always compiled if referenced by `test()` function in meson.build files. Because of that enable the test suite be default. Enabling it only when compiling from git makes the test suite disabled for `ninja dist` command which builds the code from non-git location. Since that command is closest equivalent of `make distcheck` which runs the test suite. The only drawback from the autoconf state is that users compiling libvirt from tarball will compile the test suite as well even though they will not run it in most cases. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 17 ----------------- meson.build | 5 +++++ meson_options.txt | 1 + 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/configure.ac b/configure.ac index 66fc88bd014..71766f2fe61 100644 --- a/configure.ac +++ b/configure.ac @@ -616,23 +616,6 @@ if test -z "$PERL"; then AC_MSG_ERROR(['perl' binary is required to build libvirt]) fi -LIBVIRT_ARG_WITH([TEST_SUITE], [build test suite by default], [check]) -case "$with_test_suite" in - yes|no|check) ;; - *) AC_MSG_ERROR([bad value ${withval} for tests option]) ;; -esac - -AC_MSG_CHECKING([Whether to build test suite by default]) -if test "$with_test_suite" = "check" ; then - if test -d $srcdir/.git ; then - with_test_suite=yes - else - with_test_suite=no - fi -fi -AC_MSG_RESULT([$with_test_suite]) -AM_CONDITIONAL([WITH_TESTS], [test "$with_test_suite" = "yes"]) - LIBVIRT_ARG_ENABLE([EXPENSIVE_TESTS], [set the default for enabling expensive tests ] [(long timeouts), use VIR_TEST_EXPENSIVE to ] diff --git a/meson.build b/meson.build index 633db2df51a..fee75204d27 100644 --- a/meson.build +++ b/meson.build @@ -124,6 +124,11 @@ if packager_version != '' endif +# test options + +use_test_suite = get_option('test_suite') + + # figure out libvirt version strings arr_version = meson.project_version().split('.') diff --git a/meson_options.txt b/meson_options.txt index 2281faec429..6973b9f6587 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -3,3 +3,4 @@ option('packager', type: 'string', value: '', description: 'Extra packager name' option('packager_version', type: 'string', value: '', description: 'Extra packager version') option('system', type: 'boolean', value: false, description: 'Set install paths to system ones') option('runstatedir', type: 'string', value: '', description: 'State directory for temporary sockets, pid files, etc') +option('test_suite', type: 'boolean', value: true, description: 'Whether to enable and build test suite by default') -- 2.26.2

On Thu, Jul 16, 2020 at 11:54:12 +0200, Pavel Hrdina wrote:
With autoconf this option controlled if the test suite is compiled by default or not with the fact that it will be compiled later when running `make check`.
With meson it is not possible to compile it later when running `ninja test` as it will be always compiled if referenced by `test()` function in meson.build files. Because of that enable the test suite be default.
Enabling it only when compiling from git makes the test suite disabled for `ninja dist` command which builds the code from non-git location. Since that command is closest equivalent of `make distcheck` which runs the test suite.
The only drawback from the autoconf state is that users compiling libvirt from tarball will compile the test suite as well even though they will not run it in most cases.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 17 ----------------- meson.build | 5 +++++ meson_options.txt | 1 + 3 files changed, 6 insertions(+), 17 deletions(-)
[...]
diff --git a/meson_options.txt b/meson_options.txt index 2281faec429..6973b9f6587 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -3,3 +3,4 @@ option('packager', type: 'string', value: '', description: 'Extra packager name' option('packager_version', type: 'string', value: '', description: 'Extra packager version') option('system', type: 'boolean', value: false, description: 'Set install paths to system ones') option('runstatedir', type: 'string', value: '', description: 'State directory for temporary sockets, pid files, etc') +option('test_suite', type: 'boolean', value: true, description: 'Whether to enable and build test suite by default')
Given that you've said that the testsuite is always build, the description is misleadingly noting that it can be avoided.

On a Wednesday in 2020, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:54:12 +0200, Pavel Hrdina wrote:
With autoconf this option controlled if the test suite is compiled by default or not with the fact that it will be compiled later when running `make check`.
With meson it is not possible to compile it later when running `ninja test` as it will be always compiled if referenced by `test()` function in meson.build files. Because of that enable the test suite be default.
Enabling it only when compiling from git makes the test suite disabled for `ninja dist` command which builds the code from non-git location. Since that command is closest equivalent of `make distcheck` which runs the test suite.
The only drawback from the autoconf state is that users compiling libvirt from tarball will compile the test suite as well even though they will not run it in most cases.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 17 ----------------- meson.build | 5 +++++ meson_options.txt | 1 + 3 files changed, 6 insertions(+), 17 deletions(-)
[...]
diff --git a/meson_options.txt b/meson_options.txt index 2281faec429..6973b9f6587 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -3,3 +3,4 @@ option('packager', type: 'string', value: '', description: 'Extra packager name' option('packager_version', type: 'string', value: '', description: 'Extra packager version') option('system', type: 'boolean', value: false, description: 'Set install paths to system ones') option('runstatedir', type: 'string', value: '', description: 'State directory for temporary sockets, pid files, etc') +option('test_suite', type: 'boolean', value: true, description: 'Whether to enable and build test suite by default')
Given that you've said that the testsuite is always build, the description is misleadingly noting that it can be avoided.
If the point of this is just to silently eat the command line option, I'd say just drop it. Maintainers and users will have to adjust anyway. Jano

On Wed, Jul 22, 2020 at 11:25:07AM +0200, Ján Tomko wrote:
On a Wednesday in 2020, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:54:12 +0200, Pavel Hrdina wrote:
With autoconf this option controlled if the test suite is compiled by default or not with the fact that it will be compiled later when running `make check`.
With meson it is not possible to compile it later when running `ninja test` as it will be always compiled if referenced by `test()` function in meson.build files. Because of that enable the test suite be default.
Enabling it only when compiling from git makes the test suite disabled for `ninja dist` command which builds the code from non-git location. Since that command is closest equivalent of `make distcheck` which runs the test suite.
The only drawback from the autoconf state is that users compiling libvirt from tarball will compile the test suite as well even though they will not run it in most cases.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 17 ----------------- meson.build | 5 +++++ meson_options.txt | 1 + 3 files changed, 6 insertions(+), 17 deletions(-)
[...]
diff --git a/meson_options.txt b/meson_options.txt index 2281faec429..6973b9f6587 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -3,3 +3,4 @@ option('packager', type: 'string', value: '', description: 'Extra packager name' option('packager_version', type: 'string', value: '', description: 'Extra packager version') option('system', type: 'boolean', value: false, description: 'Set install paths to system ones') option('runstatedir', type: 'string', value: '', description: 'State directory for temporary sockets, pid files, etc') +option('test_suite', type: 'boolean', value: true, description: 'Whether to enable and build test suite by default')
Given that you've said that the testsuite is always build, the description is misleadingly noting that it can be avoided.
If the point of this is just to silently eat the command line option, I'd say just drop it. Maintainers and users will have to adjust anyway.
Jano
That's true. At some point I was using the return value of this option. I'll drop it completely. Thanks Pavel

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 21 --------------------- meson.build | 6 ++++++ meson_options.txt | 1 + 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/configure.ac b/configure.ac index 71766f2fe61..7b370f4f1be 100644 --- a/configure.ac +++ b/configure.ac @@ -616,27 +616,6 @@ if test -z "$PERL"; then AC_MSG_ERROR(['perl' binary is required to build libvirt]) fi -LIBVIRT_ARG_ENABLE([EXPENSIVE_TESTS], - [set the default for enabling expensive tests ] - [(long timeouts), use VIR_TEST_EXPENSIVE to ] - [override during make], - [check]) -case "$enable_expensive_tests" in - 0|no) VIR_TEST_EXPENSIVE_DEFAULT=0 ;; - 1|yes) VIR_TEST_EXPENSIVE_DEFAULT=1 ;; - check) ;; - *) AC_MSG_ERROR([bad value ${enable_expensive_tests} for enable-expensive-tests option]) ;; -esac -if test "$enable_expensive_tests" = check; then - if test -d $srcdir/.git ; then - VIR_TEST_EXPENSIVE_DEFAULT=0 - else - VIR_TEST_EXPENSIVE_DEFAULT=1 - fi -fi -AC_SUBST([VIR_TEST_EXPENSIVE_DEFAULT]) -AM_CONDITIONAL([WITH_EXPENSIVE_TESTS], [test $VIR_TEST_EXPENSIVE_DEFAULT = 1]) - LIBVIRT_ARG_ENABLE([TEST_COVERAGE], [turn on code coverage instrumentation], [no]) case "$enable_test_coverage" in yes|no) ;; diff --git a/meson.build b/meson.build index fee75204d27..e48525d9d22 100644 --- a/meson.build +++ b/meson.build @@ -128,6 +128,12 @@ endif use_test_suite = get_option('test_suite') +if get_option('expensive_tests').auto() + use_expensive_tests = not git +else + use_expensive_tests = get_option('expensive_tests').enabled() +endif + # figure out libvirt version strings diff --git a/meson_options.txt b/meson_options.txt index 6973b9f6587..f0c4f93ad16 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -4,3 +4,4 @@ option('packager_version', type: 'string', value: '', description: 'Extra packag option('system', type: 'boolean', value: false, description: 'Set install paths to system ones') option('runstatedir', type: 'string', value: '', description: 'State directory for temporary sockets, pid files, etc') option('test_suite', type: 'boolean', value: true, description: 'Whether to enable and build test suite by default') +option('expensive_tests', type: 'feature', value: 'auto', description: 'set the default for enabling expensive tests (long timeouts), use VIR_TEST_EXPENSIVE to override') -- 2.26.2

On a Thursday in 2020, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 21 --------------------- meson.build | 6 ++++++ meson_options.txt | 1 + 3 files changed, 7 insertions(+), 21 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 21 --------------------- meson.build | 16 ++++++++++++++++ meson_options.txt | 1 + 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/configure.ac b/configure.ac index 7b370f4f1be..d76c2d22fc2 100644 --- a/configure.ac +++ b/configure.ac @@ -616,23 +616,6 @@ if test -z "$PERL"; then AC_MSG_ERROR(['perl' binary is required to build libvirt]) fi -LIBVIRT_ARG_ENABLE([TEST_COVERAGE], [turn on code coverage instrumentation], [no]) -case "$enable_test_coverage" in - yes|no) ;; - *) AC_MSG_ERROR([bad value ${enable_test_coverga} for test-coverage option]) ;; -esac - -if test "$enable_test_coverage" = yes; then - save_WARN_CFLAGS=$WARN_CFLAGS - WARN_CFLAGS= - gl_WARN_ADD([-fprofile-arcs]) - gl_WARN_ADD([-ftest-coverage]) - COVERAGE_FLAGS=$WARN_CFLAGS - AC_SUBST([COVERAGE_CFLAGS], [$COVERAGE_FLAGS]) - AC_SUBST([COVERAGE_LDFLAGS], [$COVERAGE_FLAGS]) - WARN_CFLAGS=$save_WARN_CFLAGS -fi - dnl MinGW checks LIBVIRT_WIN_CHECK_COMMON LIBVIRT_WIN_CHECK_MINGW @@ -878,10 +861,6 @@ AC_MSG_NOTICE([]) LIBVIRT_WIN_RESULT_COMMON LIBVIRT_WIN_RESULT_WINDRES AC_MSG_NOTICE([]) -AC_MSG_NOTICE([Test suite]) -AC_MSG_NOTICE([]) -LIBVIRT_RESULT([Coverage], [$enable_test_coverage]) -AC_MSG_NOTICE([]) AC_MSG_NOTICE([Miscellaneous]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_DEBUG diff --git a/meson.build b/meson.build index e48525d9d22..e91d664a77a 100644 --- a/meson.build +++ b/meson.build @@ -134,6 +134,14 @@ else use_expensive_tests = get_option('expensive_tests').enabled() endif +coverage_flags = [] +if get_option('test_coverage') + coverage_flags = [ + '-fprofile-arcs', + '-ftest-coverage', + ] +endif + # figure out libvirt version strings @@ -187,3 +195,11 @@ top_inc_dir = include_directories('.') # generate meson-config.h file configure_file(output: 'meson-config.h', configuration: conf) + + +# print configuration summary + +test_summary = { + 'Coverage': coverage_flags.length() > 0, +} +summary(test_summary, section: 'Test suite', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index f0c4f93ad16..0f79f8aea03 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -5,3 +5,4 @@ option('system', type: 'boolean', value: false, description: 'Set install paths option('runstatedir', type: 'string', value: '', description: 'State directory for temporary sockets, pid files, etc') option('test_suite', type: 'boolean', value: true, description: 'Whether to enable and build test suite by default') option('expensive_tests', type: 'feature', value: 'auto', description: 'set the default for enabling expensive tests (long timeouts), use VIR_TEST_EXPENSIVE to override') +option('test_coverage', type: 'boolean', value: false, description: 'turn on code coverage instrumentation') -- 2.26.2

On a Thursday in 2020, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 21 --------------------- meson.build | 16 ++++++++++++++++ meson_options.txt | 1 + 3 files changed, 17 insertions(+), 21 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 15 --------------- meson.build | 13 +++++++++++++ 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac index d76c2d22fc2..8f16b364de6 100644 --- a/configure.ac +++ b/configure.ac @@ -722,21 +722,6 @@ if test "$want_ifconfig" = "yes"; then AC_DEFINE_UNQUOTED([IFCONFIG_PATH], "$IFCONFIG_PATH", [path to ifconfig binary]) fi -# Detect when running under the clang static analyzer's scan-build driver -# or Coverity-prevent's cov-build. Define STATIC_ANALYSIS accordingly. -AC_CACHE_CHECK([whether this build is done by a static analysis tool], - [lv_cv_static_analysis], [ - lv_cv_static_analysis=no - if test -n "${CCC_ANALYZER_ANALYSIS+set}" || \ - test -n "$COVERITY_BUILD_COMMAND$COVERITY_LD_PRELOAD"; then - lv_cv_static_analysis=yes - fi - ]) -t=0 -test "x$lv_cv_static_analysis" = xyes && t=1 -AC_DEFINE_UNQUOTED([STATIC_ANALYSIS], [$t], - [Define to 1 when performing static analysis.]) - GNUmakefile=GNUmakefile m4_if(m4_version_compare([2.61a.100], m4_defn([m4_PACKAGE_VERSION])), [1], [], diff --git a/meson.build b/meson.build index e91d664a77a..be5e64fc6d2 100644 --- a/meson.build +++ b/meson.build @@ -143,6 +143,19 @@ if get_option('test_coverage') endif +# Detect when running under the + +rc = run_command( + 'sh', '-c', + 'test -n "${CCC_ANALYZER_HTML}"' + + ' -o -n "${CCC_ANALYZER_ANALYSIS+set}"' + + ' -o -n "$COVERITY_BUILD_COMMAND$COVERITY_LD_PRELOAD"', +) +if rc.returncode() == 0 + conf.set('STATIC_ANALYSIS', 1) +endif + + # figure out libvirt version strings arr_version = meson.project_version().split('.') -- 2.26.2

On a Thursday in 2020, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 15 --------------- meson.build | 13 +++++++++++++ 2 files changed, 13 insertions(+), 15 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-manywarnings.m4 | 339 ---------------------------------------- meson.build | 192 +++++++++++++++++++++++ 2 files changed, 192 insertions(+), 339 deletions(-) delete mode 100644 m4/virt-manywarnings.m4 diff --git a/m4/virt-manywarnings.m4 b/m4/virt-manywarnings.m4 deleted file mode 100644 index 783620da3ad..00000000000 --- a/m4/virt-manywarnings.m4 +++ /dev/null @@ -1,339 +0,0 @@ -# manywarnings.m4 serial 18 -dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Simon Josefsson - -# gl_MANYWARN_COMPLEMENT(OUTVAR, LISTVAR, REMOVEVAR) -# -------------------------------------------------- -# Copy LISTVAR to OUTVAR except for the entries in REMOVEVAR. -# Elements separated by whitespace. In set logic terms, the function -# does OUTVAR = LISTVAR \ REMOVEVAR. -AC_DEFUN([gl_MANYWARN_COMPLEMENT], -[ - gl_warn_set= - set x $2; shift - for gl_warn_item - do - case " $3 " in - *" $gl_warn_item "*) - ;; - *) - gl_warn_set="$gl_warn_set $gl_warn_item" - ;; - esac - done - $1=$gl_warn_set -]) - -# gl_MANYWARN_ALL_GCC(VARIABLE) -# ----------------------------- -# Add all documented GCC warning parameters to variable VARIABLE. -# Note that you need to test them using gl_WARN_ADD if you want to -# make sure your gcc understands it. -# -# The effects of this macro depend on the current language (_AC_LANG). -AC_DEFUN([gl_MANYWARN_ALL_GCC], -[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)]) - -# Specialization for _AC_LANG = C. -# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. -m4_defun([gl_MANYWARN_ALL_GCC(C)], -[ - AC_LANG_PUSH([C]) - - dnl First, check for some issues that only occur when combining multiple - dnl gcc warning categories. - AC_REQUIRE([AC_PROG_CC]) - if test -n "$GCC"; then - - dnl Check if -W -Werror -Wno-missing-field-initializers is supported - dnl with the current $CC $CFLAGS $CPPFLAGS. - AC_CACHE_CHECK([whether -Wno-missing-field-initializers is supported], - [gl_cv_cc_nomfi_supported], - [gl_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[]], [[]])], - [gl_cv_cc_nomfi_supported=yes], - [gl_cv_cc_nomfi_supported=no]) - CFLAGS="$gl_save_CFLAGS" - ]) - - if test "$gl_cv_cc_nomfi_supported" = yes; then - dnl Now check whether -Wno-missing-field-initializers is needed - dnl for the { 0, } construct. - AC_CACHE_CHECK([whether -Wno-missing-field-initializers is needed], - [gl_cv_cc_nomfi_needed], - [gl_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -W -Werror" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[int f (void) - { - typedef struct { int a; int b; } s_t; - s_t s1 = { 0, }; - return s1.b; - } - ]], - [[]])], - [gl_cv_cc_nomfi_needed=no], - [gl_cv_cc_nomfi_needed=yes]) - CFLAGS="$gl_save_CFLAGS" - ]) - fi - - dnl Next, check if -Werror -Wuninitialized is useful with the - dnl user's choice of $CFLAGS; some versions of gcc warn that it - dnl has no effect if -O is not also used - AC_CACHE_CHECK([whether -Wuninitialized is supported], - [gl_cv_cc_uninitialized_supported], - [gl_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror -Wuninitialized" - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[]], [[]])], - [gl_cv_cc_uninitialized_supported=yes], - [gl_cv_cc_uninitialized_supported=no]) - CFLAGS="$gl_save_CFLAGS" - ]) - - fi - - # List all gcc warning categories. - # To compare this list to your installed GCC's, run this Bash command: - # - # comm -3 \ - # <((sed -n 's/^ *\(-[^ 0-9][^ ]*\) .*/\1/p' manywarnings.m4; \ - # awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec) | sort) \ - # <(LC_ALL=C gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort) - - gl_manywarn_set= - for gl_manywarn_item in -fno-common \ - -W \ - -Wabsolute-value \ - -Waddress \ - -Waddress-of-packed-member \ - -Waggressive-loop-optimizations \ - -Wall \ - -Wattribute-warning \ - -Wattributes \ - -Wbad-function-cast \ - -Wbool-compare \ - -Wbool-operation \ - -Wbuiltin-declaration-mismatch \ - -Wbuiltin-macro-redefined \ - -Wcannot-profile \ - -Wcast-align \ - -Wcast-align=strict \ - -Wcast-function-type \ - -Wchar-subscripts \ - -Wclobbered \ - -Wcomment \ - -Wcomments \ - -Wcoverage-mismatch \ - -Wcpp \ - -Wdangling-else \ - -Wdate-time \ - -Wdeprecated \ - -Wdeprecated-declarations \ - -Wdesignated-init \ - -Wdisabled-optimization \ - -Wdiscarded-array-qualifiers \ - -Wdiscarded-qualifiers \ - -Wdiv-by-zero \ - -Wdouble-promotion \ - -Wduplicated-branches \ - -Wduplicated-cond \ - -Wduplicate-decl-specifier \ - -Wempty-body \ - -Wendif-labels \ - -Wenum-compare \ - -Wexpansion-to-defined \ - -Wextra \ - -Wformat-contains-nul \ - -Wformat-extra-args \ - -Wformat-nonliteral \ - -Wformat-security \ - -Wformat-signedness \ - -Wformat-y2k \ - -Wformat-zero-length \ - -Wframe-address \ - -Wfree-nonheap-object \ - -Whsa \ - -Wif-not-aligned \ - -Wignored-attributes \ - -Wignored-qualifiers \ - -Wimplicit \ - -Wimplicit-function-declaration \ - -Wimplicit-int \ - -Wincompatible-pointer-types \ - -Winit-self \ - -Winline \ - -Wint-conversion \ - -Wint-in-bool-context \ - -Wint-to-pointer-cast \ - -Winvalid-memory-model \ - -Winvalid-pch \ - -Wlogical-not-parentheses \ - -Wlogical-op \ - -Wmain \ - -Wmaybe-uninitialized \ - -Wmemset-elt-size \ - -Wmemset-transposed-args \ - -Wmisleading-indentation \ - -Wmissing-attributes \ - -Wmissing-braces \ - -Wmissing-declarations \ - -Wmissing-field-initializers \ - -Wmissing-include-dirs \ - -Wmissing-parameter-type \ - -Wmissing-profile \ - -Wmissing-prototypes \ - -Wmultichar \ - -Wmultistatement-macros \ - -Wnarrowing \ - -Wnested-externs \ - -Wnonnull \ - -Wnonnull-compare \ - -Wnull-dereference \ - -Wodr \ - -Wold-style-declaration \ - -Wold-style-definition \ - -Wopenmp-simd \ - -Woverflow \ - -Woverlength-strings \ - -Woverride-init \ - -Wpacked \ - -Wpacked-bitfield-compat \ - -Wpacked-not-aligned \ - -Wparentheses \ - -Wpointer-arith \ - -Wpointer-compare \ - -Wpointer-sign \ - -Wpointer-to-int-cast \ - -Wpragmas \ - -Wpsabi \ - -Wrestrict \ - -Wreturn-local-addr \ - -Wreturn-type \ - -Wscalar-storage-order \ - -Wsequence-point \ - -Wshadow \ - -Wshift-count-negative \ - -Wshift-count-overflow \ - -Wshift-negative-value \ - -Wsizeof-array-argument \ - -Wsizeof-pointer-div \ - -Wsizeof-pointer-memaccess \ - -Wstack-protector \ - -Wstrict-aliasing \ - -Wstrict-overflow \ - -Wstrict-prototypes \ - -Wstringop-truncation \ - -Wsuggest-attribute=cold \ - -Wsuggest-attribute=const \ - -Wsuggest-attribute=format \ - -Wsuggest-attribute=malloc \ - -Wsuggest-attribute=noreturn \ - -Wsuggest-attribute=pure \ - -Wsuggest-final-methods \ - -Wsuggest-final-types \ - -Wswitch \ - -Wswitch-bool \ - -Wswitch-unreachable \ - -Wsync-nand \ - -Wsystem-headers \ - -Wtautological-compare \ - -Wtrampolines \ - -Wtrigraphs \ - -Wtype-limits \ - -Wuninitialized \ - -Wunknown-pragmas \ - -Wunsafe-loop-optimizations \ - -Wunused \ - -Wunused-but-set-parameter \ - -Wunused-but-set-variable \ - -Wunused-function \ - -Wunused-label \ - -Wunused-local-typedefs \ - -Wunused-macros \ - -Wunused-parameter \ - -Wunused-result \ - -Wunused-value \ - -Wunused-variable \ - -Wvarargs \ - -Wvariadic-macros \ - -Wvector-operation-performance \ - -Wvla \ - -Wvolatile-register-var \ - -Wwrite-strings \ - \ - ; do - gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" - done - - # gcc --help=warnings outputs an unusual form for these options; list - # them here so that the above 'comm' command doesn't report a false match. - # Would prefer "min (PTRDIFF_MAX, SIZE_MAX)", but it must be a literal. - # Also, AC_COMPUTE_INT requires it to fit in a long; it is 2**63 on - # the only platforms where it does not fit in a long, so make that - # a special case. - AC_MSG_CHECKING([max safe object size]) - AC_COMPUTE_INT([gl_alloc_max], - [LONG_MAX < (PTRDIFF_MAX < (size_t) -1 ? PTRDIFF_MAX : (size_t) -1) - ? -1 - : PTRDIFF_MAX < (size_t) -1 ? (long) PTRDIFF_MAX : (long) (size_t) -1], - [[#include <limits.h> - #include <stddef.h> - #include <stdint.h> - ]], - [gl_alloc_max=2147483647]) - case $gl_alloc_max in - -1) gl_alloc_max=9223372036854775807;; - esac - AC_MSG_RESULT([$gl_alloc_max]) - gl_manywarn_set="$gl_manywarn_set -Walloc-size-larger-than=$gl_alloc_max" - gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2" - gl_manywarn_set="$gl_manywarn_set -Wattribute-alias=2" - gl_manywarn_set="$gl_manywarn_set -Wformat-overflow=2" - gl_manywarn_set="$gl_manywarn_set -Wformat-truncation=2" - gl_manywarn_set="$gl_manywarn_set -Wimplicit-fallthrough=5" - gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc" - gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2" - gl_manywarn_set="$gl_manywarn_set -Wstringop-overflow=2" - gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2" - gl_manywarn_set="$gl_manywarn_set -Wvla-larger-than=4031" - - # These are needed for older GCC versions. - if test -n "$GCC"; then - case `($CC --version) 2>/dev/null` in - 'gcc (GCC) '[[0-3]].* | \ - 'gcc (GCC) '4.[[0-7]].*) - gl_manywarn_set="$gl_manywarn_set -fdiagnostics-show-option" - gl_manywarn_set="$gl_manywarn_set -funit-at-a-time" - ;; - esac - fi - - # Disable specific options as needed. - if test "$gl_cv_cc_nomfi_needed" = yes; then - gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers" - fi - - if test "$gl_cv_cc_uninitialized_supported" = no; then - gl_manywarn_set="$gl_manywarn_set -Wno-uninitialized" - fi - - $1=$gl_manywarn_set - - AC_LANG_POP([C]) -]) - -# Specialization for _AC_LANG = C++. -# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. -m4_defun([gl_MANYWARN_ALL_GCC(C++)], -[ - gl_MANYWARN_ALL_GCC_CXX_IMPL([$1]) -]) diff --git a/meson.build b/meson.build index be5e64fc6d2..d9a95e049c0 100644 --- a/meson.build +++ b/meson.build @@ -201,6 +201,198 @@ libvirt_revision = arr_version[2].to_int() libvirt_lib_version = '@0@.@1@.@2@'.format(libvirt_so_version, libvirt_age, libvirt_revision) +# check compile flags + +cc = meson.get_compiler('c') + +cc_flags = [ + '-fno-common', + '-W', + '-Wabsolute-value', + '-Waddress', + '-Waddress-of-packed-member', + '-Waggressive-loop-optimizations', + '-Wall', + '-Wattribute-warning', + '-Wattributes', + '-Wbad-function-cast', + '-Wbool-compare', + '-Wbool-operation', + '-Wbuiltin-declaration-mismatch', + '-Wbuiltin-macro-redefined', + '-Wcannot-profile', + '-Wcast-align', + '-Wcast-align=strict', + '-Wcast-function-type', + '-Wchar-subscripts', + '-Wclobbered', + '-Wcomment', + '-Wcomments', + '-Wcoverage-mismatch', + '-Wcpp', + '-Wdangling-else', + '-Wdate-time', + '-Wdeprecated', + '-Wdeprecated-declarations', + '-Wdesignated-init', + '-Wdisabled-optimization', + '-Wdiscarded-array-qualifiers', + '-Wdiscarded-qualifiers', + '-Wdiv-by-zero', + '-Wdouble-promotion', + '-Wduplicated-branches', + '-Wduplicated-cond', + '-Wduplicate-decl-specifier', + '-Wempty-body', + '-Wendif-labels', + '-Wenum-compare', + '-Wexpansion-to-defined', + '-Wextra', + '-Wformat-contains-nul', + '-Wformat-extra-args', + '-Wformat-nonliteral', + '-Wformat-security', + '-Wformat-signedness', + '-Wformat-y2k', + '-Wformat-zero-length', + '-Wframe-address', + '-Wfree-nonheap-object', + '-Whsa', + '-Wif-not-aligned', + '-Wignored-attributes', + '-Wignored-qualifiers', + '-Wimplicit', + '-Wimplicit-function-declaration', + '-Wimplicit-int', + '-Wincompatible-pointer-types', + '-Winit-self', + '-Winline', + '-Wint-conversion', + '-Wint-in-bool-context', + '-Wint-to-pointer-cast', + '-Winvalid-memory-model', + '-Winvalid-pch', + '-Wlogical-not-parentheses', + '-Wlogical-op', + '-Wmain', + '-Wmaybe-uninitialized', + '-Wmemset-elt-size', + '-Wmemset-transposed-args', + '-Wmisleading-indentation', + '-Wmissing-attributes', + '-Wmissing-braces', + '-Wmissing-declarations', + '-Wmissing-field-initializers', + '-Wmissing-include-dirs', + '-Wmissing-parameter-type', + '-Wmissing-profile', + '-Wmissing-prototypes', + '-Wmultichar', + '-Wmultistatement-macros', + '-Wnarrowing', + '-Wnested-externs', + '-Wnonnull', + '-Wnonnull-compare', + '-Wnull-dereference', + '-Wodr', + '-Wold-style-declaration', + '-Wold-style-definition', + '-Wopenmp-simd', + '-Woverflow', + '-Woverlength-strings', + '-Woverride-init', + '-Wpacked', + '-Wpacked-bitfield-compat', + '-Wpacked-not-aligned', + '-Wparentheses', + '-Wpointer-arith', + '-Wpointer-compare', + '-Wpointer-sign', + '-Wpointer-to-int-cast', + '-Wpragmas', + '-Wpsabi', + '-Wrestrict', + '-Wreturn-local-addr', + '-Wreturn-type', + '-Wscalar-storage-order', + '-Wsequence-point', + '-Wshadow', + '-Wshift-count-negative', + '-Wshift-count-overflow', + '-Wshift-negative-value', + '-Wsizeof-array-argument', + '-Wsizeof-pointer-div', + '-Wsizeof-pointer-memaccess', + '-Wstack-protector', + '-Wstrict-aliasing', + '-Wstrict-overflow', + '-Wstrict-prototypes', + '-Wstringop-truncation', + '-Wsuggest-attribute=cold', + '-Wsuggest-attribute=const', + '-Wsuggest-attribute=format', + '-Wsuggest-attribute=malloc', + '-Wsuggest-attribute=noreturn', + '-Wsuggest-attribute=pure', + '-Wsuggest-final-methods', + '-Wsuggest-final-types', + '-Wswitch', + '-Wswitch-bool', + '-Wswitch-unreachable', + '-Wsync-nand', + '-Wsystem-headers', + '-Wtautological-compare', + '-Wtrampolines', + '-Wtrigraphs', + '-Wtype-limits', + '-Wuninitialized', + '-Wunknown-pragmas', + '-Wunsafe-loop-optimizations', + '-Wunused', + '-Wunused-but-set-parameter', + '-Wunused-but-set-variable', + '-Wunused-function', + '-Wunused-label', + '-Wunused-local-typedefs', + '-Wunused-macros', + '-Wunused-parameter', + '-Wunused-result', + '-Wunused-value', + '-Wunused-variable', + '-Wvarargs', + '-Wvariadic-macros', + '-Wvector-operation-performance', + '-Wvla', + '-Wvolatile-register-var', + '-Wwrite-strings', +] + +# gcc --help=warnings outputs +ptrdiff_max = cc.sizeof('ptrdiff_t', prefix: '#include <stddef.h>') +size_max = cc.sizeof('size_t', prefix: '#include <stdint.h>') +# Compute max safe object size by checking ptrdiff_t and size_t sizes. +# Ideally we would get PTRDIFF_MAX and SIZE_MAX values but it would +# give us (2147483647L) and we would have to remove the () and the suffix +# in order to convert it to numbers to be able to pick the smaller one. +alloc_max = run_command( + 'python3', '-c', + 'print(min(2**@0@ - 1, 2**@1@ - 1))'.format(ptrdiff_max * 8 - 1, size_max * 8), +) +cc_flags += [ + '-Walloc-size-larger-than=@0@'.format(alloc_max.stdout().strip()), + '-Warray-bounds=2', + '-Wattribute-alias=2', + '-Wformat-overflow=2', + '-Wformat-truncation=2', + '-Wimplicit-fallthrough=5', + '-Wnormalized=nfc', + '-Wshift-overflow=2', + '-Wstringop-overflow=2', + '-Wunused-const-variable=2', + '-Wvla-larger-then=4031', +] + + # define top include directory top_inc_dir = include_directories('.') -- 2.26.2

On Thu, Jul 16, 2020 at 11:54:16 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-manywarnings.m4 | 339 ---------------------------------------- meson.build | 192 +++++++++++++++++++++++ 2 files changed, 192 insertions(+), 339 deletions(-) delete mode 100644 m4/virt-manywarnings.m4
[..]
+# gcc --help=warnings outputs +ptrdiff_max = cc.sizeof('ptrdiff_t', prefix: '#include <stddef.h>') +size_max = cc.sizeof('size_t', prefix: '#include <stdint.h>') +# Compute max safe object size by checking ptrdiff_t and size_t sizes. +# Ideally we would get PTRDIFF_MAX and SIZE_MAX values but it would +# give us (2147483647L) and we would have to remove the () and the suffix +# in order to convert it to numbers to be able to pick the smaller one. +alloc_max = run_command( + 'python3', '-c', + 'print(min(2**@0@ - 1, 2**@1@ - 1))'.format(ptrdiff_max * 8 - 1, size_max * 8), +)
Preferrably do all the math in the python you call if you already must call it.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- config.h | 7 + configure.ac | 3 - m4/virt-compile-warnings.m4 | 255 ------------------------------------ m4/virt-warnings.m4 | 115 ---------------- meson.build | 221 ++++++++++++++++++++++++++++--- 5 files changed, 211 insertions(+), 390 deletions(-) delete mode 100644 m4/virt-compile-warnings.m4 delete mode 100644 m4/virt-warnings.m4 diff --git a/config.h b/config.h index 9c433ad4c0f..368688f3d01 100644 --- a/config.h +++ b/config.h @@ -1,5 +1,12 @@ #include <meson-config.h> +/* Enable compile-time and run-time bounds-checking, and some warnings, + * without upsetting newer glibc. */ + +#if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ +# define _FORTIFY_SOURCE 2 +#endif + #ifndef __GNUC__ # error "Libvirt requires GCC >= 4.8, or CLang" #endif diff --git a/configure.ac b/configure.ac index 8f16b364de6..56a471fc3ab 100644 --- a/configure.ac +++ b/configure.ac @@ -161,7 +161,6 @@ fi # Check for compiler and library settings. -LIBVIRT_COMPILE_WARNINGS LIBVIRT_LINKER_RELRO LIBVIRT_LINKER_NO_INDIRECT LIBVIRT_LINKER_NO_UNDEFINED @@ -849,8 +848,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Miscellaneous]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_DEBUG -LIBVIRT_RESULT([Use -Werror], [$enable_werror]) -LIBVIRT_RESULT([Warning Flags], [$WARN_CFLAGS]) LIBVIRT_RESULT_DTRACE LIBVIRT_RESULT_NUMAD LIBVIRT_RESULT_INIT_SCRIPT diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4 deleted file mode 100644 index d3538d59f82..00000000000 --- a/m4/virt-compile-warnings.m4 +++ /dev/null @@ -1,255 +0,0 @@ -dnl -dnl Enable all known GCC compiler warnings, except for those -dnl we can't yet cope with -dnl -AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[ - dnl ****************************** - dnl More compiler warnings - dnl ****************************** - - LIBVIRT_ARG_ENABLE([WERROR], [Use -Werror (if supported)], [check]) - if test "$enable_werror" = "check"; then - if test -d $srcdir/.git; then - is_git_version=true - enable_werror=yes - else - enable_werror=no - fi - fi - - # List of warnings that are not relevant / wanted - - # Don't care about C++ compiler compat - dontwarn="$dontwarn -Wc++-compat" - dontwarn="$dontwarn -Wabi" - dontwarn="$dontwarn -Wdeprecated" - # Don't care about ancient C standard compat - dontwarn="$dontwarn -Wtraditional" - # Don't care about ancient C standard compat - dontwarn="$dontwarn -Wtraditional-conversion" - # Ignore warnings in /usr/include - dontwarn="$dontwarn -Wsystem-headers" - # Happy for compiler to add struct padding - dontwarn="$dontwarn -Wpadded" - # GCC very confused with -O2 - dontwarn="$dontwarn -Wunreachable-code" - # Too many to deal with - dontwarn="$dontwarn -Wconversion" - # Too many to deal with - dontwarn="$dontwarn -Wsign-conversion" - # Need to allow bad cast for execve() - dontwarn="$dontwarn -Wcast-qual" - # We need to use long long in many places - dontwarn="$dontwarn -Wlong-long" - # We allow manual list of all enum cases without default: - dontwarn="$dontwarn -Wswitch-default" - # Not a problem since we don't use -fstrict-overflow - dontwarn="$dontwarn -Wstrict-overflow" - # Not a problem since we don't use -funsafe-loop-optimizations - dontwarn="$dontwarn -Wunsafe-loop-optimizations" - # gcc 4.4.6 complains this is C++ only; gcc 4.7.0 implies this from -Wall - dontwarn="$dontwarn -Wenum-compare" - # gcc 5.1 -Wformat-signedness mishandles enums, not ready for prime time - dontwarn="$dontwarn -Wformat-signedness" - # Several conditionals expand the same on both branches - # depending on the particular platform/architecture - dontwarn="$dontwarn -Wduplicated-branches" - # > This warning does not generally indicate that there is anything wrong - # > with your code; it merely indicates that GCC's optimizers are unable - # > to handle the code effectively. - # Source: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html - dontwarn="$dontwarn -Wdisabled-optimization" - # Various valid glib APIs/macros trigger this warning - dontwarn="$dontwarn -Wbad-function-cast" - - # Broken in 6.0 and later - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602 - AC_CACHE_CHECK([whether gcc gives bogus warnings for -Wlogical-op], - [lv_cv_gcc_wlogical_op_equal_expr_broken], [ - save_CFLAGS="$CFLAGS" - CFLAGS="-O2 -Wlogical-op -Werror" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #define TEST1 1 - #define TEST2 TEST1 - ]], [[ - int test = 0; - return test == TEST1 || test == TEST2;]])], - [lv_cv_gcc_wlogical_op_equal_expr_broken=no], - [lv_cv_gcc_wlogical_op_equal_expr_broken=yes]) - CFLAGS="$save_CFLAGS"]) - - AC_CACHE_CHECK([whether clang gives bogus warnings for -Wdouble-promotion], - [lv_cv_clang_double_promotion_broken], [ - save_CFLAGS="$CFLAGS" - CFLAGS="-O2 -Wdouble-promotion -Werror" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include <math.h> - ]], [[ - float f = 0.0; - return isnan(f);]])], - [lv_cv_clang_double_promotion_broken=no], - [lv_cv_clang_double_promotion_broken=yes]) - CFLAGS="$save_CFLAGS"]) - - if test "$lv_cv_clang_double_promotion_broken" = "yes"; - then - dontwarn="$dontwarn -Wdouble-promotion" - fi - - # Clang complains about unused static inline functions - # which are common with G_DEFINE_AUTOPTR_CLEANUP_FUNC - AC_CACHE_CHECK([whether clang gives bogus warnings for -Wunused-function], - [lv_cv_clang_unused_function_broken], [ - save_CFLAGS="$CFLAGS" - CFLAGS="-Wunused-function -Werror" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - static inline void foo(void) {} - ]], [[ - return 0]])], - [lv_cv_clang_unused_function_broken=no], - [lv_cv_clang_unused_function_broken=yes]) - CFLAGS="$save_CFLAGS"]) - - # We might fundamentally need some of these disabled forever, but - # ideally we'd turn many of them on - dontwarn="$dontwarn -Wfloat-equal" - dontwarn="$dontwarn -Wdeclaration-after-statement" - dontwarn="$dontwarn -Wpacked" - dontwarn="$dontwarn -Wunused-macros" - dontwarn="$dontwarn -Woverlength-strings" - dontwarn="$dontwarn -Wstack-protector" - dontwarn="$dontwarn -Wsuggest-attribute=malloc" - - # Get all possible GCC warnings - gl_MANYWARN_ALL_GCC([maybewarn]) - - # Remove the ones we don't want, blacklisted earlier - gl_MANYWARN_COMPLEMENT([wantwarn], [$maybewarn], [$dontwarn]) - - # -Wunused-functin is implied by -Wall we must turn it - # off explicitly. - if test "$lv_cv_clang_unused_function_broken" = "yes"; - then - wantwarn="$wantwarn -Wno-unused-function" - fi - - # manywarnings uses '-W' (aka -Wextra) which includes a bunch of stuff. - # Unfortunately, this means you can't simply use '-Wsign-compare' - # with gl_MANYWARN_COMPLEMENT - # So we have -W enabled, and then have to explicitly turn off... - wantwarn="$wantwarn -Wno-sign-compare" - # We do "bad" function casts all the time for event callbacks - wantwarn="$wantwarn -Wno-cast-function-type" - - # CLang incorrectly complains about dup typedefs win gnu99 mode - # so use this CLang-specific arg to keep it quiet - wantwarn="$wantwarn -Wno-typedef-redefinition" - - # manywarnings expects this to be part of -Wc++-compat, but we turn - # that one off, so we need to manually enable this again - wantwarn="$wantwarn -Wjump-misses-init" - - # manywarnings explicitly filters it out, preferring -Wswitch - # but that doesn't report missing enums if a default: - # is present. - wantwarn="$wantwarn -Wswitch-enum" - - # manywarnings turns on -Wformat=2 which implies -Wformat-nonliteral, - # so we need to manually re-exclude it. - wantwarn="$wantwarn -Wno-format-nonliteral" - - # -Wformat enables this by default, and we should keep it, - # but need to rewrite various areas of code first - wantwarn="$wantwarn -Wno-format-truncation" - - # This should be < 256 really. Currently we're down to 4096, - # but using 1024 bytes sized buffers (mostly for virStrerror) - # stops us from going down further - wantwarn="$wantwarn -Wframe-larger-than=4096" - gl_WARN_ADD([-Wframe-larger-than=262144], [RELAXED_FRAME_LIMIT_CFLAGS]) - - # Extra special flags - dnl -fstack-protector stuff passes gl_WARN_ADD with gcc - dnl on Mingw32, but fails when actually used - case $host in - aarch64-*-*) - dnl "error: -fstack-protector not supported for this target [-Werror]" - ;; - *-*-linux*) - dnl Prefer -fstack-protector-strong if it's available. - dnl There doesn't seem to be great overhead in adding - dnl -fstack-protector-all instead of -fstack-protector. - dnl - dnl We also don't need ssp-buffer-size with -all or -strong, - dnl since functions are protected regardless of buffer size. - dnl wantwarn="$wantwarn --param=ssp-buffer-size=4" - wantwarn="$wantwarn -fstack-protector-strong" - ;; - *-*-freebsd*) - dnl FreeBSD ships old gcc 4.2.1 which doesn't handle - dnl -fstack-protector-all well - wantwarn="$wantwarn -fstack-protector" - - wantwarn="$wantwarn -Wno-unused-command-line-argument" - ;; - esac - wantwarn="$wantwarn -fexceptions" - wantwarn="$wantwarn -fasynchronous-unwind-tables" - - # Need -fipa-pure-const in order to make -Wsuggest-attribute=pure - # fire even without -O. - wantwarn="$wantwarn -fipa-pure-const" - # We should eventually enable this, but right now there are at - # least 75 functions triggering warnings. - wantwarn="$wantwarn -Wno-suggest-attribute=pure" - wantwarn="$wantwarn -Wno-suggest-attribute=const" - - if test "$enable_werror" = "yes" - then - wantwarn="$wantwarn -Werror" - fi - - # Request the gnu99 standard which is the best choice with - # gcc 4.8.0. Not a warning flag, but the probing mechanism - # is convenient - wantwarn="$wantwarn -std=gnu99" - - # Check for $CC support of each warning - for w in $wantwarn; do - gl_WARN_ADD([$w]) - done - - case $host in - *-*-linux*) - dnl Fall back to -fstack-protector-all if -strong is not available - case $WARN_CFLAGS in - *-fstack-protector-strong*) - ;; - *) - gl_WARN_ADD([-fstack-protector-all]) - ;; - esac - ;; - esac - - case $WARN_CFLAGS in - *-Wsuggest-attribute=format*) - AC_DEFINE([HAVE_SUGGEST_ATTRIBUTE_FORMAT], [1], [Whether -Wsuggest-attribute=format works]) - ;; - esac - - # Use security checked glibc headers - AH_VERBATIM([FORTIFY_SOURCE], - [/* Enable compile-time and run-time bounds-checking, and some warnings, - without upsetting newer glibc. */ - #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ - # define _FORTIFY_SOURCE 2 - #endif - ]) - - if test "$gl_cv_warn_c__Wlogical_op" = yes && - test "$lv_cv_gcc_wlogical_op_equal_expr_broken" = yes; then - AC_DEFINE_UNQUOTED([BROKEN_GCC_WLOGICALOP_EQUAL_EXPR], 1, - [Define to 1 if gcc -Wlogical-op reports false positive 'or' equal expr]) - fi -]) diff --git a/m4/virt-warnings.m4 b/m4/virt-warnings.m4 deleted file mode 100644 index d272365f0a1..00000000000 --- a/m4/virt-warnings.m4 +++ /dev/null @@ -1,115 +0,0 @@ -# warnings.m4 serial 14 -dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Simon Josefsson - -# gl_AS_VAR_APPEND(VAR, VALUE) -# ---------------------------- -# Provide the functionality of AS_VAR_APPEND if Autoconf does not have it. -m4_ifdef([AS_VAR_APPEND], -[m4_copy([AS_VAR_APPEND], [gl_AS_VAR_APPEND])], -[m4_define([gl_AS_VAR_APPEND], -[AS_VAR_SET([$1], [AS_VAR_GET([$1])$2])])]) - - -# gl_COMPILER_OPTION_IF(OPTION, [IF-SUPPORTED], [IF-NOT-SUPPORTED], -# [PROGRAM = AC_LANG_PROGRAM()]) -# ----------------------------------------------------------------- -# Check if the compiler supports OPTION when compiling PROGRAM. -# -# The effects of this macro depend on the current language (_AC_LANG). -AC_DEFUN([gl_COMPILER_OPTION_IF], -[ -dnl FIXME: gl_Warn must be used unquoted until we can assume Autoconf -dnl 2.64 or newer. -AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl -AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl -AS_LITERAL_IF([$1], - [m4_pushdef([gl_Positive], m4_bpatsubst([$1], [^-Wno-], [-W]))], - [gl_positive="$1" -case $gl_positive in - -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; -esac -m4_pushdef([gl_Positive], [$gl_positive])])dnl -AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [ - gl_save_compiler_FLAGS="$gl_Flags" - gl_AS_VAR_APPEND(m4_defn([gl_Flags]), - [" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["]) - AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])], - [AS_VAR_SET(gl_Warn, [yes])], - [AS_VAR_SET(gl_Warn, [no])]) - gl_Flags="$gl_save_compiler_FLAGS" -]) -AS_VAR_IF(gl_Warn, [yes], [$2], [$3]) -m4_popdef([gl_Positive])dnl -AS_VAR_POPDEF([gl_Flags])dnl -AS_VAR_POPDEF([gl_Warn])dnl -]) - -# gl_UNKNOWN_WARNINGS_ARE_ERRORS -# ------------------------------ -# Clang doesn't complain about unknown warning options unless one also -# specifies -Wunknown-warning-option -Werror. Detect this. -# -# The effects of this macro depend on the current language (_AC_LANG). -AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS], -[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)]) - -# Specialization for _AC_LANG = C. This macro can be AC_REQUIREd. -# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. -m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C)], -[ - AC_LANG_PUSH([C]) - gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL - AC_LANG_POP([C]) -]) - -# Specialization for _AC_LANG = C++. This macro can be AC_REQUIREd. -# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. -m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)], -[ - AC_LANG_PUSH([C++]) - gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL - AC_LANG_POP([C++]) -]) - -# Specialization for _AC_LANG = Objective C. This macro can be AC_REQUIREd. -# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. -m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(Objective C)], -[ - AC_LANG_PUSH([Objective C]) - gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL - AC_LANG_POP([Objective C]) -]) - -AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL], -[gl_COMPILER_OPTION_IF([-Werror -Wunknown-warning-option], - [gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'], - [gl_unknown_warnings_are_errors=])]) - -# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS/WARN_CXXFLAGS], -# [PROGRAM = AC_LANG_PROGRAM()]) -# ----------------------------------------------------------- -# Adds parameter to WARN_CFLAGS/WARN_CXXFLAGS if the compiler supports it -# when compiling PROGRAM. For example, gl_WARN_ADD([-Wparentheses]). -# -# If VARIABLE is a variable name, AC_SUBST it. -# -# The effects of this macro depend on the current language (_AC_LANG). -AC_DEFUN([gl_WARN_ADD], -[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS(]_AC_LANG[)]) -gl_COMPILER_OPTION_IF([$1], - [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_]_AC_LANG_PREFIX[FLAGS]], [[$2]]), [" $1"])], - [], - [$3]) -m4_ifval([$2], - [AS_LITERAL_IF([$2], [AC_SUBST([$2])])], - [AC_SUBST([WARN_]_AC_LANG_PREFIX[FLAGS])])dnl -]) - -# Local Variables: -# mode: autoconf -# End: diff --git a/meson.build b/meson.build index d9a95e049c0..2450a8bdd79 100644 --- a/meson.build +++ b/meson.build @@ -7,6 +7,7 @@ project( 'buildtype=debugoptimized', 'b_pie=true', 'c_std=gnu99', + 'warning_level=2', ], ) @@ -212,10 +213,8 @@ cc_flags = [ '-Waddress', '-Waddress-of-packed-member', '-Waggressive-loop-optimizations', - '-Wall', '-Wattribute-warning', '-Wattributes', - '-Wbad-function-cast', '-Wbool-compare', '-Wbool-operation', '-Wbuiltin-declaration-mismatch', @@ -232,27 +231,20 @@ cc_flags = [ '-Wcpp', '-Wdangling-else', '-Wdate-time', - '-Wdeprecated', '-Wdeprecated-declarations', '-Wdesignated-init', - '-Wdisabled-optimization', '-Wdiscarded-array-qualifiers', '-Wdiscarded-qualifiers', '-Wdiv-by-zero', - '-Wdouble-promotion', - '-Wduplicated-branches', '-Wduplicated-cond', '-Wduplicate-decl-specifier', '-Wempty-body', '-Wendif-labels', - '-Wenum-compare', '-Wexpansion-to-defined', - '-Wextra', '-Wformat-contains-nul', '-Wformat-extra-args', '-Wformat-nonliteral', '-Wformat-security', - '-Wformat-signedness', '-Wformat-y2k', '-Wformat-zero-length', '-Wframe-address', @@ -299,9 +291,7 @@ cc_flags = [ '-Wold-style-definition', '-Wopenmp-simd', '-Woverflow', - '-Woverlength-strings', '-Woverride-init', - '-Wpacked', '-Wpacked-bitfield-compat', '-Wpacked-not-aligned', '-Wparentheses', @@ -323,15 +313,12 @@ cc_flags = [ '-Wsizeof-array-argument', '-Wsizeof-pointer-div', '-Wsizeof-pointer-memaccess', - '-Wstack-protector', '-Wstrict-aliasing', - '-Wstrict-overflow', '-Wstrict-prototypes', '-Wstringop-truncation', '-Wsuggest-attribute=cold', '-Wsuggest-attribute=const', '-Wsuggest-attribute=format', - '-Wsuggest-attribute=malloc', '-Wsuggest-attribute=noreturn', '-Wsuggest-attribute=pure', '-Wsuggest-final-methods', @@ -340,21 +327,18 @@ cc_flags = [ '-Wswitch-bool', '-Wswitch-unreachable', '-Wsync-nand', - '-Wsystem-headers', '-Wtautological-compare', '-Wtrampolines', '-Wtrigraphs', '-Wtype-limits', '-Wuninitialized', '-Wunknown-pragmas', - '-Wunsafe-loop-optimizations', '-Wunused', '-Wunused-but-set-parameter', '-Wunused-but-set-variable', '-Wunused-function', '-Wunused-label', '-Wunused-local-typedefs', - '-Wunused-macros', '-Wunused-parameter', '-Wunused-result', '-Wunused-value', @@ -392,6 +376,203 @@ cc_flags += [ '-Wvla-larger-then=4031', ] +cc_flags += [ + # So we have -W enabled, and then have to explicitly turn off... + '-Wno-sign-compare', + + # We do "bad" function casts all the time for event callbacks + '-Wno-cast-function-type', + + # CLang incorrectly complains about dup typedefs win gnu99 mode + # so use this CLang-specific arg to keep it quiet + '-Wno-typedef-redefinition', + + # We don't use -Wc++-compat so we have to enable it explicitly + '-Wjump-misses-init', + + # TODO comment + '-Wswitch-enum', + + # -Wformat=2 implies -Wformat-nonliteral so we need to manually exclude it + '-Wno-format-nonliteral', + + # -Wformat enables this by default, and we should keep it, + # but need to rewrite various areas of code first + '-Wno-format-truncation', + + # This should be < 256 really. Currently we're down to 4096, + # but using 1024 bytes sized buffers (mostly for virStrerror) + # stops us from going down further + '-Wframe-larger-than=4096', + + # extra special flags + '-fexceptions', + '-fasynchronous-unwind-tables', + + # Need -fipa-pure-const in order to make -Wsuggest-attribute=pure + # fire even without -O. + '-fipa-pure-const', + + # We should eventually enable this, but right now there are at + # least 75 functions triggering warnings. + '-Wno-suggest-attribute=pure', + '-Wno-suggest-attribute=const', +] + +if git + cc_flags += [ '-Werror' ] +endif + +# on aarch64 error: -fstack-protector not supported for this target +# on mingw32 it is supported but fails when actually used +if host_machine.cpu_family() != 'aarch64' + if host_machine.system() in [ 'linux', 'freebsd' ] + # we prefer -fstack-protector-strong but fallback to -fstack-protector-all + cc_flags += cc.first_supported_argument([ + '-fstack-protector-strong', + '-fstack-protector-all', + ]) + endif +endif + +if cc.has_argument('-Wlogical-op') + # Broken in 6.0 and later + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602 + w_logical_op_args = ['-O2', '-Wlogical-op', '-Werror'] + w_logical_op_code = ''' + #define TEST1 1 + #define TEST2 TEST1 + + int main(void) { + int test = 0; + return test == TEST1 || test == TEST2; + } + ''' + if not cc.compiles(w_logical_op_code, args: w_logical_op_args) + conf.set('BROKEN_GCC_WLOGICALOP_EQUAL_EXPR', 1) + endif +endif + +# Check whether clang gives bogus warning for -Wdouble-promotion. +w_double_promotion_args = ['-O2', '-Wdouble-promotion', '-Werror'] +w_double_promotion_code = ''' + #include <math.h> + + int main(void) { + float f = 0.0; + return isnan(f); + } +''' +if cc.compiles(w_double_promotion_code, args: w_double_promotion_args, name: '-Wdouble-promotion') + cc_flags += ['-Wdouble-promotion'] +endif + +# Clang complains about unused static inline functions which are common +# with G_DEFINE_AUTOPTR_CLEANUP_FUNC. +w_unused_function_args = ['-Wunused-function', '-Werror'] +w_unused_function_code = ''' + static inline void foo(void) {} + + int main(void) { return 0; } +''' +# -Wunused-function is implied by -Wall, we must turn it off explicitly. +if not cc.compiles(w_unused_function_code, args: w_unused_function_args) + cc_flags += ['-Wno-unused-function'] +endif + +cc_flags_disabled = [ + # In meson this is specified using 'c_std=gnu99' in project() function. + '-std=gnu99', + + # In meson this is specified using 'warning_level=2' in project() function. + '-Wall', + '-Wextra', + + # don't care about C++ compiler compat + '-Wc++-compat', + '-Wabi', + '-Wdeprecated', + + # Don't care about ancient C standard compat + '-Wtraditional', + '-Wtraditional-conversion', + + # Ignore warnings in /usr/include + '-Wsystem-headers', + + # Happy for compiler to add struct padding + '-Wpadded', + + # GCC very confused with -O2 + '-Wunreachable-code', + + # Too many to deal with + '-Wconversion', + '-Wsign-conversion', + + # Need to allow bad cast for execve() + '-Wcast-qual', + + # We need to use long long in many places + '-Wlong-long', + + # We allow manual list of all enum cases without default + '-Wswitch-default', + + # Not a problem since we don't use -fstrict-overflow + '-Wstrict-overflow', + + # Not a problem since we don't use -funsafe-loop-optimizations + '-Wunsafe-loop-optimizations', + + # gcc 4.4.6 complains this is C++ only; gcc 4.7.0 implies this from -Wall + '-Wenum-compare', + + # gcc 5.1 -Wformat-signedness mishandles enums, not ready for prime time + '-Wformat-signedness', + + # Several conditionals expand the same on both branches depending on the + # particular platform/architecture + '-Wduplicated-branches', + + # > This warning does not generally indicate that there is anything wrong + # > with your code; it merely indicates that GCC's optimizers are unable + # > to handle the code effectively. + # Source: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html + '-Wdisabled-optimization', + + # Various valid glib APIs/macros trigger this warning + '-Wbad-function-cast', + + # We might fundamentally need some of these disabled forever, but + # ideally we'd turn many of them on + '-Wfloat-equal', + '-Wdeclaration-after-statement', + '-Wpacked', + '-Wunused-macros', + '-Woverlength-strings', + '-Wstack-protector', + '-Wsuggest-attribute=malloc', +] + +foreach flag : cc_flags_disabled + if cc_flags.contains(flag) + error('@0@ is disabled but listed in cc_flags'.format(flag)) + endif +endforeach + +supported_cc_flags = cc.get_supported_arguments(cc_flags) +add_project_arguments(supported_cc_flags, language: 'c') + +if cc.has_argument('-Wsuggest-attribute=format') + conf.set('HAVE_SUGGEST_ATTRIBUTE_FORMAT', 1) +endif + +# used in tests +cc_flags_relaxed_frame_limit = [ + '-Wframe-larger-than=262144', +] + # define top include directory @@ -408,3 +589,9 @@ test_summary = { 'Coverage': coverage_flags.length() > 0, } summary(test_summary, section: 'Test suite', bool_yn: true) + +misc_summary = { + 'Use -Werror': cc_flags.contains('-Werror'), + 'Warning Flags': supported_cc_flags, +} +summary(misc_summary, section: 'Miscellaneous', bool_yn: true, list_sep: ' ') -- 2.26.2

On Thu, Jul 16, 2020 at 11:54:17 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- config.h | 7 + configure.ac | 3 - m4/virt-compile-warnings.m4 | 255 ------------------------------------ m4/virt-warnings.m4 | 115 ---------------- meson.build | 221 ++++++++++++++++++++++++++++--- 5 files changed, 211 insertions(+), 390 deletions(-) delete mode 100644 m4/virt-compile-warnings.m4 delete mode 100644 m4/virt-warnings.m4
diff --git a/config.h b/config.h index 9c433ad4c0f..368688f3d01 100644 --- a/config.h +++ b/config.h @@ -1,5 +1,12 @@ #include <meson-config.h>
+/* Enable compile-time and run-time bounds-checking, and some warnings, + * without upsetting newer glibc. */ + +#if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ +# define _FORTIFY_SOURCE 2 +#endif + #ifndef __GNUC__ # error "Libvirt requires GCC >= 4.8, or CLang" #endif diff --git a/configure.ac b/configure.ac index 8f16b364de6..56a471fc3ab 100644 --- a/configure.ac +++ b/configure.ac @@ -161,7 +161,6 @@ fi
# Check for compiler and library settings.
-LIBVIRT_COMPILE_WARNINGS LIBVIRT_LINKER_RELRO LIBVIRT_LINKER_NO_INDIRECT LIBVIRT_LINKER_NO_UNDEFINED @@ -849,8 +848,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Miscellaneous]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_DEBUG -LIBVIRT_RESULT([Use -Werror], [$enable_werror]) -LIBVIRT_RESULT([Warning Flags], [$WARN_CFLAGS]) LIBVIRT_RESULT_DTRACE LIBVIRT_RESULT_NUMAD LIBVIRT_RESULT_INIT_SCRIPT diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4 deleted file mode 100644 index d3538d59f82..00000000000 --- a/m4/virt-compile-warnings.m4 +++ /dev/null @@ -1,255 +0,0 @@ -dnl -dnl Enable all known GCC compiler warnings, except for those -dnl we can't yet cope with -dnl -AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[ - dnl ****************************** - dnl More compiler warnings - dnl ****************************** - - LIBVIRT_ARG_ENABLE([WERROR], [Use -Werror (if supported)], [check]) - if test "$enable_werror" = "check"; then - if test -d $srcdir/.git; then - is_git_version=true - enable_werror=yes - else - enable_werror=no - fi - fi - - # List of warnings that are not relevant / wanted - - # Don't care about C++ compiler compat - dontwarn="$dontwarn -Wc++-compat" - dontwarn="$dontwarn -Wabi" - dontwarn="$dontwarn -Wdeprecated" - # Don't care about ancient C standard compat - dontwarn="$dontwarn -Wtraditional" - # Don't care about ancient C standard compat - dontwarn="$dontwarn -Wtraditional-conversion" - # Ignore warnings in /usr/include - dontwarn="$dontwarn -Wsystem-headers" - # Happy for compiler to add struct padding - dontwarn="$dontwarn -Wpadded" - # GCC very confused with -O2 - dontwarn="$dontwarn -Wunreachable-code" - # Too many to deal with - dontwarn="$dontwarn -Wconversion" - # Too many to deal with - dontwarn="$dontwarn -Wsign-conversion" - # Need to allow bad cast for execve() - dontwarn="$dontwarn -Wcast-qual" - # We need to use long long in many places - dontwarn="$dontwarn -Wlong-long" - # We allow manual list of all enum cases without default: - dontwarn="$dontwarn -Wswitch-default" - # Not a problem since we don't use -fstrict-overflow - dontwarn="$dontwarn -Wstrict-overflow" - # Not a problem since we don't use -funsafe-loop-optimizations - dontwarn="$dontwarn -Wunsafe-loop-optimizations" - # gcc 4.4.6 complains this is C++ only; gcc 4.7.0 implies this from -Wall - dontwarn="$dontwarn -Wenum-compare" - # gcc 5.1 -Wformat-signedness mishandles enums, not ready for prime time - dontwarn="$dontwarn -Wformat-signedness" - # Several conditionals expand the same on both branches - # depending on the particular platform/architecture - dontwarn="$dontwarn -Wduplicated-branches" - # > This warning does not generally indicate that there is anything wrong - # > with your code; it merely indicates that GCC's optimizers are unable - # > to handle the code effectively. - # Source: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html - dontwarn="$dontwarn -Wdisabled-optimization" - # Various valid glib APIs/macros trigger this warning - dontwarn="$dontwarn -Wbad-function-cast" - - # Broken in 6.0 and later - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602 - AC_CACHE_CHECK([whether gcc gives bogus warnings for -Wlogical-op], - [lv_cv_gcc_wlogical_op_equal_expr_broken], [ - save_CFLAGS="$CFLAGS" - CFLAGS="-O2 -Wlogical-op -Werror" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #define TEST1 1 - #define TEST2 TEST1 - ]], [[ - int test = 0; - return test == TEST1 || test == TEST2;]])], - [lv_cv_gcc_wlogical_op_equal_expr_broken=no], - [lv_cv_gcc_wlogical_op_equal_expr_broken=yes]) - CFLAGS="$save_CFLAGS"]) - - AC_CACHE_CHECK([whether clang gives bogus warnings for -Wdouble-promotion], - [lv_cv_clang_double_promotion_broken], [ - save_CFLAGS="$CFLAGS" - CFLAGS="-O2 -Wdouble-promotion -Werror" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include <math.h> - ]], [[ - float f = 0.0; - return isnan(f);]])], - [lv_cv_clang_double_promotion_broken=no], - [lv_cv_clang_double_promotion_broken=yes]) - CFLAGS="$save_CFLAGS"]) - - if test "$lv_cv_clang_double_promotion_broken" = "yes"; - then - dontwarn="$dontwarn -Wdouble-promotion" - fi - - # Clang complains about unused static inline functions - # which are common with G_DEFINE_AUTOPTR_CLEANUP_FUNC - AC_CACHE_CHECK([whether clang gives bogus warnings for -Wunused-function], - [lv_cv_clang_unused_function_broken], [ - save_CFLAGS="$CFLAGS" - CFLAGS="-Wunused-function -Werror" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - static inline void foo(void) {} - ]], [[ - return 0]])], - [lv_cv_clang_unused_function_broken=no], - [lv_cv_clang_unused_function_broken=yes]) - CFLAGS="$save_CFLAGS"]) - - # We might fundamentally need some of these disabled forever, but - # ideally we'd turn many of them on - dontwarn="$dontwarn -Wfloat-equal" - dontwarn="$dontwarn -Wdeclaration-after-statement" - dontwarn="$dontwarn -Wpacked" - dontwarn="$dontwarn -Wunused-macros" - dontwarn="$dontwarn -Woverlength-strings" - dontwarn="$dontwarn -Wstack-protector" - dontwarn="$dontwarn -Wsuggest-attribute=malloc" - - # Get all possible GCC warnings - gl_MANYWARN_ALL_GCC([maybewarn]) - - # Remove the ones we don't want, blacklisted earlier - gl_MANYWARN_COMPLEMENT([wantwarn], [$maybewarn], [$dontwarn]) - - # -Wunused-functin is implied by -Wall we must turn it - # off explicitly. - if test "$lv_cv_clang_unused_function_broken" = "yes"; - then - wantwarn="$wantwarn -Wno-unused-function" - fi - - # manywarnings uses '-W' (aka -Wextra) which includes a bunch of stuff. - # Unfortunately, this means you can't simply use '-Wsign-compare' - # with gl_MANYWARN_COMPLEMENT - # So we have -W enabled, and then have to explicitly turn off... - wantwarn="$wantwarn -Wno-sign-compare" - # We do "bad" function casts all the time for event callbacks - wantwarn="$wantwarn -Wno-cast-function-type" - - # CLang incorrectly complains about dup typedefs win gnu99 mode - # so use this CLang-specific arg to keep it quiet - wantwarn="$wantwarn -Wno-typedef-redefinition" - - # manywarnings expects this to be part of -Wc++-compat, but we turn - # that one off, so we need to manually enable this again - wantwarn="$wantwarn -Wjump-misses-init" - - # manywarnings explicitly filters it out, preferring -Wswitch - # but that doesn't report missing enums if a default: - # is present. - wantwarn="$wantwarn -Wswitch-enum" - - # manywarnings turns on -Wformat=2 which implies -Wformat-nonliteral, - # so we need to manually re-exclude it. - wantwarn="$wantwarn -Wno-format-nonliteral" - - # -Wformat enables this by default, and we should keep it, - # but need to rewrite various areas of code first - wantwarn="$wantwarn -Wno-format-truncation" - - # This should be < 256 really. Currently we're down to 4096, - # but using 1024 bytes sized buffers (mostly for virStrerror) - # stops us from going down further - wantwarn="$wantwarn -Wframe-larger-than=4096" - gl_WARN_ADD([-Wframe-larger-than=262144], [RELAXED_FRAME_LIMIT_CFLAGS]) - - # Extra special flags - dnl -fstack-protector stuff passes gl_WARN_ADD with gcc - dnl on Mingw32, but fails when actually used - case $host in - aarch64-*-*) - dnl "error: -fstack-protector not supported for this target [-Werror]" - ;; - *-*-linux*) - dnl Prefer -fstack-protector-strong if it's available. - dnl There doesn't seem to be great overhead in adding - dnl -fstack-protector-all instead of -fstack-protector. - dnl - dnl We also don't need ssp-buffer-size with -all or -strong, - dnl since functions are protected regardless of buffer size. - dnl wantwarn="$wantwarn --param=ssp-buffer-size=4" - wantwarn="$wantwarn -fstack-protector-strong" - ;; - *-*-freebsd*) - dnl FreeBSD ships old gcc 4.2.1 which doesn't handle - dnl -fstack-protector-all well - wantwarn="$wantwarn -fstack-protector" - - wantwarn="$wantwarn -Wno-unused-command-line-argument" - ;; - esac - wantwarn="$wantwarn -fexceptions" - wantwarn="$wantwarn -fasynchronous-unwind-tables" - - # Need -fipa-pure-const in order to make -Wsuggest-attribute=pure - # fire even without -O. - wantwarn="$wantwarn -fipa-pure-const" - # We should eventually enable this, but right now there are at - # least 75 functions triggering warnings. - wantwarn="$wantwarn -Wno-suggest-attribute=pure" - wantwarn="$wantwarn -Wno-suggest-attribute=const" - - if test "$enable_werror" = "yes" - then - wantwarn="$wantwarn -Werror" - fi - - # Request the gnu99 standard which is the best choice with - # gcc 4.8.0. Not a warning flag, but the probing mechanism - # is convenient - wantwarn="$wantwarn -std=gnu99" - - # Check for $CC support of each warning - for w in $wantwarn; do - gl_WARN_ADD([$w]) - done - - case $host in - *-*-linux*) - dnl Fall back to -fstack-protector-all if -strong is not available - case $WARN_CFLAGS in - *-fstack-protector-strong*) - ;; - *) - gl_WARN_ADD([-fstack-protector-all]) - ;; - esac - ;; - esac - - case $WARN_CFLAGS in - *-Wsuggest-attribute=format*) - AC_DEFINE([HAVE_SUGGEST_ATTRIBUTE_FORMAT], [1], [Whether -Wsuggest-attribute=format works]) - ;; - esac - - # Use security checked glibc headers - AH_VERBATIM([FORTIFY_SOURCE], - [/* Enable compile-time and run-time bounds-checking, and some warnings, - without upsetting newer glibc. */ - #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ - # define _FORTIFY_SOURCE 2 - #endif - ]) - - if test "$gl_cv_warn_c__Wlogical_op" = yes && - test "$lv_cv_gcc_wlogical_op_equal_expr_broken" = yes; then - AC_DEFINE_UNQUOTED([BROKEN_GCC_WLOGICALOP_EQUAL_EXPR], 1, - [Define to 1 if gcc -Wlogical-op reports false positive 'or' equal expr]) - fi -]) diff --git a/m4/virt-warnings.m4 b/m4/virt-warnings.m4 deleted file mode 100644 index d272365f0a1..00000000000 --- a/m4/virt-warnings.m4 +++ /dev/null @@ -1,115 +0,0 @@ -# warnings.m4 serial 14 -dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Simon Josefsson - -# gl_AS_VAR_APPEND(VAR, VALUE) -# ---------------------------- -# Provide the functionality of AS_VAR_APPEND if Autoconf does not have it. -m4_ifdef([AS_VAR_APPEND], -[m4_copy([AS_VAR_APPEND], [gl_AS_VAR_APPEND])], -[m4_define([gl_AS_VAR_APPEND], -[AS_VAR_SET([$1], [AS_VAR_GET([$1])$2])])]) - - -# gl_COMPILER_OPTION_IF(OPTION, [IF-SUPPORTED], [IF-NOT-SUPPORTED], -# [PROGRAM = AC_LANG_PROGRAM()]) -# ----------------------------------------------------------------- -# Check if the compiler supports OPTION when compiling PROGRAM. -# -# The effects of this macro depend on the current language (_AC_LANG). -AC_DEFUN([gl_COMPILER_OPTION_IF], -[ -dnl FIXME: gl_Warn must be used unquoted until we can assume Autoconf -dnl 2.64 or newer. -AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl -AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl -AS_LITERAL_IF([$1], - [m4_pushdef([gl_Positive], m4_bpatsubst([$1], [^-Wno-], [-W]))], - [gl_positive="$1" -case $gl_positive in - -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; -esac -m4_pushdef([gl_Positive], [$gl_positive])])dnl -AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [ - gl_save_compiler_FLAGS="$gl_Flags" - gl_AS_VAR_APPEND(m4_defn([gl_Flags]), - [" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["]) - AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])], - [AS_VAR_SET(gl_Warn, [yes])], - [AS_VAR_SET(gl_Warn, [no])]) - gl_Flags="$gl_save_compiler_FLAGS" -]) -AS_VAR_IF(gl_Warn, [yes], [$2], [$3]) -m4_popdef([gl_Positive])dnl -AS_VAR_POPDEF([gl_Flags])dnl -AS_VAR_POPDEF([gl_Warn])dnl -]) - -# gl_UNKNOWN_WARNINGS_ARE_ERRORS -# ------------------------------ -# Clang doesn't complain about unknown warning options unless one also -# specifies -Wunknown-warning-option -Werror. Detect this. -# -# The effects of this macro depend on the current language (_AC_LANG). -AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS], -[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)]) - -# Specialization for _AC_LANG = C. This macro can be AC_REQUIREd. -# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. -m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C)], -[ - AC_LANG_PUSH([C]) - gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL - AC_LANG_POP([C]) -]) - -# Specialization for _AC_LANG = C++. This macro can be AC_REQUIREd. -# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. -m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)], -[ - AC_LANG_PUSH([C++]) - gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL - AC_LANG_POP([C++]) -]) - -# Specialization for _AC_LANG = Objective C. This macro can be AC_REQUIREd. -# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. -m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(Objective C)], -[ - AC_LANG_PUSH([Objective C]) - gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL - AC_LANG_POP([Objective C]) -]) - -AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL], -[gl_COMPILER_OPTION_IF([-Werror -Wunknown-warning-option], - [gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'], - [gl_unknown_warnings_are_errors=])]) - -# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS/WARN_CXXFLAGS], -# [PROGRAM = AC_LANG_PROGRAM()]) -# ----------------------------------------------------------- -# Adds parameter to WARN_CFLAGS/WARN_CXXFLAGS if the compiler supports it -# when compiling PROGRAM. For example, gl_WARN_ADD([-Wparentheses]). -# -# If VARIABLE is a variable name, AC_SUBST it. -# -# The effects of this macro depend on the current language (_AC_LANG). -AC_DEFUN([gl_WARN_ADD], -[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS(]_AC_LANG[)]) -gl_COMPILER_OPTION_IF([$1], - [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_]_AC_LANG_PREFIX[FLAGS]], [[$2]]), [" $1"])], - [], - [$3]) -m4_ifval([$2], - [AS_LITERAL_IF([$2], [AC_SUBST([$2])])], - [AC_SUBST([WARN_]_AC_LANG_PREFIX[FLAGS])])dnl -]) - -# Local Variables: -# mode: autoconf -# End: diff --git a/meson.build b/meson.build index d9a95e049c0..2450a8bdd79 100644 --- a/meson.build +++ b/meson.build @@ -7,6 +7,7 @@ project( 'buildtype=debugoptimized', 'b_pie=true', 'c_std=gnu99', + 'warning_level=2', ], )
@@ -212,10 +213,8 @@ cc_flags = [ '-Waddress', '-Waddress-of-packed-member', '-Waggressive-loop-optimizations', - '-Wall', '-Wattribute-warning', '-Wattributes', - '-Wbad-function-cast', '-Wbool-compare', '-Wbool-operation', '-Wbuiltin-declaration-mismatch', @@ -232,27 +231,20 @@ cc_flags = [ '-Wcpp', '-Wdangling-else', '-Wdate-time', - '-Wdeprecated', '-Wdeprecated-declarations', '-Wdesignated-init', - '-Wdisabled-optimization', '-Wdiscarded-array-qualifiers', '-Wdiscarded-qualifiers', '-Wdiv-by-zero', - '-Wdouble-promotion', - '-Wduplicated-branches', '-Wduplicated-cond', '-Wduplicate-decl-specifier', '-Wempty-body', '-Wendif-labels', - '-Wenum-compare', '-Wexpansion-to-defined', - '-Wextra', '-Wformat-contains-nul', '-Wformat-extra-args', '-Wformat-nonliteral', '-Wformat-security', - '-Wformat-signedness', '-Wformat-y2k', '-Wformat-zero-length', '-Wframe-address', @@ -299,9 +291,7 @@ cc_flags = [ '-Wold-style-definition', '-Wopenmp-simd', '-Woverflow', - '-Woverlength-strings', '-Woverride-init', - '-Wpacked', '-Wpacked-bitfield-compat', '-Wpacked-not-aligned', '-Wparentheses', @@ -323,15 +313,12 @@ cc_flags = [ '-Wsizeof-array-argument', '-Wsizeof-pointer-div', '-Wsizeof-pointer-memaccess', - '-Wstack-protector', '-Wstrict-aliasing', - '-Wstrict-overflow', '-Wstrict-prototypes', '-Wstringop-truncation', '-Wsuggest-attribute=cold', '-Wsuggest-attribute=const', '-Wsuggest-attribute=format', - '-Wsuggest-attribute=malloc', '-Wsuggest-attribute=noreturn', '-Wsuggest-attribute=pure', '-Wsuggest-final-methods', @@ -340,21 +327,18 @@ cc_flags = [ '-Wswitch-bool', '-Wswitch-unreachable', '-Wsync-nand', - '-Wsystem-headers', '-Wtautological-compare', '-Wtrampolines', '-Wtrigraphs', '-Wtype-limits', '-Wuninitialized', '-Wunknown-pragmas', - '-Wunsafe-loop-optimizations', '-Wunused', '-Wunused-but-set-parameter', '-Wunused-but-set-variable', '-Wunused-function', '-Wunused-label', '-Wunused-local-typedefs', - '-Wunused-macros', '-Wunused-parameter', '-Wunused-result', '-Wunused-value', @@ -392,6 +376,203 @@ cc_flags += [ '-Wvla-larger-then=4031', ]
+cc_flags += [ + # So we have -W enabled, and then have to explicitly turn off... + '-Wno-sign-compare', + + # We do "bad" function casts all the time for event callbacks + '-Wno-cast-function-type', + + # CLang incorrectly complains about dup typedefs win gnu99 mode + # so use this CLang-specific arg to keep it quiet + '-Wno-typedef-redefinition', + + # We don't use -Wc++-compat so we have to enable it explicitly + '-Wjump-misses-init', + + # TODO comment + '-Wswitch-enum',
TODO: fix all TODOs
+ + # -Wformat=2 implies -Wformat-nonliteral so we need to manually exclude it + '-Wno-format-nonliteral', + + # -Wformat enables this by default, and we should keep it, + # but need to rewrite various areas of code first + '-Wno-format-truncation', + + # This should be < 256 really. Currently we're down to 4096, + # but using 1024 bytes sized buffers (mostly for virStrerror) + # stops us from going down further + '-Wframe-larger-than=4096', + + # extra special flags + '-fexceptions', + '-fasynchronous-unwind-tables', + + # Need -fipa-pure-const in order to make -Wsuggest-attribute=pure + # fire even without -O. + '-fipa-pure-const', + + # We should eventually enable this, but right now there are at + # least 75 functions triggering warnings. + '-Wno-suggest-attribute=pure', + '-Wno-suggest-attribute=const', +] + +if git + cc_flags += [ '-Werror' ] +endif
This doesn't seem right. We definitely don't want this to be based solely on whether we're building from git.

On Wed, Jul 22, 2020 at 10:13:50AM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:54:17 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- config.h | 7 + configure.ac | 3 - m4/virt-compile-warnings.m4 | 255 ------------------------------------ m4/virt-warnings.m4 | 115 ---------------- meson.build | 221 ++++++++++++++++++++++++++++--- 5 files changed, 211 insertions(+), 390 deletions(-) delete mode 100644 m4/virt-compile-warnings.m4 delete mode 100644 m4/virt-warnings.m4
diff --git a/config.h b/config.h index 9c433ad4c0f..368688f3d01 100644 --- a/config.h +++ b/config.h @@ -1,5 +1,12 @@ #include <meson-config.h>
+/* Enable compile-time and run-time bounds-checking, and some warnings, + * without upsetting newer glibc. */ + +#if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ +# define _FORTIFY_SOURCE 2 +#endif + #ifndef __GNUC__ # error "Libvirt requires GCC >= 4.8, or CLang" #endif diff --git a/configure.ac b/configure.ac index 8f16b364de6..56a471fc3ab 100644 --- a/configure.ac +++ b/configure.ac @@ -161,7 +161,6 @@ fi
# Check for compiler and library settings.
-LIBVIRT_COMPILE_WARNINGS LIBVIRT_LINKER_RELRO LIBVIRT_LINKER_NO_INDIRECT LIBVIRT_LINKER_NO_UNDEFINED @@ -849,8 +848,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Miscellaneous]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_DEBUG -LIBVIRT_RESULT([Use -Werror], [$enable_werror]) -LIBVIRT_RESULT([Warning Flags], [$WARN_CFLAGS]) LIBVIRT_RESULT_DTRACE LIBVIRT_RESULT_NUMAD LIBVIRT_RESULT_INIT_SCRIPT diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4 deleted file mode 100644 index d3538d59f82..00000000000 --- a/m4/virt-compile-warnings.m4 +++ /dev/null @@ -1,255 +0,0 @@ -dnl -dnl Enable all known GCC compiler warnings, except for those -dnl we can't yet cope with -dnl -AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[ - dnl ****************************** - dnl More compiler warnings - dnl ****************************** - - LIBVIRT_ARG_ENABLE([WERROR], [Use -Werror (if supported)], [check]) - if test "$enable_werror" = "check"; then - if test -d $srcdir/.git; then - is_git_version=true - enable_werror=yes - else - enable_werror=no - fi - fi - - # List of warnings that are not relevant / wanted - - # Don't care about C++ compiler compat - dontwarn="$dontwarn -Wc++-compat" - dontwarn="$dontwarn -Wabi" - dontwarn="$dontwarn -Wdeprecated" - # Don't care about ancient C standard compat - dontwarn="$dontwarn -Wtraditional" - # Don't care about ancient C standard compat - dontwarn="$dontwarn -Wtraditional-conversion" - # Ignore warnings in /usr/include - dontwarn="$dontwarn -Wsystem-headers" - # Happy for compiler to add struct padding - dontwarn="$dontwarn -Wpadded" - # GCC very confused with -O2 - dontwarn="$dontwarn -Wunreachable-code" - # Too many to deal with - dontwarn="$dontwarn -Wconversion" - # Too many to deal with - dontwarn="$dontwarn -Wsign-conversion" - # Need to allow bad cast for execve() - dontwarn="$dontwarn -Wcast-qual" - # We need to use long long in many places - dontwarn="$dontwarn -Wlong-long" - # We allow manual list of all enum cases without default: - dontwarn="$dontwarn -Wswitch-default" - # Not a problem since we don't use -fstrict-overflow - dontwarn="$dontwarn -Wstrict-overflow" - # Not a problem since we don't use -funsafe-loop-optimizations - dontwarn="$dontwarn -Wunsafe-loop-optimizations" - # gcc 4.4.6 complains this is C++ only; gcc 4.7.0 implies this from -Wall - dontwarn="$dontwarn -Wenum-compare" - # gcc 5.1 -Wformat-signedness mishandles enums, not ready for prime time - dontwarn="$dontwarn -Wformat-signedness" - # Several conditionals expand the same on both branches - # depending on the particular platform/architecture - dontwarn="$dontwarn -Wduplicated-branches" - # > This warning does not generally indicate that there is anything wrong - # > with your code; it merely indicates that GCC's optimizers are unable - # > to handle the code effectively. - # Source: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html - dontwarn="$dontwarn -Wdisabled-optimization" - # Various valid glib APIs/macros trigger this warning - dontwarn="$dontwarn -Wbad-function-cast" - - # Broken in 6.0 and later - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602 - AC_CACHE_CHECK([whether gcc gives bogus warnings for -Wlogical-op], - [lv_cv_gcc_wlogical_op_equal_expr_broken], [ - save_CFLAGS="$CFLAGS" - CFLAGS="-O2 -Wlogical-op -Werror" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #define TEST1 1 - #define TEST2 TEST1 - ]], [[ - int test = 0; - return test == TEST1 || test == TEST2;]])], - [lv_cv_gcc_wlogical_op_equal_expr_broken=no], - [lv_cv_gcc_wlogical_op_equal_expr_broken=yes]) - CFLAGS="$save_CFLAGS"]) - - AC_CACHE_CHECK([whether clang gives bogus warnings for -Wdouble-promotion], - [lv_cv_clang_double_promotion_broken], [ - save_CFLAGS="$CFLAGS" - CFLAGS="-O2 -Wdouble-promotion -Werror" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include <math.h> - ]], [[ - float f = 0.0; - return isnan(f);]])], - [lv_cv_clang_double_promotion_broken=no], - [lv_cv_clang_double_promotion_broken=yes]) - CFLAGS="$save_CFLAGS"]) - - if test "$lv_cv_clang_double_promotion_broken" = "yes"; - then - dontwarn="$dontwarn -Wdouble-promotion" - fi - - # Clang complains about unused static inline functions - # which are common with G_DEFINE_AUTOPTR_CLEANUP_FUNC - AC_CACHE_CHECK([whether clang gives bogus warnings for -Wunused-function], - [lv_cv_clang_unused_function_broken], [ - save_CFLAGS="$CFLAGS" - CFLAGS="-Wunused-function -Werror" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - static inline void foo(void) {} - ]], [[ - return 0]])], - [lv_cv_clang_unused_function_broken=no], - [lv_cv_clang_unused_function_broken=yes]) - CFLAGS="$save_CFLAGS"]) - - # We might fundamentally need some of these disabled forever, but - # ideally we'd turn many of them on - dontwarn="$dontwarn -Wfloat-equal" - dontwarn="$dontwarn -Wdeclaration-after-statement" - dontwarn="$dontwarn -Wpacked" - dontwarn="$dontwarn -Wunused-macros" - dontwarn="$dontwarn -Woverlength-strings" - dontwarn="$dontwarn -Wstack-protector" - dontwarn="$dontwarn -Wsuggest-attribute=malloc" - - # Get all possible GCC warnings - gl_MANYWARN_ALL_GCC([maybewarn]) - - # Remove the ones we don't want, blacklisted earlier - gl_MANYWARN_COMPLEMENT([wantwarn], [$maybewarn], [$dontwarn]) - - # -Wunused-functin is implied by -Wall we must turn it - # off explicitly. - if test "$lv_cv_clang_unused_function_broken" = "yes"; - then - wantwarn="$wantwarn -Wno-unused-function" - fi - - # manywarnings uses '-W' (aka -Wextra) which includes a bunch of stuff. - # Unfortunately, this means you can't simply use '-Wsign-compare' - # with gl_MANYWARN_COMPLEMENT - # So we have -W enabled, and then have to explicitly turn off... - wantwarn="$wantwarn -Wno-sign-compare" - # We do "bad" function casts all the time for event callbacks - wantwarn="$wantwarn -Wno-cast-function-type" - - # CLang incorrectly complains about dup typedefs win gnu99 mode - # so use this CLang-specific arg to keep it quiet - wantwarn="$wantwarn -Wno-typedef-redefinition" - - # manywarnings expects this to be part of -Wc++-compat, but we turn - # that one off, so we need to manually enable this again - wantwarn="$wantwarn -Wjump-misses-init" - - # manywarnings explicitly filters it out, preferring -Wswitch - # but that doesn't report missing enums if a default: - # is present. - wantwarn="$wantwarn -Wswitch-enum" - - # manywarnings turns on -Wformat=2 which implies -Wformat-nonliteral, - # so we need to manually re-exclude it. - wantwarn="$wantwarn -Wno-format-nonliteral" - - # -Wformat enables this by default, and we should keep it, - # but need to rewrite various areas of code first - wantwarn="$wantwarn -Wno-format-truncation" - - # This should be < 256 really. Currently we're down to 4096, - # but using 1024 bytes sized buffers (mostly for virStrerror) - # stops us from going down further - wantwarn="$wantwarn -Wframe-larger-than=4096" - gl_WARN_ADD([-Wframe-larger-than=262144], [RELAXED_FRAME_LIMIT_CFLAGS]) - - # Extra special flags - dnl -fstack-protector stuff passes gl_WARN_ADD with gcc - dnl on Mingw32, but fails when actually used - case $host in - aarch64-*-*) - dnl "error: -fstack-protector not supported for this target [-Werror]" - ;; - *-*-linux*) - dnl Prefer -fstack-protector-strong if it's available. - dnl There doesn't seem to be great overhead in adding - dnl -fstack-protector-all instead of -fstack-protector. - dnl - dnl We also don't need ssp-buffer-size with -all or -strong, - dnl since functions are protected regardless of buffer size. - dnl wantwarn="$wantwarn --param=ssp-buffer-size=4" - wantwarn="$wantwarn -fstack-protector-strong" - ;; - *-*-freebsd*) - dnl FreeBSD ships old gcc 4.2.1 which doesn't handle - dnl -fstack-protector-all well - wantwarn="$wantwarn -fstack-protector" - - wantwarn="$wantwarn -Wno-unused-command-line-argument" - ;; - esac - wantwarn="$wantwarn -fexceptions" - wantwarn="$wantwarn -fasynchronous-unwind-tables" - - # Need -fipa-pure-const in order to make -Wsuggest-attribute=pure - # fire even without -O. - wantwarn="$wantwarn -fipa-pure-const" - # We should eventually enable this, but right now there are at - # least 75 functions triggering warnings. - wantwarn="$wantwarn -Wno-suggest-attribute=pure" - wantwarn="$wantwarn -Wno-suggest-attribute=const" - - if test "$enable_werror" = "yes" - then - wantwarn="$wantwarn -Werror" - fi - - # Request the gnu99 standard which is the best choice with - # gcc 4.8.0. Not a warning flag, but the probing mechanism - # is convenient - wantwarn="$wantwarn -std=gnu99" - - # Check for $CC support of each warning - for w in $wantwarn; do - gl_WARN_ADD([$w]) - done - - case $host in - *-*-linux*) - dnl Fall back to -fstack-protector-all if -strong is not available - case $WARN_CFLAGS in - *-fstack-protector-strong*) - ;; - *) - gl_WARN_ADD([-fstack-protector-all]) - ;; - esac - ;; - esac - - case $WARN_CFLAGS in - *-Wsuggest-attribute=format*) - AC_DEFINE([HAVE_SUGGEST_ATTRIBUTE_FORMAT], [1], [Whether -Wsuggest-attribute=format works]) - ;; - esac - - # Use security checked glibc headers - AH_VERBATIM([FORTIFY_SOURCE], - [/* Enable compile-time and run-time bounds-checking, and some warnings, - without upsetting newer glibc. */ - #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ - # define _FORTIFY_SOURCE 2 - #endif - ]) - - if test "$gl_cv_warn_c__Wlogical_op" = yes && - test "$lv_cv_gcc_wlogical_op_equal_expr_broken" = yes; then - AC_DEFINE_UNQUOTED([BROKEN_GCC_WLOGICALOP_EQUAL_EXPR], 1, - [Define to 1 if gcc -Wlogical-op reports false positive 'or' equal expr]) - fi -]) diff --git a/m4/virt-warnings.m4 b/m4/virt-warnings.m4 deleted file mode 100644 index d272365f0a1..00000000000 --- a/m4/virt-warnings.m4 +++ /dev/null @@ -1,115 +0,0 @@ -# warnings.m4 serial 14 -dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Simon Josefsson - -# gl_AS_VAR_APPEND(VAR, VALUE) -# ---------------------------- -# Provide the functionality of AS_VAR_APPEND if Autoconf does not have it. -m4_ifdef([AS_VAR_APPEND], -[m4_copy([AS_VAR_APPEND], [gl_AS_VAR_APPEND])], -[m4_define([gl_AS_VAR_APPEND], -[AS_VAR_SET([$1], [AS_VAR_GET([$1])$2])])]) - - -# gl_COMPILER_OPTION_IF(OPTION, [IF-SUPPORTED], [IF-NOT-SUPPORTED], -# [PROGRAM = AC_LANG_PROGRAM()]) -# ----------------------------------------------------------------- -# Check if the compiler supports OPTION when compiling PROGRAM. -# -# The effects of this macro depend on the current language (_AC_LANG). -AC_DEFUN([gl_COMPILER_OPTION_IF], -[ -dnl FIXME: gl_Warn must be used unquoted until we can assume Autoconf -dnl 2.64 or newer. -AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl -AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl -AS_LITERAL_IF([$1], - [m4_pushdef([gl_Positive], m4_bpatsubst([$1], [^-Wno-], [-W]))], - [gl_positive="$1" -case $gl_positive in - -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; -esac -m4_pushdef([gl_Positive], [$gl_positive])])dnl -AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [ - gl_save_compiler_FLAGS="$gl_Flags" - gl_AS_VAR_APPEND(m4_defn([gl_Flags]), - [" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["]) - AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])], - [AS_VAR_SET(gl_Warn, [yes])], - [AS_VAR_SET(gl_Warn, [no])]) - gl_Flags="$gl_save_compiler_FLAGS" -]) -AS_VAR_IF(gl_Warn, [yes], [$2], [$3]) -m4_popdef([gl_Positive])dnl -AS_VAR_POPDEF([gl_Flags])dnl -AS_VAR_POPDEF([gl_Warn])dnl -]) - -# gl_UNKNOWN_WARNINGS_ARE_ERRORS -# ------------------------------ -# Clang doesn't complain about unknown warning options unless one also -# specifies -Wunknown-warning-option -Werror. Detect this. -# -# The effects of this macro depend on the current language (_AC_LANG). -AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS], -[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)]) - -# Specialization for _AC_LANG = C. This macro can be AC_REQUIREd. -# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. -m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C)], -[ - AC_LANG_PUSH([C]) - gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL - AC_LANG_POP([C]) -]) - -# Specialization for _AC_LANG = C++. This macro can be AC_REQUIREd. -# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. -m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)], -[ - AC_LANG_PUSH([C++]) - gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL - AC_LANG_POP([C++]) -]) - -# Specialization for _AC_LANG = Objective C. This macro can be AC_REQUIREd. -# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. -m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(Objective C)], -[ - AC_LANG_PUSH([Objective C]) - gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL - AC_LANG_POP([Objective C]) -]) - -AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL], -[gl_COMPILER_OPTION_IF([-Werror -Wunknown-warning-option], - [gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'], - [gl_unknown_warnings_are_errors=])]) - -# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS/WARN_CXXFLAGS], -# [PROGRAM = AC_LANG_PROGRAM()]) -# ----------------------------------------------------------- -# Adds parameter to WARN_CFLAGS/WARN_CXXFLAGS if the compiler supports it -# when compiling PROGRAM. For example, gl_WARN_ADD([-Wparentheses]). -# -# If VARIABLE is a variable name, AC_SUBST it. -# -# The effects of this macro depend on the current language (_AC_LANG). -AC_DEFUN([gl_WARN_ADD], -[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS(]_AC_LANG[)]) -gl_COMPILER_OPTION_IF([$1], - [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_]_AC_LANG_PREFIX[FLAGS]], [[$2]]), [" $1"])], - [], - [$3]) -m4_ifval([$2], - [AS_LITERAL_IF([$2], [AC_SUBST([$2])])], - [AC_SUBST([WARN_]_AC_LANG_PREFIX[FLAGS])])dnl -]) - -# Local Variables: -# mode: autoconf -# End: diff --git a/meson.build b/meson.build index d9a95e049c0..2450a8bdd79 100644 --- a/meson.build +++ b/meson.build @@ -7,6 +7,7 @@ project( 'buildtype=debugoptimized', 'b_pie=true', 'c_std=gnu99', + 'warning_level=2', ], )
@@ -212,10 +213,8 @@ cc_flags = [ '-Waddress', '-Waddress-of-packed-member', '-Waggressive-loop-optimizations', - '-Wall', '-Wattribute-warning', '-Wattributes', - '-Wbad-function-cast', '-Wbool-compare', '-Wbool-operation', '-Wbuiltin-declaration-mismatch', @@ -232,27 +231,20 @@ cc_flags = [ '-Wcpp', '-Wdangling-else', '-Wdate-time', - '-Wdeprecated', '-Wdeprecated-declarations', '-Wdesignated-init', - '-Wdisabled-optimization', '-Wdiscarded-array-qualifiers', '-Wdiscarded-qualifiers', '-Wdiv-by-zero', - '-Wdouble-promotion', - '-Wduplicated-branches', '-Wduplicated-cond', '-Wduplicate-decl-specifier', '-Wempty-body', '-Wendif-labels', - '-Wenum-compare', '-Wexpansion-to-defined', - '-Wextra', '-Wformat-contains-nul', '-Wformat-extra-args', '-Wformat-nonliteral', '-Wformat-security', - '-Wformat-signedness', '-Wformat-y2k', '-Wformat-zero-length', '-Wframe-address', @@ -299,9 +291,7 @@ cc_flags = [ '-Wold-style-definition', '-Wopenmp-simd', '-Woverflow', - '-Woverlength-strings', '-Woverride-init', - '-Wpacked', '-Wpacked-bitfield-compat', '-Wpacked-not-aligned', '-Wparentheses', @@ -323,15 +313,12 @@ cc_flags = [ '-Wsizeof-array-argument', '-Wsizeof-pointer-div', '-Wsizeof-pointer-memaccess', - '-Wstack-protector', '-Wstrict-aliasing', - '-Wstrict-overflow', '-Wstrict-prototypes', '-Wstringop-truncation', '-Wsuggest-attribute=cold', '-Wsuggest-attribute=const', '-Wsuggest-attribute=format', - '-Wsuggest-attribute=malloc', '-Wsuggest-attribute=noreturn', '-Wsuggest-attribute=pure', '-Wsuggest-final-methods', @@ -340,21 +327,18 @@ cc_flags = [ '-Wswitch-bool', '-Wswitch-unreachable', '-Wsync-nand', - '-Wsystem-headers', '-Wtautological-compare', '-Wtrampolines', '-Wtrigraphs', '-Wtype-limits', '-Wuninitialized', '-Wunknown-pragmas', - '-Wunsafe-loop-optimizations', '-Wunused', '-Wunused-but-set-parameter', '-Wunused-but-set-variable', '-Wunused-function', '-Wunused-label', '-Wunused-local-typedefs', - '-Wunused-macros', '-Wunused-parameter', '-Wunused-result', '-Wunused-value', @@ -392,6 +376,203 @@ cc_flags += [ '-Wvla-larger-then=4031', ]
+cc_flags += [ + # So we have -W enabled, and then have to explicitly turn off... + '-Wno-sign-compare', + + # We do "bad" function casts all the time for event callbacks + '-Wno-cast-function-type', + + # CLang incorrectly complains about dup typedefs win gnu99 mode + # so use this CLang-specific arg to keep it quiet + '-Wno-typedef-redefinition', + + # We don't use -Wc++-compat so we have to enable it explicitly + '-Wjump-misses-init', + + # TODO comment + '-Wswitch-enum',
TODO: fix all TODOs
Fixed, thanks.
+ + # -Wformat=2 implies -Wformat-nonliteral so we need to manually exclude it + '-Wno-format-nonliteral', + + # -Wformat enables this by default, and we should keep it, + # but need to rewrite various areas of code first + '-Wno-format-truncation', + + # This should be < 256 really. Currently we're down to 4096, + # but using 1024 bytes sized buffers (mostly for virStrerror) + # stops us from going down further + '-Wframe-larger-than=4096', + + # extra special flags + '-fexceptions', + '-fasynchronous-unwind-tables', + + # Need -fipa-pure-const in order to make -Wsuggest-attribute=pure + # fire even without -O. + '-fipa-pure-const', + + # We should eventually enable this, but right now there are at + # least 75 functions triggering warnings. + '-Wno-suggest-attribute=pure', + '-Wno-suggest-attribute=const', +] + +if git + cc_flags += [ '-Werror' ] +endif
This doesn't seem right. We definitely don't want this to be based solely on whether we're building from git.
So the thing with Meson is that it has build-in option --werror with default value 'false'. It is possible to change the default value in the project() function. Unfortunately it is not possible to call anything else before project() function so we cannot detect if building from GIT before we can change the default value. There are three solutions: 1) Keep it as it is, it would not be possible to disable -Werror if building from GIT. 2) Drop the GIT detection and require developers to use --werror to have this functionality. 3) Introduce our own -Dgit_werror which would allow us to change the default behavior and disable -Werror for build from GIT. There is additional limitation with Meson. In both cases with autotools distcheck or Meson dist the build is done from unpacked tarball. With autotools we can use DISTCHECK_CONFIGURE_FLAGS to change the default configure flags used during distcheck, with Meson there is nothing like that so we cannot force -Werror during Meson dist build. With this limitation in order to have -Werror enabled during Meson dist build developers would have to pass --werror to meson setup for all the solutions or -Dgit_werror=enabled in case of the third solution. If you check the last patch, I'm doing it for our CI in order to have -Werror during dist build. None of the solutions are ideal to copy the behavior from autotools. Pavel

On Wed, Jul 22, 2020 at 05:49:59PM +0200, Pavel Hrdina wrote:
+ # -Wformat=2 implies -Wformat-nonliteral so we need to manually exclude it + '-Wno-format-nonliteral', + + # -Wformat enables this by default, and we should keep it, + # but need to rewrite various areas of code first + '-Wno-format-truncation', + + # This should be < 256 really. Currently we're down to 4096, + # but using 1024 bytes sized buffers (mostly for virStrerror) + # stops us from going down further + '-Wframe-larger-than=4096', + + # extra special flags + '-fexceptions', + '-fasynchronous-unwind-tables', + + # Need -fipa-pure-const in order to make -Wsuggest-attribute=pure + # fire even without -O. + '-fipa-pure-const', + + # We should eventually enable this, but right now there are at + # least 75 functions triggering warnings. + '-Wno-suggest-attribute=pure', + '-Wno-suggest-attribute=const', +] + +if git + cc_flags += [ '-Werror' ] +endif
This doesn't seem right. We definitely don't want this to be based solely on whether we're building from git.
So the thing with Meson is that it has build-in option --werror with default value 'false'. It is possible to change the default value in the project() function. Unfortunately it is not possible to call anything else before project() function so we cannot detect if building from GIT before we can change the default value.
There are three solutions:
1) Keep it as it is, it would not be possible to disable -Werror if building from GIT.
That mostly shouldn't be a problem for upstream GIT since we expect to be -Werror clean, but new GCCs break us sometimes. Today in fact with GCC 10 :-). Could also be a problem for downstreams, eg we use git to maintain patches in RPMs. So I think this is not viable.
2) Drop the GIT detection and require developers to use --werror to have this functionality.
The main goal of defaulting to Werror was to make sure developers didn't accidentally introduce build warnings. As long as we don't have gating pre-merge CI, I think need to try really hard to keep it.
3) Introduce our own -Dgit_werror which would allow us to change the default behavior and disable -Werror for build from GIT.
This duplicates --werror behaviour, but I think it is the least worst option right now. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 41 -------------------------------- m4/virt-linker-no-indirect.m4 | 32 ------------------------- m4/virt-linker-no-undefined.m4 | 32 ------------------------- m4/virt-linker-relro.m4 | 35 --------------------------- meson.build | 43 ++++++++++++++++++++++++++++++++++ 5 files changed, 43 insertions(+), 140 deletions(-) delete mode 100644 m4/virt-linker-no-indirect.m4 delete mode 100644 m4/virt-linker-no-undefined.m4 delete mode 100644 m4/virt-linker-relro.m4 diff --git a/configure.ac b/configure.ac index 56a471fc3ab..cb1aed73828 100644 --- a/configure.ac +++ b/configure.ac @@ -64,43 +64,6 @@ m4_ifndef([LT_INIT], [ AM_PROG_CC_C_O AM_PROG_LD -AC_MSG_CHECKING([for how to mark DSO non-deletable at runtime]) -LIBVIRT_NODELETE= -`$LD --help 2>&1 | grep -- "-z nodelete" >/dev/null` && \ - LIBVIRT_NODELETE="-Wl,-z -Wl,nodelete" -AC_MSG_RESULT([$LIBVIRT_NODELETE]) -AC_SUBST([LIBVIRT_NODELETE]) - -AC_MSG_CHECKING([for how to set DSO symbol versions]) -case "$host" in - *-*-mingw* | *-*-msvc* ) - # mingw's ld has the --version-script parameter, but it requires a .def file - # instead to work properly, therefore clear --version-script here and use - # -Wl, to pass the .def file to the linker - VERSION_SCRIPT_FLAGS="-Wl," - ;; - * ) - VERSION_SCRIPT_FLAGS=-Wl,--version-script= - `$LD --help 2>&1 | grep -- --version-script >/dev/null` || \ - VERSION_SCRIPT_FLAGS="-Wl,-M -Wl," - ;; -esac -AC_MSG_RESULT([$VERSION_SCRIPT_FLAGS]) -AC_SUBST([VERSION_SCRIPT_FLAGS]) - -dnl macOS has two-level namespaces by default. -dnl Override it to allow symbol replacement with DYLD_INSERT_LIBRARIES -case "$host" in - *-*-darwin*) - FLAT_NAMESPACE_FLAGS=-Wl,-flat_namespace - ;; - * ) - FLAT_NAMESPACE_FLAGS="" - ;; -esac -AC_MSG_RESULT([$FLAT_NAMESPACE_FLAGS]) -AC_SUBST([FLAT_NAMESPACE_FLAGS]) - dnl Specify if we rely on ifconfig instead of iproute2 (e.g. in case dnl we're working on BSD) want_ifconfig=no @@ -161,10 +124,6 @@ fi # Check for compiler and library settings. -LIBVIRT_LINKER_RELRO -LIBVIRT_LINKER_NO_INDIRECT -LIBVIRT_LINKER_NO_UNDEFINED - LIBVIRT_ARG_APPARMOR LIBVIRT_ARG_ATTR LIBVIRT_ARG_AUDIT diff --git a/m4/virt-linker-no-indirect.m4 b/m4/virt-linker-no-indirect.m4 deleted file mode 100644 index b344f708539..00000000000 --- a/m4/virt-linker-no-indirect.m4 +++ /dev/null @@ -1,32 +0,0 @@ -dnl -dnl Check for --no-copy-dt-needed-entries -dnl -dnl Copyright (C) 2013 Guido Günther <agx@sigxcpu.org> -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_LINKER_NO_INDIRECT],[ - AC_MSG_CHECKING([for how to avoid indirect lib deps]) - - NO_INDIRECT_LDFLAGS= - case `$LD --help 2>&1` in - *"--no-copy-dt-needed-entries"*) - NO_INDIRECT_LDFLAGS="-Wl,--no-copy-dt-needed-entries" ;; - esac - AC_SUBST([NO_INDIRECT_LDFLAGS]) - - AC_MSG_RESULT([$NO_INDIRECT_LDFLAGS]) -]) diff --git a/m4/virt-linker-no-undefined.m4 b/m4/virt-linker-no-undefined.m4 deleted file mode 100644 index 532b0de212c..00000000000 --- a/m4/virt-linker-no-undefined.m4 +++ /dev/null @@ -1,32 +0,0 @@ -dnl -dnl Check for -z defs linker flag -dnl -dnl Copyright (C) 2013-2018 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_LINKER_NO_UNDEFINED],[ - AC_MSG_CHECKING([for how to stop undefined symbols at link time]) - - NO_UNDEFINED_LDFLAGS= - ld_help=`$LD --help 2>&1` - case $ld_help in - *"-z defs"*) NO_UNDEFINED_LDFLAGS="-Wl,-z -Wl,defs" ;; - esac - AC_SUBST([NO_UNDEFINED_LDFLAGS]) - - AC_MSG_RESULT([$NO_UNDEFINED_LDFLAGS]) -]) diff --git a/m4/virt-linker-relro.m4 b/m4/virt-linker-relro.m4 deleted file mode 100644 index 079a095feed..00000000000 --- a/m4/virt-linker-relro.m4 +++ /dev/null @@ -1,35 +0,0 @@ -dnl -dnl Check for -z now and -z relro linker flags -dnl -dnl Copyright (C) 2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_LINKER_RELRO],[ - AC_MSG_CHECKING([for how to force completely read-only GOT table]) - - RELRO_LDFLAGS= - ld_help=`$LD --help 2>&1` - case $ld_help in - *"-z relro"*) RELRO_LDFLAGS="-Wl,-z -Wl,relro" ;; - esac - case $ld_help in - *"-z now"*) RELRO_LDFLAGS="$RELRO_LDFLAGS -Wl,-z -Wl,now" ;; - esac - AC_SUBST([RELRO_LDFLAGS]) - - AC_MSG_RESULT([$RELRO_LDFLAGS]) -]) diff --git a/meson.build b/meson.build index 2450a8bdd79..d1237c10875 100644 --- a/meson.build +++ b/meson.build @@ -574,6 +574,49 @@ cc_flags_relaxed_frame_limit = [ ] +# various linker checks + +libvirt_relro = cc.get_supported_link_arguments([ + '-Wl,-z,relro', + '-Wl,-z,now', +]) + +libvirt_nodelete = cc.get_supported_link_arguments([ + '-Wl,-z,nodelete', +]) + +libvirt_no_undefined = cc.get_supported_link_arguments([ + '-Wl,-z,defs', +]) + +libvirt_no_indirect = cc.get_supported_link_arguments([ + '-Wl,--no-copy-dt-needed-entries', +]) + +if host_machine.system() == 'windows' + version_script_flags = '-Wl,' +else + test_file = '@0@/src/libvirt_qemu.syms'.format(meson.source_root()) + if cc.has_link_argument('-Wl,--version-script=@0@'.format(test_file)) + version_script_flags = '-Wl,--version-script=' + elif cc.has_link_argument('-Wl,-M,') + version_script_flags = '-Wl,-M,' + else + error('No supported version script link argument found.') + endif +endif + +libvirt_flat_namespace = [] +if host_machine.system() == 'darwin' + libvirt_flat_namespace = '-Wl,-flat_namespace' +endif + +libvirt_export_dynamic = cc.first_supported_link_argument([ + '-Wl,-export-dynamic', + '-Wl,-export_dynamic', +]) + + # define top include directory top_inc_dir = include_directories('.') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- meson.build | 5 +++++ scripts/meson.build | 29 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 scripts/meson.build diff --git a/meson.build b/meson.build index d1237c10875..8c6db66a07f 100644 --- a/meson.build +++ b/meson.build @@ -622,6 +622,11 @@ libvirt_export_dynamic = cc.first_supported_link_argument([ top_inc_dir = include_directories('.') +# include remaining subdirs + +subdir('scripts') + + # generate meson-config.h file configure_file(output: 'meson-config.h', configuration: conf) diff --git a/scripts/meson.build b/scripts/meson.build new file mode 100644 index 00000000000..941e40a0917 --- /dev/null +++ b/scripts/meson.build @@ -0,0 +1,29 @@ +scripts = [ + 'apibuild.py', + 'augeas-gentest.py', + 'check-aclperms.py', + 'check-aclrules.py', + 'check-driverimpls.py', + 'check-drivername.py', + 'check-file-access.py', + 'check-remote-protocol.py', + 'check-symfile.py', + 'check-symsorting.py', + 'dtrace2systemtap.py', + 'esx_vi_generator.py', + 'genaclperms.py', + 'genpolkit.py', + 'gensystemtap.py', + 'group-qemu-caps.py', + 'header-ifdef.py', + 'hvsupport.py', + 'hyperv_wmi_generator.py', + 'mock-noinline.py', + 'prohibit-duplicate-header.py', + 'test-wrap-argv.py', +] + +foreach name : scripts + sname = name.split('.')[0].underscorify() + set_variable('@0@_prog'.format(sname), find_program(name)) +endforeach -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 2 +- configure.ac | 3 +-- include/libvirt/Makefile.am | 26 -------------------------- include/libvirt/meson.build | 36 ++++++++++++++++++++++++++++++++++++ include/meson.build | 3 +++ meson.build | 2 ++ 6 files changed, 43 insertions(+), 29 deletions(-) delete mode 100644 include/libvirt/Makefile.am create mode 100644 include/libvirt/meson.build create mode 100644 include/meson.build diff --git a/Makefile.am b/Makefile.am index 82ccbac6f91..6df2176364a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,7 +20,7 @@ # so force it explicitly DISTCHECK_CONFIGURE_FLAGS = --enable-werror -SUBDIRS = . include/libvirt src tools docs \ +SUBDIRS = . src tools docs \ tests po examples XZ_OPT ?= -v -T0 diff --git a/configure.ac b/configure.ac index cb1aed73828..07b86d8b944 100644 --- a/configure.ac +++ b/configure.ac @@ -689,7 +689,7 @@ m4_if(m4_version_compare([2.61a.100], AC_CONFIG_FILES([run], [chmod +x,-w run]) AC_CONFIG_FILES([\ - Makefile src/Makefile include/libvirt/Makefile docs/Makefile \ + Makefile src/Makefile docs/Makefile \ .color_coded \ .ycm_extra_conf.py \ libvirt.pc \ @@ -701,7 +701,6 @@ AC_CONFIG_FILES([\ src/libvirt-lxc.pc \ libvirt.spec mingw-libvirt.spec \ po/Makefile \ - include/libvirt/libvirt-common.h \ examples/Makefile \ tests/Makefile \ tools/Makefile]) diff --git a/include/libvirt/Makefile.am b/include/libvirt/Makefile.am deleted file mode 100644 index e447a5d37da..00000000000 --- a/include/libvirt/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -## Process this file with automake to produce Makefile.in - -## Copyright (C) 2005-2011, 2013-2016 Red Hat, Inc. -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library. If not, see -## <http://www.gnu.org/licenses/>. - -virincdir = $(includedir)/libvirt - -allheaders = $(wildcard $(srcdir)/*.h) -virinc_HEADERS = $(filter-out $(srcdir)/libvirt-common.h, $(allheaders)) -nodist_virinc_HEADERS = libvirt-common.h - -install-exec-hook: - $(mkinstalldirs) $(DESTDIR)$(virincdir) diff --git a/include/libvirt/meson.build b/include/libvirt/meson.build new file mode 100644 index 00000000000..4b77a222f03 --- /dev/null +++ b/include/libvirt/meson.build @@ -0,0 +1,36 @@ +libvirt_common_h_in = files('libvirt-common.h.in') + +libvirt_include = files( + 'libvirt-admin.h', + 'libvirt-domain-checkpoint.h', + 'libvirt-domain.h', + 'libvirt-domain-snapshot.h', + 'libvirt-event.h', + 'libvirt.h', + 'libvirt-host.h', + 'libvirt-interface.h', + 'libvirt-lxc.h', + 'libvirt-network.h', + 'libvirt-nodedev.h', + 'libvirt-nwfilter.h', + 'libvirt-qemu.h', + 'libvirt-secret.h', + 'libvirt-storage.h', + 'libvirt-stream.h', + 'virterror.h', +) + +include_conf = configuration_data() +include_conf.merge_from(conf) + +libvirt_common_h = configure_file( + input: libvirt_common_h_in, + output: 'libvirt-common.h', + configuration: include_conf, +) + +install_headers( + libvirt_include, + libvirt_common_h, + install_dir: includedir / 'libvirt', +) diff --git a/include/meson.build b/include/meson.build new file mode 100644 index 00000000000..06658ede6a7 --- /dev/null +++ b/include/meson.build @@ -0,0 +1,3 @@ +libvirt_inc = include_directories('.') + +subdir('libvirt') diff --git a/meson.build b/meson.build index 8c6db66a07f..b5430012a79 100644 --- a/meson.build +++ b/meson.build @@ -626,6 +626,8 @@ top_inc_dir = include_directories('.') subdir('scripts') +subdir('include') + # generate meson-config.h file configure_file(output: 'meson-config.h', configuration: conf) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 33 --------------------------------- meson.build | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 33 deletions(-) diff --git a/configure.ac b/configure.ac index 07b86d8b944..904c2a0fdcf 100644 --- a/configure.ac +++ b/configure.ac @@ -207,38 +207,6 @@ LIBVIRT_CHECK_YAJL AC_CHECK_SIZEOF([long]) -dnl Availability of various common functions (non-fatal if missing), -dnl and various less common threadsafe functions -AC_CHECK_FUNCS_ONCE([\ - elf_aux_info \ - fallocate \ - getauxval \ - getegid \ - geteuid \ - getgid \ - getifaddrs \ - getmntent_r \ - getpwuid_r \ - getrlimit \ - getuid \ - getutxid \ - if_indextoname \ - mmap \ - newlocale \ - posix_fallocate \ - posix_memalign \ - pipe2 \ - prlimit \ - sched_getaffinity \ - sched_setscheduler \ - setgroups \ - setns \ - setrlimit \ - symlink \ - sysctlbyname \ - unshare \ - ]) - dnl Availability of various common headers (non-fatal if missing). AC_CHECK_HEADERS([\ asm/hwcap.h \ @@ -263,7 +231,6 @@ AC_CHECK_HEADERS([\ ]) dnl Check whether endian provides handy macros. AC_CHECK_DECLS([htole64], [], [], [[#include <endian.h>]]) -AC_CHECK_FUNCS([stat stat64 __xstat __xstat64 lstat lstat64 __lxstat __lxstat64]) AC_CHECK_TYPE([struct ifreq], [AC_DEFINE([HAVE_STRUCT_IFREQ],[1], diff --git a/meson.build b/meson.build index b5430012a79..eb71a66cdf2 100644 --- a/meson.build +++ b/meson.build @@ -617,6 +617,53 @@ libvirt_export_dynamic = cc.first_supported_link_argument([ ]) +# check availability of various common functions (non-fatal i missing) + +functions = [ + '__lxstat', + '__lxstat64', + '__xstat', + '__xstat64', + 'elf_aux_info', + 'fallocate', + 'getauxval', + 'getegid', + 'geteuid', + 'getgid', + 'getifaddrs', + 'getmntent_r', + 'getpwuid_r', + 'getrlimit', + 'getuid', + 'getutxid', + 'if_indextoname', + 'lstat', + 'lstat64', + 'mmap', + 'newlocale', + 'pipe2', + 'posix_fallocate', + 'posix_memalign', + 'prlimit', + 'sched_getaffinity', + 'sched_setscheduler', + 'setgroups', + 'setns', + 'setrlimit', + 'stat', + 'stat64', + 'symlink', + 'sysctlbyname', + 'unshare', +] + +foreach function : functions + if cc.has_function(function) + conf.set('HAVE_@0@'.format(function.to_upper()), 1) + endif +endforeach + + # define top include directory top_inc_dir = include_directories('.') -- 2.26.2

On Thu, Jul 16, 2020 at 11:54:21 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 33 --------------------------------- meson.build | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 33 deletions(-)
[...]
diff --git a/meson.build b/meson.build index b5430012a79..eb71a66cdf2 100644 --- a/meson.build +++ b/meson.build @@ -617,6 +617,53 @@ libvirt_export_dynamic = cc.first_supported_link_argument([ ])
+# check availability of various common functions (non-fatal i missing)
if missing
+ +functions = [

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 90 ---------------------------------------------------- meson.build | 72 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 90 deletions(-) diff --git a/configure.ac b/configure.ac index 904c2a0fdcf..4a40f3fc34e 100644 --- a/configure.ac +++ b/configure.ac @@ -207,28 +207,6 @@ LIBVIRT_CHECK_YAJL AC_CHECK_SIZEOF([long]) -dnl Availability of various common headers (non-fatal if missing). -AC_CHECK_HEADERS([\ - asm/hwcap.h \ - ifaddrs.h \ - libtasn1.h \ - util.h \ - libutil.h \ - linux/magic.h \ - mntent.h \ - net/ethernet.h \ - net/if.h \ - pty.h \ - pwd.h \ - stdarg.h \ - syslog.h \ - sys/ioctl.h \ - sys/mount.h \ - sys/syscall.h \ - sys/sysctl.h \ - sys/ucred.h \ - xlocale.h \ - ]) dnl Check whether endian provides handy macros. AC_CHECK_DECLS([htole64], [], [], [[#include <endian.h>]]) @@ -256,11 +234,6 @@ AC_CHECK_DECLS([SEEK_HOLE], [], [], #include <unistd.h>]) -dnl Our only use of libtasn1.h is in the testsuite, and can be skipped -dnl if the header is not present. Assume -ltasn1 is present if the -dnl header could be found. -AM_CONDITIONAL([HAVE_LIBTASN1], [test "x$ac_cv_header_libtasn1_h" = "xyes"]) - AC_CHECK_LIB([intl],[gettext],[]) AC_CHECK_LIB([util],[openpty],[]) @@ -344,54 +317,6 @@ LIBVIRT_CHECK_SYSCTL_CONFIG LIBVIRT_CHECK_NSS - - -dnl -dnl check for kvm headers -dnl -AC_CHECK_HEADERS([linux/kvm.h]) - - -dnl -dnl check for kernel headers required by src/bridge.c -dnl -if test "$with_linux" = "yes"; then - # Various kernel versions have headers that are not self-standing, but - # yet are incompatible with the corresponding glibc headers. In order - # to guarantee compilation across a wide range of versions (from RHEL 5 - # to rawhide), we first have to probe whether glibc and kernel can be - # used in tandem; and if not, provide workarounds that ensure that - # ABI-compatible IPv6 types are present for use by the kernel headers. - # These probes mirror the usage in virnetdevbridge.c - AC_CACHE_CHECK( - [whether <linux/*.h> and <netinet/*.h> headers are compatible], - [lv_cv_netinet_linux_compatible], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include <netinet/in.h> - #include <linux/in6.h> - ]])], - [lv_cv_netinet_linux_compatible=yes], - [lv_cv_netinet_linux_compatible=no])]) - if test "x$lv_cv_netinet_linux_compatible" != xyes; then - AC_DEFINE([NETINET_LINUX_WORKAROUND], [1], - [define to 1 if Linux kernel headers require a workaround to avoid - compilation errors when mixed with glibc netinet headers]) - fi - AC_CHECK_HEADERS([linux/param.h linux/sockios.h linux/if_bridge.h linux/if_tun.h],, - [AC_MSG_ERROR([You must install kernel-headers in order to compile libvirt with QEMU or LXC support])], - [[#include <netinet/in.h> - #if NETINET_LINUX_WORKAROUND - # define in6_addr in6_addr_ - # define sockaddr_in6 sockaddr_in6_ - # define ipv6_mreq ipv6_mreq_ - # define in6addr_any in6addr_any_ - # define in6addr_loopback in6addr_loopback_ - #endif - #include <linux/in6.h> - ]]) -fi - - dnl Need to test if pkg-config exists PKG_PROG_PKG_CONFIG @@ -482,20 +407,6 @@ if test $with_storage = yes; then fi AM_CONDITIONAL([WITH_STORAGE], [test "$with_storage" = "yes"]) -dnl -dnl check for kernel headers required by btrfs ioctl -dnl -if test "$with_linux" = "yes"; then - AC_CHECK_HEADERS([linux/btrfs.h]) -fi - -dnl -dnl check for xfs dev headers required by xfs ioctl -dnl -if test "$with_linux" = "yes"; then - AC_CHECK_HEADERS([xfs/xfs.h]) -fi - dnl dnl check for DEVLINK_CMD_ESWITCH_GET dnl @@ -505,7 +416,6 @@ dnl along with the original spelling of this constant dnl (DEVLINK_CMD_ESWITCH_MODE_GET, not supported by libvirt) dnl if test "$with_linux" = "yes"; then - AC_CHECK_HEADERS([linux/devlink.h]) AC_CHECK_DECLS([DEVLINK_CMD_ESWITCH_GET], [], [], [[#include <linux/devlink.h>]]) fi diff --git a/meson.build b/meson.build index eb71a66cdf2..62e51230888 100644 --- a/meson.build +++ b/meson.build @@ -664,6 +664,78 @@ foreach function : functions endforeach +# various header checks + +headers = [ + 'asm/hwcap.h', + 'ifaddrs.h', + 'libtasn1.h', + 'libutil.h', + 'linux/kvm.h', + 'linux/magic.h', + 'mntent.h', + 'net/ethernet.h', + 'net/if.h', + 'pty.h', + 'pwd.h', + 'stdarg.h', + 'sys/ioctl.h', + 'sys/mount.h', + 'sys/syscall.h', + 'sys/sysctl.h', + 'sys/ucred.h', + 'syslog.h', + 'util.h', + 'xlocale.h', +] + +if host_machine.system() == 'linux' + # check for kernel headers required by btrfs ioctl + headers += 'linux/btrfs.h' + # check for xfs dev headers required by xfs ioctl + headers += 'xfs/xfs.h' + # check for DEVLINK_CMD_ESWITCH_GET + headers += 'linux/devlink.h' +endif + +foreach name : headers + if cc.has_header(name) + conf.set('HAVE_@0@'.format(name.underscorify().to_upper()), 1) + endif +endforeach + +# check for kernel headers required by src/util/virnetdevbridge.c +if host_machine.system() == 'linux' + # Various kernel versions have headers that are not self-standing, but + # yet are incompatible with the corresponding glibc headers. In order + # to guarantee compilation across a wide range of versions (from RHEL 5 + # to rawhide), we first have to probe whether glibc and kernel can be + # used in tandem; and if not, provide workarounds that ensure that + # ABI-compatible IPv6 types are present for use by the kernel headers. + netinet_workaround_code = ''' + #include <netinet/in.h> + #include <linux/in6.h> + + int main(void) { return 0; } + ''' + if not cc.compiles(netinet_workaround_code) + conf.set('NETINET_LINUX_WORKAROUND', 1) + endif + + required_headers = [ + 'linux/param.h', + 'linux/sockios.h', + 'linux/if_bridge.h', + 'linux/if_tun.h', + ] + foreach name : required_headers + if not cc.has_header(name) + error('You must install kernel-headers in order to compile libvirt with QEMU or LXC support') + endif + endforeach +endif + + # define top include directory top_inc_dir = include_directories('.') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 87 ---------------------------------------------------- meson.build | 72 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 87 deletions(-) diff --git a/configure.ac b/configure.ac index 4a40f3fc34e..1ffa4f931ee 100644 --- a/configure.ac +++ b/configure.ac @@ -207,9 +207,6 @@ LIBVIRT_CHECK_YAJL AC_CHECK_SIZEOF([long]) -dnl Check whether endian provides handy macros. -AC_CHECK_DECLS([htole64], [], [], [[#include <endian.h>]]) - AC_CHECK_TYPE([struct ifreq], [AC_DEFINE([HAVE_STRUCT_IFREQ],[1], [Defined if struct ifreq exists in net/if.h])], @@ -223,16 +220,6 @@ AC_CHECK_TYPE([struct sockpeercred], [], [[#include <sys/socket.h> ]]) -AC_CHECK_DECLS([ETH_FLAG_TXVLAN, ETH_FLAG_NTUPLE, ETH_FLAG_RXHASH, ETH_FLAG_LRO, - ETHTOOL_GGSO, ETHTOOL_GGRO, ETHTOOL_GFLAGS, ETHTOOL_GFEATURES, - ETHTOOL_SCOALESCE, ETHTOOL_GCOALESCE], - [], [], [[#include <linux/ethtool.h> - ]]) - -AC_CHECK_DECLS([SEEK_HOLE], [], [], - [#include <sys/types.h> - #include <unistd.h>]) - AC_CHECK_LIB([intl],[gettext],[]) AC_CHECK_LIB([util],[openpty],[]) @@ -407,27 +394,6 @@ if test $with_storage = yes; then fi AM_CONDITIONAL([WITH_STORAGE], [test "$with_storage" = "yes"]) -dnl -dnl check for DEVLINK_CMD_ESWITCH_GET -dnl -dnl Assume DEVLINK_ESWITCH_MODE_SWITCHDEV is also -dnl available, as it was introudced in kernel 4.8 -dnl along with the original spelling of this constant -dnl (DEVLINK_CMD_ESWITCH_MODE_GET, not supported by libvirt) -dnl -if test "$with_linux" = "yes"; then - AC_CHECK_DECLS([DEVLINK_CMD_ESWITCH_GET], [], [], - [[#include <linux/devlink.h>]]) -fi - -dnl -dnl check for VHOST_VSOCK_SET_GUEST_CID -dnl -if test "$with_linux" = "yes"; then - AC_CHECK_DECLS([VHOST_VSOCK_SET_GUEST_CID], [], [], - [[#include <linux/vhost.h>]]) -fi - dnl Allow perl/python overrides AC_PATH_PROGS([PYTHON], [python3]) if test -z "$PYTHON"; then @@ -478,9 +444,6 @@ then fi AM_CONDITIONAL([WITH_NODE_DEVICES], [test "$with_nodedev" = "yes"]) -dnl GET_VLAN_VID_CMD is required for virNetDevGetVLanID -AC_CHECK_DECLS([GET_VLAN_VID_CMD], [], [], [[#include <linux/if_vlan.h>]]) - # Check for Linux vs. BSD ifreq members AC_CHECK_MEMBERS([struct ifreq.ifr_newname, struct ifreq.ifr_ifindex, @@ -491,41 +454,6 @@ AC_CHECK_MEMBERS([struct ifreq.ifr_newname, #include <net/if.h> ]) -# Check for BSD approach for setting MAC addr -AC_LINK_IFELSE([AC_LANG_PROGRAM( - [[ - #include <sys/types.h> - #include <sys/socket.h> - #include <net/if_dl.h> - ]], - [[ - link_addr(0, 0)]])], - [AC_DEFINE([HAVE_DECL_LINK_ADDR], - [1], - [whether link_addr is available])]) - -# Check for BSD approach for bridge management -AC_CHECK_DECLS([BRDGSFD, BRDGADD, BRDGDEL], - [AC_DEFINE([HAVE_BSD_BRIDGE_MGMT], - [1], - [whether BSD style bridge management is available])], - [], - [#include <stdint.h> - #include <net/if.h> - #include <net/ethernet.h> - #include <net/if_bridgevar.h> - ]) - -# Check for BSD CPU affinity availability -AC_CHECK_DECLS([cpuset_getaffinity], - [AC_DEFINE([HAVE_BSD_CPU_AFFINITY], - [1], - [whether BSD CPU affinity management is available])], - [], - [#include <sys/param.h> - #include <sys/cpuset.h> - ]) - # Check for BSD kvm (kernel memory interface) if test $with_freebsd = yes; then AC_CHECK_LIB([kvm], [kvm_getprocs], [], @@ -533,21 +461,6 @@ if test $with_freebsd = yes; then ) fi -AC_CHECK_DECLS([clock_serv_t, host_get_clock_service, clock_get_time], - [AC_DEFINE([HAVE_MACH_CLOCK_ROUTINES], - [1], - [whether Mach clock routines are available])], - [], - [#include <mach/clock.h> - #include <mach/mach.h> - ]) - -# Check if we have new enough kernel to support BPF devices for cgroups v2 -if test "$with_linux" = "yes"; then - AC_CHECK_DECLS([BPF_PROG_QUERY, BPF_CGROUP_DEVICE], - [], [], [#include <linux/bpf.h>]) -fi - # Check if we need to look for ifconfig if test "$want_ifconfig" = "yes"; then AC_PATH_PROG([IFCONFIG_PATH], [ifconfig]) diff --git a/meson.build b/meson.build index 62e51230888..c79d557b289 100644 --- a/meson.build +++ b/meson.build @@ -736,6 +736,78 @@ if host_machine.system() == 'linux' endif +# check various symbols + +symbols = [ + # Check whether endian provides handy macros. + [ 'endian.h', 'htole64' ], + + [ 'linux/ethtool.h', 'ETH_FLAG_TXVLAN' ], + [ 'linux/ethtool.h', 'ETH_FLAG_NTUPLE' ], + [ 'linux/ethtool.h', 'ETH_FLAG_RXHASH' ], + [ 'linux/ethtool.h', 'ETH_FLAG_LRO' ], + [ 'linux/ethtool.h', 'ETHTOOL_GGSO' ], + [ 'linux/ethtool.h', 'ETHTOOL_GGRO' ], + [ 'linux/ethtool.h', 'ETHTOOL_GFLAGS' ], + [ 'linux/ethtool.h', 'ETHTOOL_GFEATURES' ], + [ 'linux/ethtool.h', 'ETHTOOL_SCOALESCE' ], + [ 'linux/ethtool.h', 'ETHTOOL_GCOALESCE' ], + + # GET_VLAN_VID_CMD is required for virNetDevGetVLanID + [ 'linux/if_vlan.h', 'GET_VLAN_VID_CMD' ], + + [ 'unistd.h', 'SEEK_HOLE' ], + + # GET_VLAN_VID_CMD is required for virNetDevGetVLanID + [ 'linux/if_vlan.h', 'GET_VLAN_VID_CMD' ], + + # Check for BSD approach for setting MAC addr + [ 'net/if_dl.h', 'link_addr' ], +] + +if host_machine.system() == 'linux' + symbols += [ + # check for DEVLINK_CMD_ESWITCH_GET + # Assume DEVLINK_ESWITCH_MODE_SWITCHDEV is also available, as it was + # introudced in kernel 4.8 along with the original spelling of this + # constant (DEVLINK_CMD_ESWITCH_MODE_GET, not supported by libvirt). + [ 'linux/devlink.h', 'DEVLINK_CMD_ESWITCH_GET' ], + + # check for VHOST_VSOCK_SET_GUEST_CID + [ 'linux/vhost.h', 'VHOST_VSOCK_SET_GUEST_CID' ], + + # Check if we have new enough kernel to support BPF devices for cgroups v2 + [ 'linux/bpf.h', 'BPF_PROG_QUERY' ], + [ 'linux/bpf.h', 'BPF_CGROUP_DEVICE' ], + ] +endif + +foreach symbol : symbols + if cc.has_header_symbol(symbol[0], symbol[1]) + conf.set('HAVE_DECL_@0@'.format(symbol[1].to_upper()), 1) + endif +endforeach + +# Check for BSD approach for bridge management +if (cc.has_header_symbol('net/if_bridgevar.h', 'BRDGSFD') and + cc.has_header_symbol('net/if_bridgevar.h', 'BRDGADD') and + cc.has_header_symbol('net/if_bridgevar.h', 'BRDGDEL')) + conf.set('HAVE_BSD_BRIDGE_MGMT', 1) +endif + +# Check for BSD CPU affinity availability +if cc.has_header_symbol('sys/cpuset.h', 'cpuset_getaffinity') + conf.set('HAVE_BSD_CPU_AFFINITY', 1) +endif + +# whether Mach clock routines are available +if (cc.has_header_symbol('mach/clock.h', 'clock_serv_t') and + cc.has_header_symbol('mach/clock.h', 'host_get_clock_service') and + cc.has_header_symbol('mach/clock.h', 'clock_get_time')) + conf.set('HAVE_MACH_CLOCK_ROUTINES', 1) +endif + + # define top include directory top_inc_dir = include_directories('.') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 15 --------------- meson.build | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac index 1ffa4f931ee..69067091f09 100644 --- a/configure.ac +++ b/configure.ac @@ -51,8 +51,6 @@ AC_PROG_CPP dnl get 64-int interfaces on 32-bit platforms AC_SYS_LARGEFILE -AC_TYPE_UID_T - dnl Support building Win32 DLLs (must appear *before* AM_PROG_LIBTOOL) AC_LIBTOOL_WIN32_DLL @@ -207,19 +205,6 @@ LIBVIRT_CHECK_YAJL AC_CHECK_SIZEOF([long]) -AC_CHECK_TYPE([struct ifreq], - [AC_DEFINE([HAVE_STRUCT_IFREQ],[1], - [Defined if struct ifreq exists in net/if.h])], - [], [[#include <sys/socket.h> - #include <net/if.h> - ]]) - -AC_CHECK_TYPE([struct sockpeercred], - [AC_DEFINE([HAVE_STRUCT_SOCKPEERCRED], [1], - [Defined if struct sockpeercred is available])], - [], [[#include <sys/socket.h> - ]]) - AC_CHECK_LIB([intl],[gettext],[]) AC_CHECK_LIB([util],[openpty],[]) diff --git a/meson.build b/meson.build index c79d557b289..aa492c9549a 100644 --- a/meson.build +++ b/meson.build @@ -808,6 +808,33 @@ if (cc.has_header_symbol('mach/clock.h', 'clock_serv_t') and endif +# check various types + +types = [ + [ 'struct ifreq', '#include <sys/socket.h>\n#include <net/if.h>'] , + [ 'struct sockpeercred', '#include <sys/socket.h' ], +] + +foreach type : types + if cc.has_type(type[0], prefix: type[1]) + name = type[0].underscorify().to_upper() + conf.set('HAVE_@0@'.format(name), 1) + endif +endforeach + +if host_machine.system() == 'windows' + uid_types = [ + 'uid_t', + 'gid_t', + ] + foreach type : uid_types + if not cc.has_type(type, prefix: '#include <sys/types.h>') + conf.set(type, 'int') + endif + endforeach +endif + + # define top include directory top_inc_dir = include_directories('.') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 9 --------- meson.build | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 69067091f09..a426ba2a355 100644 --- a/configure.ac +++ b/configure.ac @@ -429,15 +429,6 @@ then fi AM_CONDITIONAL([WITH_NODE_DEVICES], [test "$with_nodedev" = "yes"]) -# Check for Linux vs. BSD ifreq members -AC_CHECK_MEMBERS([struct ifreq.ifr_newname, - struct ifreq.ifr_ifindex, - struct ifreq.ifr_index, - struct ifreq.ifr_hwaddr], - [], [], - [#include <sys/socket.h> - #include <net/if.h> - ]) # Check for BSD kvm (kernel memory interface) if test $with_freebsd = yes; then diff --git a/meson.build b/meson.build index aa492c9549a..d474745f31e 100644 --- a/meson.build +++ b/meson.build @@ -835,6 +835,25 @@ if host_machine.system() == 'windows' endif +# check various members + +members = [ + # Check for Linux vs. BSD ifreq members + [ 'struct ifreq', 'ifr_newname', '#include <sys/socket.h>\n#include <net/if.h>' ], + [ 'struct ifreq', 'ifr_ifindex', '#include <sys/socket.h>\n#include <net/if.h>' ], + [ 'struct ifreq', 'ifr_index', '#include <sys/socket.h>\n#include <net/if.h>' ], + [ 'struct ifreq', 'ifr_hwaddr', '#include <sys/socket.h>\n#include <net/if.h>' ], +] + +foreach member : members + if cc.has_member(member[0], member[1], prefix: member[2]) + type = member[0].underscorify().to_upper() + member = member[1].underscorify().to_upper() + conf.set('HAVE_@0@_@1@'.format(type, member), 1) + endif +endforeach + + # define top include directory top_inc_dir = include_directories('.') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 2 -- meson.build | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index a426ba2a355..b85fa9a9a6f 100644 --- a/configure.ac +++ b/configure.ac @@ -203,8 +203,6 @@ LIBVIRT_CHECK_WIRESHARK LIBVIRT_CHECK_XDR LIBVIRT_CHECK_YAJL -AC_CHECK_SIZEOF([long]) - AC_CHECK_LIB([intl],[gettext],[]) AC_CHECK_LIB([util],[openpty],[]) diff --git a/meson.build b/meson.build index d474745f31e..121022e5f78 100644 --- a/meson.build +++ b/meson.build @@ -854,6 +854,11 @@ foreach member : members endforeach +# check various types sizeof + +conf.set('SIZEOF_LONG', cc.sizeof('long')) + + # define top include directory top_inc_dir = include_directories('.') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 39 ------------- m4/virt-external-programs.m4 | 106 ----------------------------------- meson.build | 82 +++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 145 deletions(-) delete mode 100644 m4/virt-external-programs.m4 diff --git a/configure.ac b/configure.ac index b85fa9a9a6f..d8ff2ba3900 100644 --- a/configure.ac +++ b/configure.ac @@ -40,9 +40,6 @@ m4_ifndef([AM_SILENT_RULES], AC_CANONICAL_HOST -dnl Where we look for daemons and admin binaries during configure -LIBVIRT_SBIN_PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin" - dnl Checks for C compiler. AC_PROG_CC AC_PROG_INSTALL @@ -62,10 +59,6 @@ m4_ifndef([LT_INIT], [ AM_PROG_CC_C_O AM_PROG_LD -dnl Specify if we rely on ifconfig instead of iproute2 (e.g. in case -dnl we're working on BSD) -want_ifconfig=no - dnl Make some notes about which OS we're compiling for, as the lxc and qemu dnl drivers require linux headers, and storage_mpath, dtrace, and nwfilter dnl are also linux specific. The "network" and storage_fs drivers are known @@ -90,7 +83,6 @@ if test $with_linux = no; then fi if test $with_freebsd = yes; then - want_ifconfig=yes with_firewalld=no fi @@ -208,12 +200,6 @@ AC_CHECK_LIB([intl],[gettext],[]) AC_CHECK_LIB([util],[openpty],[]) -dnl -dnl Check for external programs -dnl - -LIBVIRT_CHECK_EXTERNAL_PROGRAMS - dnl dnl Virtualization drivers check dnl @@ -377,17 +363,6 @@ if test $with_storage = yes; then fi AM_CONDITIONAL([WITH_STORAGE], [test "$with_storage" = "yes"]) -dnl Allow perl/python overrides -AC_PATH_PROGS([PYTHON], [python3]) -if test -z "$PYTHON"; then - AC_MSG_ERROR(['python3' binary is required to build libvirt]) -fi -AC_DEFINE_UNQUOTED([PYTHON], "$PYTHON", [path to python binary]) -AC_PATH_PROG([FLAKE8], [flake8]) -if test -z "$FLAKE8"; then - AC_MSG_WARN(['flake8' binary is required to check python code style]) -fi - dnl Python3 < 3.7 treats the C locale as 7-bit only. dnl We must force env vars so it treats it as UTF-8 dnl regardless of the user's locale. @@ -395,11 +370,6 @@ RUNUTF8="LC_ALL= LANG=C LC_CTYPE=en_US.UTF-8" AC_SUBST(RUNUTF8) -AC_PATH_PROG([PERL], [perl]) -if test -z "$PERL"; then - AC_MSG_ERROR(['perl' binary is required to build libvirt]) -fi - dnl MinGW checks LIBVIRT_WIN_CHECK_COMMON LIBVIRT_WIN_CHECK_MINGW @@ -435,15 +405,6 @@ if test $with_freebsd = yes; then ) fi -# Check if we need to look for ifconfig -if test "$want_ifconfig" = "yes"; then - AC_PATH_PROG([IFCONFIG_PATH], [ifconfig]) - if test -z "$IFCONFIG_PATH"; then - AC_MSG_ERROR([Failed to find ifconfig.]) - fi - AC_DEFINE_UNQUOTED([IFCONFIG_PATH], "$IFCONFIG_PATH", [path to ifconfig binary]) -fi - GNUmakefile=GNUmakefile m4_if(m4_version_compare([2.61a.100], m4_defn([m4_PACKAGE_VERSION])), [1], [], diff --git a/m4/virt-external-programs.m4 b/m4/virt-external-programs.m4 deleted file mode 100644 index d905beed71d..00000000000 --- a/m4/virt-external-programs.m4 +++ /dev/null @@ -1,106 +0,0 @@ -dnl The External programs check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_CHECK_EXTERNAL_PROGRAMS], [ - dnl Do we have rpcgen? - AC_PATH_PROGS([RPCGEN], [rpcgen portable-rpcgen], [no]) - AM_CONDITIONAL([HAVE_RPCGEN], [test "x$ac_cv_path_RPCGEN" != "xno"]) - - dnl Miscellaneous external programs. - AC_PATH_PROG([XMLLINT], [xmllint], []) - if test -z "$XMLLINT" - then - AC_MSG_ERROR("xmllint is required to build libvirt") - fi - AC_PATH_PROG([XSLTPROC], [xsltproc], []) - if test -z "$XSLTPROC" - then - AC_MSG_ERROR("xsltproc is required to build libvirt") - fi - - dnl Drop the rst2html (aka HTML4) variants once we - dnl stop supporting Ubuntu 16.04 (Xenial) - AC_PATH_PROGS([RST2HTML], [rst2html5 rst2html5.py rst2html5-3 rst2html rst2html.py rst2html-3], []) - if test -z "$RST2HTML" - then - AC_MSG_ERROR("rst2html5/rst2html is required to build libvirt") - fi - AC_PATH_PROGS([RST2MAN], [rst2man rst2man.py rst2man-3], []) - if test -z "$RST2MAN" - then - AC_MSG_ERROR("rst2man is required to build libvirt") - fi - AC_PATH_PROG([AUGPARSE], [augparse], [/usr/bin/augparse]) - AC_PROG_MKDIR_P - AC_PROG_LN_S - - dnl External programs that we can use if they are available. - dnl We will hard-code paths to these programs unless we cannot - dnl detect them, in which case we'll search for the program - dnl along the $PATH at runtime and fail if it's not there. - AC_PATH_PROG([DMIDECODE], [dmidecode], [dmidecode], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([DNSMASQ], [dnsmasq], [dnsmasq], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([RADVD], [radvd], [radvd], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([TC], [tc], [tc], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([UDEVADM], [udevadm], [udevadm], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([MODPROBE], [modprobe], [modprobe], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([RMMOD], [rmmod], [rmmod], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([MM_CTL], [mm-ctl], [mm-ctl], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([OVS_VSCTL], [ovs-vsctl], [ovs-vsctl], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([SCRUB], [scrub], [scrub], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([ADDR2LINE], [addr2line], [addr2line], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([MDEVCTL], [mdevctl], [mdevctl], [$LIBVIRT_SBIN_PATH]) - - AC_DEFINE_UNQUOTED([DMIDECODE], ["$DMIDECODE"], - [Location or name of the dmidecode program]) - AC_DEFINE_UNQUOTED([DNSMASQ], ["$DNSMASQ"], - [Location or name of the dnsmasq program]) - AC_DEFINE_UNQUOTED([RADVD], ["$RADVD"], - [Location or name of the radvd program]) - AC_DEFINE_UNQUOTED([TC], ["$TC"], - [Location or name of the tc program (see iproute2)]) - AC_DEFINE_UNQUOTED([MM_CTL], ["$MM_CTL"], - [Location or name of the mm-ctl program]) - AC_DEFINE_UNQUOTED([OVS_VSCTL], ["$OVS_VSCTL"], - [Location or name of the ovs-vsctl program]) - AC_DEFINE_UNQUOTED([UDEVADM], ["$UDEVADM"], - [Location or name of the udevadm program]) - AC_DEFINE_UNQUOTED([MODPROBE], ["$MODPROBE"], - [Location or name of the modprobe program]) - AC_DEFINE_UNQUOTED([RMMOD], ["$RMMOD"], - [Location or name of the rmmod program]) - AC_DEFINE_UNQUOTED([SCRUB], ["$SCRUB"], - [Location or name of the scrub program (for wiping algorithms)]) - AC_DEFINE_UNQUOTED([ADDR2LINE], ["$ADDR2LINE"], - [Location of addr2line program]) - AC_DEFINE_UNQUOTED([MDEVCTL], ["$MDEVCTL"], - [Location or name of the mdevctl program]) - - AC_PATH_PROG([IP_PATH], [ip], [/sbin/ip], [$LIBVIRT_SBIN_PATH]) - AC_DEFINE_UNQUOTED([IP_PATH], ["$IP_PATH"], [path to ip binary]) - - AC_PATH_PROG([IPTABLES_PATH], [iptables], /sbin/iptables, [$LIBVIRT_SBIN_PATH]) - AC_DEFINE_UNQUOTED([IPTABLES_PATH], ["$IPTABLES_PATH"], [path to iptables binary]) - - AC_PATH_PROG([IP6TABLES_PATH], [ip6tables], [/sbin/ip6tables], [$LIBVIRT_SBIN_PATH]) - AC_DEFINE_UNQUOTED([IP6TABLES_PATH], ["$IP6TABLES_PATH"], [path to ip6tables binary]) - - AC_PATH_PROG([EBTABLES_PATH], [ebtables], [/sbin/ebtables], [$LIBVIRT_SBIN_PATH]) - AC_DEFINE_UNQUOTED([EBTABLES_PATH], ["$EBTABLES_PATH"], [path to ebtables binary]) -]) diff --git a/meson.build b/meson.build index 121022e5f78..3f86f931de0 100644 --- a/meson.build +++ b/meson.build @@ -859,6 +859,88 @@ endforeach conf.set('SIZEOF_LONG', cc.sizeof('long')) +# Where we look for daemons and admin binaries during configure + +libvirt_sbin_path = [ + '/sbin', + '/usr/sbin', + '/usr/local/sbin', +] + + +# required programs check + +required_programs = [ + 'perl', + 'python3', + 'xmllint', + 'xsltproc', +] + +required_programs_groups = [ + {'name':'rpcgen', 'prog':['rpcgen', 'portable-rpcgen']}, + # Drop the rst2html (aka HTML4) variants once we stop supporting Ubuntu 16.04 (Xenial) + {'name':'rst2html', 'prog':['rst2html5', 'rst2html5.py', 'rst2html5-3', 'rst2html', 'rst2html.py', 'rst2html-3']}, + {'name':'rst2man', 'prog':['rst2man', 'rst2man.py', 'rst2man-3']}, +] + +if host_machine.system() == 'freebsd' + required_programs += 'ifconfig' +endif + +foreach name : required_programs + prog = find_program(name, required: true, dirs: libvirt_sbin_path) + varname = name.underscorify() + conf.set_quoted(varname.to_upper(), prog.path()) + set_variable('@0@_prog'.format(varname), prog) +endforeach + +foreach item : required_programs_groups + prog = find_program(item.get('prog'), required: true, dirs: libvirt_sbin_path) + varname = item.get('name').underscorify() + conf.set_quoted(varname.to_upper(), prog.path()) + set_variable('@0@_prog'.format(varname), prog) +endforeach + + +# optional programs + +optional_programs = [ + 'addr2line', + 'augparse', + 'dmidecode', + 'dnsmasq', + 'ebtables', + 'flake8', + 'ip', + 'ip6tables', + 'iptables', + 'mdevctl', + 'mm-ctl', + 'modprobe', + 'ovs-vsctl', + 'radvd', + 'rmmod', + 'scrub', + 'tc', + 'udevadm', +] + +foreach name : optional_programs + prog = find_program(name, required: false, dirs: libvirt_sbin_path) + varname = name.underscorify() + if prog.found() + prog_path = prog.path() + else + prog_path = name + endif + + conf.set_quoted(varname.to_upper(), prog_path) + conf.set_quoted('@0@_PATH'.format(varname.to_upper()), prog_path) + set_variable('@0@_prog'.format(varname), prog) +endforeach + + # define top include directory top_inc_dir = include_directories('.') -- 2.26.2

We compile src/util/viriscsi unconditionally where we require ISCSIADM to be defined. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-storage-iscsi.m4 | 6 ------ meson.build | 1 + 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/m4/virt-storage-iscsi.m4 b/m4/virt-storage-iscsi.m4 index eb0b08671c3..0e04079a1cc 100644 --- a/m4/virt-storage-iscsi.m4 +++ b/m4/virt-storage-iscsi.m4 @@ -24,7 +24,6 @@ AC_DEFUN([LIBVIRT_STORAGE_ARG_ISCSI], [ AC_DEFUN([LIBVIRT_STORAGE_CHECK_ISCSI], [ if test "$with_storage_iscsi" = "yes" || test "$with_storage_iscsi" = "check"; then - AC_PATH_PROG([ISCSIADM], [iscsiadm], [], [$LIBVIRT_SBIN_PATH]) if test "$with_storage_iscsi" = "yes" ; then if test -z "$ISCSIADM" ; then AC_MSG_ERROR([We need iscsiadm for iSCSI storage driver]) ; fi else @@ -37,11 +36,6 @@ AC_DEFUN([LIBVIRT_STORAGE_CHECK_ISCSI], [ AC_DEFINE_UNQUOTED([WITH_STORAGE_ISCSI], 1, [whether iSCSI backend for storage driver is enabled]) fi fi - if test -z "$ISCIADM" ; then - AC_DEFINE_UNQUOTED([ISCSIADM],["iscsiadm"],[Name of iscsiadm program]) - else - AC_DEFINE_UNQUOTED([ISCSIADM],["$ISCSIADM"],[Location of iscsiadm program]) - fi AM_CONDITIONAL([WITH_STORAGE_ISCSI], [test "$with_storage_iscsi" = "yes"]) ]) diff --git a/meson.build b/meson.build index 3f86f931de0..d4b3a9e910d 100644 --- a/meson.build +++ b/meson.build @@ -915,6 +915,7 @@ optional_programs = [ 'ip', 'ip6tables', 'iptables', + 'iscsiadm', 'mdevctl', 'mm-ctl', 'modprobe', -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 2 -- m4/virt-acl.m4 | 37 ------------------------------------- meson.build | 15 +++++++++++++++ 3 files changed, 15 insertions(+), 39 deletions(-) delete mode 100644 m4/virt-acl.m4 diff --git a/configure.ac b/configure.ac index d8ff2ba3900..53c87b4e293 100644 --- a/configure.ac +++ b/configure.ac @@ -150,7 +150,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_ACL LIBVIRT_CHECK_APPARMOR LIBVIRT_CHECK_ATTR LIBVIRT_CHECK_AUDIT @@ -480,7 +479,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_ACL LIBVIRT_RESULT_APPARMOR LIBVIRT_RESULT_ATTR LIBVIRT_RESULT_AUDIT diff --git a/m4/virt-acl.m4 b/m4/virt-acl.m4 deleted file mode 100644 index d548729b1dd..00000000000 --- a/m4/virt-acl.m4 +++ /dev/null @@ -1,37 +0,0 @@ -dnl ACL support -dnl -dnl Copyright (C) 2017 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_CHECK_ACL], [ - - AC_CHECK_HEADERS([sys/acl.h]) - - ACL_CFLAGS="" - ACL_LIBS="" - with_acl=no - if test "x$ac_cv_header_sys_acl_h:x$with_linux" = "xyes:xyes"; then - ACL_LIBS="-lacl" - with_acl=yes - fi - AC_SUBST([ACL_CFLAGS]) - AC_SUBST([ACL_LIBS]) -]) - -AC_DEFUN([LIBVIRT_RESULT_ACL], [ - LIBVIRT_RESULT_LIB([ACL]) -]) diff --git a/meson.build b/meson.build index d4b3a9e910d..d8ff8e0d658 100644 --- a/meson.build +++ b/meson.build @@ -942,6 +942,16 @@ foreach name : optional_programs endforeach +# generic build dependencies + +if host_machine.system() == 'linux' and cc.has_header('sys/acl.h') + acl_dep = cc.find_library('acl', required: false) + conf.set('HAVE_SYS_ACL_H', 1) +else + acl_dep = dependency('', required: false) +endif + + # define top include directory top_inc_dir = include_directories('.') @@ -960,6 +970,11 @@ configure_file(output: 'meson-config.h', configuration: conf) # print configuration summary +libs_summary = { + 'acl': acl_dep.found(), +} +summary(libs_summary, section: 'Libraries', bool_yn: true) + test_summary = { 'Coverage': coverage_flags.length() > 0, } -- 2.26.2

APPARMOR_MOUNT is not used so dropping it in meson. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-apparmor.m4 | 41 ----------------------------------------- meson.build | 8 ++++++++ meson_options.txt | 4 ++++ 4 files changed, 12 insertions(+), 44 deletions(-) delete mode 100644 m4/virt-apparmor.m4 diff --git a/configure.ac b/configure.ac index 53c87b4e293..5bf4727faa7 100644 --- a/configure.ac +++ b/configure.ac @@ -114,7 +114,6 @@ fi # Check for compiler and library settings. -LIBVIRT_ARG_APPARMOR LIBVIRT_ARG_ATTR LIBVIRT_ARG_AUDIT LIBVIRT_ARG_BASH_COMPLETION @@ -150,7 +149,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_APPARMOR LIBVIRT_CHECK_ATTR LIBVIRT_CHECK_AUDIT LIBVIRT_CHECK_BASH_COMPLETION @@ -479,7 +477,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_APPARMOR LIBVIRT_RESULT_ATTR LIBVIRT_RESULT_AUDIT LIBVIRT_RESULT_BASH_COMPLETION diff --git a/m4/virt-apparmor.m4 b/m4/virt-apparmor.m4 deleted file mode 100644 index ebddfce2015..00000000000 --- a/m4/virt-apparmor.m4 +++ /dev/null @@ -1,41 +0,0 @@ -dnl The libapparmor.so library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_APPARMOR],[ - LIBVIRT_ARG_WITH_FEATURE([APPARMOR], [AppArmor], [check]) - LIBVIRT_ARG_WITH([APPARMOR_MOUNT], [set AppArmor mount point], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_APPARMOR],[ - LIBVIRT_CHECK_LIB([APPARMOR], [apparmor], - [aa_change_profile], [sys/apparmor.h]) - - if test "$with_apparmor" = "yes"; then - AC_DEFINE_UNQUOTED([APPARMOR_DIR], - "/etc/apparmor.d", - [path to apparmor directory]) - AC_DEFINE_UNQUOTED([APPARMOR_PROFILES_PATH], - "/sys/kernel/security/apparmor/profiles", - [path to kernel profiles]) - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_APPARMOR],[ - LIBVIRT_RESULT_LIB([APPARMOR]) -]) diff --git a/meson.build b/meson.build index d8ff8e0d658..be0bc975116 100644 --- a/meson.build +++ b/meson.build @@ -951,6 +951,13 @@ else acl_dep = dependency('', required: false) endif +apparmor_dep = cc.find_library('AppArmor', required: get_option('apparmor')) +if apparmor_dep.found() + conf.set('WITH_APPARMOR', 1) + conf.set_quoted('APPARMOR_DIR', '/etc/apparmor.d') + conf.set_quoted('APPARMOR_PROFILES_PATH', '/sys/kernel/security/apparmor/profiles') +endif + # define top include directory @@ -972,6 +979,7 @@ configure_file(output: 'meson-config.h', configuration: conf) libs_summary = { 'acl': acl_dep.found(), + 'apparmor': apparmor_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 0f79f8aea03..dc60d569dd2 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -6,3 +6,7 @@ option('runstatedir', type: 'string', value: '', description: 'State directory f option('test_suite', type: 'boolean', value: true, description: 'Whether to enable and build test suite by default') option('expensive_tests', type: 'feature', value: 'auto', description: 'set the default for enabling expensive tests (long timeouts), use VIR_TEST_EXPENSIVE to override') option('test_coverage', type: 'boolean', value: false, description: 'turn on code coverage instrumentation') + + +# build dependencies options +option('apparmor', type: 'feature', value: 'auto', description: 'apparmor support') -- 2.26.2

On 7/16/20 11:54 AM, Pavel Hrdina wrote:
APPARMOR_MOUNT is not used so dropping it in meson.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-apparmor.m4 | 41 ----------------------------------------- meson.build | 8 ++++++++ meson_options.txt | 4 ++++ 4 files changed, 12 insertions(+), 44 deletions(-) delete mode 100644 m4/virt-apparmor.m4
diff --git a/configure.ac b/configure.ac index 53c87b4e293..5bf4727faa7 100644 --- a/configure.ac +++ b/configure.ac @@ -114,7 +114,6 @@ fi
# Check for compiler and library settings.
-LIBVIRT_ARG_APPARMOR LIBVIRT_ARG_ATTR LIBVIRT_ARG_AUDIT LIBVIRT_ARG_BASH_COMPLETION @@ -150,7 +149,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL
-LIBVIRT_CHECK_APPARMOR LIBVIRT_CHECK_ATTR LIBVIRT_CHECK_AUDIT LIBVIRT_CHECK_BASH_COMPLETION @@ -479,7 +477,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_APPARMOR LIBVIRT_RESULT_ATTR LIBVIRT_RESULT_AUDIT LIBVIRT_RESULT_BASH_COMPLETION diff --git a/m4/virt-apparmor.m4 b/m4/virt-apparmor.m4 deleted file mode 100644 index ebddfce2015..00000000000 --- a/m4/virt-apparmor.m4 +++ /dev/null @@ -1,41 +0,0 @@ -dnl The libapparmor.so library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_APPARMOR],[ - LIBVIRT_ARG_WITH_FEATURE([APPARMOR], [AppArmor], [check]) - LIBVIRT_ARG_WITH([APPARMOR_MOUNT], [set AppArmor mount point], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_APPARMOR],[ - LIBVIRT_CHECK_LIB([APPARMOR], [apparmor], - [aa_change_profile], [sys/apparmor.h]) - - if test "$with_apparmor" = "yes"; then - AC_DEFINE_UNQUOTED([APPARMOR_DIR], - "/etc/apparmor.d", - [path to apparmor directory]) - AC_DEFINE_UNQUOTED([APPARMOR_PROFILES_PATH], - "/sys/kernel/security/apparmor/profiles", - [path to kernel profiles]) - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_APPARMOR],[ - LIBVIRT_RESULT_LIB([APPARMOR]) -]) diff --git a/meson.build b/meson.build index d8ff8e0d658..be0bc975116 100644 --- a/meson.build +++ b/meson.build @@ -951,6 +951,13 @@ else acl_dep = dependency('', required: false) endif
+apparmor_dep = cc.find_library('AppArmor', required: get_option('apparmor'))
IIUC this tries to find -lAppArmor, but the library is called /usr/lib64/libapparmor.so.1.6.2. And also, it provides pkgconfig file: /usr/lib64/pkgconfig/libapparmor.pc I don't know how to fix it, so I'm just reporting it. Sorry, Michal

On Tue, Jul 28, 2020 at 07:03:56PM +0200, Michal Privoznik wrote:
On 7/16/20 11:54 AM, Pavel Hrdina wrote:
APPARMOR_MOUNT is not used so dropping it in meson.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-apparmor.m4 | 41 ----------------------------------------- meson.build | 8 ++++++++ meson_options.txt | 4 ++++ 4 files changed, 12 insertions(+), 44 deletions(-) delete mode 100644 m4/virt-apparmor.m4
diff --git a/configure.ac b/configure.ac index 53c87b4e293..5bf4727faa7 100644 --- a/configure.ac +++ b/configure.ac @@ -114,7 +114,6 @@ fi # Check for compiler and library settings. -LIBVIRT_ARG_APPARMOR LIBVIRT_ARG_ATTR LIBVIRT_ARG_AUDIT LIBVIRT_ARG_BASH_COMPLETION @@ -150,7 +149,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_APPARMOR LIBVIRT_CHECK_ATTR LIBVIRT_CHECK_AUDIT LIBVIRT_CHECK_BASH_COMPLETION @@ -479,7 +477,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_APPARMOR LIBVIRT_RESULT_ATTR LIBVIRT_RESULT_AUDIT LIBVIRT_RESULT_BASH_COMPLETION diff --git a/m4/virt-apparmor.m4 b/m4/virt-apparmor.m4 deleted file mode 100644 index ebddfce2015..00000000000 --- a/m4/virt-apparmor.m4 +++ /dev/null @@ -1,41 +0,0 @@ -dnl The libapparmor.so library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_APPARMOR],[ - LIBVIRT_ARG_WITH_FEATURE([APPARMOR], [AppArmor], [check]) - LIBVIRT_ARG_WITH([APPARMOR_MOUNT], [set AppArmor mount point], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_APPARMOR],[ - LIBVIRT_CHECK_LIB([APPARMOR], [apparmor], - [aa_change_profile], [sys/apparmor.h]) - - if test "$with_apparmor" = "yes"; then - AC_DEFINE_UNQUOTED([APPARMOR_DIR], - "/etc/apparmor.d", - [path to apparmor directory]) - AC_DEFINE_UNQUOTED([APPARMOR_PROFILES_PATH], - "/sys/kernel/security/apparmor/profiles", - [path to kernel profiles]) - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_APPARMOR],[ - LIBVIRT_RESULT_LIB([APPARMOR]) -]) diff --git a/meson.build b/meson.build index d8ff8e0d658..be0bc975116 100644 --- a/meson.build +++ b/meson.build @@ -951,6 +951,13 @@ else acl_dep = dependency('', required: false) endif +apparmor_dep = cc.find_library('AppArmor', required: get_option('apparmor'))
IIUC this tries to find -lAppArmor, but the library is called /usr/lib64/libapparmor.so.1.6.2. And also, it provides pkgconfig file: /usr/lib64/pkgconfig/libapparmor.pc
I don't know how to fix it, so I'm just reporting it.
Thanks for the report, the -lAppArmor was my mistake, not using pkgconfig is pre-existing with autotools but in this case I can convert it directly to pkgconfig in meson. The libapparmor.pc file exits on all supported distributions so we should be safe. No worries :) I'll fix it. Pavel

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-attr.m4 | 13 ------------- meson.build | 3 +++ meson_options.txt | 1 + 4 files changed, 4 insertions(+), 16 deletions(-) delete mode 100644 m4/virt-attr.m4 diff --git a/configure.ac b/configure.ac index 5bf4727faa7..6d5fcb4281d 100644 --- a/configure.ac +++ b/configure.ac @@ -114,7 +114,6 @@ fi # Check for compiler and library settings. -LIBVIRT_ARG_ATTR LIBVIRT_ARG_AUDIT LIBVIRT_ARG_BASH_COMPLETION LIBVIRT_ARG_BLKID @@ -149,7 +148,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_ATTR LIBVIRT_CHECK_AUDIT LIBVIRT_CHECK_BASH_COMPLETION LIBVIRT_CHECK_BLKID @@ -477,7 +475,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_ATTR LIBVIRT_RESULT_AUDIT LIBVIRT_RESULT_BASH_COMPLETION LIBVIRT_RESULT_BLKID diff --git a/m4/virt-attr.m4 b/m4/virt-attr.m4 deleted file mode 100644 index 478549c17f1..00000000000 --- a/m4/virt-attr.m4 +++ /dev/null @@ -1,13 +0,0 @@ -dnl The libattr.so library - -AC_DEFUN([LIBVIRT_ARG_ATTR],[ - LIBVIRT_ARG_WITH_FEATURE([ATTR], [attr], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_ATTR],[ - LIBVIRT_CHECK_LIB([ATTR], [attr], [getxattr], [sys/xattr.h]) -]) - -AC_DEFUN([LIBVIRT_RESULT_ATTR],[ - LIBVIRT_RESULT_LIB([ATTR]) -]) diff --git a/meson.build b/meson.build index be0bc975116..3d7bd8c4149 100644 --- a/meson.build +++ b/meson.build @@ -958,6 +958,8 @@ if apparmor_dep.found() conf.set_quoted('APPARMOR_PROFILES_PATH', '/sys/kernel/security/apparmor/profiles') endif +attr_dep = cc.find_library('attr', required: get_option('attr')) + # define top include directory @@ -980,6 +982,7 @@ configure_file(output: 'meson-config.h', configuration: conf) libs_summary = { 'acl': acl_dep.found(), 'apparmor': apparmor_dep.found(), + 'attr': attr_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index dc60d569dd2..be7ad8b96f9 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -10,3 +10,4 @@ option('test_coverage', type: 'boolean', value: false, description: 'turn on cod # build dependencies options option('apparmor', type: 'feature', value: 'auto', description: 'apparmor support') +option('attr', type: 'feature', value: 'auto', description: 'attr support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-audit.m4 | 31 ------------------------------- meson.build | 6 ++++++ meson_options.txt | 1 + 4 files changed, 7 insertions(+), 34 deletions(-) delete mode 100644 m4/virt-audit.m4 diff --git a/configure.ac b/configure.ac index 6d5fcb4281d..2c9f38f9ba6 100644 --- a/configure.ac +++ b/configure.ac @@ -114,7 +114,6 @@ fi # Check for compiler and library settings. -LIBVIRT_ARG_AUDIT LIBVIRT_ARG_BASH_COMPLETION LIBVIRT_ARG_BLKID LIBVIRT_ARG_CAPNG @@ -148,7 +147,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_AUDIT LIBVIRT_CHECK_BASH_COMPLETION LIBVIRT_CHECK_BLKID LIBVIRT_CHECK_CAPNG @@ -475,7 +473,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_AUDIT LIBVIRT_RESULT_BASH_COMPLETION LIBVIRT_RESULT_BLKID LIBVIRT_RESULT_CAPNG diff --git a/m4/virt-audit.m4 b/m4/virt-audit.m4 deleted file mode 100644 index f2e855e88f0..00000000000 --- a/m4/virt-audit.m4 +++ /dev/null @@ -1,31 +0,0 @@ -dnl The libaudit.so library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_AUDIT],[ - LIBVIRT_ARG_WITH_FEATURE([AUDIT], [audit], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_AUDIT],[ - LIBVIRT_CHECK_LIB([AUDIT], [audit], - [audit_encode_nv_string], [libaudit.h]) -]) - -AC_DEFUN([LIBVIRT_RESULT_AUDIT],[ - LIBVIRT_RESULT_LIB([AUDIT]) -]) diff --git a/meson.build b/meson.build index 3d7bd8c4149..7aacfc2011c 100644 --- a/meson.build +++ b/meson.build @@ -960,6 +960,11 @@ endif attr_dep = cc.find_library('attr', required: get_option('attr')) +audit_dep = cc.find_library('audit', required: get_option('audit')) +if audit_dep.found() + conf.set('WITH_AUDIT', 1) +endif + # define top include directory @@ -983,6 +988,7 @@ libs_summary = { 'acl': acl_dep.found(), 'apparmor': apparmor_dep.found(), 'attr': attr_dep.found(), + 'audit': audit_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index be7ad8b96f9..16822374180 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -11,3 +11,4 @@ option('test_coverage', type: 'boolean', value: false, description: 'turn on cod # build dependencies options option('apparmor', type: 'feature', value: 'auto', description: 'apparmor support') option('attr', type: 'feature', value: 'auto', description: 'attr support') +option('audit', type: 'feature', value: 'auto', description: 'audit support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 -- m4/virt-readline.m4 | 86 --------------------------------------------- meson.build | 64 +++++++++++++++++++++++++++++++++ meson_options.txt | 1 + 4 files changed, 65 insertions(+), 89 deletions(-) delete mode 100644 m4/virt-readline.m4 diff --git a/configure.ac b/configure.ac index 2c9f38f9ba6..b822e862535 100644 --- a/configure.ac +++ b/configure.ac @@ -137,7 +137,6 @@ LIBVIRT_ARG_OPENWSMAN LIBVIRT_ARG_PCIACCESS LIBVIRT_ARG_PM_UTILS LIBVIRT_ARG_POLKIT -LIBVIRT_ARG_READLINE LIBVIRT_ARG_SANLOCK LIBVIRT_ARG_SASL LIBVIRT_ARG_SELINUX @@ -177,7 +176,6 @@ LIBVIRT_CHECK_PCIACCESS LIBVIRT_CHECK_PM_UTILS LIBVIRT_CHECK_POLKIT LIBVIRT_CHECK_PTHREAD -LIBVIRT_CHECK_READLINE LIBVIRT_CHECK_SANLOCK LIBVIRT_CHECK_SASL LIBVIRT_CHECK_SELINUX @@ -502,7 +500,6 @@ LIBVIRT_RESULT_PCIACCESS LIBVIRT_RESULT_PM_UTILS LIBVIRT_RESULT_POLKIT LIBVIRT_RESULT_RBD -LIBVIRT_RESULT_READLINE LIBVIRT_RESULT_SANLOCK LIBVIRT_RESULT_SASL LIBVIRT_RESULT_SELINUX diff --git a/m4/virt-readline.m4 b/m4/virt-readline.m4 deleted file mode 100644 index cd12110c4e2..00000000000 --- a/m4/virt-readline.m4 +++ /dev/null @@ -1,86 +0,0 @@ -dnl The readline library -dnl -dnl Copyright (C) 2005-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_READLINE],[ - LIBVIRT_ARG_WITH_FEATURE([READLINE], [readline], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_READLINE],[ - - # We have to check for readline.pc's presence beforehand because for - # the longest time the library didn't ship a .pc file at all - PKG_CHECK_EXISTS([readline], [use_pkgconfig=1], [use_pkgconfig=0]) - - if test $use_pkgconfig = 1; then - # readline 7.0 is the first version which includes pkg-config support - LIBVIRT_CHECK_PKG([READLINE], [readline], [7.0]) - else - # This function is present in all reasonable (5.0+) readline versions; - # however, the macOS base system contains a library called libedit which - # takes over the readline name despite lacking many of its features. We - # want to make sure we only enable readline support when linking against - # the actual readline library, and the availability of this specific - # functions is as good a witness for that fact as any. - AC_CHECK_DECLS([rl_completion_quote_character], - [], [], - [[#include <stdio.h> - #include <readline/readline.h>]]) - - if test "$ac_cv_have_decl_rl_completion_quote_character" = "no" ; then - if test "$with_readline" = "yes" ; then - AC_MSG_ERROR([readline is missing rl_completion_quote_character]) - else - with_readline=no; - fi - fi - - # The normal library check... - LIBVIRT_CHECK_LIB([READLINE], [readline], [readline], [readline/readline.h]) - fi - - # We need this to avoid compilation issues with modern compilers. - # See 9ea3424a178 for a more detailed explanation - if test "$with_readline" = "yes" ; then - case "$READLINE_CFLAGS" in - *-D_FUNCTION_DEF*) ;; - *) READLINE_CFLAGS="-D_FUNCTION_DEF $READLINE_CFLAGS" ;; - esac - fi - - # Gross kludge for readline include path obtained through pkg-config. - # - # As of 8.0, upstream readline.pc has -I${includedir}/readline among - # its Cflags, which is clearly wrong. This does not affect Linux - # because ${includedir} is already part of the default include path, - # but on other platforms that's not the case and the result is that - # <readline/readline.h> can't be located, causing the build to fail. - # A patch solving this issue has already been posted upstream, so once - # the fix has landed in FreeBSD ports and macOS homebrew we can safely - # drop the kludge and rely on pkg-config alone on those platforms. - # - # [1] http://lists.gnu.org/archive/html/bug-readline/2019-04/msg00007.html - case "$READLINE_CFLAGS" in - *include/readline*) READLINE_CFLAGS=$(echo $READLINE_CFLAGS | sed s,include/readline,include,g) ;; - *) ;; - esac -]) - -AC_DEFUN([LIBVIRT_RESULT_READLINE],[ - LIBVIRT_RESULT_LIB([READLINE]) -]) diff --git a/meson.build b/meson.build index 7aacfc2011c..c30b14c1643 100644 --- a/meson.build +++ b/meson.build @@ -965,6 +965,69 @@ if audit_dep.found() conf.set('WITH_AUDIT', 1) endif +# readline 7.0 is the first version which includes pkg-config support +readline_version = '7.0' +readline_dep = dependency('readline', version: '>=' + readline_version, required: false) +if not readline_dep.found() + readline_dep = cc.find_library('readline', required: get_option('readline')) + + if readline_dep.found() + # This function is present in all reasonable (5.0+) readline versions; + # however, the macOS base system contains a library called libedit which + # takes over the readline name despite lacking many of its features. We + # want to make sure we only enable readline support when linking against + # the actual readline library, and the availability of this specific + # functions is as good a witness for that fact as any. + correct_rl = cc.has_function('rl_completion_quote_character', prefix: '#include <readline/readline.h>') + if not correct_rl and get_option('readline').enabled() + error('readline is missing rl_completion_quote_character') + else + readline_dep = dependency('', required: false) + endif + endif +endif +if readline_dep.found() + # Gross kludge for readline include path obtained through pkg-config. + # + # As of 8.0, upstream readline.pc has -I${includedir}/readline among + # its Cflags, which is clearly wrong. This does not affect Linux + # because ${includedir} is already part of the default include path, + # but on other platforms that's not the case and the result is that + # <readline/readline.h> can't be located, causing the build to fail. + # A patch solving this issue has already been posted upstream, so once + # the fix has landed in FreeBSD ports and macOS homebrew we can safely + # drop the kludge and rely on pkg-config alone on those platforms. + # + # [1] http://lists.gnu.org/archive/html/bug-readline/2019-04/msg00007.html + if readline_dep.type_name() == 'pkgconfig' and host_machine.system() != 'linux' + pkg_config_prog = find_program('pkg-config') + rc = run_command(pkg_config_prog, '--cflags', 'readline', check: true) + cflags = rc.stdout().strip() + if cflags.contains('include/readline') + rc = run_command( + 'python3', '-c', + 'print("@0@".replace("@1@", "@2@"))'.format( + cflags, 'include/readline', 'include', + ), + check: true, + ) + readline_dep = declare_dependency( + compile_args: rc.stdout().strip().split(), + dependencies: [ readline_dep ], + ) + endif + endif + + # We need this to avoid compilation issues with modern compilers. + # See 9ea3424a178 for a more detailed explanation + readline_dep = declare_dependency( + compile_args: [ '-D_FUNCTION_DEF' ], + dependencies: [ readline_dep ], + ) + + conf.set('WITH_READLINE', 1) +endif + # define top include directory @@ -989,6 +1052,7 @@ libs_summary = { 'apparmor': apparmor_dep.found(), 'attr': attr_dep.found(), 'audit': audit_dep.found(), + 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 16822374180..aafc694533a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -12,3 +12,4 @@ option('test_coverage', type: 'boolean', value: false, description: 'turn on cod option('apparmor', type: 'feature', value: 'auto', description: 'apparmor support') option('attr', type: 'feature', value: 'auto', description: 'attr support') option('audit', type: 'feature', value: 'auto', description: 'audit support') +option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

On Thu, 2020-07-16 at 11:54 +0200, Pavel Hrdina wrote:
+++ b/meson_options.txt @@ -12,3 +12,4 @@ option('test_coverage', type: 'boolean', value: false, description: 'turn on cod option('apparmor', type: 'feature', value: 'auto', description: 'apparmor support') option('attr', type: 'feature', value: 'auto', description: 'attr support') option('audit', type: 'feature', value: 'auto', description: 'audit support') +option('readline', type: 'feature', value: 'auto', description: 'readline support')
Erik reports that there are issues with building RPMs on CentOS. He opened https://gitlab.com/libvirt/libvirt-ci/-/merge_requests/42, but it seems to me that the topic should be discussed here instead, so I'm quoting his message and replying inline.
After libvirt switched to the meson build system, rpmbuild on CentOS is no longer viable as meson >= 0.54.0 is required while only 0.49.2 (at the time of this patch) is available from the package manager. Even if --nodeps is passed, the "%meson" RPM macro won't expand and the build will fail.
The question is, was dropping RPM build support for CentOS an intentional change? I'm not sure it was, because otherwise the spec file could have been cleaned up a bit at the same time. If it was not, then we need to make use of the `%meson` macro conditional. As an aside, I haven't actually checked, but I think that even though CentOS 8 ships a version of Meson that's too old for us it should at least have the `%meson` macro. Maybe that won't work with a Meson installed from PyPi, though...
It doesn't end there though, even if meson 0.54.0 were available, the rpm build would still fail because of readline-devel not providing the pkg config file on CentOS-8 which we rely on.
Looking at the lastest pipeline, all CentOS versions have "readline: NO" in their build summary, but the build still succeeded, so I'm not sure why the RPM build would fail? readline is an optional dependency, and we're not passing `-Dreadline=enabled`. Additionally, the complex logic necessary to detect readline correctly, even in the absence of its pkg-config file, is still present in `meson.build`, so I'm not sure why it's not doing what it's supposed to do... -- Andrea Bolognani / Red Hat / Virtualization

On Wed, Aug 05, 2020 at 10:59:08AM +0200, Andrea Bolognani wrote:
On Thu, 2020-07-16 at 11:54 +0200, Pavel Hrdina wrote:
+++ b/meson_options.txt @@ -12,3 +12,4 @@ option('test_coverage', type: 'boolean', value: false, description: 'turn on cod option('apparmor', type: 'feature', value: 'auto', description: 'apparmor support') option('attr', type: 'feature', value: 'auto', description: 'attr support') option('audit', type: 'feature', value: 'auto', description: 'audit support') +option('readline', type: 'feature', value: 'auto', description: 'readline support')
Erik reports that there are issues with building RPMs on CentOS. He opened https://gitlab.com/libvirt/libvirt-ci/-/merge_requests/42, but it seems to me that the topic should be discussed here instead, so I'm quoting his message and replying inline.
After libvirt switched to the meson build system, rpmbuild on CentOS is no longer viable as meson >= 0.54.0 is required while only 0.49.2 (at the time of this patch) is available from the package manager. Even if --nodeps is passed, the "%meson" RPM macro won't expand and the build will fail.
The question is, was dropping RPM build support for CentOS an intentional change? I'm not sure it was, because otherwise the spec file could have been cleaned up a bit at the same time. If it was not, then we need to make use of the `%meson` macro conditional.
As an aside, I haven't actually checked, but I think that even though CentOS 8 ships a version of Meson that's too old for us it should at least have the `%meson` macro. Maybe that won't work with a Meson installed from PyPi, though...
One thing I haven't tried is to install the old meson and use --nodeps with rpmbuild, still, rather than having 2 version of meson installed on CentOS for the rpmbuild, we should fallback to something else if %meson isn't defined.
It doesn't end there though, even if meson 0.54.0 were available, the rpm build would still fail because of readline-devel not providing the pkg config file on CentOS-8 which we rely on.
Looking at the lastest pipeline, all CentOS versions have "readline: NO" in their build summary, but the build still succeeded, so I'm not sure why the RPM build would fail? readline is an optional dependency, and we're not passing `-Dreadline=enabled`.
Additionally, the complex logic necessary to detect readline correctly, even in the absence of its pkg-config file, is still present in `meson.build`, so I'm not sure why it's not doing what it's supposed to do...
Well, I just reported what happened to me yesterday when I was doing some mdev review on CentOS 8 and wanted to do an RPM install of the latest libvirt, meson couldn't be re-built from the latest spec on CentOS 8, but taking the binary package directly from Fedora 32 worked like a charm and then I hit the readline issue for some reason, it's true I've had a bunch of packages (including readline) installed manually in order to overcome the meson issues. I'll re-try in a completely clean environment to see whether the missing readline pkg config was only related to my environment or it actually fails the build. Erik

On Wed, 2020-08-05 at 11:23 +0200, Erik Skultety wrote:
On Wed, Aug 05, 2020 at 10:59:08AM +0200, Andrea Bolognani wrote:
Erik reports that there are issues with building RPMs on CentOS. He opened https://gitlab.com/libvirt/libvirt-ci/-/merge_requests/42, but it seems to me that the topic should be discussed here instead, so I'm quoting his message and replying inline.
After libvirt switched to the meson build system, rpmbuild on CentOS is no longer viable as meson >= 0.54.0 is required while only 0.49.2 (at the time of this patch) is available from the package manager. Even if --nodeps is passed, the "%meson" RPM macro won't expand and the build will fail.
The question is, was dropping RPM build support for CentOS an intentional change? I'm not sure it was, because otherwise the spec file could have been cleaned up a bit at the same time. If it was not, then we need to make use of the `%meson` macro conditional.
As an aside, I haven't actually checked, but I think that even though CentOS 8 ships a version of Meson that's too old for us it should at least have the `%meson` macro. Maybe that won't work with a Meson installed from PyPi, though...
One thing I haven't tried is to install the old meson and use --nodeps with rpmbuild, still, rather than having 2 version of meson installed on CentOS for the rpmbuild, we should fallback to something else if %meson isn't defined.
Oh, I see now the %meson macro is shipped as part of meson itself. We definitely don't want to install two versions of meson, and if we end up agreeing that keeping RPM builds working on CentOS is important we will have to work around the need for the macro on CentOS 7 anyway, so we should be able to use that same workaround on CentOS 8 too.
It doesn't end there though, even if meson 0.54.0 were available, the rpm build would still fail because of readline-devel not providing the pkg config file on CentOS-8 which we rely on.
Looking at the lastest pipeline, all CentOS versions have "readline: NO" in their build summary, but the build still succeeded, so I'm not sure why the RPM build would fail? readline is an optional dependency, and we're not passing `-Dreadline=enabled`.
Additionally, the complex logic necessary to detect readline correctly, even in the absence of its pkg-config file, is still present in `meson.build`, so I'm not sure why it's not doing what it's supposed to do...
Well, I just reported what happened to me yesterday when I was doing some mdev review on CentOS 8 and wanted to do an RPM install of the latest libvirt, meson couldn't be re-built from the latest spec on CentOS 8, but taking the binary package directly from Fedora 32 worked like a charm and then I hit the readline issue for some reason, it's true I've had a bunch of packages (including readline) installed manually in order to overcome the meson issues. I'll re-try in a completely clean environment to see whether the missing readline pkg config was only related to my environment or it actually fails the build.
I don't understand exactly what issue you ran into based on your description, but even just looking at the pipeline shows that something is not quite right, since readline was detected correctly on CentOS before the switch and now it isn't. I'm hoping Pavel can shed some light there :) -- Andrea Bolognani / Red Hat / Virtualization

On Wed, Aug 05, 2020 at 11:52:30AM +0200, Andrea Bolognani wrote:
On Wed, 2020-08-05 at 11:23 +0200, Erik Skultety wrote:
On Wed, Aug 05, 2020 at 10:59:08AM +0200, Andrea Bolognani wrote:
Erik reports that there are issues with building RPMs on CentOS. He opened https://gitlab.com/libvirt/libvirt-ci/-/merge_requests/42, but it seems to me that the topic should be discussed here instead, so I'm quoting his message and replying inline.
After libvirt switched to the meson build system, rpmbuild on CentOS is no longer viable as meson >= 0.54.0 is required while only 0.49.2 (at the time of this patch) is available from the package manager. Even if --nodeps is passed, the "%meson" RPM macro won't expand and the build will fail.
The question is, was dropping RPM build support for CentOS an intentional change? I'm not sure it was, because otherwise the spec file could have been cleaned up a bit at the same time. If it was not, then we need to make use of the `%meson` macro conditional.
As an aside, I haven't actually checked, but I think that even though CentOS 8 ships a version of Meson that's too old for us it should at least have the `%meson` macro. Maybe that won't work with a Meson installed from PyPi, though...
One thing I haven't tried is to install the old meson and use --nodeps with rpmbuild, still, rather than having 2 version of meson installed on CentOS for the rpmbuild, we should fallback to something else if %meson isn't defined.
Oh, I see now the %meson macro is shipped as part of meson itself. We definitely don't want to install two versions of meson, and if we end up agreeing that keeping RPM builds working on CentOS is important we will have to work around the need for the macro on CentOS 7 anyway, so we should be able to use that same workaround on CentOS 8 too.
We need to figure it out somehow but I'm not sure that we want to copy the content of /usr/lib/rpm/macros.d/macros.meson file into our spec file. Downstream maintainers will probably have to bundle meson 0.54.0 together with libvirt in the packages, that was my original motivation not to introduce the BuildRequires in our spec file. It was pointed out during review that I should add it there, which actually makes sense as we depend on the macro. For our testing purposes we can install the system wide meson and newer version from PyPi if required and remove the version requirement from the spec file. That way downstream maintainers will get the system wide meson with meson macros for RPM and if required they will use the bundled meson to do the compilation. Everything should work and we will not make our spec file even more complex.
It doesn't end there though, even if meson 0.54.0 were available, the rpm build would still fail because of readline-devel not providing the pkg config file on CentOS-8 which we rely on.
Looking at the lastest pipeline, all CentOS versions have "readline: NO" in their build summary, but the build still succeeded, so I'm not sure why the RPM build would fail? readline is an optional dependency, and we're not passing `-Dreadline=enabled`.
Additionally, the complex logic necessary to detect readline correctly, even in the absence of its pkg-config file, is still present in `meson.build`, so I'm not sure why it's not doing what it's supposed to do...
Well, I just reported what happened to me yesterday when I was doing some mdev review on CentOS 8 and wanted to do an RPM install of the latest libvirt, meson couldn't be re-built from the latest spec on CentOS 8, but taking the binary package directly from Fedora 32 worked like a charm and then I hit the readline issue for some reason, it's true I've had a bunch of packages (including readline) installed manually in order to overcome the meson issues. I'll re-try in a completely clean environment to see whether the missing readline pkg config was only related to my environment or it actually fails the build.
I don't understand exactly what issue you ran into based on your description, but even just looking at the pipeline shows that something is not quite right, since readline was detected correctly on CentOS before the switch and now it isn't. I'm hoping Pavel can shed some light there :)
Sigh, so the autotools virt-readline.m4 file had a comment that rl_completion_quote_character function is available in all reasonable versions. Well, it's not a function so meson obviously fails to detect it with cc.has_function(), in addition the readline/readline.h header requires that the user includes stdio.h before it, again sigh. My mistake expecting that software requiring some header file will include it as well, I guess at some point it was not cool to do the nice thing for users. I'll post a patch shortly to fix the readline detection. Pavel

On Wed, 2020-08-05 at 12:24 +0200, Pavel Hrdina wrote:
On Wed, Aug 05, 2020 at 11:52:30AM +0200, Andrea Bolognani wrote:
Oh, I see now the %meson macro is shipped as part of meson itself. We definitely don't want to install two versions of meson, and if we end up agreeing that keeping RPM builds working on CentOS is important we will have to work around the need for the macro on CentOS 7 anyway, so we should be able to use that same workaround on CentOS 8 too.
We need to figure it out somehow but I'm not sure that we want to copy the content of /usr/lib/rpm/macros.d/macros.meson file into our spec file.
Downstream maintainers will probably have to bundle meson 0.54.0 together with libvirt in the packages, that was my original motivation not to introduce the BuildRequires in our spec file. It was pointed out during review that I should add it there, which actually makes sense as we depend on the macro.
For our testing purposes we can install the system wide meson and newer version from PyPi if required and remove the version requirement from the spec file.
That way downstream maintainers will get the system wide meson with meson macros for RPM and if required they will use the bundled meson to do the compilation.
Everything should work and we will not make our spec file even more complex.
So you're suggesting that on CentOS we install Meson both from RPM and from PyPi, the former being used only for the RPM macros? I don't think that's a good approach; in addition, that's not something that we can accomodate in our CI pipeline without gross hacks. Including the RPM macros directly in our spec file, conditionally and only for CentOS of course, doesn't seem too bad: that's just 45 lines of code, which is basically a drop in the ocean considering that our spec file is almost 2000 lines long. We could make the BuildRequires conditional in the same way.
I don't understand exactly what issue you ran into based on your description, but even just looking at the pipeline shows that something is not quite right, since readline was detected correctly on CentOS before the switch and now it isn't. I'm hoping Pavel can shed some light there :)
Sigh, so the autotools virt-readline.m4 file had a comment that rl_completion_quote_character function is available in all reasonable versions.
Well, it's not a function so meson obviously fails to detect it with cc.has_function()
Claiminig that it's a function might have been my mistake, sorry for that O:-)
I'll post a patch shortly to fix the readline detection.
Thanks! -- Andrea Bolognani / Red Hat / Virtualization

On Wed, Aug 05, 2020 at 12:52:15PM +0200, Andrea Bolognani wrote:
On Wed, 2020-08-05 at 12:24 +0200, Pavel Hrdina wrote:
On Wed, Aug 05, 2020 at 11:52:30AM +0200, Andrea Bolognani wrote:
Oh, I see now the %meson macro is shipped as part of meson itself. We definitely don't want to install two versions of meson, and if we end up agreeing that keeping RPM builds working on CentOS is important we will have to work around the need for the macro on CentOS 7 anyway, so we should be able to use that same workaround on CentOS 8 too.
We need to figure it out somehow but I'm not sure that we want to copy the content of /usr/lib/rpm/macros.d/macros.meson file into our spec file.
Downstream maintainers will probably have to bundle meson 0.54.0 together with libvirt in the packages, that was my original motivation not to introduce the BuildRequires in our spec file. It was pointed out during review that I should add it there, which actually makes sense as we depend on the macro.
For our testing purposes we can install the system wide meson and newer version from PyPi if required and remove the version requirement from the spec file.
That way downstream maintainers will get the system wide meson with meson macros for RPM and if required they will use the bundled meson to do the compilation.
Everything should work and we will not make our spec file even more complex.
So you're suggesting that on CentOS we install Meson both from RPM and from PyPi, the former being used only for the RPM macros? I don't think that's a good approach; in addition, that's not something that we can accomodate in our CI pipeline without gross hacks.
Including the RPM macros directly in our spec file, conditionally and only for CentOS of course, doesn't seem too bad: that's just 45 lines of code, which is basically a drop in the ocean considering that our spec file is almost 2000 lines long.
We could make the BuildRequires conditional in the same way.
Gross hack in our CI vs gross hack in spec file. I vote for CI to have the hack. In addition the macros are provided by meson and there are changes in the macro file, for example the latest macro file uses `meson compile` instead of `ninja build` which was introduced in 0.54.0 so we would have to have some older copy of the macros. We could probably come up with some replacement for the macro that would work on all OSes that lack the correct meson version but I don't think it's better then having it solved in our CI. And the fact that our spec file is already large is not a solid argument to add some ugly workaround there. If anything we should clean it up. Pavel

On Wed, 2020-08-05 at 13:27 +0200, Pavel Hrdina wrote:
Gross hack in our CI vs gross hack in spec file. I vote for CI to have the hack.
In addition the macros are provided by meson and there are changes in the macro file, for example the latest macro file uses `meson compile` instead of `ninja build` which was introduced in 0.54.0 so we would have to have some older copy of the macros.
Not really, since the version of Meson that we use for building would still be the one installed from PyPi, eg. 0.54.0 or newer. What about the other way around? Would the old macros work fine with the newer Meson?
We could probably come up with some replacement for the macro that would work on all OSes that lack the correct meson version but I don't think it's better then having it solved in our CI.
Note that this doesn't only affect our CI but also anyone who wants to build the RPM on CentOS. Telling those users "install Meson from PyPi" sounds more reasonable than "install Meson from PyPi and also from RPM".
And the fact that our spec file is already large is not a solid argument to add some ugly workaround there. If anything we should clean it up.
Fair enough :) -- Andrea Bolognani / Red Hat / Virtualization

On Wed, Aug 05, 2020 at 01:47:21PM +0200, Andrea Bolognani wrote:
On Wed, 2020-08-05 at 13:27 +0200, Pavel Hrdina wrote:
Gross hack in our CI vs gross hack in spec file. I vote for CI to have the hack.
In addition the macros are provided by meson and there are changes in the macro file, for example the latest macro file uses `meson compile` instead of `ninja build` which was introduced in 0.54.0 so we would have to have some older copy of the macros.
Not really, since the version of Meson that we use for building would still be the one installed from PyPi, eg. 0.54.0 or newer. What about the other way around? Would the old macros work fine with the newer Meson?
An alternative idea, meson 0.54.0 depends on Python 3.8 ABI. Python 3.8 is available on CentOS-8, so maybe we could try asking for a meson 0.54 build on CentOS 8 as well. CentOS 7 would be great too, but I'm willing to accept a compromise here that we will only do an RPM build on the latest CentOS. I mean, compiling the code on CentOS 7 is one thing, but building an RPM brings its own issues/dependencies (a similar problem can be observed with libvirt-tck where CentOS 7 simply turned out to be an unsuitable platform), from upstream POV we mainly care about the latest releases of our dependencies for any *reasonable* development anyway, so shifting the focus slightly to the latest CentOS in terms of doing an RPM build doesn't seem like such an issue to me - all of ^this assuming we could get a newer meson build. Erik

On Wed, Aug 05, 2020 at 02:00:14PM +0200, Erik Skultety wrote:
On Wed, Aug 05, 2020 at 01:47:21PM +0200, Andrea Bolognani wrote:
On Wed, 2020-08-05 at 13:27 +0200, Pavel Hrdina wrote:
Gross hack in our CI vs gross hack in spec file. I vote for CI to have the hack.
In addition the macros are provided by meson and there are changes in the macro file, for example the latest macro file uses `meson compile` instead of `ninja build` which was introduced in 0.54.0 so we would have to have some older copy of the macros.
Not really, since the version of Meson that we use for building would still be the one installed from PyPi, eg. 0.54.0 or newer. What about the other way around? Would the old macros work fine with the newer Meson?
An alternative idea, meson 0.54.0 depends on Python 3.8 ABI. Python 3.8 is available on CentOS-8, so maybe we could try asking for a meson 0.54 build on CentOS 8 as well.
I don't think that's true. The setup.py file in upstream meson requires python 3.5.2 and the README.md file mentions python 3.5. Are you sure about that? Pavel

On Wed, Aug 05, 2020 at 02:37:09PM +0200, Pavel Hrdina wrote:
On Wed, Aug 05, 2020 at 02:00:14PM +0200, Erik Skultety wrote:
On Wed, Aug 05, 2020 at 01:47:21PM +0200, Andrea Bolognani wrote:
On Wed, 2020-08-05 at 13:27 +0200, Pavel Hrdina wrote:
Gross hack in our CI vs gross hack in spec file. I vote for CI to have the hack.
In addition the macros are provided by meson and there are changes in the macro file, for example the latest macro file uses `meson compile` instead of `ninja build` which was introduced in 0.54.0 so we would have to have some older copy of the macros.
Not really, since the version of Meson that we use for building would still be the one installed from PyPi, eg. 0.54.0 or newer. What about the other way around? Would the old macros work fine with the newer Meson?
An alternative idea, meson 0.54.0 depends on Python 3.8 ABI. Python 3.8 is available on CentOS-8, so maybe we could try asking for a meson 0.54 build on CentOS 8 as well.
I don't think that's true. The setup.py file in upstream meson requires python 3.5.2 and the README.md file mentions python 3.5. Are you sure about that?
Hmm, it's what I got from unpacking the CPIO of the rpm package, but looking at the specfile of 0.54, it requires python%{python3_version}, which resolves to 3.8 on Fedora but would resolve to 3.6 on CentOS-8, so you're right. The exact version doesn't really matter, what should matter in the email is the overall idea to actually try pushing for a more modern meson. Erik

On Wed, Aug 05, 2020 at 01:47:21PM +0200, Andrea Bolognani wrote:
On Wed, 2020-08-05 at 13:27 +0200, Pavel Hrdina wrote:
Gross hack in our CI vs gross hack in spec file. I vote for CI to have the hack.
In addition the macros are provided by meson and there are changes in the macro file, for example the latest macro file uses `meson compile` instead of `ninja build` which was introduced in 0.54.0 so we would have to have some older copy of the macros.
Not really, since the version of Meson that we use for building would still be the one installed from PyPi, eg. 0.54.0 or newer. What about the other way around? Would the old macros work fine with the newer Meson?
Good point, we would use the PyPi version anyway so using the content of macros.meson from that version would not be an issue. I guess they have the same 'do not break users' so it should work with newer meson, but it will not be used anyway if the new meson is available from system packages.
We could probably come up with some replacement for the macro that would work on all OSes that lack the correct meson version but I don't think it's better then having it solved in our CI.
Note that this doesn't only affect our CI but also anyone who wants to build the RPM on CentOS. Telling those users "install Meson from PyPi" sounds more reasonable than "install Meson from PyPi and also from RPM".
I know that it affects users as well, but it would not be that complicated to install both. Once we (hopefully) move remaining projects to meson and some of the projects would require newer meson we would have to introduce the ugly hack into these spec files as well (if there are any). After checking what is in the macro file the only drawback is that the build-in `%meson` macro has the path to meson defined by `%__meson` so my suggestion would not work. I wanted to suggest to use rpmbuild --nodeps --load /path/to/marcos.meson but PyPi meson doesn't ship that file :/. We probably doesn't have any other option than adding the ugly macro content into the spec file which I don't like at all. Pavel

On Wed, 2020-08-05 at 14:30 +0200, Pavel Hrdina wrote:
Once we (hopefully) move remaining projects to meson and some of the projects would require newer meson we would have to introduce the ugly hack into these spec files as well (if there are any).
After checking what is in the macro file the only drawback is that the build-in `%meson` macro has the path to meson defined by `%__meson` so my suggestion would not work.
I wanted to suggest to use rpmbuild --nodeps --load /path/to/marcos.meson but PyPi meson doesn't ship that file :/.
We probably doesn't have any other option than adding the ugly macro content into the spec file which I don't like at all.
It makes sense that the path would point to /usr/bin because the macros are intended to be used with the RPMs, not random versions of Meson installed from PyPi. Maybe the most sensible thing to do is just admit that we can't reasonably build RPMs for libvirt on platforms where Meson itself is not available as an RPM package. Users can still take the Fedora package and rebuild it on CentOS if they're so inclined, and we should be able to get Meson 0.54.0 included in a future CentOS 8 update to minimize the impact of this problem further, so ultimately we're only losing CentOS 7 coverage for the RPM build in the long-ish run. Note that we're currently not building RPMs as part of the CI pipeline at all :) -- Andrea Bolognani / Red Hat / Virtualization

On Wed, Aug 05, 2020 at 03:14:52PM +0200, Andrea Bolognani wrote:
On Wed, 2020-08-05 at 14:30 +0200, Pavel Hrdina wrote:
Once we (hopefully) move remaining projects to meson and some of the projects would require newer meson we would have to introduce the ugly hack into these spec files as well (if there are any).
After checking what is in the macro file the only drawback is that the build-in `%meson` macro has the path to meson defined by `%__meson` so my suggestion would not work.
I wanted to suggest to use rpmbuild --nodeps --load /path/to/marcos.meson but PyPi meson doesn't ship that file :/.
We probably doesn't have any other option than adding the ugly macro content into the spec file which I don't like at all.
It makes sense that the path would point to /usr/bin because the macros are intended to be used with the RPMs, not random versions of Meson installed from PyPi.
Maybe the most sensible thing to do is just admit that we can't reasonably build RPMs for libvirt on platforms where Meson itself is not available as an RPM package.
Users can still take the Fedora package and rebuild it on CentOS if they're so inclined, and we should be able to get Meson 0.54.0
Already ahead of you....tried to rebuild it, didn't work - I hit specfile syntax issues and not being well-versed in SPEC at all, I gave up and installed it directly from Fedora, worked like a charm. I'll contact the RHEL packager and ask about getting updated meson.
included in a future CentOS 8 update to minimize the impact of this problem further, so ultimately we're only losing CentOS 7 coverage for the RPM build in the long-ish run.
Note that we're currently not building RPMs as part of the CI pipeline at all :)
Erik

On Wed, Aug 05, 2020 at 03:23:44PM +0200, Erik Skultety wrote:
On Wed, Aug 05, 2020 at 03:14:52PM +0200, Andrea Bolognani wrote:
On Wed, 2020-08-05 at 14:30 +0200, Pavel Hrdina wrote:
Once we (hopefully) move remaining projects to meson and some of the projects would require newer meson we would have to introduce the ugly hack into these spec files as well (if there are any).
After checking what is in the macro file the only drawback is that the build-in `%meson` macro has the path to meson defined by `%__meson` so my suggestion would not work.
I wanted to suggest to use rpmbuild --nodeps --load /path/to/marcos.meson but PyPi meson doesn't ship that file :/.
We probably doesn't have any other option than adding the ugly macro content into the spec file which I don't like at all.
It makes sense that the path would point to /usr/bin because the macros are intended to be used with the RPMs, not random versions of Meson installed from PyPi.
Maybe the most sensible thing to do is just admit that we can't reasonably build RPMs for libvirt on platforms where Meson itself is not available as an RPM package.
If we add the macro ourselves to spec file it will be already ugly so we don't have to use /usr/bin/meson but meson only to get whatever is in the path which would be the PyPi installed one. This way it should work everywhere where it worked with autoconf and you have correct meson version installed.
Users can still take the Fedora package and rebuild it on CentOS if they're so inclined, and we should be able to get Meson 0.54.0
Already ahead of you....tried to rebuild it, didn't work - I hit specfile syntax issues and not being well-versed in SPEC at all, I gave up and installed it directly from Fedora, worked like a charm. I'll contact the RHEL packager and ask about getting updated meson.
Exactly because of the `%__meson` macro the source RPM will not work as well if you don't have correct version of meson that ships the RPM macros file. Downstream maintainers can bundle meson directly into the source RPM and remove the meson BuildRequires and redefine `%__meson` macro to the bundled meson.
included in a future CentOS 8 update to minimize the impact of this problem further, so ultimately we're only losing CentOS 7 coverage for the RPM build in the long-ish run.
Note that we're currently not building RPMs as part of the CI pipeline at all :)
I don't mind fixing it if we come up with something reasonable but I also don't mind leaving it as it is. If we get a lot of complains from users we can push for a fix. Pavel

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 -- m4/virt-bash-completion.m4 | 70 -------------------------------------- meson.build | 30 ++++++++++++++++ meson_options.txt | 2 ++ 4 files changed, 32 insertions(+), 73 deletions(-) delete mode 100644 m4/virt-bash-completion.m4 diff --git a/configure.ac b/configure.ac index b822e862535..a8f838c0ccf 100644 --- a/configure.ac +++ b/configure.ac @@ -114,7 +114,6 @@ fi # Check for compiler and library settings. -LIBVIRT_ARG_BASH_COMPLETION LIBVIRT_ARG_BLKID LIBVIRT_ARG_CAPNG LIBVIRT_ARG_CURL @@ -146,7 +145,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_BASH_COMPLETION LIBVIRT_CHECK_BLKID LIBVIRT_CHECK_CAPNG LIBVIRT_CHECK_CURL @@ -471,7 +469,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_BASH_COMPLETION LIBVIRT_RESULT_BLKID LIBVIRT_RESULT_CAPNG LIBVIRT_RESULT_CURL diff --git a/m4/virt-bash-completion.m4 b/m4/virt-bash-completion.m4 deleted file mode 100644 index c8342176f8b..00000000000 --- a/m4/virt-bash-completion.m4 +++ /dev/null @@ -1,70 +0,0 @@ -dnl Bash completion support -dnl -dnl Copyright (C) 2017 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 <http://www.gnu.org/licenses/>. -dnl -dnl Inspired by libguestfs code. -dnl - -AC_DEFUN([LIBVIRT_ARG_BASH_COMPLETION],[ - LIBVIRT_ARG_WITH_FEATURE([BASH_COMPLETION], [bash-completion], [check], [2.0]) - LIBVIRT_ARG_WITH([BASH_COMPLETIONS_DIR], - [directory containing bash completions scripts], - [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_BASH_COMPLETION], [ - AC_REQUIRE([LIBVIRT_CHECK_READLINE]) - - if test "x$with_readline" != "xyes" ; then - if test "x$with_bash_completion" = "xyes" ; then - AC_MSG_ERROR([readline is required for bash completion support]) - else - with_bash_completion=no - fi - fi - - LIBVIRT_CHECK_PKG([BASH_COMPLETION], [bash-completion], [2.0]) - - if test "x$with_bash_completion" = "xyes" ; then - if test "x$with_bash_completions_dir" = "xcheck"; then - AC_MSG_CHECKING([for bash-completions directory]) - BASH_COMPLETIONS_DIR="$($PKG_CONFIG --variable=completionsdir bash-completion)" - AC_MSG_RESULT([$BASH_COMPLETIONS_DIR]) - - dnl Replace bash completions's exec_prefix with our own. - dnl Note that ${exec_prefix} is kept verbatim at this point in time, - dnl and will only be expanded later, when make is called: this makes - dnl it possible to override such prefix at compilation or installation - dnl time - bash_completions_prefix="$($PKG_CONFIG --variable=prefix bash-completion)" - if test "x$bash_completions_prefix" = "x" ; then - bash_completions_prefix="/usr" - fi - - BASH_COMPLETIONS_DIR='${exec_prefix}'"${BASH_COMPLETIONS_DIR#$bash_completions_prefix}" - elif test "x$with_bash_completions_dir" = "xno" || test "x$with_bash_completions_dir" = "xyes"; then - AC_MSG_ERROR([bash-completions-dir must be used only with valid path]) - else - BASH_COMPLETIONS_DIR=$with_bash_completions_dir - fi - AC_SUBST([BASH_COMPLETIONS_DIR]) - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_BASH_COMPLETION],[ - LIBVIRT_RESULT_LIB([BASH_COMPLETION]) -]) diff --git a/meson.build b/meson.build index c30b14c1643..5cca3b7d5c2 100644 --- a/meson.build +++ b/meson.build @@ -965,6 +965,9 @@ if audit_dep.found() conf.set('WITH_AUDIT', 1) endif +bash_completion_version = '2.0' +bash_completion_dep = dependency('bash-completion', version: '>=' + bash_completion_version, required: get_option('bash_completion')) + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) @@ -1029,6 +1032,32 @@ if readline_dep.found() endif +# generic build dependencies checks + +if bash_completion_dep.found() and not readline_dep.found() + if get_option('bash_completion').enabled() + error('readline is required for bash completion support') + else + bash_completion_dep = dependency('', required: false) + endif +endif +if bash_completion_dep.found() + bash_completion_dir = get_option('bash_completion_dir') + if bash_completion_dir == '' + bash_completion_dir = bash_completion_dep.get_pkgconfig_variable('completionsdir') + bash_completion_prefix = bash_completion_dep.get_pkgconfig_variable('prefix') + rc = run_command( + 'python3', '-c', + 'print("@0@".replace("@1@", "@2@"))'.format( + bash_completion_dir, bash_completion_prefix, prefix, + ), + check: true, + ) + bash_completion_dir = rc.stdout().strip() + endif +endif + + # define top include directory top_inc_dir = include_directories('.') @@ -1052,6 +1081,7 @@ libs_summary = { 'apparmor': apparmor_dep.found(), 'attr': attr_dep.found(), 'audit': audit_dep.found(), + 'bash_completion': bash_completion_dep.found(), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index aafc694533a..5313b9bb5fb 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -12,4 +12,6 @@ option('test_coverage', type: 'boolean', value: false, description: 'turn on cod option('apparmor', type: 'feature', value: 'auto', description: 'apparmor support') option('attr', type: 'feature', value: 'auto', description: 'attr support') option('audit', type: 'feature', value: 'auto', description: 'audit support') +option('bash_completion', type: 'feature', value: 'auto', description: 'bash-completion support') +option('bash_completion_dir', type: 'string', value: '', description: 'directory containing bash completion scripts') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-blkid.m4 | 30 ------------------------------ meson.build | 7 +++++++ meson_options.txt | 1 + 4 files changed, 8 insertions(+), 33 deletions(-) delete mode 100644 m4/virt-blkid.m4 diff --git a/configure.ac b/configure.ac index a8f838c0ccf..25fb8ca8f5f 100644 --- a/configure.ac +++ b/configure.ac @@ -114,7 +114,6 @@ fi # Check for compiler and library settings. -LIBVIRT_ARG_BLKID LIBVIRT_ARG_CAPNG LIBVIRT_ARG_CURL LIBVIRT_ARG_DBUS @@ -145,7 +144,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_BLKID LIBVIRT_CHECK_CAPNG LIBVIRT_CHECK_CURL LIBVIRT_CHECK_DBUS @@ -469,7 +467,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_BLKID LIBVIRT_RESULT_CAPNG LIBVIRT_RESULT_CURL LIBVIRT_RESULT_DBUS diff --git a/m4/virt-blkid.m4 b/m4/virt-blkid.m4 deleted file mode 100644 index 609d0d58031..00000000000 --- a/m4/virt-blkid.m4 +++ /dev/null @@ -1,30 +0,0 @@ -dnl The libblkid.so library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_BLKID],[ - LIBVIRT_ARG_WITH_FEATURE([BLKID], [blkid], [check], [2.17]) -]) - -AC_DEFUN([LIBVIRT_CHECK_BLKID],[ - LIBVIRT_CHECK_PKG([BLKID], [blkid], [2.17]) -]) - -AC_DEFUN([LIBVIRT_RESULT_BLKID],[ - LIBVIRT_RESULT_LIB([BLKID]) -]) diff --git a/meson.build b/meson.build index 5cca3b7d5c2..7988a7b0a13 100644 --- a/meson.build +++ b/meson.build @@ -968,6 +968,12 @@ endif bash_completion_version = '2.0' bash_completion_dep = dependency('bash-completion', version: '>=' + bash_completion_version, required: get_option('bash_completion')) +blkid_version = '2.17' +blkid_dep = dependency('blkid', version: '>=' + blkid_version, required: get_option('blkid')) +if blkid_dep.found() + conf.set('WITH_BLKID', 1) +endif + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) @@ -1082,6 +1088,7 @@ libs_summary = { 'attr': attr_dep.found(), 'audit': audit_dep.found(), 'bash_completion': bash_completion_dep.found(), + 'blkid': blkid_dep.found(), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 5313b9bb5fb..73e64f26b0a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -14,4 +14,5 @@ option('attr', type: 'feature', value: 'auto', description: 'attr support') option('audit', type: 'feature', value: 'auto', description: 'audit support') option('bash_completion', type: 'feature', value: 'auto', description: 'bash-completion support') option('bash_completion_dir', type: 'string', value: '', description: 'directory containing bash completion scripts') +option('blkid', type: 'feature', value: 'auto', description: 'blkid support') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-capng.m4 | 30 ------------------------------ meson.build | 6 ++++++ meson_options.txt | 1 + 4 files changed, 7 insertions(+), 33 deletions(-) delete mode 100644 m4/virt-capng.m4 diff --git a/configure.ac b/configure.ac index 25fb8ca8f5f..acd326adf71 100644 --- a/configure.ac +++ b/configure.ac @@ -114,7 +114,6 @@ fi # Check for compiler and library settings. -LIBVIRT_ARG_CAPNG LIBVIRT_ARG_CURL LIBVIRT_ARG_DBUS LIBVIRT_ARG_FIREWALLD @@ -144,7 +143,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_CAPNG LIBVIRT_CHECK_CURL LIBVIRT_CHECK_DBUS LIBVIRT_CHECK_DEVMAPPER @@ -467,7 +465,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_CAPNG LIBVIRT_RESULT_CURL LIBVIRT_RESULT_DBUS LIBVIRT_RESULT_DLOPEN diff --git a/m4/virt-capng.m4 b/m4/virt-capng.m4 deleted file mode 100644 index bf9fcd2aa84..00000000000 --- a/m4/virt-capng.m4 +++ /dev/null @@ -1,30 +0,0 @@ -dnl The libcapng.so library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_CAPNG],[ - LIBVIRT_ARG_WITH_FEATURE([CAPNG], [cap-ng], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_CAPNG],[ - LIBVIRT_CHECK_LIB([CAPNG], [cap-ng], [capng_updatev], [cap-ng.h]) -]) - -AC_DEFUN([LIBVIRT_RESULT_CAPNG],[ - LIBVIRT_RESULT_LIB([CAPNG]) -]) diff --git a/meson.build b/meson.build index 7988a7b0a13..d504e7720d2 100644 --- a/meson.build +++ b/meson.build @@ -974,6 +974,11 @@ if blkid_dep.found() conf.set('WITH_BLKID', 1) endif +capng_dep = cc.find_library('cap-ng', required: get_option('capng')) +if capng_dep.found() + conf.set('WITH_CAPNG', 1) +endif + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) @@ -1089,6 +1094,7 @@ libs_summary = { 'audit': audit_dep.found(), 'bash_completion': bash_completion_dep.found(), 'blkid': blkid_dep.found(), + 'capng': capng_dep.found(), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 73e64f26b0a..f53c94c6982 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -15,4 +15,5 @@ option('audit', type: 'feature', value: 'auto', description: 'audit support') option('bash_completion', type: 'feature', value: 'auto', description: 'bash-completion support') option('bash_completion_dir', type: 'string', value: '', description: 'directory containing bash completion scripts') option('blkid', type: 'feature', value: 'auto', description: 'blkid support') +option('capng', type: 'feature', value: 'auto', description: 'cap-ng support') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-curl.m4 | 38 -------------------------------------- meson.build | 17 +++++++++++++++++ meson_options.txt | 1 + 4 files changed, 18 insertions(+), 41 deletions(-) delete mode 100644 m4/virt-curl.m4 diff --git a/configure.ac b/configure.ac index acd326adf71..f89ea566c03 100644 --- a/configure.ac +++ b/configure.ac @@ -114,7 +114,6 @@ fi # Check for compiler and library settings. -LIBVIRT_ARG_CURL LIBVIRT_ARG_DBUS LIBVIRT_ARG_FIREWALLD LIBVIRT_ARG_FIREWALLD_ZONE @@ -143,7 +142,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_CURL LIBVIRT_CHECK_DBUS LIBVIRT_CHECK_DEVMAPPER LIBVIRT_CHECK_DLOPEN @@ -465,7 +463,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_CURL LIBVIRT_RESULT_DBUS LIBVIRT_RESULT_DLOPEN LIBVIRT_RESULT_FIREWALLD diff --git a/m4/virt-curl.m4 b/m4/virt-curl.m4 deleted file mode 100644 index 84fcd69a8e0..00000000000 --- a/m4/virt-curl.m4 +++ /dev/null @@ -1,38 +0,0 @@ -dnl The libcurl.so library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_CURL],[ - LIBVIRT_ARG_WITH_FEATURE([CURL], [libcurl], [check], [7.18.0]) -]) - -AC_DEFUN([LIBVIRT_CHECK_CURL],[ - LIBVIRT_CHECK_PKG([CURL], [libcurl], [7.18.0]) - - # XXX as of libcurl-devel-7.20.1-3.fc13.x86_64, curl ships a version - # of <curl/curl.h> that #defines several wrapper macros around underlying - # functions to add type safety for gcc only. However, these macros - # spuriously trip gcc's -Wlogical-op warning. Avoid the warning by - # disabling the wrappers; even if it removes some type-check safety. - CURL_CFLAGS="-DCURL_DISABLE_TYPECHECK $CURL_CFLAGS" - AC_SUBST(CURL_CFLAGS) -]) - -AC_DEFUN([LIBVIRT_RESULT_CURL],[ - LIBVIRT_RESULT_LIB([CURL]) -]) diff --git a/meson.build b/meson.build index d504e7720d2..26378134118 100644 --- a/meson.build +++ b/meson.build @@ -979,6 +979,22 @@ if capng_dep.found() conf.set('WITH_CAPNG', 1) endif +curl_version = '7.18.0' +curl_dep = dependency('libcurl', version: '>=' + curl_version, required: get_option('curl')) +if curl_dep.found() + # XXX as of libcurl-devel-7.20.1-3.fc13.x86_64, curl ships a version + # of <curl/curl.h> that #defines several wrapper macros around underlying + # functions to add type safety for gcc only. However, these macros + # spuriously trip gcc's -Wlogical-op warning. Avoid the warning by + # disabling the wrappers; even if it removes some type-check safety. + curl_dep = declare_dependency( + compile_args: [ '-DCURL_DISABLE_TYPECHECK' ], + dependencies: [ curl_dep ], + ) + + conf.set('WITH_CURL', 1) +endif + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) @@ -1095,6 +1111,7 @@ libs_summary = { 'bash_completion': bash_completion_dep.found(), 'blkid': blkid_dep.found(), 'capng': capng_dep.found(), + 'curl': curl_dep.found(), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index f53c94c6982..f0d5e05b469 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -16,4 +16,5 @@ option('bash_completion', type: 'feature', value: 'auto', description: 'bash-com option('bash_completion_dir', type: 'string', value: '', description: 'directory containing bash completion scripts') option('blkid', type: 'feature', value: 'auto', description: 'blkid support') option('capng', type: 'feature', value: 'auto', description: 'cap-ng support') +option('curl', type: 'feature', value: 'auto', description: 'curl support') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

Convert #if VAL into #ifdef VAL in order to make meson more readable and because it's not necessary to have both defines existing. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-dbus.m4 | 41 ----------------------------------------- meson.build | 17 +++++++++++++++++ meson_options.txt | 1 + 4 files changed, 18 insertions(+), 44 deletions(-) delete mode 100644 m4/virt-dbus.m4 diff --git a/configure.ac b/configure.ac index f89ea566c03..3499b372036 100644 --- a/configure.ac +++ b/configure.ac @@ -114,7 +114,6 @@ fi # Check for compiler and library settings. -LIBVIRT_ARG_DBUS LIBVIRT_ARG_FIREWALLD LIBVIRT_ARG_FIREWALLD_ZONE LIBVIRT_ARG_FUSE @@ -142,7 +141,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_DBUS LIBVIRT_CHECK_DEVMAPPER LIBVIRT_CHECK_DLOPEN LIBVIRT_CHECK_FIREWALLD @@ -463,7 +461,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_DBUS LIBVIRT_RESULT_DLOPEN LIBVIRT_RESULT_FIREWALLD LIBVIRT_RESULT_FIREWALLD_ZONE diff --git a/m4/virt-dbus.m4 b/m4/virt-dbus.m4 deleted file mode 100644 index f5af1a8022b..00000000000 --- a/m4/virt-dbus.m4 +++ /dev/null @@ -1,41 +0,0 @@ -dnl The libdbus.so library -dnl -dnl Copyright (C) 2012-2014 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_DBUS],[ - LIBVIRT_ARG_WITH_FEATURE([DBUS], [dbus-1], [check], [1.0.0]) -]) - -AC_DEFUN([LIBVIRT_CHECK_DBUS],[ - LIBVIRT_CHECK_PKG([DBUS], [dbus-1], [1.0.0]) - - if test "$with_dbus" = "yes" ; then - old_CFLAGS="$CFLAGS" - old_LIBS="$LIBS" - CFLAGS="$CFLAGS $DBUS_CFLAGS" - LIBS="$LIBS $DBUS_LIBS" - AC_CHECK_FUNCS([dbus_watch_get_unix_fd]) - AC_CHECK_TYPES([DBusBasicValue], [], [], [[#include <dbus/dbus.h>]]) - CFLAGS="$old_CFLAGS" - LIBS="$old_LIBS" - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_DBUS],[ - LIBVIRT_RESULT_LIB([DBUS]) -]) diff --git a/meson.build b/meson.build index 26378134118..081641c8617 100644 --- a/meson.build +++ b/meson.build @@ -995,6 +995,22 @@ if curl_dep.found() conf.set('WITH_CURL', 1) endif +dbus_version = '1.0.0' +dbus_dep = dependency('dbus-1', version: '>=' + dbus_version, required: get_option('dbus')) +if dbus_dep.found() + conf.set('WITH_DBUS', 1) + + function = 'dbus_watch_get_unix_fd' + if cc.has_function(function, dependencies: dbus_dep) + conf.set('HAVE_@0@'.format(function.to_upper()), 1) + endif + + type = 'DBusBasicValue' + if cc.has_type(type, dependencies: dbus_dep, prefix: '#include <dbus/dbus.h>') + conf.set('HAVE_@0@'.format(type.to_upper()), 1) + endif +endif + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) @@ -1112,6 +1128,7 @@ libs_summary = { 'blkid': blkid_dep.found(), 'capng': capng_dep.found(), 'curl': curl_dep.found(), + 'dbus': dbus_dep.found(), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index f0d5e05b469..957c88a1622 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -17,4 +17,5 @@ option('bash_completion_dir', type: 'string', value: '', description: 'directory option('blkid', type: 'feature', value: 'auto', description: 'blkid support') option('capng', type: 'feature', value: 'auto', description: 'cap-ng support') option('curl', type: 'feature', value: 'auto', description: 'curl support') +option('dbus', type: 'feature', value: 'auto', description: 'dbus-1 support') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 1 - m4/virt-devmapper.m4 | 32 -------------------------------- meson.build | 13 +++++++++++++ 3 files changed, 13 insertions(+), 33 deletions(-) delete mode 100644 m4/virt-devmapper.m4 diff --git a/configure.ac b/configure.ac index 3499b372036..9bb397d8e3e 100644 --- a/configure.ac +++ b/configure.ac @@ -141,7 +141,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_DEVMAPPER LIBVIRT_CHECK_DLOPEN LIBVIRT_CHECK_FIREWALLD LIBVIRT_CHECK_FIREWALLD_ZONE diff --git a/m4/virt-devmapper.m4 b/m4/virt-devmapper.m4 deleted file mode 100644 index 165caa69685..00000000000 --- a/m4/virt-devmapper.m4 +++ /dev/null @@ -1,32 +0,0 @@ -dnl The devmapper library -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_CHECK_DEVMAPPER], [ - DEVMAPPER_REQUIRED=1.0.0 - - with_devmapper=check - - LIBVIRT_CHECK_PKG([DEVMAPPER], [devmapper], [$DEVMAPPER_REQUIRED], []) - - if test "x$with_devmapper" = "xno"; then - # devmapper is missing pkg-config files in ubuntu, suse, etc - with_devmapper=check - LIBVIRT_CHECK_LIB([DEVMAPPER], [devmapper], [dm_task_run], [libdevmapper.h]) - fi -]) diff --git a/meson.build b/meson.build index 081641c8617..01525c05055 100644 --- a/meson.build +++ b/meson.build @@ -1011,6 +1011,19 @@ if dbus_dep.found() endif endif +devmapper_version = '1.0.0' +devmapper_dep = dependency('devmapper', version: '>=' + devmapper_version, required: false) +if not devmapper_dep.found() + # devmapper is missing pkg-config files in ubuntu, suse, etc + devmapper_dep = cc.find_library('devmapper', required: false) + if devmapper_dep.found() and not cc.has_function('dm_task_run', dependencies: tmp) + devmapper_dep = dependency('', required: false) + endif +endif +if devmapper_dep.found() + conf.set('WITH_DEVMAPPER', 1) +endif + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 2 -- m4/virt-dlopen.m4 | 45 --------------------------------------------- meson.build | 10 ++++++++++ 3 files changed, 10 insertions(+), 47 deletions(-) delete mode 100644 m4/virt-dlopen.m4 diff --git a/configure.ac b/configure.ac index 9bb397d8e3e..0dc9dc3bcfb 100644 --- a/configure.ac +++ b/configure.ac @@ -141,7 +141,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_DLOPEN LIBVIRT_CHECK_FIREWALLD LIBVIRT_CHECK_FIREWALLD_ZONE LIBVIRT_CHECK_FUSE @@ -460,7 +459,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_DLOPEN LIBVIRT_RESULT_FIREWALLD LIBVIRT_RESULT_FIREWALLD_ZONE LIBVIRT_RESULT_FUSE diff --git a/m4/virt-dlopen.m4 b/m4/virt-dlopen.m4 deleted file mode 100644 index 412ce79adec..00000000000 --- a/m4/virt-dlopen.m4 +++ /dev/null @@ -1,45 +0,0 @@ -dnl The dlopen library -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_CHECK_DLOPEN], [ - - with_dlopen=yes - with_dlfcn=yes - - AC_CHECK_HEADER([dlfcn.h],, [with_dlfcn=no]) - AC_SEARCH_LIBS([dlopen], [dl],, [with_dlopen=no]) - - case $ac_cv_search_dlopen:$host_os in - 'none required'* | *:mingw* | *:msvc*) - DLOPEN_LIBS= ;; - no*) - AC_MSG_ERROR([Unable to find dlopen()]) ;; - *) - if test "x$with_dlfcn" != "xyes"; then - AC_MSG_ERROR([Unable to find dlfcn.h]) - fi - DLOPEN_LIBS=$ac_cv_search_dlopen ;; - esac - - AC_SUBST([DLOPEN_LIBS]) -]) - -AC_DEFUN([LIBVIRT_RESULT_DLOPEN], [ - LIBVIRT_RESULT_LIB([DLOPEN]) -]) diff --git a/meson.build b/meson.build index 01525c05055..31f4e730ce7 100644 --- a/meson.build +++ b/meson.build @@ -1024,6 +1024,15 @@ if devmapper_dep.found() conf.set('WITH_DEVMAPPER', 1) endif +dlopen_use = host_machine.system() != 'windows' +dlopen_dep = cc.find_library('dl', required: dlopen_use) +if dlopen_dep.found() + if not cc.has_header('dlfcn.h') + error('Unable to find dlfcn.h') + endif + conf.set('HAVE_DLFCN_H', 1) +endif + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) @@ -1142,6 +1151,7 @@ libs_summary = { 'capng': capng_dep.found(), 'curl': curl_dep.found(), 'dbus': dbus_dep.found(), + 'dlopen': dlopen_dep.found(), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 7 ------- m4/virt-firewalld.m4 | 43 ------------------------------------------- meson.build | 9 +++++++++ meson_options.txt | 1 + 4 files changed, 10 insertions(+), 50 deletions(-) delete mode 100644 m4/virt-firewalld.m4 diff --git a/configure.ac b/configure.ac index 0dc9dc3bcfb..825d14c6384 100644 --- a/configure.ac +++ b/configure.ac @@ -82,10 +82,6 @@ if test $with_linux = no; then with_storage_scsi=no fi -if test $with_freebsd = yes; then - with_firewalld=no -fi - AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"]) AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"]) @@ -114,7 +110,6 @@ fi # Check for compiler and library settings. -LIBVIRT_ARG_FIREWALLD LIBVIRT_ARG_FIREWALLD_ZONE LIBVIRT_ARG_FUSE LIBVIRT_ARG_GLUSTER @@ -141,7 +136,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_FIREWALLD LIBVIRT_CHECK_FIREWALLD_ZONE LIBVIRT_CHECK_FUSE LIBVIRT_CHECK_GLIB @@ -459,7 +453,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_FIREWALLD LIBVIRT_RESULT_FIREWALLD_ZONE LIBVIRT_RESULT_FUSE LIBVIRT_RESULT_GLIB diff --git a/m4/virt-firewalld.m4 b/m4/virt-firewalld.m4 deleted file mode 100644 index 89efa47589b..00000000000 --- a/m4/virt-firewalld.m4 +++ /dev/null @@ -1,43 +0,0 @@ -dnl The firewalld support -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_FIREWALLD], [ - LIBVIRT_ARG_WITH_FEATURE([FIREWALLD], [firewalld], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_FIREWALLD], [ - AC_REQUIRE([LIBVIRT_CHECK_DBUS]) - - if test "x$with_firewalld" = "xcheck" ; then - with_firewalld=$with_dbus - fi - - if test "x$with_firewalld" = "xyes" ; then - if test "x$with_dbus" != "xyes" ; then - AC_MSG_ERROR([You must have dbus enabled for firewalld support]) - fi - AC_DEFINE_UNQUOTED([WITH_FIREWALLD], [1], [whether firewalld support is enabled]) - fi - - AM_CONDITIONAL([WITH_FIREWALLD], [test "x$with_firewalld" != "xno"]) -]) - -AC_DEFUN([LIBVIRT_RESULT_FIREWALLD], [ - LIBVIRT_RESULT_LIB([FIREWALLD]) -]) diff --git a/meson.build b/meson.build index 31f4e730ce7..385a959e88b 100644 --- a/meson.build +++ b/meson.build @@ -1122,6 +1122,14 @@ if bash_completion_dep.found() endif endif +if host_machine.system() != 'freebsd' + if not get_option('firewalld').disabled() and dbus_dep.found() + conf.set('WITH_FIREWALLD', 1) + elif get_option('firewalld').enabled() + error('You must have dbus enabled for firewalld support') + endif +endif + # define top include directory @@ -1152,6 +1160,7 @@ libs_summary = { 'curl': curl_dep.found(), 'dbus': dbus_dep.found(), 'dlopen': dlopen_dep.found(), + 'firewalld': conf.has('WITH_FIREWALLD'), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 957c88a1622..d9e614131cd 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -18,4 +18,5 @@ option('blkid', type: 'feature', value: 'auto', description: 'blkid support') option('capng', type: 'feature', value: 'auto', description: 'cap-ng support') option('curl', type: 'feature', value: 'auto', description: 'curl support') option('dbus', type: 'feature', value: 'auto', description: 'dbus-1 support') +option('firewalld', type: 'feature', value: 'auto', description: 'firewalld support') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-firewalld-zone.m4 | 45 --------------------------------------- meson.build | 7 ++++++ meson_options.txt | 1 + 4 files changed, 8 insertions(+), 48 deletions(-) delete mode 100644 m4/virt-firewalld-zone.m4 diff --git a/configure.ac b/configure.ac index 825d14c6384..086505d95f6 100644 --- a/configure.ac +++ b/configure.ac @@ -110,7 +110,6 @@ fi # Check for compiler and library settings. -LIBVIRT_ARG_FIREWALLD_ZONE LIBVIRT_ARG_FUSE LIBVIRT_ARG_GLUSTER LIBVIRT_ARG_HAL @@ -136,7 +135,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_FIREWALLD_ZONE LIBVIRT_CHECK_FUSE LIBVIRT_CHECK_GLIB LIBVIRT_CHECK_GLUSTER @@ -453,7 +451,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_FIREWALLD_ZONE LIBVIRT_RESULT_FUSE LIBVIRT_RESULT_GLIB LIBVIRT_RESULT_GLUSTER diff --git a/m4/virt-firewalld-zone.m4 b/m4/virt-firewalld-zone.m4 deleted file mode 100644 index b67d1a0b2fb..00000000000 --- a/m4/virt-firewalld-zone.m4 +++ /dev/null @@ -1,45 +0,0 @@ -dnl firewalld_zone check - whether or not to install the firewall "libvirt" zone -dnl -dnl Copyright (C) 2019 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_FIREWALLD_ZONE], [ - LIBVIRT_ARG_WITH([FIREWALLD_ZONE], [Whether to install firewalld libvirt zone], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_FIREWALLD_ZONE], [ - AC_REQUIRE([LIBVIRT_CHECK_FIREWALLD]) - AC_MSG_CHECKING([for whether to install firewalld libvirt zone]) - - if test "x$with_firewalld_zone" = "xcheck" ; then - with_firewalld_zone=$with_firewalld - fi - - if test "x$with_firewalld_zone" = "xyes" ; then - if test "x$with_firewalld" != "xyes" ; then - AC_MSG_ERROR([You must have firewalld support enabled to enable firewalld-zone]) - fi - AC_DEFINE_UNQUOTED([WITH_FIREWALLD_ZONE], [1], [whether firewalld libvirt zone is installed]) - fi - - AM_CONDITIONAL([WITH_FIREWALLD_ZONE], [test "x$with_firewalld_zone" != "xno"]) - AC_MSG_RESULT($with_firewalld_zone) -]) - -AC_DEFUN([LIBVIRT_RESULT_FIREWALLD_ZONE], [ - LIBVIRT_RESULT([firewalld-zone], [$with_firewalld_zone]) -]) diff --git a/meson.build b/meson.build index 385a959e88b..573a414b846 100644 --- a/meson.build +++ b/meson.build @@ -1130,6 +1130,12 @@ if host_machine.system() != 'freebsd' endif endif +if not get_option('firewalld_zone').disabled() and conf.has('WITH_FIREWALLD') + conf.set('WITH_FIREWALLD_ZONE', 1) +elif get_option('firewalld_zone').enabled() + error('You must have firewalld support enabled to enable firewalld_zone') +endif + # define top include directory @@ -1161,6 +1167,7 @@ libs_summary = { 'dbus': dbus_dep.found(), 'dlopen': dlopen_dep.found(), 'firewalld': conf.has('WITH_FIREWALLD'), + 'firewalld-zone': conf.has('WITH_FIREWALLD_ZONE'), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index d9e614131cd..75417751dd6 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -19,4 +19,5 @@ option('capng', type: 'feature', value: 'auto', description: 'cap-ng support') option('curl', type: 'feature', value: 'auto', description: 'curl support') option('dbus', type: 'feature', value: 'auto', description: 'dbus-1 support') option('firewalld', type: 'feature', value: 'auto', description: 'firewalld support') +option('firewalld_zone', type: 'feature', value: 'auto', description: 'whether to install firewalld libvirt zone') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-fuse.m4 | 30 ------------------------------ meson.build | 7 +++++++ meson_options.txt | 1 + 4 files changed, 8 insertions(+), 33 deletions(-) delete mode 100644 m4/virt-fuse.m4 diff --git a/configure.ac b/configure.ac index 086505d95f6..b136bf6a4cd 100644 --- a/configure.ac +++ b/configure.ac @@ -110,7 +110,6 @@ fi # Check for compiler and library settings. -LIBVIRT_ARG_FUSE LIBVIRT_ARG_GLUSTER LIBVIRT_ARG_HAL LIBVIRT_ARG_LIBISCSI @@ -135,7 +134,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_FUSE LIBVIRT_CHECK_GLIB LIBVIRT_CHECK_GLUSTER LIBVIRT_CHECK_GNUTLS @@ -451,7 +449,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_FUSE LIBVIRT_RESULT_GLIB LIBVIRT_RESULT_GLUSTER LIBVIRT_RESULT_GNUTLS diff --git a/m4/virt-fuse.m4 b/m4/virt-fuse.m4 deleted file mode 100644 index cc5726fe646..00000000000 --- a/m4/virt-fuse.m4 +++ /dev/null @@ -1,30 +0,0 @@ -dnl The libfuse.so library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_FUSE],[ - LIBVIRT_ARG_WITH_FEATURE([FUSE], [fuse], [check], [2.8.6]) -]) - -AC_DEFUN([LIBVIRT_CHECK_FUSE],[ - LIBVIRT_CHECK_PKG([FUSE], [fuse], [2.8.6]) -]) - -AC_DEFUN([LIBVIRT_RESULT_FUSE],[ - LIBVIRT_RESULT_LIB([FUSE]) -]) diff --git a/meson.build b/meson.build index 573a414b846..7ed5a0218f9 100644 --- a/meson.build +++ b/meson.build @@ -1033,6 +1033,12 @@ if dlopen_dep.found() conf.set('HAVE_DLFCN_H', 1) endif +fuse_version = '2.8.6' +fuse_dep = dependency('fuse', version: '>=' + fuse_version, required: get_option('fuse')) +if fuse_dep.found() + conf.set('WITH_FUSE', 1) +endif + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) @@ -1168,6 +1174,7 @@ libs_summary = { 'dlopen': dlopen_dep.found(), 'firewalld': conf.has('WITH_FIREWALLD'), 'firewalld-zone': conf.has('WITH_FIREWALLD_ZONE'), + 'fuse': fuse_dep.found(), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 75417751dd6..9aae950b8ca 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -20,4 +20,5 @@ option('curl', type: 'feature', value: 'auto', description: 'curl support') option('dbus', type: 'feature', value: 'auto', description: 'dbus-1 support') option('firewalld', type: 'feature', value: 'auto', description: 'firewalld support') option('firewalld_zone', type: 'feature', value: 'auto', description: 'whether to install firewalld libvirt zone') +option('fuse', type: 'feature', value: 'auto', description: 'fuse support') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 2 -- m4/virt-glib.m4 | 36 ------------------------------------ meson.build | 9 +++++++++ 3 files changed, 9 insertions(+), 38 deletions(-) delete mode 100644 m4/virt-glib.m4 diff --git a/configure.ac b/configure.ac index b136bf6a4cd..0a8a0221206 100644 --- a/configure.ac +++ b/configure.ac @@ -134,7 +134,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_GLIB LIBVIRT_CHECK_GLUSTER LIBVIRT_CHECK_GNUTLS LIBVIRT_CHECK_HAL @@ -449,7 +448,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_GLIB LIBVIRT_RESULT_GLUSTER LIBVIRT_RESULT_GNUTLS LIBVIRT_RESULT_HAL diff --git a/m4/virt-glib.m4 b/m4/virt-glib.m4 deleted file mode 100644 index 03e51711c0c..00000000000 --- a/m4/virt-glib.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl The glib.so library -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_GLIB], [ - LIBVIRT_ARG_WITH([GLIB], [glib-2.0 location], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_GLIB],[ - GLIB_REQUIRED=2.48.0 - - LIBVIRT_CHECK_PKG([GLIB], [glib-2.0 gobject-2.0 gio-2.0], [$GLIB_REQUIRED]) - - if test "$with_glib" = "no" ; then - AC_MSG_ERROR([glib-2.0, gobject-2.0 >= $GLIB_REQUIRED are required for libvirt]) - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_GLIB], [ - LIBVIRT_RESULT_LIB([GLIB]) -]) diff --git a/meson.build b/meson.build index 7ed5a0218f9..132d887be2a 100644 --- a/meson.build +++ b/meson.build @@ -1039,6 +1039,14 @@ if fuse_dep.found() conf.set('WITH_FUSE', 1) endif +glib_version = '2.48.0' +glib_dep = dependency('glib-2.0', version: '>=' + glib_version) +gobject_dep = dependency('gobject-2.0', version: '>=' + glib_version) +gio_dep = dependency('gio-2.0', version: '>=' + glib_version) +glib_dep = declare_dependency( + dependencies: [ glib_dep, gobject_dep, gio_dep ], +) + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) @@ -1175,6 +1183,7 @@ libs_summary = { 'firewalld': conf.has('WITH_FIREWALLD'), 'firewalld-zone': conf.has('WITH_FIREWALLD_ZONE'), 'fuse': fuse_dep.found(), + 'glib_dep': glib_dep.found(), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-gluster.m4 | 32 -------------------------------- meson.build | 4 ++++ meson_options.txt | 1 + 4 files changed, 5 insertions(+), 35 deletions(-) delete mode 100644 m4/virt-gluster.m4 diff --git a/configure.ac b/configure.ac index 0a8a0221206..fa9fecccc73 100644 --- a/configure.ac +++ b/configure.ac @@ -110,7 +110,6 @@ fi # Check for compiler and library settings. -LIBVIRT_ARG_GLUSTER LIBVIRT_ARG_HAL LIBVIRT_ARG_LIBISCSI LIBVIRT_ARG_LIBPCAP @@ -134,7 +133,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_GLUSTER LIBVIRT_CHECK_GNUTLS LIBVIRT_CHECK_HAL LIBVIRT_CHECK_LIBISCSI @@ -448,7 +446,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_GLUSTER LIBVIRT_RESULT_GNUTLS LIBVIRT_RESULT_HAL LIBVIRT_RESULT_LIBISCSI diff --git a/m4/virt-gluster.m4 b/m4/virt-gluster.m4 deleted file mode 100644 index 7edff40047f..00000000000 --- a/m4/virt-gluster.m4 +++ /dev/null @@ -1,32 +0,0 @@ -dnl The gluster libgfapi.so library -dnl -dnl Copyright (C) 2013 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 <http://www.gnu.org/licenses/>. -dnl - -dnl Currently tested against Fedora 19 with glusterfs 3.4.1; earlier -dnl versions may be possible but only with further testing -AC_DEFUN([LIBVIRT_ARG_GLUSTER],[ - LIBVIRT_ARG_WITH_FEATURE([GLUSTERFS], [glusterfs], [check], [3.4.1]) -]) - -AC_DEFUN([LIBVIRT_CHECK_GLUSTER],[ - LIBVIRT_CHECK_PKG([GLUSTERFS], [glusterfs-api], [3.4.1]) -]) - -AC_DEFUN([LIBVIRT_RESULT_GLUSTER],[ - LIBVIRT_RESULT_LIB([GLUSTERFS]) -]) diff --git a/meson.build b/meson.build index 132d887be2a..4ee7031b32c 100644 --- a/meson.build +++ b/meson.build @@ -1047,6 +1047,9 @@ glib_dep = declare_dependency( dependencies: [ glib_dep, gobject_dep, gio_dep ], ) +glusterfs_version = '3.4.1' +glusterfs_dep = dependency('glusterfs-api', version: '>=' + glusterfs_version, required: get_option('glusterfs')) + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) @@ -1184,6 +1187,7 @@ libs_summary = { 'firewalld-zone': conf.has('WITH_FIREWALLD_ZONE'), 'fuse': fuse_dep.found(), 'glib_dep': glib_dep.found(), + 'glusterfs': glusterfs_dep.found(), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 9aae950b8ca..cc3e5bbabab 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -21,4 +21,5 @@ option('dbus', type: 'feature', value: 'auto', description: 'dbus-1 support') option('firewalld', type: 'feature', value: 'auto', description: 'firewalld support') option('firewalld_zone', type: 'feature', value: 'auto', description: 'whether to install firewalld libvirt zone') option('fuse', type: 'feature', value: 'auto', description: 'fuse support') +option('glusterfs', type: 'feature', value: 'auto', description: 'glusterfs support') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 2 -- m4/virt-gnutls.m4 | 30 ------------------------------ meson.build | 4 ++++ 3 files changed, 4 insertions(+), 32 deletions(-) delete mode 100644 m4/virt-gnutls.m4 diff --git a/configure.ac b/configure.ac index fa9fecccc73..de31d11e63b 100644 --- a/configure.ac +++ b/configure.ac @@ -133,7 +133,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_GNUTLS LIBVIRT_CHECK_HAL LIBVIRT_CHECK_LIBISCSI LIBVIRT_CHECK_LIBNL @@ -446,7 +445,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_GNUTLS LIBVIRT_RESULT_HAL LIBVIRT_RESULT_LIBISCSI LIBVIRT_RESULT_LIBNL diff --git a/m4/virt-gnutls.m4 b/m4/virt-gnutls.m4 deleted file mode 100644 index 6829ca55cf5..00000000000 --- a/m4/virt-gnutls.m4 +++ /dev/null @@ -1,30 +0,0 @@ -dnl The gnutls libgnutls.so library -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_CHECK_GNUTLS],[ - LIBVIRT_CHECK_PKG([GNUTLS], [gnutls], [3.2.0]) - - dnl Require gnutls >= 3.2.0 because of 3.2.11 in Ubuntu 14.04 - dnl That should have all the functions we use (in >= 2.12) - dnl and also use nettle, because it's >= 3.0 -]) - -AC_DEFUN([LIBVIRT_RESULT_GNUTLS],[ - LIBVIRT_RESULT_LIB([GNUTLS]) -]) diff --git a/meson.build b/meson.build index 4ee7031b32c..5a9e9f26db1 100644 --- a/meson.build +++ b/meson.build @@ -1050,6 +1050,9 @@ glib_dep = declare_dependency( glusterfs_version = '3.4.1' glusterfs_dep = dependency('glusterfs-api', version: '>=' + glusterfs_version, required: get_option('glusterfs')) +gnutls_version = '3.2.0' +gnutls_dep = dependency('gnutls', version: '>=' + gnutls_version) + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) @@ -1188,6 +1191,7 @@ libs_summary = { 'fuse': fuse_dep.found(), 'glib_dep': glib_dep.found(), 'glusterfs': glusterfs_dep.found(), + 'gnutls': gnutls_dep.found(), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-hal.m4 | 30 ------------------------------ meson.build | 7 +++++++ meson_options.txt | 1 + 4 files changed, 8 insertions(+), 33 deletions(-) delete mode 100644 m4/virt-hal.m4 diff --git a/configure.ac b/configure.ac index de31d11e63b..5a37af6f27f 100644 --- a/configure.ac +++ b/configure.ac @@ -110,7 +110,6 @@ fi # Check for compiler and library settings. -LIBVIRT_ARG_HAL LIBVIRT_ARG_LIBISCSI LIBVIRT_ARG_LIBPCAP LIBVIRT_ARG_LIBSSH @@ -133,7 +132,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_HAL LIBVIRT_CHECK_LIBISCSI LIBVIRT_CHECK_LIBNL LIBVIRT_CHECK_LIBPARTED @@ -445,7 +443,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_HAL LIBVIRT_RESULT_LIBISCSI LIBVIRT_RESULT_LIBNL LIBVIRT_RESULT_LIBPCAP diff --git a/m4/virt-hal.m4 b/m4/virt-hal.m4 deleted file mode 100644 index e37bbf979b4..00000000000 --- a/m4/virt-hal.m4 +++ /dev/null @@ -1,30 +0,0 @@ -dnl The libhal.so library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_HAL],[ - LIBVIRT_ARG_WITH_FEATURE([HAL], [hal], [check], [0.5.0]) -]) - -AC_DEFUN([LIBVIRT_CHECK_HAL],[ - LIBVIRT_CHECK_PKG([HAL], [hal], [0.5.0]) -]) - -AC_DEFUN([LIBVIRT_RESULT_HAL],[ - LIBVIRT_RESULT_LIB([HAL]) -]) diff --git a/meson.build b/meson.build index 5a9e9f26db1..ef76c2fad07 100644 --- a/meson.build +++ b/meson.build @@ -1053,6 +1053,12 @@ glusterfs_dep = dependency('glusterfs-api', version: '>=' + glusterfs_version, r gnutls_version = '3.2.0' gnutls_dep = dependency('gnutls', version: '>=' + gnutls_version) +hal_version = '0.5.0' +hal_dep = dependency('hal', version: '>=' + hal_version, required: get_option('hal')) +if hal_dep.found() + conf.set('WITH_HAL', 1) +endif + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) @@ -1192,6 +1198,7 @@ libs_summary = { 'glib_dep': glib_dep.found(), 'glusterfs': glusterfs_dep.found(), 'gnutls': gnutls_dep.found(), + 'hal': hal_dep.found(), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index cc3e5bbabab..9ba8ad0dd83 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -22,4 +22,5 @@ option('firewalld', type: 'feature', value: 'auto', description: 'firewalld supp option('firewalld_zone', type: 'feature', value: 'auto', description: 'whether to install firewalld libvirt zone') option('fuse', type: 'feature', value: 'auto', description: 'fuse support') option('glusterfs', type: 'feature', value: 'auto', description: 'glusterfs support') +option('hal', type: 'feature', value: 'auto', description: 'hal support') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 7 ------- meson.build | 6 ++++++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 5a37af6f27f..3726854d524 100644 --- a/configure.ac +++ b/configure.ac @@ -361,13 +361,6 @@ fi AM_CONDITIONAL([WITH_NODE_DEVICES], [test "$with_nodedev" = "yes"]) -# Check for BSD kvm (kernel memory interface) -if test $with_freebsd = yes; then - AC_CHECK_LIB([kvm], [kvm_getprocs], [], - [AC_MSG_ERROR([BSD kernel memory interface library is required to build on FreeBSD])] - ) -fi - GNUmakefile=GNUmakefile m4_if(m4_version_compare([2.61a.100], m4_defn([m4_PACKAGE_VERSION])), [1], [], diff --git a/meson.build b/meson.build index ef76c2fad07..62529932518 100644 --- a/meson.build +++ b/meson.build @@ -1059,6 +1059,12 @@ if hal_dep.found() conf.set('WITH_HAL', 1) endif +# Check for BSD kvm (kernel memory interface) +if host_machine.system() == 'freebsd' + kvm_dep = cc.find_library('kvm') + add_project_link_arguments('-lkvm', language: 'c') +endif + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-libiscsi.m4 | 30 ------------------------------ meson.build | 4 ++++ meson_options.txt | 1 + 4 files changed, 5 insertions(+), 33 deletions(-) delete mode 100644 m4/virt-libiscsi.m4 diff --git a/configure.ac b/configure.ac index 3726854d524..b74cb72db4a 100644 --- a/configure.ac +++ b/configure.ac @@ -110,7 +110,6 @@ fi # Check for compiler and library settings. -LIBVIRT_ARG_LIBISCSI LIBVIRT_ARG_LIBPCAP LIBVIRT_ARG_LIBSSH LIBVIRT_ARG_LIBXML @@ -132,7 +131,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_LIBISCSI LIBVIRT_CHECK_LIBNL LIBVIRT_CHECK_LIBPARTED LIBVIRT_CHECK_LIBPCAP @@ -436,7 +434,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_LIBISCSI LIBVIRT_RESULT_LIBNL LIBVIRT_RESULT_LIBPCAP LIBVIRT_RESULT_LIBSSH diff --git a/m4/virt-libiscsi.m4 b/m4/virt-libiscsi.m4 deleted file mode 100644 index 2747f00ec4e..00000000000 --- a/m4/virt-libiscsi.m4 +++ /dev/null @@ -1,30 +0,0 @@ -dnl Libiscsi library -dnl -dnl Copyright (C) 2018 Clementine Hayat. -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_LIBISCSI],[ - LIBVIRT_ARG_WITH_FEATURE([LIBISCSI], [libiscsi], [check], [1.18.0]) -]) - -AC_DEFUN([LIBVIRT_CHECK_LIBISCSI],[ - LIBVIRT_CHECK_PKG([LIBISCSI], [libiscsi], [1.18.0]) -]) - -AC_DEFUN([LIBVIRT_RESULT_LIBISCSI],[ - LIBVIRT_RESULT_LIB(LIBISCSI) -]) diff --git a/meson.build b/meson.build index 62529932518..9d43be1375c 100644 --- a/meson.build +++ b/meson.build @@ -1065,6 +1065,9 @@ if host_machine.system() == 'freebsd' add_project_link_arguments('-lkvm', language: 'c') endif +libiscsi_version = '1.18.0' +libiscsi_dep = dependency('libiscsi', version: '>=' + libiscsi_version, required: get_option('libiscsi')) + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) @@ -1205,6 +1208,7 @@ libs_summary = { 'glusterfs': glusterfs_dep.found(), 'gnutls': gnutls_dep.found(), 'hal': hal_dep.found(), + 'libiscsi': libiscsi_dep.found(), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 9ba8ad0dd83..c06e6ee9256 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -23,4 +23,5 @@ option('firewalld_zone', type: 'feature', value: 'auto', description: 'whether t option('fuse', type: 'feature', value: 'auto', description: 'fuse support') option('glusterfs', type: 'feature', value: 'auto', description: 'glusterfs support') option('hal', type: 'feature', value: 'auto', description: 'hal support') +option('libiscsi', type: 'feature', value: 'auto', description: 'libiscsi support') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-macvtap.m4 | 56 ---------------------------------------------- meson.build | 20 +++++++++++++++++ meson_options.txt | 1 + 4 files changed, 21 insertions(+), 59 deletions(-) delete mode 100644 m4/virt-macvtap.m4 diff --git a/configure.ac b/configure.ac index b74cb72db4a..456e60e62bc 100644 --- a/configure.ac +++ b/configure.ac @@ -113,7 +113,6 @@ fi LIBVIRT_ARG_LIBPCAP LIBVIRT_ARG_LIBSSH LIBVIRT_ARG_LIBXML -LIBVIRT_ARG_MACVTAP LIBVIRT_ARG_NETCF LIBVIRT_ARG_NLS LIBVIRT_ARG_NSS @@ -136,7 +135,6 @@ LIBVIRT_CHECK_LIBPARTED LIBVIRT_CHECK_LIBPCAP LIBVIRT_CHECK_LIBSSH LIBVIRT_CHECK_LIBXML -LIBVIRT_CHECK_MACVTAP LIBVIRT_CHECK_NETCF LIBVIRT_CHECK_NLS LIBVIRT_CHECK_NUMACTL @@ -439,7 +437,6 @@ LIBVIRT_RESULT_LIBPCAP LIBVIRT_RESULT_LIBSSH LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_LIBXML -LIBVIRT_RESULT_MACVTAP LIBVIRT_RESULT_NETCF LIBVIRT_RESULT_NLS LIBVIRT_RESULT_NSS diff --git a/m4/virt-macvtap.m4 b/m4/virt-macvtap.m4 deleted file mode 100644 index c5da96ecf2f..00000000000 --- a/m4/virt-macvtap.m4 +++ /dev/null @@ -1,56 +0,0 @@ -dnl The macvtap support -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_MACVTAP], [ - LIBVIRT_ARG_WITH([MACVTAP], [enable macvtap device], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_MACVTAP], [ - AC_MSG_CHECKING([whether to compile with macvtap support]) - if test "$with_macvtap" != "no" ; then - AC_TRY_COMPILE([ #include <sys/socket.h> - #include <linux/rtnetlink.h> ], - [ int x = MACVLAN_MODE_BRIDGE; - int y = IFLA_VF_MAX; ], - [ with_macvtap=yes ], - [ if test "$with_macvtap" = "yes" ; then - AC_MSG_ERROR([Installed linux headers don't show support for macvtap device.]) - fi - with_macvtap=no ]) - if test "$with_macvtap" = "yes" ; then - val=1 - else - val=0 - fi - AC_DEFINE_UNQUOTED([WITH_MACVTAP], $val, [whether macvtap support is enabled]) - fi - AM_CONDITIONAL([WITH_MACVTAP], [test "$with_macvtap" = "yes"]) - AC_MSG_RESULT([$with_macvtap]) - - if test "$with_macvtap" = yes; then - AC_CHECK_DECLS([MACVLAN_MODE_PASSTHRU], [], [], [[ - #include <sys/socket.h> - #include <linux/if_link.h> - ]]) - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_MACVTAP], [ - LIBVIRT_RESULT_LIB([MACVTAP]) -]) diff --git a/meson.build b/meson.build index 9d43be1375c..ce3dbca83e0 100644 --- a/meson.build +++ b/meson.build @@ -1068,6 +1068,25 @@ endif libiscsi_version = '1.18.0' libiscsi_dep = dependency('libiscsi', version: '>=' + libiscsi_version, required: get_option('libiscsi')) +use_macvtap = false +if not get_option('macvtap').disabled() + if (cc.has_header_symbol('linux/if_link.h', 'MACVLAN_MODE_BRIDGE') and + cc.has_header_symbol('linux/if_link.h', 'IFLA_VF_MAX')) + use_macvtap = true + endif + + if get_option('macvtap').enabled() and not use_macvtap + error('Installed linux headers don\'t show support for macvtap device.') + endif +endif +if use_macvtap + conf.set('WITH_MACVTAP', 1) + + if cc.has_header_symbol('linux/if_link.h', 'MACVLAN_MODE_PASSTHRU') + conf.set('HAVE_DECL_MACVLAN_MODE_PASSTHRU', 1) + endif +endif + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) @@ -1209,6 +1228,7 @@ libs_summary = { 'gnutls': gnutls_dep.found(), 'hal': hal_dep.found(), 'libiscsi': libiscsi_dep.found(), + 'macvtap': conf.has('WITH_MACVTAP'), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index c06e6ee9256..44e756bdcf3 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -24,4 +24,5 @@ option('fuse', type: 'feature', value: 'auto', description: 'fuse support') option('glusterfs', type: 'feature', value: 'auto', description: 'glusterfs support') option('hal', type: 'feature', value: 'auto', description: 'hal support') option('libiscsi', type: 'feature', value: 'auto', description: 'libiscsi support') +option('macvtap', type: 'feature', value: 'auto', description: 'enable macvtap device') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 2 -- m4/virt-libnl.m4 | 47 ----------------------------------------------- meson.build | 20 ++++++++++++++++++++ 3 files changed, 20 insertions(+), 49 deletions(-) delete mode 100644 m4/virt-libnl.m4 diff --git a/configure.ac b/configure.ac index 456e60e62bc..755fe0073f0 100644 --- a/configure.ac +++ b/configure.ac @@ -130,7 +130,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_LIBNL LIBVIRT_CHECK_LIBPARTED LIBVIRT_CHECK_LIBPCAP LIBVIRT_CHECK_LIBSSH @@ -432,7 +431,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_LIBNL LIBVIRT_RESULT_LIBPCAP LIBVIRT_RESULT_LIBSSH LIBVIRT_RESULT_LIBXL diff --git a/m4/virt-libnl.m4 b/m4/virt-libnl.m4 deleted file mode 100644 index cd780cf90e7..00000000000 --- a/m4/virt-libnl.m4 +++ /dev/null @@ -1,47 +0,0 @@ -dnl The libnl library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_CHECK_LIBNL], [ - AC_REQUIRE([LIBVIRT_CHECK_MACVTAP]) - - with_libnl=no - - if test "$with_linux" = "yes"; then - PKG_CHECK_MODULES([LIBNL], [libnl-3.0], [ - with_libnl=yes - AC_DEFINE([HAVE_LIBNL], [1], [whether the netlink library is available]) - PKG_CHECK_MODULES([LIBNL_ROUTE], [libnl-route-3.0]) - LIBNL_CFLAGS="$LIBNL_CFLAGS $LIBNL_ROUTE_CFLAGS" - LIBNL_LIBS="$LIBNL_LIBS $LIBNL_ROUTE_LIBS" - ], [:]) - fi - if test "$with_libnl" = no; then - if test "$with_macvtap" = "yes"; then - AC_MSG_ERROR([libnl3-devel is required for macvtap support]) - fi - fi - AM_CONDITIONAL([HAVE_LIBNL], [test "$with_libnl" = "yes"]) - - AC_SUBST([LIBNL_CFLAGS]) - AC_SUBST([LIBNL_LIBS]) -]) - -AC_DEFUN([LIBVIRT_RESULT_LIBNL], [ - LIBVIRT_RESULT_LIB([LIBNL]) -]) diff --git a/meson.build b/meson.build index ce3dbca83e0..d096a531bb7 100644 --- a/meson.build +++ b/meson.build @@ -1068,6 +1068,21 @@ endif libiscsi_version = '1.18.0' libiscsi_dep = dependency('libiscsi', version: '>=' + libiscsi_version, required: get_option('libiscsi')) +libnl_version = '3.0' +if host_machine.system() == 'linux' + libnl_dep = dependency('libnl-3.0', version: '>=' + libnl_version, required: false) + libnl_route_dep = dependency('libnl-route-3.0', version: '>=' + libnl_version, required: false) + + if libnl_dep.found() and libnl_route_dep.found() + libnl_dep = declare_dependency( + dependencies: [ libnl_dep, libnl_route_dep ], + ) + conf.set('HAVE_LIBNL', 1) + endif +else + libnl_dep = dependency('', required: false) +endif + use_macvtap = false if not get_option('macvtap').disabled() if (cc.has_header_symbol('linux/if_link.h', 'MACVLAN_MODE_BRIDGE') and @@ -1190,6 +1205,10 @@ elif get_option('firewalld_zone').enabled() error('You must have firewalld support enabled to enable firewalld_zone') endif +if conf.has('WITH_MACVTAP') and not conf.has('HAVE_LIBNL') + error('libnl3-devel is required for macvtap support') +endif + # define top include directory @@ -1228,6 +1247,7 @@ libs_summary = { 'gnutls': gnutls_dep.found(), 'hal': hal_dep.found(), 'libiscsi': libiscsi_dep.found(), + 'libnl': libnl_dep.found(), 'macvtap': conf.has('WITH_MACVTAP'), 'readline': readline_dep.found(), } -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 1 - m4/virt-parted.m4 | 38 -------------------------------------- meson.build | 11 +++++++++++ 3 files changed, 11 insertions(+), 39 deletions(-) delete mode 100644 m4/virt-parted.m4 diff --git a/configure.ac b/configure.ac index 755fe0073f0..b09a185c053 100644 --- a/configure.ac +++ b/configure.ac @@ -130,7 +130,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_LIBPARTED LIBVIRT_CHECK_LIBPCAP LIBVIRT_CHECK_LIBSSH LIBVIRT_CHECK_LIBXML diff --git a/m4/virt-parted.m4 b/m4/virt-parted.m4 deleted file mode 100644 index a73050a8b10..00000000000 --- a/m4/virt-parted.m4 +++ /dev/null @@ -1,38 +0,0 @@ -dnl The parted check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_CHECK_LIBPARTED], [ - PARTED_REQUIRED="1.8.0" - - with_libparted=check - - LIBVIRT_CHECK_PKG([LIBPARTED], [libparted], [$PARTED_REQUIRED]) - - if test "x$with_libparted" = "xyes"; then - AC_PATH_PROG([PARTED], [parted], [], [$LIBVIRT_SBIN_PATH]) - if test -z "$PARTED" ; then - with_libparted=no - fi - fi - - if test "x$with_libparted" = "xyes"; then - AC_DEFINE_UNQUOTED([PARTED], ["$PARTED"], - [Location or name of the parted program]) - fi -]) diff --git a/meson.build b/meson.build index d096a531bb7..38e18f5c750 100644 --- a/meson.build +++ b/meson.build @@ -1083,6 +1083,17 @@ else libnl_dep = dependency('', required: false) endif +libparted_version = '1.8.0' +libparted_dep = dependency('libparted', version: '>=' + libparted_version, required: false) +if libparted_dep.found() + parted_prog = find_program('parted', required: false, dirs: libvirt_sbin_path) + if parted_prog.found() + conf.set_quoted('PARTED', parted_prog.path()) + else + libparted_dep = dependency('', required: false) + endif +endif + use_macvtap = false if not get_option('macvtap').disabled() if (cc.has_header_symbol('linux/if_link.h', 'MACVLAN_MODE_BRIDGE') and -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-libpcap.m4 | 62 ---------------------------------------------- meson.build | 18 ++++++++++++++ meson_options.txt | 1 + 4 files changed, 19 insertions(+), 65 deletions(-) delete mode 100644 m4/virt-libpcap.m4 diff --git a/configure.ac b/configure.ac index b09a185c053..6d5e4e034fb 100644 --- a/configure.ac +++ b/configure.ac @@ -110,7 +110,6 @@ fi # Check for compiler and library settings. -LIBVIRT_ARG_LIBPCAP LIBVIRT_ARG_LIBSSH LIBVIRT_ARG_LIBXML LIBVIRT_ARG_NETCF @@ -130,7 +129,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_LIBPCAP LIBVIRT_CHECK_LIBSSH LIBVIRT_CHECK_LIBXML LIBVIRT_CHECK_NETCF @@ -430,7 +428,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_LIBPCAP LIBVIRT_RESULT_LIBSSH LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_LIBXML diff --git a/m4/virt-libpcap.m4 b/m4/virt-libpcap.m4 deleted file mode 100644 index 605c2fdea71..00000000000 --- a/m4/virt-libpcap.m4 +++ /dev/null @@ -1,62 +0,0 @@ -dnl The pcap library -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_LIBPCAP], [ - LIBVIRT_ARG_WITH([LIBPCAP], [libpcap location], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_LIBPCAP], [ - LIBPCAP_REQUIRED="1.5.0" - LIBPCAP_CONFIG="pcap-config" - LIBPCAP_CFLAGS="" - LIBPCAP_LIBS="" - - if test "x$with_libpcap" != "xno"; then - case $with_libpcap in - ''|yes|check) LIBPCAP_CONFIG="pcap-config" ;; - *) LIBPCAP_CONFIG="$with_libpcap/bin/pcap-config" ;; - esac - AS_IF([test "x$LIBPCAP_CONFIG" != "x"], [ - AC_MSG_CHECKING(libpcap $LIBPCAP_CONFIG >= $LIBPCAP_REQUIRED ) - if ! $LIBPCAP_CONFIG --libs > /dev/null 2>&1 ; then - if test "x$with_libpcap" != "xcheck"; then - AC_MSG_ERROR([You must install libpcap >= $LIBPCAP_REQUIRED to compile libvirt]) - fi - AC_MSG_RESULT(no) - with_libpcap="no" - else - LIBPCAP_LIBS="`$LIBPCAP_CONFIG --libs`" - LIBPCAP_CFLAGS="`$LIBPCAP_CONFIG --cflags`" - with_libpcap="yes" - AC_MSG_RESULT(yes) - fi - ]) - fi - - if test "x$with_libpcap" = "xyes"; then - AC_DEFINE_UNQUOTED([HAVE_LIBPCAP], 1, [whether libpcap can be used]) - fi - - AC_SUBST([LIBPCAP_CFLAGS]) - AC_SUBST([LIBPCAP_LIBS]) -]) - -AC_DEFUN([LIBVIRT_RESULT_LIBPCAP], [ - LIBVIRT_RESULT_LIB([LIBPCAP]) -]) diff --git a/meson.build b/meson.build index 38e18f5c750..2346ae31d5a 100644 --- a/meson.build +++ b/meson.build @@ -1094,6 +1094,23 @@ if libparted_dep.found() endif endif +libpcap_version = '1.5.0' +libpcap_dep = dependency('libpcap', version: '>=' + libpcap_version, required: false) +if not libpcap_dep.found() + pcap_config_prog = find_program('pcap-config', required: get_option('libpcap')) + if pcap_config_prog.found() + pcap_args = run_command(pcap_config_prog, '--cflags').stdout().strip().split() + pcap_libs = run_command(pcap_config_prog, '--libs').stdout().strip().split() + libpcap_dep = declare_dependency( + compile_args: pcap_args, + link_args: pcap_libs, + ) + endif +endif +if libpcap_dep.found() + conf.set('HAVE_LIBPCAP', 1) +endif + use_macvtap = false if not get_option('macvtap').disabled() if (cc.has_header_symbol('linux/if_link.h', 'MACVLAN_MODE_BRIDGE') and @@ -1259,6 +1276,7 @@ libs_summary = { 'hal': hal_dep.found(), 'libiscsi': libiscsi_dep.found(), 'libnl': libnl_dep.found(), + 'libpcap': libpcap_dep.found(), 'macvtap': conf.has('WITH_MACVTAP'), 'readline': readline_dep.found(), } diff --git a/meson_options.txt b/meson_options.txt index 44e756bdcf3..9e4e3f66429 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -24,5 +24,6 @@ option('fuse', type: 'feature', value: 'auto', description: 'fuse support') option('glusterfs', type: 'feature', value: 'auto', description: 'glusterfs support') option('hal', type: 'feature', value: 'auto', description: 'hal support') option('libiscsi', type: 'feature', value: 'auto', description: 'libiscsi support') +option('libpcap', type: 'feature', value: 'auto', description: 'libpcap support') option('macvtap', type: 'feature', value: 'auto', description: 'enable macvtap device') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 ---- m4/virt-libssh.m4 | 51 ----------------------------------------------- meson.build | 22 ++++++++++++++++++++ meson_options.txt | 1 + 4 files changed, 23 insertions(+), 55 deletions(-) delete mode 100644 m4/virt-libssh.m4 diff --git a/configure.ac b/configure.ac index 6d5e4e034fb..1709f56a8b5 100644 --- a/configure.ac +++ b/configure.ac @@ -98,7 +98,6 @@ if test "$with_remote" = "no" ; then with_libvirtd=no with_ssh2=no with_sasl=no - with_libssh=no fi # Stateful drivers are useful only when building the daemon. if test "$with_libvirtd" = "no" ; then @@ -110,7 +109,6 @@ fi # Check for compiler and library settings. -LIBVIRT_ARG_LIBSSH LIBVIRT_ARG_LIBXML LIBVIRT_ARG_NETCF LIBVIRT_ARG_NLS @@ -129,7 +127,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_LIBSSH LIBVIRT_CHECK_LIBXML LIBVIRT_CHECK_NETCF LIBVIRT_CHECK_NLS @@ -428,7 +425,6 @@ LIBVIRT_RESULT_DRIVER_MODULES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_LIBSSH LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_LIBXML LIBVIRT_RESULT_NETCF diff --git a/m4/virt-libssh.m4 b/m4/virt-libssh.m4 deleted file mode 100644 index 132447da163..00000000000 --- a/m4/virt-libssh.m4 +++ /dev/null @@ -1,51 +0,0 @@ -dnl The libssh.so library -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_LIBSSH],[ - LIBVIRT_ARG_WITH_FEATURE([LIBSSH], [libssh], [check], [0.7]) -]) - -AC_DEFUN([LIBVIRT_CHECK_LIBSSH],[ - LIBVIRT_CHECK_PKG([LIBSSH], [libssh], [0.7]) - - if test "$with_libssh" = "yes" ; then - old_CFLAGS="$CFLAGS" - old_LIBS="$LIBS" - CFLAGS="$CFLAGS $LIBSSH_CFLAGS" - LIBS="$LIBS $LIBSSH_LIBS" - AC_CHECK_FUNC([ssh_get_server_publickey], - [], - [AC_DEFINE_UNQUOTED([ssh_get_server_publickey], [ssh_get_publickey], - [ssh_get_publickey is deprecated and replaced by ssh_get_server_publickey.])]) - AC_CHECK_FUNC([ssh_session_is_known_server], - [], - [AC_DEFINE_UNQUOTED([ssh_session_is_known_server], [ssh_is_server_known], - [ssh_is_server_known is deprecated and replaced by ssh_session_is_known_server.])]) - AC_CHECK_FUNC([ssh_session_update_known_hosts], - [], - [AC_DEFINE_UNQUOTED([ssh_session_update_known_hosts], [ssh_write_knownhost], - [ssh_write_knownhost is deprecated and replaced by ssh_session_update_known_hosts.])]) - CFLAGS="$old_CFLAGS" - LIBS="$old_LIBS" - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_LIBSSH],[ - LIBVIRT_RESULT_LIB([LIBSSH]) -]) diff --git a/meson.build b/meson.build index 2346ae31d5a..2ab3aa87dea 100644 --- a/meson.build +++ b/meson.build @@ -1111,6 +1111,27 @@ if libpcap_dep.found() conf.set('HAVE_LIBPCAP', 1) endif +libssh_version = '0.7' +if get_option('driver_remote').enabled() + libssh_dep = dependency('libssh', version: '>=' + libssh_version, required: get_option('libssh')) + if libssh_dep.found() + conf.set('WITH_LIBSSH', 1) + + functions = [ + [ 'ssh_get_server_publickey', 'ssh_get_publickey' ], + [ 'ssh_session_is_known_server', 'ssh_is_server_known' ], + [ 'ssh_session_update_known_hosts', 'ssh_write_knownhost' ], + ] + foreach name : functions + if not cc.has_function(name[0], dependencies: libssh_dep) + conf.set(name[0], name[1]) + endif + endforeach + endif +else + libssh_dep = dependency('', required: false) +endif + use_macvtap = false if not get_option('macvtap').disabled() if (cc.has_header_symbol('linux/if_link.h', 'MACVLAN_MODE_BRIDGE') and @@ -1277,6 +1298,7 @@ libs_summary = { 'libiscsi': libiscsi_dep.found(), 'libnl': libnl_dep.found(), 'libpcap': libpcap_dep.found(), + 'libssh': libssh_dep.found(), 'macvtap': conf.has('WITH_MACVTAP'), 'readline': readline_dep.found(), } diff --git a/meson_options.txt b/meson_options.txt index 9e4e3f66429..9588db5b835 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -25,5 +25,6 @@ option('glusterfs', type: 'feature', value: 'auto', description: 'glusterfs supp option('hal', type: 'feature', value: 'auto', description: 'hal support') option('libiscsi', type: 'feature', value: 'auto', description: 'libiscsi support') option('libpcap', type: 'feature', value: 'auto', description: 'libpcap support') +option('libssh', type: 'feature', value: 'auto', description: 'libssh support') option('macvtap', type: 'feature', value: 'auto', description: 'enable macvtap device') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

On Thu, Jul 16, 2020 at 11:54:54 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 ---- m4/virt-libssh.m4 | 51 ----------------------------------------------- meson.build | 22 ++++++++++++++++++++ meson_options.txt | 1 + 4 files changed, 23 insertions(+), 55 deletions(-) delete mode 100644 m4/virt-libssh.m4
diff --git a/meson.build b/meson.build index 2346ae31d5a..2ab3aa87dea 100644 --- a/meson.build +++ b/meson.build @@ -1111,6 +1111,27 @@ if libpcap_dep.found() conf.set('HAVE_LIBPCAP', 1) endif
+libssh_version = '0.7' +if get_option('driver_remote').enabled() + libssh_dep = dependency('libssh', version: '>=' + libssh_version, required: get_option('libssh')) + if libssh_dep.found() + conf.set('WITH_LIBSSH', 1) + + functions = [ + [ 'ssh_get_server_publickey', 'ssh_get_publickey' ], + [ 'ssh_session_is_known_server', 'ssh_is_server_known' ], + [ 'ssh_session_update_known_hosts', 'ssh_write_knownhost' ],
IMO using a dictionary here would be great for clarity to see which are the old and which are the new symbols. Or at least a comment similarly to what we had before.
+ ] + foreach name : functions + if not cc.has_function(name[0], dependencies: libssh_dep) + conf.set(name[0], name[1]) + endif + endforeach

On Wed, Jul 22, 2020 at 10:56:45AM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:54:54 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 ---- m4/virt-libssh.m4 | 51 ----------------------------------------------- meson.build | 22 ++++++++++++++++++++ meson_options.txt | 1 + 4 files changed, 23 insertions(+), 55 deletions(-) delete mode 100644 m4/virt-libssh.m4
diff --git a/meson.build b/meson.build index 2346ae31d5a..2ab3aa87dea 100644 --- a/meson.build +++ b/meson.build @@ -1111,6 +1111,27 @@ if libpcap_dep.found() conf.set('HAVE_LIBPCAP', 1) endif
+libssh_version = '0.7' +if get_option('driver_remote').enabled() + libssh_dep = dependency('libssh', version: '>=' + libssh_version, required: get_option('libssh')) + if libssh_dep.found() + conf.set('WITH_LIBSSH', 1) + + functions = [ + [ 'ssh_get_server_publickey', 'ssh_get_publickey' ], + [ 'ssh_session_is_known_server', 'ssh_is_server_known' ], + [ 'ssh_session_update_known_hosts', 'ssh_write_knownhost' ],
IMO using a dictionary here would be great for clarity to see which are the old and which are the new symbols. Or at least a comment similarly to what we had before.
Dictionary would be to verbose so I'll go with comment. Good point, thanks. Pavel

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 ---- m4/virt-ssh2.m4 | 30 ------------------------------ meson.build | 11 +++++++++++ meson_options.txt | 1 + 4 files changed, 12 insertions(+), 34 deletions(-) delete mode 100644 m4/virt-ssh2.m4 diff --git a/configure.ac b/configure.ac index 1709f56a8b5..c81db75ae33 100644 --- a/configure.ac +++ b/configure.ac @@ -96,7 +96,6 @@ fi # RPC, we don't need several libraries. if test "$with_remote" = "no" ; then with_libvirtd=no - with_ssh2=no with_sasl=no fi # Stateful drivers are useful only when building the daemon. @@ -121,7 +120,6 @@ LIBVIRT_ARG_POLKIT LIBVIRT_ARG_SANLOCK LIBVIRT_ARG_SASL LIBVIRT_ARG_SELINUX -LIBVIRT_ARG_SSH2 LIBVIRT_ARG_UDEV LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK @@ -140,7 +138,6 @@ LIBVIRT_CHECK_PTHREAD LIBVIRT_CHECK_SANLOCK LIBVIRT_CHECK_SASL LIBVIRT_CHECK_SELINUX -LIBVIRT_CHECK_SSH2 LIBVIRT_CHECK_UDEV LIBVIRT_CHECK_VIRTUALPORT LIBVIRT_CHECK_WIRESHARK @@ -439,7 +436,6 @@ LIBVIRT_RESULT_RBD LIBVIRT_RESULT_SANLOCK LIBVIRT_RESULT_SASL LIBVIRT_RESULT_SELINUX -LIBVIRT_RESULT_SSH2 LIBVIRT_RESULT_UDEV LIBVIRT_RESULT_VIRTUALPORT LIBVIRT_RESULT_XDR diff --git a/m4/virt-ssh2.m4 b/m4/virt-ssh2.m4 deleted file mode 100644 index f712f81fe2c..00000000000 --- a/m4/virt-ssh2.m4 +++ /dev/null @@ -1,30 +0,0 @@ -dnl The libssh2.so library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_SSH2],[ - LIBVIRT_ARG_WITH_FEATURE([SSH2], [libssh2], [check], [1.3]) -]) - -AC_DEFUN([LIBVIRT_CHECK_SSH2],[ - LIBVIRT_CHECK_PKG([SSH2], [libssh2], [1.3]) -]) - -AC_DEFUN([LIBVIRT_RESULT_SSH2],[ - LIBVIRT_RESULT_LIB([SSH2]) -]) diff --git a/meson.build b/meson.build index 2ab3aa87dea..6f37862611a 100644 --- a/meson.build +++ b/meson.build @@ -1132,6 +1132,16 @@ else libssh_dep = dependency('', required: false) endif +libssh2_version = '1.3' +if get_option('driver_remote').enabled() + libssh2_dep = dependency('libssh2', version: '>=' + libssh2_version, required: get_option('libssh2')) + if libssh2_dep.found() + conf.set('WITH_SSH2', 1) + endif +else + libssh2_dep = dependency('', required: false) +endif + use_macvtap = false if not get_option('macvtap').disabled() if (cc.has_header_symbol('linux/if_link.h', 'MACVLAN_MODE_BRIDGE') and @@ -1299,6 +1309,7 @@ libs_summary = { 'libnl': libnl_dep.found(), 'libpcap': libpcap_dep.found(), 'libssh': libssh_dep.found(), + 'libssh2': libssh2_dep.found(), 'macvtap': conf.has('WITH_MACVTAP'), 'readline': readline_dep.found(), } diff --git a/meson_options.txt b/meson_options.txt index 9588db5b835..a6e53ca36dc 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -26,5 +26,6 @@ option('hal', type: 'feature', value: 'auto', description: 'hal support') option('libiscsi', type: 'feature', value: 'auto', description: 'libiscsi support') option('libpcap', type: 'feature', value: 'auto', description: 'libpcap support') option('libssh', type: 'feature', value: 'auto', description: 'libssh support') +option('libssh2', type: 'feature', value: 'auto', description: 'libssh2 support') option('macvtap', type: 'feature', value: 'auto', description: 'enable macvtap device') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-libxml.m4 | 36 ------------------------------------ meson.build | 4 ++++ 3 files changed, 4 insertions(+), 39 deletions(-) delete mode 100644 m4/virt-libxml.m4 diff --git a/configure.ac b/configure.ac index c81db75ae33..6710900fa35 100644 --- a/configure.ac +++ b/configure.ac @@ -108,7 +108,6 @@ fi # Check for compiler and library settings. -LIBVIRT_ARG_LIBXML LIBVIRT_ARG_NETCF LIBVIRT_ARG_NLS LIBVIRT_ARG_NSS @@ -125,7 +124,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_LIBXML LIBVIRT_CHECK_NETCF LIBVIRT_CHECK_NLS LIBVIRT_CHECK_NUMACTL @@ -423,7 +421,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_LIBXL -LIBVIRT_RESULT_LIBXML LIBVIRT_RESULT_NETCF LIBVIRT_RESULT_NLS LIBVIRT_RESULT_NSS diff --git a/m4/virt-libxml.m4 b/m4/virt-libxml.m4 deleted file mode 100644 index cce54d88fb1..00000000000 --- a/m4/virt-libxml.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl The libxml-2.0 library -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_LIBXML], [ - LIBVIRT_ARG_WITH([LIBXML], [libxml-2.0 location], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_LIBXML], [ - LIBXML_REQUIRED="2.9.1" - - LIBVIRT_CHECK_PKG([LIBXML], [libxml-2.0], [$LIBXML_REQUIRED]) - - if test "$with_libxml" = "no" ; then - AC_MSG_ERROR([libxml2 >= $LIBXML_REQUIRED is required for libvirt]) - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_LIBXML], [ - LIBVIRT_RESULT_LIB([LIBXML]) -]) diff --git a/meson.build b/meson.build index 6f37862611a..55cf12a951c 100644 --- a/meson.build +++ b/meson.build @@ -1142,6 +1142,9 @@ else libssh2_dep = dependency('', required: false) endif +libxml_version = '2.9.1' +libxml_dep = dependency('libxml-2.0', version: '>=' + libxml_version) + use_macvtap = false if not get_option('macvtap').disabled() if (cc.has_header_symbol('linux/if_link.h', 'MACVLAN_MODE_BRIDGE') and @@ -1310,6 +1313,7 @@ libs_summary = { 'libpcap': libpcap_dep.found(), 'libssh': libssh_dep.found(), 'libssh2': libssh2_dep.found(), + 'libxml': libxml_dep.found(), 'macvtap': conf.has('WITH_MACVTAP'), 'readline': readline_dep.found(), } -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-netcf.m4 | 30 ------------------------------ meson.build | 7 +++++++ meson_options.txt | 1 + 4 files changed, 8 insertions(+), 33 deletions(-) delete mode 100644 m4/virt-netcf.m4 diff --git a/configure.ac b/configure.ac index 6710900fa35..798a30bbd3d 100644 --- a/configure.ac +++ b/configure.ac @@ -108,7 +108,6 @@ fi # Check for compiler and library settings. -LIBVIRT_ARG_NETCF LIBVIRT_ARG_NLS LIBVIRT_ARG_NSS LIBVIRT_ARG_NUMACTL @@ -124,7 +123,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_NETCF LIBVIRT_CHECK_NLS LIBVIRT_CHECK_NUMACTL LIBVIRT_CHECK_NWFILTER @@ -421,7 +419,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_LIBXL -LIBVIRT_RESULT_NETCF LIBVIRT_RESULT_NLS LIBVIRT_RESULT_NSS LIBVIRT_RESULT_NUMACTL diff --git a/m4/virt-netcf.m4 b/m4/virt-netcf.m4 deleted file mode 100644 index ada6b5a7a98..00000000000 --- a/m4/virt-netcf.m4 +++ /dev/null @@ -1,30 +0,0 @@ -dnl The libnetcf.so library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_NETCF],[ - LIBVIRT_ARG_WITH_FEATURE([NETCF], [netcf], [check], [0.1.8]) -]) - -AC_DEFUN([LIBVIRT_CHECK_NETCF],[ - LIBVIRT_CHECK_PKG([NETCF], [netcf], [0.1.8]) -]) - -AC_DEFUN([LIBVIRT_RESULT_NETCF],[ - LIBVIRT_RESULT_LIB([NETCF]) -]) diff --git a/meson.build b/meson.build index 55cf12a951c..025878a0df6 100644 --- a/meson.build +++ b/meson.build @@ -1164,6 +1164,12 @@ if use_macvtap endif endif +netcf_version = '0.1.8' +netcf_dep = dependency('netcf', version: '>=' + netcf_version, required: get_option('netcf')) +if netcf_dep.found() + conf.set('WITH_NETCF', 1) +endif + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) @@ -1315,6 +1321,7 @@ libs_summary = { 'libssh2': libssh2_dep.found(), 'libxml': libxml_dep.found(), 'macvtap': conf.has('WITH_MACVTAP'), + 'netcf': netcf_dep.found(), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index a6e53ca36dc..dc248ee0fe4 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -28,4 +28,5 @@ option('libpcap', type: 'feature', value: 'auto', description: 'libpcap support' option('libssh', type: 'feature', value: 'auto', description: 'libssh support') option('libssh2', type: 'feature', value: 'auto', description: 'libssh2 support') option('macvtap', type: 'feature', value: 'auto', description: 'enable macvtap device') +option('netcf', type: 'feature', value: 'auto', description: 'netcf support') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 --- m4/virt-nls.m4 | 72 ----------------------------------------------- meson.build | 39 +++++++++++++++++++++++++ meson_options.txt | 1 + 4 files changed, 40 insertions(+), 76 deletions(-) delete mode 100644 m4/virt-nls.m4 diff --git a/configure.ac b/configure.ac index 798a30bbd3d..87ba8d059f2 100644 --- a/configure.ac +++ b/configure.ac @@ -108,7 +108,6 @@ fi # Check for compiler and library settings. -LIBVIRT_ARG_NLS LIBVIRT_ARG_NSS LIBVIRT_ARG_NUMACTL LIBVIRT_ARG_OPENWSMAN @@ -123,7 +122,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_NLS LIBVIRT_CHECK_NUMACTL LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_OPENWSMAN @@ -141,7 +139,6 @@ LIBVIRT_CHECK_XDR LIBVIRT_CHECK_YAJL -AC_CHECK_LIB([intl],[gettext],[]) AC_CHECK_LIB([util],[openpty],[]) @@ -419,7 +416,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_LIBXL -LIBVIRT_RESULT_NLS LIBVIRT_RESULT_NSS LIBVIRT_RESULT_NUMACTL LIBVIRT_RESULT_OPENWSMAN diff --git a/m4/virt-nls.m4 b/m4/virt-nls.m4 deleted file mode 100644 index fd8707033af..00000000000 --- a/m4/virt-nls.m4 +++ /dev/null @@ -1,72 +0,0 @@ -dnl gettext utilities -dnl -dnl Copyright (C) 2018 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_NLS],[ - LIBVIRT_ARG_ENABLE([NLS], [NLS], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_NLS],[ - if test "x$enable_nls" != "xno" - then - AC_CHECK_FUNC([gettext], [], [ - AC_CHECK_LIB([intl], [gettext], [], [ - if test "x$enable_nls" = "xcheck" - then - enable_nls=no - else - AC_MSG_ERROR([gettext() is required to build libvirt]") - fi - ]) - ]) - fi - - if test "x$enable_nls" != "xno" - then - AC_CHECK_HEADERS([libintl.h], [enable_nls=yes],[ - if test "x$enable_nls" = "xcheck" - then - enable_nls=no - else - AC_MSG_ERROR([libintl.h is required to build libvirt]") - fi - ]) - fi - - dnl GNU gettext tools (optional). - AC_CHECK_PROG([XGETTEXT], [xgettext], [xgettext], [no]) - AC_CHECK_PROG([MSGFMT], [msgfmt], [msgfmt], [no]) - AC_CHECK_PROG([MSGMERGE], [msgmerge], [msgmerge], [no]) - - dnl Check they are the GNU gettext tools. - AC_MSG_CHECKING([msgfmt is GNU tool]) - if $MSGFMT --version >/dev/null 2>&1 && $MSGFMT --version | grep -q 'GNU gettext'; then - msgfmt_is_gnu=yes - else - msgfmt_is_gnu=no - fi - AC_MSG_RESULT([$msgfmt_is_gnu]) - AM_CONDITIONAL([ENABLE_NLS], [test "x$enable_nls" = "xyes"]) - AM_CONDITIONAL([HAVE_GNU_GETTEXT_TOOLS], - [test "x$XGETTEXT" != "xno" && test "x$MSGFMT" != "xno" && \ - test "x$MSGMERGE" != "xno" && test "x$msgfmt_is_gnu" != "xno"]) -]) - -AC_DEFUN([LIBVIRT_RESULT_NLS],[ - LIBVIRT_RESULT([NLS], [$enable_nls]) -]) diff --git a/meson.build b/meson.build index 025878a0df6..9a32159472e 100644 --- a/meson.build +++ b/meson.build @@ -1170,6 +1170,44 @@ if netcf_dep.found() conf.set('WITH_NETCF', 1) endif +have_gnu_gettext_tools = false +if not get_option('nls').disabled() + have_gettext = cc.has_function('gettext') + if not have_gettext + intl_lib = cc.find_library('intl', required: false) + have_gettext = intl_lib.found() + if have_gettext + add_project_link_arguments('-lintl', language: 'c') + endif + endif + if not have_gettext and get_option('nls').enabled() + error('gettext() is required to build libvirt') + endif + + if cc.has_header('libintl.h') + conf.set('HAVE_LIBINTL_H', 1) + elif get_option('nls').enabled() + error('libintl.h is required to build libvirt') + endif + + gettext_progs = [ + 'xgettext', + 'msgfmt', + 'msgmerge', + ] + foreach name : gettext_progs + prog = find_program(name, required: false) + set_variable('@0@_prog'.format(name), prog) + endforeach + + if xgettext_prog.found() and msgfmt_prog.found() and msgmerge_prog.found() + rc = run_command(msgfmt_prog, '--version') + if rc.returncode() == 0 and rc.stdout().contains('GNU gettext') + have_gnu_gettext_tools = true + endif + endif +endif + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) @@ -1322,6 +1360,7 @@ libs_summary = { 'libxml': libxml_dep.found(), 'macvtap': conf.has('WITH_MACVTAP'), 'netcf': netcf_dep.found(), + 'NLS': have_gnu_gettext_tools, 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index dc248ee0fe4..d906281900d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -29,4 +29,5 @@ option('libssh', type: 'feature', value: 'auto', description: 'libssh support') option('libssh2', type: 'feature', value: 'auto', description: 'libssh2 support') option('macvtap', type: 'feature', value: 'auto', description: 'enable macvtap device') option('netcf', type: 'feature', value: 'auto', description: 'netcf support') +option('nls', type: 'feature', value: 'auto', description: 'nls support') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-numactl.m4 | 34 ---------------------------------- meson.build | 10 ++++++++++ meson_options.txt | 1 + 4 files changed, 11 insertions(+), 37 deletions(-) delete mode 100644 m4/virt-numactl.m4 diff --git a/configure.ac b/configure.ac index 87ba8d059f2..2f3730581ef 100644 --- a/configure.ac +++ b/configure.ac @@ -109,7 +109,6 @@ fi # Check for compiler and library settings. LIBVIRT_ARG_NSS -LIBVIRT_ARG_NUMACTL LIBVIRT_ARG_OPENWSMAN LIBVIRT_ARG_PCIACCESS LIBVIRT_ARG_PM_UTILS @@ -122,7 +121,6 @@ LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL -LIBVIRT_CHECK_NUMACTL LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_OPENWSMAN LIBVIRT_CHECK_PCIACCESS @@ -417,7 +415,6 @@ AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_NSS -LIBVIRT_RESULT_NUMACTL LIBVIRT_RESULT_OPENWSMAN LIBVIRT_RESULT_PCIACCESS LIBVIRT_RESULT_PM_UTILS diff --git a/m4/virt-numactl.m4 b/m4/virt-numactl.m4 deleted file mode 100644 index f93ffd56dee..00000000000 --- a/m4/virt-numactl.m4 +++ /dev/null @@ -1,34 +0,0 @@ -dnl The libnuma.so library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_NUMACTL],[ - LIBVIRT_ARG_WITH_FEATURE([NUMACTL], [numa], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_NUMACTL],[ - LIBVIRT_CHECK_LIB([NUMACTL], [numa], [numa_available], [numa.h]) - AC_CHECK_LIB([numa], [numa_bitmask_isbitset], [have_numa_bitmask_isbitset=yes]) - if test "$have_numa_bitmask_isbitset" = "yes"; then - AC_DEFINE_UNQUOTED([HAVE_NUMA_BITMASK_ISBITSET], 1, [whether numa_bitmask_isbitset is available]) - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_NUMACTL],[ - LIBVIRT_RESULT_LIB([NUMACTL]) -]) diff --git a/meson.build b/meson.build index 9a32159472e..cda54c0e862 100644 --- a/meson.build +++ b/meson.build @@ -1208,6 +1208,15 @@ if not get_option('nls').disabled() endif endif +numactl_dep = cc.find_library('numa', required: get_option('numactl')) +if numactl_dep.found() + conf.set('WITH_NUMACTL', 1) + + if cc.has_function('numa_bitmask_isbitset', dependencies: [ numactl_dep ]) + conf.set('HAVE_NUMA_BITMASK_ISBITSET', 1) + endif +endif + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) @@ -1361,6 +1370,7 @@ libs_summary = { 'macvtap': conf.has('WITH_MACVTAP'), 'netcf': netcf_dep.found(), 'NLS': have_gnu_gettext_tools, + 'numaclt': numactl_dep.found(), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index d906281900d..a29ea23d21a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -30,4 +30,5 @@ option('libssh2', type: 'feature', value: 'auto', description: 'libssh2 support' option('macvtap', type: 'feature', value: 'auto', description: 'enable macvtap device') option('netcf', type: 'feature', value: 'auto', description: 'netcf support') option('nls', type: 'feature', value: 'auto', description: 'nls support') +option('numactl', type: 'feature', value: 'auto', description: 'numactl support') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-openwsman.m4 | 30 ------------------------------ meson.build | 4 ++++ meson_options.txt | 1 + 4 files changed, 5 insertions(+), 33 deletions(-) delete mode 100644 m4/virt-openwsman.m4 diff --git a/configure.ac b/configure.ac index 2f3730581ef..ce8d3b76657 100644 --- a/configure.ac +++ b/configure.ac @@ -109,7 +109,6 @@ fi # Check for compiler and library settings. LIBVIRT_ARG_NSS -LIBVIRT_ARG_OPENWSMAN LIBVIRT_ARG_PCIACCESS LIBVIRT_ARG_PM_UTILS LIBVIRT_ARG_POLKIT @@ -122,7 +121,6 @@ LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL LIBVIRT_CHECK_NWFILTER -LIBVIRT_CHECK_OPENWSMAN LIBVIRT_CHECK_PCIACCESS LIBVIRT_CHECK_PM_UTILS LIBVIRT_CHECK_POLKIT @@ -415,7 +413,6 @@ AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_NSS -LIBVIRT_RESULT_OPENWSMAN LIBVIRT_RESULT_PCIACCESS LIBVIRT_RESULT_PM_UTILS LIBVIRT_RESULT_POLKIT diff --git a/m4/virt-openwsman.m4 b/m4/virt-openwsman.m4 deleted file mode 100644 index c952ef89361..00000000000 --- a/m4/virt-openwsman.m4 +++ /dev/null @@ -1,30 +0,0 @@ -dnl The libopenwsman.so library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_OPENWSMAN],[ - LIBVIRT_ARG_WITH_FEATURE([OPENWSMAN], [openwsman], [check], [2.2.3]) -]) - -AC_DEFUN([LIBVIRT_CHECK_OPENWSMAN],[ - LIBVIRT_CHECK_PKG([OPENWSMAN], [openwsman], [2.2.3]) -]) - -AC_DEFUN([LIBVIRT_RESULT_OPENWSMAN],[ - LIBVIRT_RESULT_LIB([OPENWSMAN]) -]) diff --git a/meson.build b/meson.build index cda54c0e862..0fc7f3f4bb7 100644 --- a/meson.build +++ b/meson.build @@ -1217,6 +1217,9 @@ if numactl_dep.found() endif endif +openwsman_version = '2.2.3' +openwsman_dep = dependency('openwsman', version: '>=' + openwsman_version, required: get_option('openwsman')) + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) @@ -1371,6 +1374,7 @@ libs_summary = { 'netcf': netcf_dep.found(), 'NLS': have_gnu_gettext_tools, 'numaclt': numactl_dep.found(), + 'openwsman': openwsman_dep.found(), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index a29ea23d21a..05d5e44f420 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -31,4 +31,5 @@ option('macvtap', type: 'feature', value: 'auto', description: 'enable macvtap d option('netcf', type: 'feature', value: 'auto', description: 'netcf support') option('nls', type: 'feature', value: 'auto', description: 'nls support') option('numactl', type: 'feature', value: 'auto', description: 'numactl support') +option('openwsman', type: 'feature', value: 'auto', description: 'openwsman support') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-driver-vz.m4 | 4 ---- meson.build | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/m4/virt-driver-vz.m4 b/m4/virt-driver-vz.m4 index 9a8bc42efa1..11045e8b393 100644 --- a/m4/virt-driver-vz.m4 +++ b/m4/virt-driver-vz.m4 @@ -22,12 +22,8 @@ AC_DEFUN([LIBVIRT_DRIVER_ARG_VZ],[ ]) AC_DEFUN([LIBVIRT_DRIVER_CHECK_VZ],[ - PARALLELS_SDK_REQUIRED="7.0.22" - if test "$with_vz" = "yes" || test "$with_vz" = "check"; then - PKG_CHECK_MODULES([PARALLELS_SDK], [parallels-sdk >= $PARALLELS_SDK_REQUIRED], - [PARALLELS_SDK_FOUND=yes], [PARALLELS_SDK_FOUND=no]) if test "$with_vz" = "yes" && test "$PARALLELS_SDK_FOUND" = "no"; then AC_MSG_ERROR([Parallels Virtualization SDK is needed to build the Virtuozzo driver.]) diff --git a/meson.build b/meson.build index 0fc7f3f4bb7..a9ebcd18842 100644 --- a/meson.build +++ b/meson.build @@ -1220,6 +1220,9 @@ endif openwsman_version = '2.2.3' openwsman_dep = dependency('openwsman', version: '>=' + openwsman_version, required: get_option('openwsman')) +parallels_sdk_version = '7.0.22' +parallels_sdk_dep = dependency('parallels-sdk', version: '>=' + parallels_sdk_version, required: false) + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-pciaccess.m4 | 30 ------------------------------ meson.build | 4 ++++ meson_options.txt | 1 + 4 files changed, 5 insertions(+), 33 deletions(-) delete mode 100644 m4/virt-pciaccess.m4 diff --git a/configure.ac b/configure.ac index ce8d3b76657..49e6cb6e84e 100644 --- a/configure.ac +++ b/configure.ac @@ -109,7 +109,6 @@ fi # Check for compiler and library settings. LIBVIRT_ARG_NSS -LIBVIRT_ARG_PCIACCESS LIBVIRT_ARG_PM_UTILS LIBVIRT_ARG_POLKIT LIBVIRT_ARG_SANLOCK @@ -121,7 +120,6 @@ LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL LIBVIRT_CHECK_NWFILTER -LIBVIRT_CHECK_PCIACCESS LIBVIRT_CHECK_PM_UTILS LIBVIRT_CHECK_POLKIT LIBVIRT_CHECK_PTHREAD @@ -413,7 +411,6 @@ AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_NSS -LIBVIRT_RESULT_PCIACCESS LIBVIRT_RESULT_PM_UTILS LIBVIRT_RESULT_POLKIT LIBVIRT_RESULT_RBD diff --git a/m4/virt-pciaccess.m4 b/m4/virt-pciaccess.m4 deleted file mode 100644 index da92647d467..00000000000 --- a/m4/virt-pciaccess.m4 +++ /dev/null @@ -1,30 +0,0 @@ -dnl The libpciaccess.so library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_PCIACCESS],[ - LIBVIRT_ARG_WITH_FEATURE([PCIACCESS], [pciaccess], [check], [0.10.0]) -]) - -AC_DEFUN([LIBVIRT_CHECK_PCIACCESS],[ - LIBVIRT_CHECK_PKG([PCIACCESS], [pciaccess], [0.10.0]) -]) - -AC_DEFUN([LIBVIRT_RESULT_PCIACCESS],[ - LIBVIRT_RESULT_LIB([PCIACCESS]) -]) diff --git a/meson.build b/meson.build index a9ebcd18842..17116af59da 100644 --- a/meson.build +++ b/meson.build @@ -1223,6 +1223,9 @@ openwsman_dep = dependency('openwsman', version: '>=' + openwsman_version, requi parallels_sdk_version = '7.0.22' parallels_sdk_dep = dependency('parallels-sdk', version: '>=' + parallels_sdk_version, required: false) +pciaccess_version = '0.10.0' +pciaccess_dep = dependency('pciaccess', version: '>=' + pciaccess_version, required: get_option('pciaccess')) + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) @@ -1378,6 +1381,7 @@ libs_summary = { 'NLS': have_gnu_gettext_tools, 'numaclt': numactl_dep.found(), 'openwsman': openwsman_dep.found(), + 'pciaccess': pciaccess_dep.found(), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 05d5e44f420..991245e0841 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -32,4 +32,5 @@ option('netcf', type: 'feature', value: 'auto', description: 'netcf support') option('nls', type: 'feature', value: 'auto', description: 'nls support') option('numactl', type: 'feature', value: 'auto', description: 'numactl support') option('openwsman', type: 'feature', value: 'auto', description: 'openwsman support') +option('pciaccess', type: 'feature', value: 'auto', description: 'pciaccess support') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-polkit.m4 | 62 ----------------------------------------------- meson.build | 13 ++++++++++ meson_options.txt | 1 + 4 files changed, 14 insertions(+), 65 deletions(-) delete mode 100644 m4/virt-polkit.m4 diff --git a/configure.ac b/configure.ac index 49e6cb6e84e..359bfe4fa54 100644 --- a/configure.ac +++ b/configure.ac @@ -110,7 +110,6 @@ fi LIBVIRT_ARG_NSS LIBVIRT_ARG_PM_UTILS -LIBVIRT_ARG_POLKIT LIBVIRT_ARG_SANLOCK LIBVIRT_ARG_SASL LIBVIRT_ARG_SELINUX @@ -121,7 +120,6 @@ LIBVIRT_ARG_YAJL LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_PM_UTILS -LIBVIRT_CHECK_POLKIT LIBVIRT_CHECK_PTHREAD LIBVIRT_CHECK_SANLOCK LIBVIRT_CHECK_SASL @@ -412,7 +410,6 @@ AC_MSG_NOTICE([]) LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_NSS LIBVIRT_RESULT_PM_UTILS -LIBVIRT_RESULT_POLKIT LIBVIRT_RESULT_RBD LIBVIRT_RESULT_SANLOCK LIBVIRT_RESULT_SASL diff --git a/m4/virt-polkit.m4 b/m4/virt-polkit.m4 deleted file mode 100644 index 06da9e4ba6f..00000000000 --- a/m4/virt-polkit.m4 +++ /dev/null @@ -1,62 +0,0 @@ -dnl The polkit library -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_POLKIT], [ - LIBVIRT_ARG_WITH([POLKIT], [use PolicyKit for UNIX socket access checks], - [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_POLKIT], [ - AC_REQUIRE([LIBVIRT_CHECK_DBUS]) - - if test "x$with_win" = "xyes"; then - with_polkit=no - fi - - if test "x$with_polkit" = "xcheck"; then - dnl For --with-polkit=check, also require the pkcheck binary, even - dnl though we talk to polkit directly over D-Bus. - AC_PATH_PROG([PKCHECK_PATH], [pkcheck], [], [$LIBVIRT_SBIN_PATH]) - if test "x$PKCHECK_PATH" = "x" ; then - with_polkit="no" - fi - fi - - if test "x$with_polkit" = "xyes" || test "x$with_polkit" = "xcheck"; then - dnl For --with-polkit=yes, all we need is D-Bus. - if test "x$with_dbus" = "xyes" ; then - AC_DEFINE_UNQUOTED([WITH_POLKIT], 1, - [use PolicyKit for UNIX socket access checks]) - with_polkit="yes" - else - if test "x$with_polkit" = "xcheck" ; then - with_polkit=no - else - AC_MSG_ERROR( - [You must install dbus to compile libvirt with polkit-1]) - fi - fi - fi - - AM_CONDITIONAL([WITH_POLKIT], [test "x$with_polkit" = "xyes"]) -]) - -AC_DEFUN([LIBVIRT_RESULT_POLKIT], [ - LIBVIRT_RESULT([polkit], [$with_polkit]) -]) diff --git a/meson.build b/meson.build index 17116af59da..e6dc0aa8717 100644 --- a/meson.build +++ b/meson.build @@ -1226,6 +1226,12 @@ parallels_sdk_dep = dependency('parallels-sdk', version: '>=' + parallels_sdk_ve pciaccess_version = '0.10.0' pciaccess_dep = dependency('pciaccess', version: '>=' + pciaccess_version, required: get_option('pciaccess')) +if not get_option('polkit').disabled() and host_machine.system() != 'windows' + pkcheck_prog = find_program('pkcheck', required: false, dirs: libvirt_sbin_path) +else + pkcheck_prog = dependency('', required: false) +endif + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) @@ -1333,6 +1339,12 @@ if conf.has('WITH_MACVTAP') and not conf.has('HAVE_LIBNL') error('libnl3-devel is required for macvtap support') endif +if (pkcheck_prog.found() or get_option('polkit').enabled()) and dbus_dep.found() + conf.set('WITH_POLKIT', 1) +elif get_option('polkit').enabled() + error('You must install dbus to compile libvirt with polkit-1') +endif + # define top include directory @@ -1382,6 +1394,7 @@ libs_summary = { 'numaclt': numactl_dep.found(), 'openwsman': openwsman_dep.found(), 'pciaccess': pciaccess_dep.found(), + 'polkit': conf.has('WITH_POLKIT'), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 991245e0841..3dfe4ca0166 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -33,4 +33,5 @@ option('nls', type: 'feature', value: 'auto', description: 'nls support') option('numactl', type: 'feature', value: 'auto', description: 'numactl support') option('openwsman', type: 'feature', value: 'auto', description: 'openwsman support') option('pciaccess', type: 'feature', value: 'auto', description: 'pciaccess support') +option('polkit', type: 'feature', value: 'auto', description: 'use PolicyKit for UNIX socket access checks') option('readline', type: 'feature', value: 'auto', description: 'readline support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-storage-rbd.m4 | 12 ------------ meson.build | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/m4/virt-storage-rbd.m4 b/m4/virt-storage-rbd.m4 index f3d9d049084..cd3b24ea2fa 100644 --- a/m4/virt-storage-rbd.m4 +++ b/m4/virt-storage-rbd.m4 @@ -25,18 +25,6 @@ AC_DEFUN([LIBVIRT_STORAGE_ARG_RBD], [ AC_DEFUN([LIBVIRT_STORAGE_CHECK_RBD], [ LIBRBD_LIBS= if test "$with_storage_rbd" = "yes" || test "$with_storage_rbd" = "check"; then - AC_CHECK_HEADER([rbd/librbd.h], [LIBRBD_FOUND=yes; break;]) - - if test "$LIBRBD_FOUND" = "yes"; then - LIBRBD_LIBS="-lrbd -lrados" - - old_LIBS="$LIBS" - LIBS="$LIBS $LIBRBD_LIBS" - AC_CHECK_FUNCS([rbd_get_features],[],[LIBRBD_FOUND=no]) - AC_CHECK_FUNCS([rbd_list2]) - LIBS="$old_LIBS" - fi - if test "$LIBRBD_FOUND" = "yes"; then with_storage_rbd=yes AC_DEFINE_UNQUOTED([WITH_STORAGE_RBD], [1], diff --git a/meson.build b/meson.build index e6dc0aa8717..d272b5cca05 100644 --- a/meson.build +++ b/meson.build @@ -1232,6 +1232,21 @@ else pkcheck_prog = dependency('', required: false) endif +rbd_dep = cc.find_library('rbd', required: false) +rados_dep = cc.find_library('rados', required: false) +if rbd_dep.found() and not cc.has_function('rbd_get_features', dependencies: rbd_dep) + rbd_dep = dependency('', required: false) +endif +if rbd_dep.found() and rados_dep.found() + if cc.has_function('rbd_list2', dependencies: rbd_dep) + conf.set('HAVE_RBD_LIST2', 1) + endif + + rbd_dep = declare_dependency(dependencies: [ rbd_dep, rados_dep ]) +else + rbd_dep = dependency('', required: false) +endif + # readline 7.0 is the first version which includes pkg-config support readline_version = '7.0' readline_dep = dependency('readline', version: '>=' + readline_version, required: false) @@ -1395,6 +1410,7 @@ libs_summary = { 'openwsman': openwsman_dep.found(), 'pciaccess': pciaccess_dep.found(), 'polkit': conf.has('WITH_POLKIT'), + 'rbd': rbd_dep.found(), 'readline': readline_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-sanlock.m4 | 47 ---------------------------------------------- meson.build | 13 +++++++++++++ meson_options.txt | 1 + 4 files changed, 14 insertions(+), 50 deletions(-) delete mode 100644 m4/virt-sanlock.m4 diff --git a/configure.ac b/configure.ac index 359bfe4fa54..97b0f6c4bb8 100644 --- a/configure.ac +++ b/configure.ac @@ -110,7 +110,6 @@ fi LIBVIRT_ARG_NSS LIBVIRT_ARG_PM_UTILS -LIBVIRT_ARG_SANLOCK LIBVIRT_ARG_SASL LIBVIRT_ARG_SELINUX LIBVIRT_ARG_UDEV @@ -121,7 +120,6 @@ LIBVIRT_ARG_YAJL LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_PM_UTILS LIBVIRT_CHECK_PTHREAD -LIBVIRT_CHECK_SANLOCK LIBVIRT_CHECK_SASL LIBVIRT_CHECK_SELINUX LIBVIRT_CHECK_UDEV @@ -411,7 +409,6 @@ LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_NSS LIBVIRT_RESULT_PM_UTILS LIBVIRT_RESULT_RBD -LIBVIRT_RESULT_SANLOCK LIBVIRT_RESULT_SASL LIBVIRT_RESULT_SELINUX LIBVIRT_RESULT_UDEV diff --git a/m4/virt-sanlock.m4 b/m4/virt-sanlock.m4 deleted file mode 100644 index eb05ab6934b..00000000000 --- a/m4/virt-sanlock.m4 +++ /dev/null @@ -1,47 +0,0 @@ -dnl The libsanlock_client.so library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_SANLOCK],[ - LIBVIRT_ARG_WITH_FEATURE([SANLOCK], [sanlock-client], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_SANLOCK],[ - LIBVIRT_CHECK_PKG([SANLOCK], [libsanlock_client], [3.2.4]) - - if test "x$with_sanlock" = "xyes" ; then - old_cppflags="$CPPFLAGS" - old_libs="$LIBS" - CPPFLAGS="$CPPFLAGS $SANLOCK_CFLAGS" - LIBS="$LIBS $SANLOCK_LIBS" - - AC_CHECK_LIB([sanlock_client], [sanlock_strerror], - [sanlock_strerror=yes], [sanlock_strerror=no]) - if test "x$sanlock_strerror" = "xyes" ; then - AC_DEFINE_UNQUOTED([HAVE_SANLOCK_STRERROR], 1, - [whether sanlock supports sanlock_strerror]) - fi - - CPPFLAGS="$old_cppflags" - LIBS="$old_libs" - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_SANLOCK],[ - LIBVIRT_RESULT_LIB([SANLOCK]) -]) diff --git a/meson.build b/meson.build index d272b5cca05..1bdca816379 100644 --- a/meson.build +++ b/meson.build @@ -1310,6 +1310,18 @@ if readline_dep.found() conf.set('WITH_READLINE', 1) endif +if not get_option('sanlock').disabled() + sanlock_dep = dependency('libsanlock_client', required: false) + + if sanlock_dep.found() + conf.set('WITH_SANLOCK', 1) + # check for sanlock_strerror introduced in sanlock-3.5.0 + if cc.has_function('sanlock_strerror', dependencies: sanlock_dep) + conf.set('HAVE_SANLOCK_STRERROR', 1) + endif + endif +endif + # generic build dependencies checks @@ -1412,6 +1424,7 @@ libs_summary = { 'polkit': conf.has('WITH_POLKIT'), 'rbd': rbd_dep.found(), 'readline': readline_dep.found(), + 'sanlock': conf.has('WITH_SANLOCK'), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 3dfe4ca0166..964fe5e8aea 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -35,3 +35,4 @@ option('openwsman', type: 'feature', value: 'auto', description: 'openwsman supp option('pciaccess', type: 'feature', value: 'auto', description: 'pciaccess support') option('polkit', type: 'feature', value: 'auto', description: 'use PolicyKit for UNIX socket access checks') option('readline', type: 'feature', value: 'auto', description: 'readline support') +option('sanlock', type: 'feature', value: 'auto', description: 'sanlock support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 ---- m4/virt-sasl.m4 | 30 ------------------------------ meson.build | 11 +++++++++++ meson_options.txt | 1 + 4 files changed, 12 insertions(+), 34 deletions(-) delete mode 100644 m4/virt-sasl.m4 diff --git a/configure.ac b/configure.ac index 97b0f6c4bb8..c8d7bbf7a92 100644 --- a/configure.ac +++ b/configure.ac @@ -96,7 +96,6 @@ fi # RPC, we don't need several libraries. if test "$with_remote" = "no" ; then with_libvirtd=no - with_sasl=no fi # Stateful drivers are useful only when building the daemon. if test "$with_libvirtd" = "no" ; then @@ -110,7 +109,6 @@ fi LIBVIRT_ARG_NSS LIBVIRT_ARG_PM_UTILS -LIBVIRT_ARG_SASL LIBVIRT_ARG_SELINUX LIBVIRT_ARG_UDEV LIBVIRT_ARG_VIRTUALPORT @@ -120,7 +118,6 @@ LIBVIRT_ARG_YAJL LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_PM_UTILS LIBVIRT_CHECK_PTHREAD -LIBVIRT_CHECK_SASL LIBVIRT_CHECK_SELINUX LIBVIRT_CHECK_UDEV LIBVIRT_CHECK_VIRTUALPORT @@ -409,7 +406,6 @@ LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_NSS LIBVIRT_RESULT_PM_UTILS LIBVIRT_RESULT_RBD -LIBVIRT_RESULT_SASL LIBVIRT_RESULT_SELINUX LIBVIRT_RESULT_UDEV LIBVIRT_RESULT_VIRTUALPORT diff --git a/m4/virt-sasl.m4 b/m4/virt-sasl.m4 deleted file mode 100644 index 674e1693502..00000000000 --- a/m4/virt-sasl.m4 +++ /dev/null @@ -1,30 +0,0 @@ -dnl The libsasl2.so or libsasl.so library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_SASL],[ - LIBVIRT_ARG_WITH_FEATURE([SASL], [sasl], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_SASL],[ - LIBVIRT_CHECK_PKG([SASL], [libsasl2], [2.1.26]) -]) - -AC_DEFUN([LIBVIRT_RESULT_SASL],[ - LIBVIRT_RESULT_LIB([SASL]) -]) diff --git a/meson.build b/meson.build index 1bdca816379..d7f3fa7a198 100644 --- a/meson.build +++ b/meson.build @@ -1322,6 +1322,16 @@ if not get_option('sanlock').disabled() endif endif +sasl_version = '2.1.26' +if get_option('driver_remote').enabled() + sasl_dep = dependency('libsasl2', version: '>=' + sasl_version, required: get_option('sasl')) + if sasl_dep.found() + conf.set('WITH_SASL', 1) + endif +else + sasl_dep = dependency('', required: false) +endif + # generic build dependencies checks @@ -1425,6 +1435,7 @@ libs_summary = { 'rbd': rbd_dep.found(), 'readline': readline_dep.found(), 'sanlock': conf.has('WITH_SANLOCK'), + 'sasl': sasl_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 964fe5e8aea..a674876713c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -36,3 +36,4 @@ option('pciaccess', type: 'feature', value: 'auto', description: 'pciaccess supp option('polkit', type: 'feature', value: 'auto', description: 'use PolicyKit for UNIX socket access checks') option('readline', type: 'feature', value: 'auto', description: 'readline support') option('sanlock', type: 'feature', value: 'auto', description: 'sanlock support') +option('sasl', type: 'feature', value: 'auto', description: 'sasl supprt') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-selinux.m4 | 47 ---------------------------------------------- meson.build | 15 +++++++++++++++ meson_options.txt | 2 ++ 4 files changed, 17 insertions(+), 50 deletions(-) delete mode 100644 m4/virt-selinux.m4 diff --git a/configure.ac b/configure.ac index c8d7bbf7a92..0a51a07be0e 100644 --- a/configure.ac +++ b/configure.ac @@ -109,7 +109,6 @@ fi LIBVIRT_ARG_NSS LIBVIRT_ARG_PM_UTILS -LIBVIRT_ARG_SELINUX LIBVIRT_ARG_UDEV LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK @@ -118,7 +117,6 @@ LIBVIRT_ARG_YAJL LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_PM_UTILS LIBVIRT_CHECK_PTHREAD -LIBVIRT_CHECK_SELINUX LIBVIRT_CHECK_UDEV LIBVIRT_CHECK_VIRTUALPORT LIBVIRT_CHECK_WIRESHARK @@ -406,7 +404,6 @@ LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_NSS LIBVIRT_RESULT_PM_UTILS LIBVIRT_RESULT_RBD -LIBVIRT_RESULT_SELINUX LIBVIRT_RESULT_UDEV LIBVIRT_RESULT_VIRTUALPORT LIBVIRT_RESULT_XDR diff --git a/m4/virt-selinux.m4 b/m4/virt-selinux.m4 deleted file mode 100644 index fb541e207ed..00000000000 --- a/m4/virt-selinux.m4 +++ /dev/null @@ -1,47 +0,0 @@ -dnl The libselinux.so library -dnl -dnl Copyright (C) 2012-2014, 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_SELINUX],[ - LIBVIRT_ARG_WITH_FEATURE([SELINUX], [SELinux], [check]) - LIBVIRT_ARG_WITH([SELINUX_MOUNT], [set SELinux mount point], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_SELINUX],[ - LIBVIRT_CHECK_LIB([SELINUX], [selinux], - [fgetfilecon_raw], [selinux/selinux.h]) - - if test "$with_selinux" = "yes"; then - AC_MSG_CHECKING([SELinux mount point]) - if test "$with_selinux_mount" = "check" || test -z "$with_selinux_mount"; then - if test -d /sys/fs/selinux ; then - SELINUX_MOUNT=/sys/fs/selinux - else - SELINUX_MOUNT=/selinux - fi - else - SELINUX_MOUNT=$with_selinux_mount - fi - AC_MSG_RESULT([$SELINUX_MOUNT]) - AC_DEFINE_UNQUOTED([SELINUX_MOUNT], ["$SELINUX_MOUNT"], [SELinux mount point]) - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_SELINUX],[ - LIBVIRT_RESULT_LIB([SELINUX]) -]) diff --git a/meson.build b/meson.build index d7f3fa7a198..fa4dbee3ef3 100644 --- a/meson.build +++ b/meson.build @@ -1332,6 +1332,20 @@ else sasl_dep = dependency('', required: false) endif +selinux_dep = cc.find_library('selinux', required: get_option('selinux')) +if selinux_dep.found() + selinux_mount = get_option('selinux_mount') + if selinux_mount == '' + if run_command('test', '-d', '/sys/fs/selinux').returncode() == 0 + selinux_mount = '/sys/fs/selinux' + else + selinux_mount = '/selinux' + endif + endif + conf.set_quoted('SELINUX_MOUNT', selinux_mount) + conf.set('WITH_SELINUX', 1) +endif + # generic build dependencies checks @@ -1436,6 +1450,7 @@ libs_summary = { 'readline': readline_dep.found(), 'sanlock': conf.has('WITH_SANLOCK'), 'sasl': sasl_dep.found(), + 'selinux': selinux_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index a674876713c..40830f9494a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -37,3 +37,5 @@ option('polkit', type: 'feature', value: 'auto', description: 'use PolicyKit for option('readline', type: 'feature', value: 'auto', description: 'readline support') option('sanlock', type: 'feature', value: 'auto', description: 'sanlock support') option('sasl', type: 'feature', value: 'auto', description: 'sasl supprt') +option('selinux', type: 'feature', value: 'auto', description: 'selinux support') +option('selinux_mount', type: 'string', value: '', description: 'set SELinux mount point') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 1 - m4/virt-pthread.m4 | 58 ---------------------------------------------- meson.build | 18 ++++++++++++++ 3 files changed, 18 insertions(+), 59 deletions(-) delete mode 100644 m4/virt-pthread.m4 diff --git a/configure.ac b/configure.ac index 0a51a07be0e..60cde7c3da7 100644 --- a/configure.ac +++ b/configure.ac @@ -116,7 +116,6 @@ LIBVIRT_ARG_YAJL LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_PM_UTILS -LIBVIRT_CHECK_PTHREAD LIBVIRT_CHECK_UDEV LIBVIRT_CHECK_VIRTUALPORT LIBVIRT_CHECK_WIRESHARK diff --git a/m4/virt-pthread.m4 b/m4/virt-pthread.m4 deleted file mode 100644 index 0b52b40bb82..00000000000 --- a/m4/virt-pthread.m4 +++ /dev/null @@ -1,58 +0,0 @@ -dnl The libpthread.so library -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_CHECK_PTHREAD], [ - dnl Availability of pthread functions - - AC_SEARCH_LIBS([pthread_mutexattr_init],[pthread ""]) - - if test "$ac_cv_func_pthread_mutexattr_init" = "no" - then - AC_MSG_ERROR([libpthread is required for building libvirt]) - fi - THREAD_LIBS="" - if test "x$ac_cv_func_pthread_mutexattr_init" != "x" - then - THREAD_LIBS="-l$ac_cv_func_pthread_mutexattr_init" - fi - AC_SUBST([THREAD_LIBS]) - - AC_CHECK_HEADER([pthread.h],,[ - AC_MSG_ERROR([pthread.h is required for building libvirt]) - ]) - - dnl At least mingw64-winpthreads #defines pthread_sigmask to 0, - dnl which in turn causes compilation to complain about unused variables. - dnl Expose this broken implementation, so we can work around it. - AC_CACHE_CHECK([whether pthread_sigmask does anything], - [lv_cv_pthread_sigmask_works], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include <sys/types.h> - #include <signal.h> - ]], [[ - #ifdef pthread_sigmask - int (*foo)(int, const sigset_t *, sigset_t *) = &pthread_sigmask; - return !foo; - #endif - ]])], [lv_cv_pthread_sigmask_works=yes], [lv_cv_pthread_sigmask_works=no])]) - if test "x$lv_cv_pthread_sigmask_works" != xyes; then - AC_DEFINE([FUNC_PTHREAD_SIGMASK_BROKEN], [1], - [Define to 1 if pthread_sigmask is not a real function]) - fi -]) diff --git a/meson.build b/meson.build index fa4dbee3ef3..41c6075985d 100644 --- a/meson.build +++ b/meson.build @@ -1346,6 +1346,24 @@ if selinux_dep.found() conf.set('WITH_SELINUX', 1) endif +thread_dep = dependency('threads', required: true) +pthread_sigmask_code = ''' + #include <sys/types.h> + #include <signal.h> + + int main() { + #ifdef pthread_sigmask + int (*foo)(int, const sigset_t *, sigset_t *) = &pthread_sigmask; + return !foo; + #endif + + return 0; + } +''' +if not cc.compiles(pthread_sigmask_code) + conf.set('FUNC_PTHREAD_SIGMASK_BROKEN', 1) +endif + # generic build dependencies checks -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-udev.m4 | 36 ------------------------------------ meson.build | 11 +++++++++++ meson_options.txt | 1 + 4 files changed, 12 insertions(+), 39 deletions(-) delete mode 100644 m4/virt-udev.m4 diff --git a/configure.ac b/configure.ac index 60cde7c3da7..da4873ea6fd 100644 --- a/configure.ac +++ b/configure.ac @@ -109,14 +109,12 @@ fi LIBVIRT_ARG_NSS LIBVIRT_ARG_PM_UTILS -LIBVIRT_ARG_UDEV LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_PM_UTILS -LIBVIRT_CHECK_UDEV LIBVIRT_CHECK_VIRTUALPORT LIBVIRT_CHECK_WIRESHARK LIBVIRT_CHECK_XDR @@ -403,7 +401,6 @@ LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_NSS LIBVIRT_RESULT_PM_UTILS LIBVIRT_RESULT_RBD -LIBVIRT_RESULT_UDEV LIBVIRT_RESULT_VIRTUALPORT LIBVIRT_RESULT_XDR LIBVIRT_RESULT_YAJL diff --git a/m4/virt-udev.m4 b/m4/virt-udev.m4 deleted file mode 100644 index 2e0f993e339..00000000000 --- a/m4/virt-udev.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl The libudev.so library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_UDEV],[ - LIBVIRT_ARG_WITH_FEATURE([UDEV], [libudev], [check], [219]) -]) - -AC_DEFUN([LIBVIRT_CHECK_UDEV],[ - AC_REQUIRE([LIBVIRT_CHECK_PCIACCESS]) - LIBVIRT_CHECK_PKG([UDEV], [libudev], [219]) - - if test "$with_udev" = "yes" && test "$with_pciaccess" != "yes" ; then - AC_MSG_ERROR([You must install the pciaccess module to build with udev]) - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_UDEV],[ - AC_REQUIRE([LIBVIRT_RESULT_PCIACCESS]) - LIBVIRT_RESULT_LIB([UDEV]) -]) diff --git a/meson.build b/meson.build index 41c6075985d..453522fd79a 100644 --- a/meson.build +++ b/meson.build @@ -1364,6 +1364,12 @@ if not cc.compiles(pthread_sigmask_code) conf.set('FUNC_PTHREAD_SIGMASK_BROKEN', 1) endif +udev_version = '219' +udev_dep = dependency('libudev', version: '>=' + udev_version, required: get_option('udev')) +if udev_dep.found() + conf.set('WITH_UDEV', 1) +endif + # generic build dependencies checks @@ -1414,6 +1420,10 @@ elif get_option('polkit').enabled() error('You must install dbus to compile libvirt with polkit-1') endif +if udev_dep.found() and not pciaccess_dep.found() + error('You must install the pciaccess module to build with udev') +endif + # define top include directory @@ -1469,6 +1479,7 @@ libs_summary = { 'sanlock': conf.has('WITH_SANLOCK'), 'sasl': sasl_dep.found(), 'selinux': selinux_dep.found(), + 'udev': udev_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 40830f9494a..42b63444ee4 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -39,3 +39,4 @@ option('sanlock', type: 'feature', value: 'auto', description: 'sanlock support' option('sasl', type: 'feature', value: 'auto', description: 'sasl supprt') option('selinux', type: 'feature', value: 'auto', description: 'selinux support') option('selinux_mount', type: 'string', value: '', description: 'set SELinux mount point') +option('udev', type: 'feature', value: 'auto', description: 'udev support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 2 -- meson.build | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index da4873ea6fd..4d437a54021 100644 --- a/configure.ac +++ b/configure.ac @@ -121,8 +121,6 @@ LIBVIRT_CHECK_XDR LIBVIRT_CHECK_YAJL -AC_CHECK_LIB([util],[openpty],[]) - dnl dnl Virtualization drivers check diff --git a/meson.build b/meson.build index 453522fd79a..fa1236e87b8 100644 --- a/meson.build +++ b/meson.build @@ -1370,6 +1370,11 @@ if udev_dep.found() conf.set('WITH_UDEV', 1) endif +util_dep = cc.find_library('util', required: false) +if util_dep.found() + add_project_link_arguments('-lutil', language: 'c') +endif + # generic build dependencies checks -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 -- m4/virt-virtualport.m4 | 65 ------------------------------------------ meson.build | 13 +++++++++ meson_options.txt | 1 + 4 files changed, 14 insertions(+), 68 deletions(-) delete mode 100644 m4/virt-virtualport.m4 diff --git a/configure.ac b/configure.ac index 4d437a54021..86e4b63ddf7 100644 --- a/configure.ac +++ b/configure.ac @@ -109,13 +109,11 @@ fi LIBVIRT_ARG_NSS LIBVIRT_ARG_PM_UTILS -LIBVIRT_ARG_VIRTUALPORT LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_PM_UTILS -LIBVIRT_CHECK_VIRTUALPORT LIBVIRT_CHECK_WIRESHARK LIBVIRT_CHECK_XDR LIBVIRT_CHECK_YAJL @@ -399,7 +397,6 @@ LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_NSS LIBVIRT_RESULT_PM_UTILS LIBVIRT_RESULT_RBD -LIBVIRT_RESULT_VIRTUALPORT LIBVIRT_RESULT_XDR LIBVIRT_RESULT_YAJL AC_MSG_NOTICE([]) diff --git a/m4/virt-virtualport.m4 b/m4/virt-virtualport.m4 deleted file mode 100644 index b758efc3c4a..00000000000 --- a/m4/virt-virtualport.m4 +++ /dev/null @@ -1,65 +0,0 @@ -dnl The virtualport support check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_VIRTUALPORT], [ - LIBVIRT_ARG_WITH([VIRTUALPORT], [enable virtual port support], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_VIRTUALPORT],[ - AC_REQUIRE([LIBVIRT_CHECK_MACVTAP]) - - dnl Warn the user and error out if they requested virtualport support - dnl with configure options, but the required macvtap support isn't available - - if test "$with_virtualport" = "yes"; then - if test "$with_macvtap" = "no"; then - AC_MSG_ERROR([--with-virtualport requires --with-macvtap]) - fi - fi - - dnl virtualport checks - - if test "$with_macvtap" != "yes"; then - with_virtualport=no - fi - if test "$with_virtualport" != "no"; then - AC_MSG_CHECKING([whether to compile with virtual port support]) - AC_TRY_COMPILE([ #include <sys/socket.h> - #include <linux/rtnetlink.h> ], - [ int x = IFLA_PORT_MAX; ], - [ with_virtualport=yes ], - [ if test "$with_virtualport" = "yes" ; then - AC_MSG_ERROR([Installed linux headers don't show support for virtual port support.]) - fi - with_virtualport=no ]) - if test "$with_virtualport" = "yes"; then - val=1 - else - val=0 - fi - AC_DEFINE_UNQUOTED([WITH_VIRTUALPORT], $val, - [whether vsi vepa support is enabled]) - AC_MSG_RESULT([$with_virtualport]) - fi - AM_CONDITIONAL([WITH_VIRTUALPORT], [test "$with_virtualport" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_RESULT_VIRTUALPORT],[ - LIBVIRT_RESULT_LIB([VIRTUALPORT]) -]) diff --git a/meson.build b/meson.build index fa1236e87b8..f5cc0e1d41f 100644 --- a/meson.build +++ b/meson.build @@ -1375,6 +1375,14 @@ if util_dep.found() add_project_link_arguments('-lutil', language: 'c') endif +if not get_option('virtualport').disabled() + if cc.has_header_symbol('linux/if_link.h', 'IFLA_PORT_MAX') + conf.set('WITH_VIRTUALPORT', 1) + elif get_option('virtualport').enabled() + error('Installed linux headers don\'t show support for virtual port support.') + endif +endif + # generic build dependencies checks @@ -1429,6 +1437,10 @@ if udev_dep.found() and not pciaccess_dep.found() error('You must install the pciaccess module to build with udev') endif +if conf.has('WITH_VIRTUALPORT') and not conf.has('WITH_MACVTAP') + error('macvtap is required for virtualport support') +endif + # define top include directory @@ -1485,6 +1497,7 @@ libs_summary = { 'sasl': sasl_dep.found(), 'selinux': selinux_dep.found(), 'udev': udev_dep.found(), + 'virtualport': conf.has('WITH_VIRTUALPORT'), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 42b63444ee4..025cc663027 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -40,3 +40,4 @@ option('sasl', type: 'feature', value: 'auto', description: 'sasl supprt') option('selinux', type: 'feature', value: 'auto', description: 'selinux support') option('selinux_mount', type: 'string', value: '', description: 'set SELinux mount point') option('udev', type: 'feature', value: 'auto', description: 'udev support') +option('virtualport', type: 'feature', value: 'auto', description: 'enable virtual port support') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-win-common.m4 | 42 ------------------------------------------ m4/virt-win-mingw.m4 | 28 ---------------------------- meson.build | 26 ++++++++++++++++++++++++++ 4 files changed, 26 insertions(+), 73 deletions(-) delete mode 100644 m4/virt-win-common.m4 delete mode 100644 m4/virt-win-mingw.m4 diff --git a/configure.ac b/configure.ac index 86e4b63ddf7..0b02b259c65 100644 --- a/configure.ac +++ b/configure.ac @@ -291,8 +291,6 @@ AC_SUBST(RUNUTF8) dnl MinGW checks -LIBVIRT_WIN_CHECK_COMMON -LIBVIRT_WIN_CHECK_MINGW LIBVIRT_WIN_CHECK_SYMBOLS LIBVIRT_WIN_CHECK_WINDRES @@ -402,7 +400,6 @@ LIBVIRT_RESULT_YAJL AC_MSG_NOTICE([]) AC_MSG_NOTICE([Windows]) AC_MSG_NOTICE([]) -LIBVIRT_WIN_RESULT_COMMON LIBVIRT_WIN_RESULT_WINDRES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Miscellaneous]) diff --git a/m4/virt-win-common.m4 b/m4/virt-win-common.m4 deleted file mode 100644 index ebc9d0836e4..00000000000 --- a/m4/virt-win-common.m4 +++ /dev/null @@ -1,42 +0,0 @@ -dnl The MinGW common checks -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_WIN_CHECK_COMMON], [ - WIN32_EXTRA_CFLAGS= - WIN32_EXTRA_LIBS= - - case "$host" in - *-*-mingw* ) - WIN32_EXTRA_LIBS="-lole32 -loleaut32" - # If the host is Windows, and shared libraries are disabled, we - # need to add -DLIBVIRT_STATIC to the CFLAGS for proper linking - if test "x$enable_shared" = "xno"; then - WIN32_EXTRA_CFLAGS="-DLIBVIRT_STATIC" - fi - ;; - esac - - AC_SUBST([WIN32_EXTRA_CFLAGS]) - AC_SUBST([WIN32_EXTRA_LIBS]) -]) - -AC_DEFUN([LIBVIRT_WIN_RESULT_COMMON], [ - details="CFLAGS='$WIN32_EXTRA_CFLAGS' LIBS='$WIN32_EXTRA_LIBS'" - LIBVIRT_RESULT([MinGW], [$with_win], [$details]) -]) diff --git a/m4/virt-win-mingw.m4 b/m4/virt-win-mingw.m4 deleted file mode 100644 index 3003bcf031f..00000000000 --- a/m4/virt-win-mingw.m4 +++ /dev/null @@ -1,28 +0,0 @@ -dnl The MinGW check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_WIN_CHECK_MINGW], [ - MINGW_EXTRA_LDFLAGS= - case "$host" in - *-*-mingw*) - MINGW_EXTRA_LDFLAGS="-no-undefined" - esac - - AC_SUBST([MINGW_EXTRA_LDFLAGS]) -]) diff --git a/meson.build b/meson.build index f5cc0e1d41f..3f05a1c0c6b 100644 --- a/meson.build +++ b/meson.build @@ -1383,6 +1383,27 @@ if not get_option('virtualport').disabled() endif endif +if host_machine.system() == 'windows' + ole32_dep = cc.find_library('ole32') + oleaut32_dep = cc.find_library('oleaut32') + win32_dep = declare_dependency( + dependencies: [ + ole32_dep, + oleaut32_dep, + ], + ) + if get_option('default_library') == 'static' + win32_flags = [ '-DLIBVIRT_STATIC' ] + else + win32_flags = [] + endif + win32_link_flags = [ '-Wl,-no-undefined' ] +else + win32_dep = dependency('', required: false) + win32_flags = [] + win32_link_flags = [] +endif + # generic build dependencies checks @@ -1501,6 +1522,11 @@ libs_summary = { } summary(libs_summary, section: 'Libraries', bool_yn: true) +win_summary = { + 'MinGW': host_machine.system() == 'windows', +} +summary(win_summary, section: 'Windows', bool_yn: true) + test_summary = { 'Coverage': coverage_flags.length() > 0, } -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 6 ---- m4/virt-wireshark.m4 | 71 -------------------------------------------- meson.build | 44 +++++++++++++++++++++++++++ meson_options.txt | 2 ++ 4 files changed, 46 insertions(+), 77 deletions(-) delete mode 100644 m4/virt-wireshark.m4 diff --git a/configure.ac b/configure.ac index 0b02b259c65..5e92466c4aa 100644 --- a/configure.ac +++ b/configure.ac @@ -109,12 +109,10 @@ fi LIBVIRT_ARG_NSS LIBVIRT_ARG_PM_UTILS -LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_YAJL LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_PM_UTILS -LIBVIRT_CHECK_WIRESHARK LIBVIRT_CHECK_XDR LIBVIRT_CHECK_YAJL @@ -414,10 +412,6 @@ LIBVIRT_RESULT_LOGIN_SHELL LIBVIRT_RESULT_HOST_VALIDATE LIBVIRT_RESULT_TLS_PRIORITY AC_MSG_NOTICE([]) -AC_MSG_NOTICE([Developer Tools]) -AC_MSG_NOTICE([]) -LIBVIRT_RESULT_WIRESHARK -AC_MSG_NOTICE([]) AC_MSG_NOTICE([Privileges]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_QEMU_PRIVILEGES diff --git a/m4/virt-wireshark.m4 b/m4/virt-wireshark.m4 deleted file mode 100644 index 2eee8a6ce86..00000000000 --- a/m4/virt-wireshark.m4 +++ /dev/null @@ -1,71 +0,0 @@ -dnl The libvirt.so wireshark plugin -dnl -dnl Copyright (C) 2015 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_WIRESHARK],[ - LIBVIRT_ARG_WITH_FEATURE([WIRESHARK_DISSECTOR], [wireshark], [check], [2.4.0]) - LIBVIRT_ARG_WITH([WS_PLUGINDIR], - [wireshark plugins directory for use when installing - wireshark plugin], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_WIRESHARK],[ - LIBVIRT_CHECK_PKG([WIRESHARK_DISSECTOR], [wireshark], [2.4.0]) - - dnl Check for system location of wireshark plugins - if test "x$with_wireshark_dissector" != "xno" ; then - if test "x$with_ws_plugindir" = "xcheck" ; then - ws_plugindir="$($PKG_CONFIG --variable plugindir wireshark)" - ws_exec_prefix="$($PKG_CONFIG --variable exec_prefix wireshark)" - ws_modversion="$($PKG_CONFIG --modversion wireshark)" - if test "x$ws_plugindir" = "x" ; then - dnl On some systems the plugindir variable may not be stored within pkg config. - dnl Fall back to older style of constructing the plugin dir path. - ws_plugindir="$libdir/wireshark/plugins/$ws_modversion" - else - if test "x$ws_exec_prefix" = "x" ; then - dnl If wireshark's exec_prefix cannot be retrieved from pkg-config, - dnl this is our best bet - ws_exec_prefix="/usr" - fi - dnl Replace wireshark's exec_prefix with our own. - dnl Note that ${exec_prefix} is kept verbatim at this point in time, - dnl and will only be expanded later, when make is called: this makes - dnl it possible to override such prefix at compilation or installation - dnl time - ws_plugindir='${exec_prefix}'"${ws_plugindir#$ws_exec_prefix}" - fi - - dnl Since wireshark 2.5.0 plugins can't live in top level - dnl plugindir but have to be under one of ["epan", - dnl "wiretap", "codecs"] subdir. The first one looks okay. - ws_plugindir="$ws_plugindir/epan" - - elif test "x$with_ws_plugindir" = "xno" || test "x$with_ws_plugindir" = "xyes"; then - AC_MSG_ERROR([ws-plugindir must be used only with valid path]) - else - ws_plugindir=$with_ws_plugindir - fi - fi - - AC_SUBST([ws_plugindir]) -]) - -AC_DEFUN([LIBVIRT_RESULT_WIRESHARK],[ - LIBVIRT_RESULT_LIB([WIRESHARK_DISSECTOR]) -]) diff --git a/meson.build b/meson.build index 3f05a1c0c6b..b710417db2f 100644 --- a/meson.build +++ b/meson.build @@ -1404,6 +1404,45 @@ else win32_link_flags = [] endif +wireshark_version = '2.4.0' +wireshark_dep = dependency('wireshark', version: '>=' + wireshark_version, required: get_option('wireshark_dissector')) +if wireshark_dep.found() + wireshark_plugindir = get_option('wireshark_plugindir') + if wireshark_plugindir == '' + wireshark_plugindir = wireshark_dep.get_pkgconfig_variable('plugindir') + endif + + # On some systems the plugindir variable may not be stored within pkg config. + # Fall back to older style of constructing the plugin dir path. + if wireshark_plugindir == '' + wireshark_modversion = wireshark_dep.version() + wireshark_plugindir = '@0@/wireshark/plugins/@1@'.format( + libdir, wireshark_modversion + ) + else + wireshark_prefix = wireshark_dep.get_pkgconfig_variable('prefix') + if wireshark_prefix == '' + # If wireshark's prefix cannot be retrieved from pkg-config, + # this is our best bet. + wireshark_prefix = '/usr' + endif + # Replace wireshark's prefix with our own. + # There is no replace method in meson so we have to workaround it. + rc = run_command( + 'python3', '-c', + 'print("@0@".replace("@1@", "@2@"))'.format( + wireshark_plugindir, wireshark_prefix, prefix, + ), + check: true, + ) + wireshark_plugindir = rc.stdout().strip() + endif + + # Since wireshark 2.5.0 plugins can't live in top level plugindir but have + # to be under one of ["epan", "wiretap", "codecs"] subdir. The first one looks okay. + wireshark_plugindir = wireshark_plugindir / 'epan' +endif + # generic build dependencies checks @@ -1537,3 +1576,8 @@ misc_summary = { 'Warning Flags': supported_cc_flags, } summary(misc_summary, section: 'Miscellaneous', bool_yn: true, list_sep: ' ') + +devtools_summary = { + 'wireshark_dissector': wireshark_dep.found(), +} +summary(devtools_summary, section: 'Developer Tools', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 025cc663027..25aa81621f9 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -41,3 +41,5 @@ option('selinux', type: 'feature', value: 'auto', description: 'selinux support' option('selinux_mount', type: 'string', value: '', description: 'set SELinux mount point') option('udev', type: 'feature', value: 'auto', description: 'udev support') option('virtualport', type: 'feature', value: 'auto', description: 'enable virtual port support') +option('wireshark_dissector', type: 'feature', value: 'auto', description: 'wireshark support') +option('wireshark_plugindir', type: 'string', value: '', description: 'wireshark plugins directory for use when installing wireshark plugin') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 2 -- m4/virt-xdr.m4 | 40 ---------------------------------------- meson.build | 12 ++++++++++++ 3 files changed, 12 insertions(+), 42 deletions(-) delete mode 100644 m4/virt-xdr.m4 diff --git a/configure.ac b/configure.ac index 5e92466c4aa..1a1a855cba6 100644 --- a/configure.ac +++ b/configure.ac @@ -113,7 +113,6 @@ LIBVIRT_ARG_YAJL LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_PM_UTILS -LIBVIRT_CHECK_XDR LIBVIRT_CHECK_YAJL @@ -393,7 +392,6 @@ LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_NSS LIBVIRT_RESULT_PM_UTILS LIBVIRT_RESULT_RBD -LIBVIRT_RESULT_XDR LIBVIRT_RESULT_YAJL AC_MSG_NOTICE([]) AC_MSG_NOTICE([Windows]) diff --git a/m4/virt-xdr.m4 b/m4/virt-xdr.m4 deleted file mode 100644 index 09d0c2ba2f4..00000000000 --- a/m4/virt-xdr.m4 +++ /dev/null @@ -1,40 +0,0 @@ -dnl The XDR implementation check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_CHECK_XDR], [ - if test x"$with_remote" = x"yes" || test x"$with_libvirtd" = x"yes"; then - dnl On MinGW portablexdr provides XDR functions, on linux they are - dnl provided by libtirpc and on FreeBSD/macOS there is no need to - dnl use extra library as it's provided by libc directly. - - with_xdr="yes" - - if test "$with_win" = "yes"; then - LIBVIRT_CHECK_LIB([XDR], [portablexdr], [xdrmem_create], [rpc/rpc.h]) - elif test "$with_linux" = "yes"; then - LIBVIRT_CHECK_PKG([XDR], [libtirpc], [0.1.10]) - else - AM_CONDITIONAL([WITH_XDR], [test "x$with_xdr" = "xyes"]) - fi - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_XDR], [ - LIBVIRT_RESULT_LIB([XDR]) -]) diff --git a/meson.build b/meson.build index b710417db2f..948ca4d93ab 100644 --- a/meson.build +++ b/meson.build @@ -1443,6 +1443,17 @@ if wireshark_dep.found() wireshark_plugindir = wireshark_plugindir / 'epan' endif +# On MinGW portablexdr provides XDR functions, on linux they are +# provided by libtirpc and on FreeBSD/macOS there is no need to +# use extra library as it's provided by libc directly. +if host_machine.system() == 'windows' + xdr_dep = cc.find_library('portablexdr', required: false) +elif host_machine.system() == 'linux' + xdr_dep = dependency('libtirpc', required: false) +else + xdr_dep = declare_dependency() +endif + # generic build dependencies checks @@ -1558,6 +1569,7 @@ libs_summary = { 'selinux': selinux_dep.found(), 'udev': udev_dep.found(), 'virtualport': conf.has('WITH_VIRTUALPORT'), + 'xdr': xdr_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-yajl.m4 | 42 ------------------------------------------ meson.build | 25 +++++++++++++++++++++++++ meson_options.txt | 1 + 4 files changed, 26 insertions(+), 45 deletions(-) delete mode 100644 m4/virt-yajl.m4 diff --git a/configure.ac b/configure.ac index 1a1a855cba6..7c872bbfe6c 100644 --- a/configure.ac +++ b/configure.ac @@ -109,11 +109,9 @@ fi LIBVIRT_ARG_NSS LIBVIRT_ARG_PM_UTILS -LIBVIRT_ARG_YAJL LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_PM_UTILS -LIBVIRT_CHECK_YAJL @@ -392,7 +390,6 @@ LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_NSS LIBVIRT_RESULT_PM_UTILS LIBVIRT_RESULT_RBD -LIBVIRT_RESULT_YAJL AC_MSG_NOTICE([]) AC_MSG_NOTICE([Windows]) AC_MSG_NOTICE([]) diff --git a/m4/virt-yajl.m4 b/m4/virt-yajl.m4 deleted file mode 100644 index b602abd0a7c..00000000000 --- a/m4/virt-yajl.m4 +++ /dev/null @@ -1,42 +0,0 @@ -dnl The libyajl.so library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_YAJL],[ - LIBVIRT_ARG_WITH_FEATURE([YAJL], [yajl], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_YAJL],[ - dnl YAJL JSON library http://lloyd.github.com/yajl/ - - PKG_CHECK_EXISTS([yajl], [use_pkgconfig=1], [use_pkgconfig=0]) - - if test $use_pkgconfig = 1; then - dnl 2.0.3 was the version where the pkg-config file was first added - LIBVIRT_CHECK_PKG([YAJL], [yajl], [2.0.3]) - else - dnl SLES 12 and openSUSE Leap 42.3 still use 2.0.1 - dnl TODO: delete this in July 2020 - LIBVIRT_CHECK_LIB([YAJL], [yajl], - [yajl_tree_parse], [yajl/yajl_common.h]) - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_YAJL],[ - LIBVIRT_RESULT_LIB([YAJL]) -]) diff --git a/meson.build b/meson.build index 948ca4d93ab..13062279c0a 100644 --- a/meson.build +++ b/meson.build @@ -1454,6 +1454,30 @@ else xdr_dep = declare_dependency() endif +yajl_version = '2.0.3' +if not get_option('yajl').disabled() + yajl_dep = dependency('yajl', version: '>=' + yajl_version, required: false) + # 2.0.3 was the version where the pkg-config file was first added + # SLES 12 and openSUSE Leap 42.3 still use 2.0.1 + # TODO: delete this in July 2020 + if not yajl_dep.found() + yajl_dep = cc.find_library('yajl', required: get_option('yajl')) + if yajl_dep.found() + has_func = cc.has_function('yajl_tree_parse', dependencies: yajl_dep, prefix: '#include <yajl/yajl_common.h>') + if not has_func and get_option('yajl').enabled() + error('yajl >= @0@ was not found'.format(yajl_version)) + elif not has_func + yajl_dep = dependency('', required: false) + endif + endif + endif +else + yajl_dep = dependency('', required: false) +endif +if yajl_dep.found() + conf.set('WITH_YAJL', 1) +endif + # generic build dependencies checks @@ -1570,6 +1594,7 @@ libs_summary = { 'udev': udev_dep.found(), 'virtualport': conf.has('WITH_VIRTUALPORT'), 'xdr': xdr_dep.found(), + 'yajl': yajl_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 25aa81621f9..a0615fcfdc1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -43,3 +43,4 @@ option('udev', type: 'feature', value: 'auto', description: 'udev support') option('virtualport', type: 'feature', value: 'auto', description: 'enable virtual port support') option('wireshark_dissector', type: 'feature', value: 'auto', description: 'wireshark support') option('wireshark_plugindir', type: 'string', value: '', description: 'wireshark plugins directory for use when installing wireshark plugin') +option('yajl', type: 'feature', value: 'auto', description: 'yajl support') -- 2.26.2

On Thu, Jul 16, 2020 at 11:55:15 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-yajl.m4 | 42 ------------------------------------------ meson.build | 25 +++++++++++++++++++++++++ meson_options.txt | 1 + 4 files changed, 26 insertions(+), 45 deletions(-) delete mode 100644 m4/virt-yajl.m4
diff --git a/configure.ac b/configure.ac index 1a1a855cba6..7c872bbfe6c 100644 --- a/configure.ac +++ b/configure.ac @@ -109,11 +109,9 @@ fi
LIBVIRT_ARG_NSS LIBVIRT_ARG_PM_UTILS -LIBVIRT_ARG_YAJL
LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_PM_UTILS -LIBVIRT_CHECK_YAJL
@@ -392,7 +390,6 @@ LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_NSS LIBVIRT_RESULT_PM_UTILS LIBVIRT_RESULT_RBD -LIBVIRT_RESULT_YAJL AC_MSG_NOTICE([]) AC_MSG_NOTICE([Windows]) AC_MSG_NOTICE([]) diff --git a/m4/virt-yajl.m4 b/m4/virt-yajl.m4 deleted file mode 100644 index b602abd0a7c..00000000000 --- a/m4/virt-yajl.m4 +++ /dev/null @@ -1,42 +0,0 @@ -dnl The libyajl.so library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_YAJL],[ - LIBVIRT_ARG_WITH_FEATURE([YAJL], [yajl], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_YAJL],[ - dnl YAJL JSON library http://lloyd.github.com/yajl/ - - PKG_CHECK_EXISTS([yajl], [use_pkgconfig=1], [use_pkgconfig=0]) - - if test $use_pkgconfig = 1; then - dnl 2.0.3 was the version where the pkg-config file was first added - LIBVIRT_CHECK_PKG([YAJL], [yajl], [2.0.3]) - else - dnl SLES 12 and openSUSE Leap 42.3 still use 2.0.1 - dnl TODO: delete this in July 2020 - LIBVIRT_CHECK_LIB([YAJL], [yajl], - [yajl_tree_parse], [yajl/yajl_common.h]) - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_YAJL],[ - LIBVIRT_RESULT_LIB([YAJL]) -]) diff --git a/meson.build b/meson.build index 948ca4d93ab..13062279c0a 100644 --- a/meson.build +++ b/meson.build @@ -1454,6 +1454,30 @@ else xdr_dep = declare_dependency() endif
+yajl_version = '2.0.3' +if not get_option('yajl').disabled() + yajl_dep = dependency('yajl', version: '>=' + yajl_version, required: false) + # 2.0.3 was the version where the pkg-config file was first added + # SLES 12 and openSUSE Leap 42.3 still use 2.0.1 + # TODO: delete this in July 2020
Is it already time to clean this up and switch to a proper version?
+ if not yajl_dep.found() + yajl_dep = cc.find_library('yajl', required: get_option('yajl')) + if yajl_dep.found()

On Wed, Jul 22, 2020 at 12:29:12PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:55:15 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-yajl.m4 | 42 ------------------------------------------ meson.build | 25 +++++++++++++++++++++++++ meson_options.txt | 1 + 4 files changed, 26 insertions(+), 45 deletions(-) delete mode 100644 m4/virt-yajl.m4
diff --git a/configure.ac b/configure.ac index 1a1a855cba6..7c872bbfe6c 100644 --- a/configure.ac +++ b/configure.ac @@ -109,11 +109,9 @@ fi
LIBVIRT_ARG_NSS LIBVIRT_ARG_PM_UTILS -LIBVIRT_ARG_YAJL
LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_PM_UTILS -LIBVIRT_CHECK_YAJL
@@ -392,7 +390,6 @@ LIBVIRT_RESULT_LIBXL LIBVIRT_RESULT_NSS LIBVIRT_RESULT_PM_UTILS LIBVIRT_RESULT_RBD -LIBVIRT_RESULT_YAJL AC_MSG_NOTICE([]) AC_MSG_NOTICE([Windows]) AC_MSG_NOTICE([]) diff --git a/m4/virt-yajl.m4 b/m4/virt-yajl.m4 deleted file mode 100644 index b602abd0a7c..00000000000 --- a/m4/virt-yajl.m4 +++ /dev/null @@ -1,42 +0,0 @@ -dnl The libyajl.so library -dnl -dnl Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_YAJL],[ - LIBVIRT_ARG_WITH_FEATURE([YAJL], [yajl], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_YAJL],[ - dnl YAJL JSON library http://lloyd.github.com/yajl/ - - PKG_CHECK_EXISTS([yajl], [use_pkgconfig=1], [use_pkgconfig=0]) - - if test $use_pkgconfig = 1; then - dnl 2.0.3 was the version where the pkg-config file was first added - LIBVIRT_CHECK_PKG([YAJL], [yajl], [2.0.3]) - else - dnl SLES 12 and openSUSE Leap 42.3 still use 2.0.1 - dnl TODO: delete this in July 2020 - LIBVIRT_CHECK_LIB([YAJL], [yajl], - [yajl_tree_parse], [yajl/yajl_common.h]) - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_YAJL],[ - LIBVIRT_RESULT_LIB([YAJL]) -]) diff --git a/meson.build b/meson.build index 948ca4d93ab..13062279c0a 100644 --- a/meson.build +++ b/meson.build @@ -1454,6 +1454,30 @@ else xdr_dep = declare_dependency() endif
+yajl_version = '2.0.3' +if not get_option('yajl').disabled() + yajl_dep = dependency('yajl', version: '>=' + yajl_version, required: false) + # 2.0.3 was the version where the pkg-config file was first added + # SLES 12 and openSUSE Leap 42.3 still use 2.0.1 + # TODO: delete this in July 2020
Is it already time to clean this up and switch to a proper version?
Possibly but I would rather do it as followup to not introduce conflicts within this series. Pavel

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-driver-remote.m4 | 48 ---------------------------------------- meson.build | 18 +++++++++++++++ meson_options.txt | 5 +++++ 4 files changed, 23 insertions(+), 51 deletions(-) delete mode 100644 m4/virt-driver-remote.m4 diff --git a/configure.ac b/configure.ac index 7c872bbfe6c..e9a684b1b58 100644 --- a/configure.ac +++ b/configure.ac @@ -130,7 +130,6 @@ LIBVIRT_DRIVER_ARG_BHYVE LIBVIRT_DRIVER_ARG_ESX LIBVIRT_DRIVER_ARG_HYPERV LIBVIRT_DRIVER_ARG_TEST -LIBVIRT_DRIVER_ARG_REMOTE LIBVIRT_DRIVER_ARG_LIBVIRTD LIBVIRT_DRIVER_ARG_NETWORK LIBVIRT_DRIVER_ARG_INTERFACE @@ -146,7 +145,6 @@ LIBVIRT_DRIVER_CHECK_BHYVE LIBVIRT_DRIVER_CHECK_ESX LIBVIRT_DRIVER_CHECK_HYPERV LIBVIRT_DRIVER_CHECK_TEST -LIBVIRT_DRIVER_CHECK_REMOTE LIBVIRT_DRIVER_CHECK_LIBVIRTD LIBVIRT_DRIVER_CHECK_NETWORK LIBVIRT_DRIVER_CHECK_INTERFACE @@ -354,7 +352,6 @@ LIBVIRT_DRIVER_RESULT_HYPERV LIBVIRT_DRIVER_RESULT_VZ LIBVIRT_DRIVER_RESULT_BHYVE LIBVIRT_DRIVER_RESULT_TEST -LIBVIRT_DRIVER_RESULT_REMOTE LIBVIRT_DRIVER_RESULT_NETWORK LIBVIRT_DRIVER_RESULT_LIBVIRTD LIBVIRT_DRIVER_RESULT_INTERFACE diff --git a/m4/virt-driver-remote.m4 b/m4/virt-driver-remote.m4 deleted file mode 100644 index 8d98e369b35..00000000000 --- a/m4/virt-driver-remote.m4 +++ /dev/null @@ -1,48 +0,0 @@ -dnl The remote 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_DRIVER_ARG_REMOTE], [ - LIBVIRT_ARG_WITH_FEATURE([REMOTE], [remote driver], [yes]) - LIBVIRT_ARG_WITH([REMOTE_DEFAULT_MODE], [remote driver default mode], [legacy]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_CHECK_REMOTE], [ - if test "$with_remote" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_REMOTE], 1, [whether Remote driver is enabled]) - fi - AM_CONDITIONAL([WITH_REMOTE], [test "$with_remote" = "yes"]) - - case "$with_remote_default_mode" in - legacy) - REMOTE_DRIVER_MODE_DEFAULT=REMOTE_DRIVER_MODE_LEGACY - ;; - direct) - REMOTE_DRIVER_MODE_DEFAULT=REMOTE_DRIVER_MODE_DIRECT - ;; - *) - AC_MSG_ERROR([Unknown remote mode '$with_remote_default_mode']) - ;; - esac - - AC_DEFINE_UNQUOTED([REMOTE_DRIVER_MODE_DEFAULT],[$REMOTE_DRIVER_MODE_DEFAULT], [Default remote driver mode]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_RESULT_REMOTE], [ - LIBVIRT_RESULT([Remote], [$with_remote]) -]) diff --git a/meson.build b/meson.build index 13062279c0a..6c31ae6c848 100644 --- a/meson.build +++ b/meson.build @@ -1537,6 +1537,19 @@ if conf.has('WITH_VIRTUALPORT') and not conf.has('WITH_MACVTAP') endif +# build driver options + +if get_option('driver_remote').enabled() + if not xdr_dep.found() and host_machine.system() not in [ 'freebsd', 'darwin' ] + error('XDR is required for remote driver') + endif + conf.set('WITH_REMOTE', 1) +endif + +remote_default_mode = get_option('remote_default_mode').to_upper() +conf.set('REMOTE_DRIVER_MODE_DEFAULT', 'REMOTE_DRIVER_MODE_@0@'.format(remote_default_mode)) + + # define top include directory top_inc_dir = include_directories('.') @@ -1555,6 +1568,11 @@ configure_file(output: 'meson-config.h', configuration: conf) # print configuration summary +driver_summary = { + 'Remote': conf.has('WITH_REMOTE'), +} +summary(driver_summary, section: 'Drivers', bool_yn: true) + libs_summary = { 'acl': acl_dep.found(), 'apparmor': apparmor_dep.found(), diff --git a/meson_options.txt b/meson_options.txt index a0615fcfdc1..4360540bf5a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -44,3 +44,8 @@ option('virtualport', type: 'feature', value: 'auto', description: 'enable virtu option('wireshark_dissector', type: 'feature', value: 'auto', description: 'wireshark support') option('wireshark_plugindir', type: 'string', value: '', description: 'wireshark plugins directory for use when installing wireshark plugin') option('yajl', type: 'feature', value: 'auto', description: 'yajl support') + + +# build driver options +option('driver_remote', type: 'feature', value: 'enabled', description: 'remote driver') +option('remote_default_mode', type: 'combo', choices: ['legacy', 'direct'], value: 'legacy', description: 'remote driver default mode') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 13 ------------- m4/virt-driver-libvirtd.m4 | 33 --------------------------------- meson.build | 23 +++++++++++++++++++++++ meson_options.txt | 1 + 4 files changed, 24 insertions(+), 46 deletions(-) delete mode 100644 m4/virt-driver-libvirtd.m4 diff --git a/configure.ac b/configure.ac index e9a684b1b58..25250fd2c4c 100644 --- a/configure.ac +++ b/configure.ac @@ -87,16 +87,6 @@ AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"]) AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"]) AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" = "yes"]) -if test "$with_win" = "yes" ; then - # We don't support the daemon yet - with_libvirtd=no -fi - -# The daemon requires remote support. Likewise, if we are not using -# RPC, we don't need several libraries. -if test "$with_remote" = "no" ; then - with_libvirtd=no -fi # Stateful drivers are useful only when building the daemon. if test "$with_libvirtd" = "no" ; then with_qemu=no @@ -130,7 +120,6 @@ LIBVIRT_DRIVER_ARG_BHYVE LIBVIRT_DRIVER_ARG_ESX LIBVIRT_DRIVER_ARG_HYPERV LIBVIRT_DRIVER_ARG_TEST -LIBVIRT_DRIVER_ARG_LIBVIRTD LIBVIRT_DRIVER_ARG_NETWORK LIBVIRT_DRIVER_ARG_INTERFACE @@ -145,7 +134,6 @@ LIBVIRT_DRIVER_CHECK_BHYVE LIBVIRT_DRIVER_CHECK_ESX LIBVIRT_DRIVER_CHECK_HYPERV LIBVIRT_DRIVER_CHECK_TEST -LIBVIRT_DRIVER_CHECK_LIBVIRTD LIBVIRT_DRIVER_CHECK_NETWORK LIBVIRT_DRIVER_CHECK_INTERFACE @@ -353,7 +341,6 @@ LIBVIRT_DRIVER_RESULT_VZ LIBVIRT_DRIVER_RESULT_BHYVE LIBVIRT_DRIVER_RESULT_TEST LIBVIRT_DRIVER_RESULT_NETWORK -LIBVIRT_DRIVER_RESULT_LIBVIRTD LIBVIRT_DRIVER_RESULT_INTERFACE AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) diff --git a/m4/virt-driver-libvirtd.m4 b/m4/virt-driver-libvirtd.m4 deleted file mode 100644 index 090f9532f94..00000000000 --- a/m4/virt-driver-libvirtd.m4 +++ /dev/null @@ -1,33 +0,0 @@ -dnl The libvirtd 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_DRIVER_ARG_LIBVIRTD], [ - LIBVIRT_ARG_WITH_FEATURE([LIBVIRTD], [libvirtd], [yes]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBVIRTD], [ - if test "$with_libvirtd" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_LIBVIRTD], 1, [whether libvirtd daemon is enabled]) - fi - AM_CONDITIONAL([WITH_LIBVIRTD], [test "$with_libvirtd" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_RESULT_LIBVIRTD], [ - LIBVIRT_RESULT([Libvirtd], [$with_libvirtd]) -]) diff --git a/meson.build b/meson.build index 6c31ae6c848..4aae01f62e5 100644 --- a/meson.build +++ b/meson.build @@ -1549,6 +1549,28 @@ endif remote_default_mode = get_option('remote_default_mode').to_upper() conf.set('REMOTE_DRIVER_MODE_DEFAULT', 'REMOTE_DRIVER_MODE_@0@'.format(remote_default_mode)) +if not get_option('driver_libvirtd').disabled() + use_libvirtd = true + + if host_machine.system() == 'windows' + use_libvirtd = false + if get_option('driver_libvirtd').enabled() + error('libvirtd daemon is not supported on windows') + endif + endif + + if not conf.has('WITH_REMOTE') + use_libvirtd = false + if get_option('driver_libvirtd').enabled() + error('remote driver is required for libvirtd daemon') + endif + endif + + if use_libvirtd + conf.set('WITH_LIBVIRTD', 1) + endif +endif + # define top include directory @@ -1570,6 +1592,7 @@ configure_file(output: 'meson-config.h', configuration: conf) driver_summary = { 'Remote': conf.has('WITH_REMOTE'), + 'Libvirtd': conf.has('WITH_LIBVIRTD'), } summary(driver_summary, section: 'Drivers', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 4360540bf5a..8731f78defe 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -47,5 +47,6 @@ option('yajl', type: 'feature', value: 'auto', description: 'yajl support') # build driver options +option('driver_libvirtd', type: 'feature', value: 'auto', description: 'libvirtd driver') option('driver_remote', type: 'feature', value: 'enabled', description: 'remote driver') option('remote_default_mode', type: 'combo', choices: ['legacy', 'direct'], value: 'legacy', description: 'remote driver default mode') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-driver-bhyve.m4 | 56 ----------------------------------------- meson.build | 16 ++++++++++++ meson_options.txt | 1 + 4 files changed, 17 insertions(+), 59 deletions(-) delete mode 100644 m4/virt-driver-bhyve.m4 diff --git a/configure.ac b/configure.ac index 25250fd2c4c..155d7495840 100644 --- a/configure.ac +++ b/configure.ac @@ -116,7 +116,6 @@ LIBVIRT_DRIVER_ARG_LIBXL LIBVIRT_DRIVER_ARG_VBOX LIBVIRT_DRIVER_ARG_LXC LIBVIRT_DRIVER_ARG_VZ -LIBVIRT_DRIVER_ARG_BHYVE LIBVIRT_DRIVER_ARG_ESX LIBVIRT_DRIVER_ARG_HYPERV LIBVIRT_DRIVER_ARG_TEST @@ -130,7 +129,6 @@ LIBVIRT_DRIVER_CHECK_LIBXL LIBVIRT_DRIVER_CHECK_VBOX LIBVIRT_DRIVER_CHECK_LXC LIBVIRT_DRIVER_CHECK_VZ -LIBVIRT_DRIVER_CHECK_BHYVE LIBVIRT_DRIVER_CHECK_ESX LIBVIRT_DRIVER_CHECK_HYPERV LIBVIRT_DRIVER_CHECK_TEST @@ -338,7 +336,6 @@ LIBVIRT_DRIVER_RESULT_LXC LIBVIRT_DRIVER_RESULT_ESX LIBVIRT_DRIVER_RESULT_HYPERV LIBVIRT_DRIVER_RESULT_VZ -LIBVIRT_DRIVER_RESULT_BHYVE LIBVIRT_DRIVER_RESULT_TEST LIBVIRT_DRIVER_RESULT_NETWORK LIBVIRT_DRIVER_RESULT_INTERFACE diff --git a/m4/virt-driver-bhyve.m4 b/m4/virt-driver-bhyve.m4 deleted file mode 100644 index 14b30c0b3e7..00000000000 --- a/m4/virt-driver-bhyve.m4 +++ /dev/null @@ -1,56 +0,0 @@ -dnl The bhyve driver -dnl -dnl Copyright (C) 2014 Roman Bogorodskiy -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_DRIVER_ARG_BHYVE],[ - LIBVIRT_ARG_WITH_FEATURE([BHYVE], [BHyVe], [check]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_CHECK_BHYVE],[ - if test "$with_bhyve" != "no"; then - AC_PATH_PROG([BHYVE], [bhyve], [], [$PATH:/usr/sbin]) - AC_PATH_PROG([BHYVECTL], [bhyvectl], [], [$PATH:/usr/sbin]) - AC_PATH_PROG([BHYVELOAD], [bhyveload], [], [$PATH:/usr/sbin/]) - - if test -z "$BHYVE" || test -z "$BHYVECTL" || \ - test -z "$BHYVELOAD" || test "$with_freebsd" = "no"; then - if test "$with_bhyve" = "check"; then - with_bhyve="no" - else - AC_MSG_ERROR([The bhyve driver cannot be enabled]) - fi - else - with_bhyve="yes" - fi - fi - - if test "$with_bhyve" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_BHYVE], 1, [whether bhyve driver is enabled]) - AC_DEFINE_UNQUOTED([BHYVE], ["$BHYVE"], - [Location of the bhyve tool]) - AC_DEFINE_UNQUOTED([BHYVECTL], ["$BHYVECTL"], - [Location of the bhyvectl tool]) - AC_DEFINE_UNQUOTED([BHYVELOAD], ["$BHYVELOAD"], - [Location of the bhyveload tool]) - fi - AM_CONDITIONAL([WITH_BHYVE], [test "$with_bhyve" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_RESULT_BHYVE],[ - LIBVIRT_RESULT([Bhyve], [$with_bhyve]) -]) diff --git a/meson.build b/meson.build index 4aae01f62e5..5d9eb1142d0 100644 --- a/meson.build +++ b/meson.build @@ -1571,6 +1571,21 @@ if not get_option('driver_libvirtd').disabled() endif endif +if not get_option('driver_bhyve').disabled() and host_machine.system() == 'freebsd' + bhyve_prog = find_program('bhyve', required: get_option('driver_bhyve')) + bhyvectl_prog = find_program('bhyvectl', required: get_option('driver_bhyve')) + bhyveload_prog = find_program('bhyveload', required: get_option('driver_bhyve')) + + if bhyve_prog.found() and bhyvectl_prog.found() and bhyveload_prog.found() + conf.set('WITH_BHYVE', 1) + conf.set_quoted('BHYVE', bhyve_prog.path()) + conf.set_quoted('BHYVECTL', bhyvectl_prog.path()) + conf.set_quoted('BHYVELOAD', bhyveload_prog.path()) + endif +elif get_option('driver_bhyve').enabled() + error('The bhyve driver cannot be enabled') +endif + # define top include directory @@ -1591,6 +1606,7 @@ configure_file(output: 'meson-config.h', configuration: conf) # print configuration summary driver_summary = { + 'Bhyve': conf.has('WITH_BHYVE'), 'Remote': conf.has('WITH_REMOTE'), 'Libvirtd': conf.has('WITH_LIBVIRTD'), } diff --git a/meson_options.txt b/meson_options.txt index 8731f78defe..0e1b43b8350 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -47,6 +47,7 @@ option('yajl', type: 'feature', value: 'auto', description: 'yajl support') # build driver options +option('driver_bhyve', type: 'feature', value: 'auto', description: 'BHyVe driver') option('driver_libvirtd', type: 'feature', value: 'auto', description: 'libvirtd driver') option('driver_remote', type: 'feature', value: 'enabled', description: 'remote driver') option('remote_default_mode', type: 'combo', choices: ['legacy', 'direct'], value: 'legacy', description: 'remote driver default mode') -- 2.26.2

On a Thursday in 2020, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-driver-bhyve.m4 | 56 ----------------------------------------- meson.build | 16 ++++++++++++ meson_options.txt | 1 + 4 files changed, 17 insertions(+), 59 deletions(-) delete mode 100644 m4/virt-driver-bhyve.m4
diff --git a/configure.ac b/configure.ac index 25250fd2c4c..155d7495840 100644 --- a/configure.ac +++ b/configure.ac @@ -116,7 +116,6 @@ LIBVIRT_DRIVER_ARG_LIBXL LIBVIRT_DRIVER_ARG_VBOX LIBVIRT_DRIVER_ARG_LXC LIBVIRT_DRIVER_ARG_VZ -LIBVIRT_DRIVER_ARG_BHYVE LIBVIRT_DRIVER_ARG_ESX LIBVIRT_DRIVER_ARG_HYPERV LIBVIRT_DRIVER_ARG_TEST @@ -130,7 +129,6 @@ LIBVIRT_DRIVER_CHECK_LIBXL LIBVIRT_DRIVER_CHECK_VBOX LIBVIRT_DRIVER_CHECK_LXC LIBVIRT_DRIVER_CHECK_VZ -LIBVIRT_DRIVER_CHECK_BHYVE LIBVIRT_DRIVER_CHECK_ESX LIBVIRT_DRIVER_CHECK_HYPERV LIBVIRT_DRIVER_CHECK_TEST @@ -338,7 +336,6 @@ LIBVIRT_DRIVER_RESULT_LXC LIBVIRT_DRIVER_RESULT_ESX LIBVIRT_DRIVER_RESULT_HYPERV LIBVIRT_DRIVER_RESULT_VZ -LIBVIRT_DRIVER_RESULT_BHYVE LIBVIRT_DRIVER_RESULT_TEST LIBVIRT_DRIVER_RESULT_NETWORK LIBVIRT_DRIVER_RESULT_INTERFACE diff --git a/m4/virt-driver-bhyve.m4 b/m4/virt-driver-bhyve.m4 deleted file mode 100644 index 14b30c0b3e7..00000000000 --- a/m4/virt-driver-bhyve.m4 +++ /dev/null @@ -1,56 +0,0 @@ -dnl The bhyve driver -dnl -dnl Copyright (C) 2014 Roman Bogorodskiy -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_DRIVER_ARG_BHYVE],[ - LIBVIRT_ARG_WITH_FEATURE([BHYVE], [BHyVe], [check]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_CHECK_BHYVE],[ - if test "$with_bhyve" != "no"; then - AC_PATH_PROG([BHYVE], [bhyve], [], [$PATH:/usr/sbin]) - AC_PATH_PROG([BHYVECTL], [bhyvectl], [], [$PATH:/usr/sbin]) - AC_PATH_PROG([BHYVELOAD], [bhyveload], [], [$PATH:/usr/sbin/]) - - if test -z "$BHYVE" || test -z "$BHYVECTL" || \ - test -z "$BHYVELOAD" || test "$with_freebsd" = "no"; then - if test "$with_bhyve" = "check"; then - with_bhyve="no" - else - AC_MSG_ERROR([The bhyve driver cannot be enabled]) - fi - else - with_bhyve="yes" - fi - fi - - if test "$with_bhyve" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_BHYVE], 1, [whether bhyve driver is enabled]) - AC_DEFINE_UNQUOTED([BHYVE], ["$BHYVE"], - [Location of the bhyve tool]) - AC_DEFINE_UNQUOTED([BHYVECTL], ["$BHYVECTL"], - [Location of the bhyvectl tool]) - AC_DEFINE_UNQUOTED([BHYVELOAD], ["$BHYVELOAD"], - [Location of the bhyveload tool]) - fi - AM_CONDITIONAL([WITH_BHYVE], [test "$with_bhyve" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_RESULT_BHYVE],[ - LIBVIRT_RESULT([Bhyve], [$with_bhyve]) -]) diff --git a/meson.build b/meson.build index 4aae01f62e5..5d9eb1142d0 100644 --- a/meson.build +++ b/meson.build @@ -1571,6 +1571,21 @@ if not get_option('driver_libvirtd').disabled() endif endif
+if not get_option('driver_bhyve').disabled() and host_machine.system() == 'freebsd' + bhyve_prog = find_program('bhyve', required: get_option('driver_bhyve')) + bhyvectl_prog = find_program('bhyvectl', required: get_option('driver_bhyve')) + bhyveload_prog = find_program('bhyveload', required: get_option('driver_bhyve')) + + if bhyve_prog.found() and bhyvectl_prog.found() and bhyveload_prog.found() + conf.set('WITH_BHYVE', 1) + conf.set_quoted('BHYVE', bhyve_prog.path()) + conf.set_quoted('BHYVECTL', bhyvectl_prog.path()) + conf.set_quoted('BHYVELOAD', bhyveload_prog.path()) + endif +elif get_option('driver_bhyve').enabled() + error('The bhyve driver cannot be enabled') +endif +
# define top include directory
@@ -1591,6 +1606,7 @@ configure_file(output: 'meson-config.h', configuration: conf) # print configuration summary
driver_summary = { + 'Bhyve': conf.has('WITH_BHYVE'), 'Remote': conf.has('WITH_REMOTE'), 'Libvirtd': conf.has('WITH_LIBVIRTD'), } diff --git a/meson_options.txt b/meson_options.txt index 8731f78defe..0e1b43b8350 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -47,6 +47,7 @@ option('yajl', type: 'feature', value: 'auto', description: 'yajl support')
# build driver options +option('driver_bhyve', type: 'feature', value: 'auto', description: 'BHyVe driver')
s/BHyVe/bhyve/ Jano
option('driver_libvirtd', type: 'feature', value: 'auto', description: 'libvirtd driver') option('driver_remote', type: 'feature', value: 'enabled', description: 'remote driver') option('remote_default_mode', type: 'combo', choices: ['legacy', 'direct'], value: 'legacy', description: 'remote driver default mode') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-driver-esx.m4 | 57 ------------------------------------------- meson.build | 8 ++++++ meson_options.txt | 1 + 4 files changed, 9 insertions(+), 60 deletions(-) delete mode 100644 m4/virt-driver-esx.m4 diff --git a/configure.ac b/configure.ac index 155d7495840..a85c52bea14 100644 --- a/configure.ac +++ b/configure.ac @@ -116,7 +116,6 @@ LIBVIRT_DRIVER_ARG_LIBXL LIBVIRT_DRIVER_ARG_VBOX LIBVIRT_DRIVER_ARG_LXC LIBVIRT_DRIVER_ARG_VZ -LIBVIRT_DRIVER_ARG_ESX LIBVIRT_DRIVER_ARG_HYPERV LIBVIRT_DRIVER_ARG_TEST LIBVIRT_DRIVER_ARG_NETWORK @@ -129,7 +128,6 @@ LIBVIRT_DRIVER_CHECK_LIBXL LIBVIRT_DRIVER_CHECK_VBOX LIBVIRT_DRIVER_CHECK_LXC LIBVIRT_DRIVER_CHECK_VZ -LIBVIRT_DRIVER_CHECK_ESX LIBVIRT_DRIVER_CHECK_HYPERV LIBVIRT_DRIVER_CHECK_TEST LIBVIRT_DRIVER_CHECK_NETWORK @@ -333,7 +331,6 @@ LIBVIRT_DRIVER_RESULT_VMWARE LIBVIRT_DRIVER_RESULT_VBOX LIBVIRT_DRIVER_RESULT_LIBXL LIBVIRT_DRIVER_RESULT_LXC -LIBVIRT_DRIVER_RESULT_ESX LIBVIRT_DRIVER_RESULT_HYPERV LIBVIRT_DRIVER_RESULT_VZ LIBVIRT_DRIVER_RESULT_TEST diff --git a/m4/virt-driver-esx.m4 b/m4/virt-driver-esx.m4 deleted file mode 100644 index 4a2944b617a..00000000000 --- a/m4/virt-driver-esx.m4 +++ /dev/null @@ -1,57 +0,0 @@ -dnl The ESX 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_DRIVER_ARG_ESX], [ - LIBVIRT_ARG_WITH_FEATURE([ESX], [ESX], [check]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_CHECK_ESX], [ - AC_REQUIRE([LIBVIRT_CHECK_CURL]) - AC_REQUIRE([LIBVIRT_DRIVER_CHECK_VMWARE]) - - if test "$with_curl" != "yes" ; then - if test "$with_esx" != "yes"; then - with_esx=no - else - AC_MSG_ERROR([Curl is required for the ESX driver]) - fi - else - if test "$with_esx" = "check"; then - with_esx=yes - fi - fi - - if test "$with_esx" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_ESX], 1, [whether ESX driver is enabled]) - fi - AM_CONDITIONAL([WITH_ESX], [test "$with_esx" = "yes"]) - - with_vmx=yes - if test "$with_esx" != "yes" && test "$with_vmware" != "yes"; then - with_vmx=no - fi - if test "$with_vmx" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_VMX], 1, [whether VMware VMX config handling is enabled]) - fi - AM_CONDITIONAL([WITH_VMX], [test "$with_vmx" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_RESULT_ESX], [ - LIBVIRT_RESULT([ESX], [$with_esx]) -]) diff --git a/meson.build b/meson.build index 5d9eb1142d0..153790c29ec 100644 --- a/meson.build +++ b/meson.build @@ -1586,6 +1586,13 @@ elif get_option('driver_bhyve').enabled() error('The bhyve driver cannot be enabled') endif +if not get_option('driver_esx').disabled() and curl_dep.found() + conf.set('WITH_ESX', 1) + conf.set('WITH_VMX', 1) +elif get_option('driver_esx').enabled() + error('Curl is required for the ESX driver') +endif + # define top include directory @@ -1606,6 +1613,7 @@ configure_file(output: 'meson-config.h', configuration: conf) # print configuration summary driver_summary = { + 'ESX': conf.has('WITH_ESX'), 'Bhyve': conf.has('WITH_BHYVE'), 'Remote': conf.has('WITH_REMOTE'), 'Libvirtd': conf.has('WITH_LIBVIRTD'), diff --git a/meson_options.txt b/meson_options.txt index 0e1b43b8350..700b7d41287 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -48,6 +48,7 @@ option('yajl', type: 'feature', value: 'auto', description: 'yajl support') # build driver options option('driver_bhyve', type: 'feature', value: 'auto', description: 'BHyVe driver') +option('driver_esx', type: 'feature', value: 'enabled', description: 'esx driver') option('driver_libvirtd', type: 'feature', value: 'auto', description: 'libvirtd driver') option('driver_remote', type: 'feature', value: 'enabled', description: 'remote driver') option('remote_default_mode', type: 'combo', choices: ['legacy', 'direct'], value: 'legacy', description: 'remote driver default mode') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-driver-hyperv.m4 | 47 ---------------------------------------- meson.build | 7 ++++++ meson_options.txt | 1 + 4 files changed, 8 insertions(+), 50 deletions(-) delete mode 100644 m4/virt-driver-hyperv.m4 diff --git a/configure.ac b/configure.ac index a85c52bea14..84cd16f4d95 100644 --- a/configure.ac +++ b/configure.ac @@ -116,7 +116,6 @@ LIBVIRT_DRIVER_ARG_LIBXL LIBVIRT_DRIVER_ARG_VBOX LIBVIRT_DRIVER_ARG_LXC LIBVIRT_DRIVER_ARG_VZ -LIBVIRT_DRIVER_ARG_HYPERV LIBVIRT_DRIVER_ARG_TEST LIBVIRT_DRIVER_ARG_NETWORK LIBVIRT_DRIVER_ARG_INTERFACE @@ -128,7 +127,6 @@ LIBVIRT_DRIVER_CHECK_LIBXL LIBVIRT_DRIVER_CHECK_VBOX LIBVIRT_DRIVER_CHECK_LXC LIBVIRT_DRIVER_CHECK_VZ -LIBVIRT_DRIVER_CHECK_HYPERV LIBVIRT_DRIVER_CHECK_TEST LIBVIRT_DRIVER_CHECK_NETWORK LIBVIRT_DRIVER_CHECK_INTERFACE @@ -331,7 +329,6 @@ LIBVIRT_DRIVER_RESULT_VMWARE LIBVIRT_DRIVER_RESULT_VBOX LIBVIRT_DRIVER_RESULT_LIBXL LIBVIRT_DRIVER_RESULT_LXC -LIBVIRT_DRIVER_RESULT_HYPERV LIBVIRT_DRIVER_RESULT_VZ LIBVIRT_DRIVER_RESULT_TEST LIBVIRT_DRIVER_RESULT_NETWORK diff --git a/m4/virt-driver-hyperv.m4 b/m4/virt-driver-hyperv.m4 deleted file mode 100644 index f276a881f3b..00000000000 --- a/m4/virt-driver-hyperv.m4 +++ /dev/null @@ -1,47 +0,0 @@ -dnl The Hyper-V 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_DRIVER_ARG_HYPERV], [ - LIBVIRT_ARG_WITH_FEATURE([HYPERV], [Hyper-V], [check]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_CHECK_HYPERV], [ - AC_REQUIRE([LIBVIRT_CHECK_OPENWSMAN]) - - if test "$with_hyperv" != "no"; then - if test "$with_openwsman" != "yes"; then - if test "$with_hyperv" = "check"; then - with_hyperv=no - else - AC_MSG_ERROR([openwsman is required for the Hyper-V driver]) - fi - else - with_hyperv=yes - fi - fi - - if test "$with_hyperv" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_HYPERV], 1, [whether Hyper-V driver is enabled]) - fi - AM_CONDITIONAL([WITH_HYPERV], [test "$with_hyperv" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_RESULT_HYPERV], [ - LIBVIRT_RESULT([Hyper-V], [$with_hyperv]) -]) diff --git a/meson.build b/meson.build index 153790c29ec..3c1ccb8f600 100644 --- a/meson.build +++ b/meson.build @@ -1593,6 +1593,12 @@ elif get_option('driver_esx').enabled() error('Curl is required for the ESX driver') endif +if not get_option('driver_hyperv').disabled() and openwsman_dep.found() + conf.set('WITH_HYPERV', 1) +elif get_option('driver_hyperv').enabled() + error('openwsman is required for the Hyper-V driver') +endif + # define top include directory @@ -1614,6 +1620,7 @@ configure_file(output: 'meson-config.h', configuration: conf) driver_summary = { 'ESX': conf.has('WITH_ESX'), + 'Hyper-V': conf.has('WITH_HYPERV'), 'Bhyve': conf.has('WITH_BHYVE'), 'Remote': conf.has('WITH_REMOTE'), 'Libvirtd': conf.has('WITH_LIBVIRTD'), diff --git a/meson_options.txt b/meson_options.txt index 700b7d41287..c64700fcc4e 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -49,6 +49,7 @@ option('yajl', type: 'feature', value: 'auto', description: 'yajl support') # build driver options option('driver_bhyve', type: 'feature', value: 'auto', description: 'BHyVe driver') option('driver_esx', type: 'feature', value: 'enabled', description: 'esx driver') +option('driver_hyperv', type: 'feature', value: 'auto', description: 'Hyper-V driver') option('driver_libvirtd', type: 'feature', value: 'auto', description: 'libvirtd driver') option('driver_remote', type: 'feature', value: 'enabled', description: 'remote driver') option('remote_default_mode', type: 'combo', choices: ['legacy', 'direct'], value: 'legacy', description: 'remote driver default mode') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- 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" = "yes"]) if test "$with_libvirtd" = "no" ; then with_qemu=no with_lxc=no - with_libxl=no with_vbox=no fi @@ -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_DRIVER_ARG_LIBXL], [ - LIBVIRT_ARG_WITH_FEATURE([LIBXL], [libxenlight], [check]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBXL], [ - LIBXL_LIBS="" - LIBXL_CFLAGS="" - LIBXL_FIRMWARE_DIR="" - LIBXL_EXECBIN_DIR="" - LIBXL_API_VERSION="-DLIBXL_API_VERSION=0x040500" - - dnl search for libxl, aka libxenlight - old_with_libxl="$with_libxl" - LIBVIRT_CHECK_PKG([LIBXL], [xenlight], [4.6.0]) - if test "x$with_libxl" = "xyes" ; then - LIBXL_FIRMWARE_DIR=$($PKG_CONFIG --variable xenfirmwaredir xenlight) - LIBXL_EXECBIN_DIR=$($PKG_CONFIG --variable libexec_bin xenlight) - fi - - if test "$with_libxl" = "yes"; then - LIBXL_CFLAGS="$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="$LIBXL_LIBS -lxlutil" - if test "x$LIBXL_FIRMWARE_DIR" != "x"; then - AC_DEFINE_UNQUOTED([LIBXL_FIRMWARE_DIR], ["$LIBXL_FIRMWARE_DIR"], [directory containing Xen firmware blobs]) - fi - if test "x$LIBXL_EXECBIN_DIR" != "x"; then - AC_DEFINE_UNQUOTED([LIBXL_EXECBIN_DIR], ["$LIBXL_EXECBIN_DIR"], [directory 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="$LIBXL_LIBS -lxenstore -lxentoollog" - ],[ - LIBXL_LIBS="$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], [Define to 1 if Xen has PVH support.])], [], [#include <libxl.h>]) - - 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 +if not get_option('driver_libxl').disabled() and conf.has('WITH_LIBVIRTD') + libxl_version = '4.6.0' + libxl_dep = dependency('xenlight', version: '>=' + libxl_version, required: get_option('driver_libxl')) + + if libxl_dep.found() + libxl_firmware_dir = libxl_dep.get_pkgconfig_variable('xenfirmwaredir') + libxl_execbin = libxl_dep.get_pkgconfig_variable('libexec_bin') + if libxl_firmware_dir != '' + conf.set_quoted('LIBXL_FIRMWARE_DIR', libxl_firmware_dir) + endif + if libxl_execbin != '' + 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 = cc.find_library('xlutil') + + xen_store_dep = cc.find_library('xenstore') + + # xtl_* infrastructure is in libxentoollog since Xen 4.7 previously + # it was in libxenctrl. + if libxl_dep.version().version_compare('>=4.7.0') + xtl_link_dep = cc.find_library('xentoollog') + else + xtl_link_dep = cc.find_library('xenctrl') + endif + + libxl_dep = declare_dependency( + compile_args: '-DLIBXL_API_VERSION=0x040500', + 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 + # define top include directory @@ -1619,6 +1670,7 @@ configure_file(output: 'meson-config.h', configuration: conf) # print configuration summary driver_summary = { + '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', description: 'BHyVe drive option('driver_esx', type: 'feature', value: 'enabled', description: 'esx driver') option('driver_hyperv', type: 'feature', value: 'auto', description: 'Hyper-V driver') option('driver_libvirtd', type: 'feature', value: 'auto', description: 'libvirtd driver') +option('driver_libxl', type: 'feature', value: 'auto', description: 'libxenlight driver') option('driver_remote', type: 'feature', value: 'enabled', description: 'remote driver') option('remote_default_mode', type: 'combo', choices: ['legacy', 'direct'], value: 'legacy', description: 'remote driver default mode') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 8 ----- m4/virt-driver-lxc.m4 | 74 ------------------------------------------- meson.build | 34 ++++++++++++++++++++ meson_options.txt | 1 + 4 files changed, 35 insertions(+), 82 deletions(-) delete mode 100644 m4/virt-driver-lxc.m4 diff --git a/configure.ac b/configure.ac index 4725050080f..3139b41a36a 100644 --- a/configure.ac +++ b/configure.ac @@ -74,10 +74,6 @@ case $host in esac if test $with_linux = no; then - if test "x$with_lxc" != xyes - then - with_lxc=no - fi with_dtrace=no with_storage_scsi=no fi @@ -90,7 +86,6 @@ AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" = "yes"]) # Stateful drivers are useful only when building the daemon. if test "$with_libvirtd" = "no" ; then with_qemu=no - with_lxc=no with_vbox=no fi @@ -112,7 +107,6 @@ LIBVIRT_DRIVER_ARG_QEMU LIBVIRT_DRIVER_ARG_OPENVZ LIBVIRT_DRIVER_ARG_VMWARE LIBVIRT_DRIVER_ARG_VBOX -LIBVIRT_DRIVER_ARG_LXC LIBVIRT_DRIVER_ARG_VZ LIBVIRT_DRIVER_ARG_TEST LIBVIRT_DRIVER_ARG_NETWORK @@ -122,7 +116,6 @@ LIBVIRT_DRIVER_CHECK_QEMU LIBVIRT_DRIVER_CHECK_OPENVZ LIBVIRT_DRIVER_CHECK_VMWARE LIBVIRT_DRIVER_CHECK_VBOX -LIBVIRT_DRIVER_CHECK_LXC LIBVIRT_DRIVER_CHECK_VZ LIBVIRT_DRIVER_CHECK_TEST LIBVIRT_DRIVER_CHECK_NETWORK @@ -324,7 +317,6 @@ LIBVIRT_DRIVER_RESULT_QEMU LIBVIRT_DRIVER_RESULT_OPENVZ LIBVIRT_DRIVER_RESULT_VMWARE LIBVIRT_DRIVER_RESULT_VBOX -LIBVIRT_DRIVER_RESULT_LXC LIBVIRT_DRIVER_RESULT_VZ LIBVIRT_DRIVER_RESULT_TEST LIBVIRT_DRIVER_RESULT_NETWORK diff --git a/m4/virt-driver-lxc.m4 b/m4/virt-driver-lxc.m4 deleted file mode 100644 index d2951b596a6..00000000000 --- a/m4/virt-driver-lxc.m4 +++ /dev/null @@ -1,74 +0,0 @@ -dnl The LXC 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_DRIVER_ARG_LXC], [ - LIBVIRT_ARG_WITH_FEATURE([LXC], [Linux Container], [check]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_CHECK_LXC], [ - if test "$with_libvirtd" = "no" ; then - with_lxc=no - fi - - if test "$with_lxc" = "yes" || test "$with_lxc" = "check"; then - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ - #include <sched.h> - #include <linux/loop.h> - #include <sys/epoll.h> - ]], [[ - unshare(!(LO_FLAGS_AUTOCLEAR + EPOLL_CLOEXEC)); - ]]) - ], [ - with_lxc=yes - AC_DEFINE([HAVE_DECL_LO_FLAGS_AUTOCLEAR], [1], - [Define to 1 if you have the declaration of `LO_FLAGS_AUTOCLEAR', - and to 0 if you don't.]) - ], [ - if test "$with_lxc" = "check"; then - with_lxc=no - AC_MSG_NOTICE([Required kernel features were not found, disabling LXC]) - else - AC_MSG_ERROR([Required kernel features for LXC were not found]) - fi - ]) - - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ - #include <sched.h> - #include <linux/loop.h> - #include <sys/epoll.h> - ]], [[ - unshare(!(LOOP_CTL_GET_FREE)); - ]]) - ], [ - AC_DEFINE([HAVE_DECL_LOOP_CTL_GET_FREE], [1], - [Define to 1 if you have the declaration of `LOOP_CTL_GET_FREE', - and to 0 if you don't.]) - ]) - fi - if test "$with_lxc" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_LXC], 1, [whether LXC driver is enabled]) - fi - AM_CONDITIONAL([WITH_LXC], [test "$with_lxc" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_RESULT_LXC], [ - LIBVIRT_RESULT([LXC], [$with_lxc]) -]) diff --git a/meson.build b/meson.build index 813da0ff79e..2ed93e857d0 100644 --- a/meson.build +++ b/meson.build @@ -1650,6 +1650,39 @@ elif get_option('driver_libxl').enabled() error('libvirtd is required for libxenlight') endif +if not get_option('driver_lxc').disabled() and host_machine.system() == 'linux' and conf.has('WITH_LIBVIRTD') + lxc_support_code = ''' +#include <sched.h> +#include <linux/loop.h> +#include <sys/epoll.h> + +void main(void) { + unshare(!(LO_FLAGS_AUTOCLEAR + EPOLL_CLOEXEC)); +} + ''' + if cc.compiles(lxc_support_code, name: 'lxc support', args: '-D_GNU_SOURCE') + conf.set('WITH_LXC', 1) + conf.set('HAVE_DECL_LO_FLAGS_AUTOCLEAR', 1) + elif get_option('driver_lxc').enabled() + error('Required kernel features for LXC were not found') + endif + + lxc_get_free_code = ''' +#include <sched.h> +#include <linux/loop.h> +#include <sys/epoll.h> + +void main(void) { + unshare(!(LOOP_CTL_GET_FREE)); +} + ''' + if cc.compiles(lxc_get_free_code) + conf.set('HAVE_DECL_LOOP_CTL_GET_FREE', 1) + endif +elif get_option('driver_lxc').enabled() + error('linux and remote_driver are required for LXC') +endif + # define top include directory @@ -1671,6 +1704,7 @@ configure_file(output: 'meson-config.h', configuration: conf) driver_summary = { 'libxl': conf.has('WITH_LIBXL'), + 'LXC': conf.has('WITH_LXC'), '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 5329fd4cd05..ccc0a209378 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -52,5 +52,6 @@ option('driver_esx', type: 'feature', value: 'enabled', description: 'esx driver option('driver_hyperv', type: 'feature', value: 'auto', description: 'Hyper-V driver') option('driver_libvirtd', type: 'feature', value: 'auto', description: 'libvirtd driver') option('driver_libxl', type: 'feature', value: 'auto', description: 'libxenlight driver') +option('driver_lxc', type: 'feature', value: 'auto', description: 'Linux Container driver') option('driver_remote', type: 'feature', value: 'enabled', description: 'remote driver') option('remote_default_mode', type: 'combo', choices: ['legacy', 'direct'], value: 'legacy', description: 'remote driver default mode') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-driver-openvz.m4 | 42 ---------------------------------------- meson.build | 7 +++++++ meson_options.txt | 1 + 4 files changed, 8 insertions(+), 45 deletions(-) delete mode 100644 m4/virt-driver-openvz.m4 diff --git a/configure.ac b/configure.ac index 3139b41a36a..30b84856d38 100644 --- a/configure.ac +++ b/configure.ac @@ -104,7 +104,6 @@ dnl Virtualization drivers check dnl LIBVIRT_DRIVER_ARG_QEMU -LIBVIRT_DRIVER_ARG_OPENVZ LIBVIRT_DRIVER_ARG_VMWARE LIBVIRT_DRIVER_ARG_VBOX LIBVIRT_DRIVER_ARG_VZ @@ -113,7 +112,6 @@ LIBVIRT_DRIVER_ARG_NETWORK LIBVIRT_DRIVER_ARG_INTERFACE LIBVIRT_DRIVER_CHECK_QEMU -LIBVIRT_DRIVER_CHECK_OPENVZ LIBVIRT_DRIVER_CHECK_VMWARE LIBVIRT_DRIVER_CHECK_VBOX LIBVIRT_DRIVER_CHECK_VZ @@ -314,7 +312,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Drivers]) AC_MSG_NOTICE([]) LIBVIRT_DRIVER_RESULT_QEMU -LIBVIRT_DRIVER_RESULT_OPENVZ LIBVIRT_DRIVER_RESULT_VMWARE LIBVIRT_DRIVER_RESULT_VBOX LIBVIRT_DRIVER_RESULT_VZ diff --git a/m4/virt-driver-openvz.m4 b/m4/virt-driver-openvz.m4 deleted file mode 100644 index 3ad682b3437..00000000000 --- a/m4/virt-driver-openvz.m4 +++ /dev/null @@ -1,42 +0,0 @@ -dnl The OpenVZ 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_DRIVER_ARG_OPENVZ], [ - LIBVIRT_ARG_WITH_FEATURE([OPENVZ], [OpenVZ], [check]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_CHECK_OPENVZ], [ - if test "$with_openvz" = "check"; then - with_openvz=$with_linux - fi - - if test "$with_openvz" = "yes" && test "$with_linux" = "no"; then - AC_MSG_ERROR([The OpenVZ driver can be enabled on Linux only.]) - fi - - if test "$with_openvz" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_OPENVZ], 1, [whether OpenVZ driver is enabled]) - fi - - AM_CONDITIONAL([WITH_OPENVZ], [test "$with_openvz" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_RESULT_OPENVZ], [ - LIBVIRT_RESULT([OpenVZ], [$with_openvz]) -]) diff --git a/meson.build b/meson.build index 2ed93e857d0..cae9743f5b2 100644 --- a/meson.build +++ b/meson.build @@ -1683,6 +1683,12 @@ elif get_option('driver_lxc').enabled() error('linux and remote_driver are required for LXC') endif +if not get_option('driver_openvz').disabled() and host_machine.system() == 'linux' + conf.set('WITH_OPENVZ', 1) +elif get_option('driver_openvz').enabled() + error('OpenVZ driver can be enabled on Linux only') +endif + # define top include directory @@ -1703,6 +1709,7 @@ configure_file(output: 'meson-config.h', configuration: conf) # print configuration summary driver_summary = { + 'OpenVZ': conf.has('WITH_OPENVZ'), 'libxl': conf.has('WITH_LIBXL'), 'LXC': conf.has('WITH_LXC'), 'ESX': conf.has('WITH_ESX'), diff --git a/meson_options.txt b/meson_options.txt index ccc0a209378..dbe56561752 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -53,5 +53,6 @@ option('driver_hyperv', type: 'feature', value: 'auto', description: 'Hyper-V dr option('driver_libvirtd', type: 'feature', value: 'auto', description: 'libvirtd driver') option('driver_libxl', type: 'feature', value: 'auto', description: 'libxenlight driver') option('driver_lxc', type: 'feature', value: 'auto', description: 'Linux Container driver') +option('driver_openvz', type: 'feature', value: 'auto', description: 'OpenVZ driver') option('driver_remote', type: 'feature', value: 'enabled', description: 'remote driver') option('remote_default_mode', type: 'combo', choices: ['legacy', 'direct'], value: 'legacy', description: 'remote driver default mode') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 8 --- m4/virt-driver-qemu.m4 | 132 ----------------------------------------- meson.build | 127 +++++++++++++++++++++++++++++++++++++++ meson_options.txt | 3 + 4 files changed, 130 insertions(+), 140 deletions(-) delete mode 100644 m4/virt-driver-qemu.m4 diff --git a/configure.ac b/configure.ac index 30b84856d38..d0189c8701a 100644 --- a/configure.ac +++ b/configure.ac @@ -85,7 +85,6 @@ AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" = "yes"]) # Stateful drivers are useful only when building the daemon. if test "$with_libvirtd" = "no" ; then - with_qemu=no with_vbox=no fi @@ -103,7 +102,6 @@ dnl dnl Virtualization drivers check dnl -LIBVIRT_DRIVER_ARG_QEMU LIBVIRT_DRIVER_ARG_VMWARE LIBVIRT_DRIVER_ARG_VBOX LIBVIRT_DRIVER_ARG_VZ @@ -111,7 +109,6 @@ LIBVIRT_DRIVER_ARG_TEST LIBVIRT_DRIVER_ARG_NETWORK LIBVIRT_DRIVER_ARG_INTERFACE -LIBVIRT_DRIVER_CHECK_QEMU LIBVIRT_DRIVER_CHECK_VMWARE LIBVIRT_DRIVER_CHECK_VBOX LIBVIRT_DRIVER_CHECK_VZ @@ -311,7 +308,6 @@ AC_MSG_NOTICE([=====================]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Drivers]) AC_MSG_NOTICE([]) -LIBVIRT_DRIVER_RESULT_QEMU LIBVIRT_DRIVER_RESULT_VMWARE LIBVIRT_DRIVER_RESULT_VBOX LIBVIRT_DRIVER_RESULT_VZ @@ -366,7 +362,3 @@ LIBVIRT_RESULT_LOGIN_SHELL LIBVIRT_RESULT_HOST_VALIDATE LIBVIRT_RESULT_TLS_PRIORITY AC_MSG_NOTICE([]) -AC_MSG_NOTICE([Privileges]) -AC_MSG_NOTICE([]) -LIBVIRT_RESULT_QEMU_PRIVILEGES -AC_MSG_NOTICE([]) diff --git a/m4/virt-driver-qemu.m4 b/m4/virt-driver-qemu.m4 deleted file mode 100644 index 886261fce5c..00000000000 --- a/m4/virt-driver-qemu.m4 +++ /dev/null @@ -1,132 +0,0 @@ -dnl The QEMU 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_DRIVER_ARG_QEMU], [ - LIBVIRT_ARG_WITH_FEATURE([QEMU], [QEMU/KVM], [check]) - LIBVIRT_ARG_WITH([QEMU_USER], [username to run QEMU system instance as], - ['platform dependent']) - LIBVIRT_ARG_WITH([QEMU_GROUP], [groupname to run QEMU system instance as], - ['platform dependent']) -]) - -AC_DEFUN([LIBVIRT_DRIVER_CHECK_QEMU], [ - dnl There is no way qemu driver will work without JSON support - AC_REQUIRE([LIBVIRT_CHECK_YAJL]) - if test "$with_qemu:$with_yajl" = "yes:no"; then - AC_MSG_ERROR([YAJL 2 is required to build QEMU driver]) - fi - if test "$with_qemu" = "check"; then - with_qemu=$with_yajl - fi - - if test "$with_qemu" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_QEMU], 1, [whether QEMU driver is enabled]) - fi - AM_CONDITIONAL([WITH_QEMU], [test "$with_qemu" = "yes"]) - - if test $with_freebsd = yes || test $with_macos = yes; then - default_qemu_user=root - default_qemu_group=wheel - else - # Try to integrate gracefully with downstream packages by running QEMU - # processes using the same user and group they would - case $(grep ^ID= /etc/os-release 2>/dev/null) in - *arch*) - default_qemu_user=nobody - default_qemu_group=nobody - ;; - *centos*|*fedora*|*gentoo*|*rhel*|*suse*) - default_qemu_user=qemu - default_qemu_group=qemu - ;; - *debian*) - default_qemu_user=libvirt-qemu - default_qemu_group=libvirt-qemu - ;; - *ubuntu*) - default_qemu_user=libvirt-qemu - default_qemu_group=kvm - ;; - *) - default_qemu_user=root - default_qemu_group=root - ;; - esac - # If the expected user and group don't exist, or we haven't hit any - # of the cases above because we're running on an unknown OS, the only - # sensible fallback is root:root - AC_MSG_CHECKING([for QEMU credentials ($default_qemu_user:$default_qemu_group)]) - if getent passwd "$default_qemu_user" >/dev/null 2>&1 && \ - getent group "$default_qemu_group" >/dev/null 2>&1; then - AC_MSG_RESULT([ok]) - else - AC_MSG_RESULT([not found, using root:root instead]) - default_qemu_user=root - default_qemu_group=root - fi - fi - - if test "x$with_qemu_user" = "xplatform dependent" ; then - QEMU_USER="$default_qemu_user" - else - QEMU_USER="$with_qemu_user" - fi - if test "x$with_qemu_group" = "xplatform dependent" ; then - QEMU_GROUP="$default_qemu_group" - else - QEMU_GROUP="$with_qemu_group" - fi - AC_DEFINE_UNQUOTED([QEMU_USER], ["$QEMU_USER"], [QEMU user account]) - AC_DEFINE_UNQUOTED([QEMU_GROUP], ["$QEMU_GROUP"], [QEMU group account]) - - AC_PATH_PROG([QEMU_BRIDGE_HELPER], [qemu-bridge-helper], - [/usr/libexec/qemu-bridge-helper], - [/usr/libexec:/usr/lib/qemu:/usr/lib]) - AC_DEFINE_UNQUOTED([QEMU_BRIDGE_HELPER], ["$QEMU_BRIDGE_HELPER"], - [QEMU bridge helper]) - AC_PATH_PROG([QEMU_PR_HELPER], [qemu-pr-helper], - [/usr/bin/qemu-pr-helper], - [/usr/bin:/usr/libexec]) - AC_DEFINE_UNQUOTED([QEMU_PR_HELPER], ["$QEMU_PR_HELPER"], - [QEMU PR helper]) - AC_PATH_PROG([QEMU_SLIRP_HELPER], [slirp-helper], - [/usr/bin/slirp-helper], - [/usr/bin:/usr/libexec]) - AC_DEFINE_UNQUOTED([QEMU_SLIRP_HELPER], ["$QEMU_SLIRP_HELPER"], - [QEMU slirp helper]) - - AC_PATH_PROG([QEMU_DBUS_DAEMON], [dbus-daemon], - [/usr/bin/dbus-daemon], - [/usr/bin:/usr/libexec]) - AC_DEFINE_UNQUOTED([QEMU_DBUS_DAEMON], ["$QEMU_DBUS_DAEMON"], - [QEMU dbus daemon]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_RESULT_QEMU], [ - LIBVIRT_RESULT([QEMU], [$with_qemu]) -]) - -AC_DEFUN([LIBVIRT_RESULT_QEMU_PRIVILEGES], [ - if test "$QEMU_USER" = "root"; then - LIBVIRT_RESULT([QEMU], [$QEMU_USER:$QEMU_GROUP], - [!!! running QEMU as root is strongly discouraged !!!]) - else - LIBVIRT_RESULT([QEMU], [$QEMU_USER:$QEMU_GROUP]) - fi -]) diff --git a/meson.build b/meson.build index cae9743f5b2..b7710bd0fcb 100644 --- a/meson.build +++ b/meson.build @@ -1689,6 +1689,121 @@ elif get_option('driver_openvz').enabled() error('OpenVZ driver can be enabled on Linux only') endif +if not get_option('driver_qemu').disabled() + use_qemu = true + + if not yajl_dep.found() + use_qemu = false + if get_option('driver_qemu').enabled() + error('YAJL 2 is required to build QEMU driver') + endif + endif + + if not conf.has('WITH_LIBVIRTD') + use_qemu = false + if get_option('driver_qemu').enabled() + error('libvirtd is required to build QEMU driver') + endif + endif + + if use_qemu + conf.set('WITH_QEMU', 1) + + if host_machine.system() in ['freebsd', 'darwin'] + default_qemu_user = 'root' + default_qemu_group = 'wheel' + else + os_release = run_command('grep', '^ID=', '/etc/os-release').stdout() + if os_release.contains('arch') + default_qemu_user = 'nobody' + default_qemu_group = 'nobody' + elif ( os_release.contains('centos') or + os_release.contains('fedora') or + os_release.contains('gentoo') or + os_release.contains('rhel') or + os_release.contains('suse')) + default_qemu_user = 'qemu' + default_qemu_group = 'qemu' + elif os_release.contains('debian') + default_qemu_user = 'libvirt-qemu' + default_qemu_group = 'libvirt-qemu' + elif os_release.contains('ubuntu') + default_qemu_user = 'libvirt-qemu' + default_qemu_group = 'kvm' + else + default_qemu_user = 'root' + default_qemu_group = 'root' + endif + # If the expected user and group don't exist, or we haven't hit any + # of the cases above bacuse we're running on an unknown OS, the only + # sensible fallback is root:root + if ( run_command('getent', 'passwd', default_qemu_user).returncode() != 0 and + run_command('getent', 'group', default_qemu_group).returncode() != 0 ) + default_qemu_user = 'root' + default_qemu_group = 'root' + endif + endif + qemu_user = get_option('qemu_user') + if qemu_user == '' + qemu_user = default_qemu_user + endif + qemu_group = get_option('qemu_group') + if qemu_group == '' + qemu_group = default_qemu_group + endif + conf.set_quoted('QEMU_USER', qemu_user) + conf.set_quoted('QEMU_GROUP', qemu_group) + + qemu_bridge_prog = find_program( + 'qemu-bridge-helper', + dirs: [ '/usr/libexec', '/usr/lib/qemu', '/usr/lib' ], + required: false + ) + if qemu_bridge_prog.found() + qemu_bridge_path = qemu_bridge_prog.path() + else + qemu_bridge_path = '/usr/libexec/qemu-bridge-helper' + endif + conf.set_quoted('QEMU_BRIDGE_HELPER', qemu_bridge_path) + + qemu_pr_prog = find_program( + 'qemu-pr-helper', + dirs: [ '/usr/bin', '/usr/libexec' ], + required: false + ) + if qemu_pr_prog.found() + qemu_pr_path = qemu_pr_prog.path() + else + qemu_pr_path = '/usr/bin/qemu-pr-helper' + endif + conf.set_quoted('QEMU_PR_HELPER', qemu_pr_path) + + qemu_slirp_prog = find_program( + 'slirp-helper', + dirs: [ '/usr/bin', '/usr/libexec' ], + required: false + ) + if qemu_slirp_prog.found() + qemu_slirp_path = qemu_slirp_prog.path() + else + qemu_slirp_path = '/usr/bin/slirp-helper' + endif + conf.set_quoted('QEMU_SLIRP_HELPER', qemu_slirp_path) + + qemu_dbus_daemon_prog = find_program( + 'dbus-daemon', + dirs: [ '/usr/bin', '/usr/libexec' ], + required: false + ) + if qemu_dbus_daemon_prog.found() + qemu_dbus_daemon_path = qemu_dbus_daemon_prog.path() + else + qemu_dbus_daemon_path = '/usr/bin/dbus-daemon' + endif + conf.set_quoted('QEMU_DBUS_DAEMON', qemu_dbus_daemon_path) + endif +endif + # define top include directory @@ -1709,6 +1824,7 @@ configure_file(output: 'meson-config.h', configuration: conf) # print configuration summary driver_summary = { + 'QEMU': conf.has('WITH_QEMU'), 'OpenVZ': conf.has('WITH_OPENVZ'), 'libxl': conf.has('WITH_LIBXL'), 'LXC': conf.has('WITH_LXC'), @@ -1783,3 +1899,14 @@ devtools_summary = { 'wireshark_dissector': wireshark_dep.found(), } summary(devtools_summary, section: 'Developer Tools', bool_yn: true) + +if conf.has('WITH_QEMU') + qemu_warn = '' + if qemu_user == 'root' + qemu_warn = ' !!! running QEMU as root is strongly discouraged !!!' + endif + priv_summary = { + 'QEMU': '@0@:@1@@2@'.format(qemu_user, qemu_group, qemu_warn), + } + summary(priv_summary, section: 'Privileges') +endif diff --git a/meson_options.txt b/meson_options.txt index dbe56561752..4f8cddd0aee 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -54,5 +54,8 @@ option('driver_libvirtd', type: 'feature', value: 'auto', description: 'libvirtd option('driver_libxl', type: 'feature', value: 'auto', description: 'libxenlight driver') option('driver_lxc', type: 'feature', value: 'auto', description: 'Linux Container driver') option('driver_openvz', type: 'feature', value: 'auto', description: 'OpenVZ driver') +option('driver_qemu', type: 'feature', value: 'auto', description: 'QEMU/KVM driver') +option('qemu_user', type: 'string', value: '', description: 'username to run QEMU system instance as') +option('qemu_group', type: 'string', value: '', description: 'groupname to run QEMU system instance as') option('driver_remote', type: 'feature', value: 'enabled', description: 'remote driver') option('remote_default_mode', type: 'combo', choices: ['legacy', 'direct'], value: 'legacy', description: 'remote driver default mode') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-driver-test.m4 | 33 --------------------------------- meson.build | 5 +++++ meson_options.txt | 1 + 4 files changed, 6 insertions(+), 36 deletions(-) delete mode 100644 m4/virt-driver-test.m4 diff --git a/configure.ac b/configure.ac index d0189c8701a..ab1b2145756 100644 --- a/configure.ac +++ b/configure.ac @@ -105,14 +105,12 @@ dnl LIBVIRT_DRIVER_ARG_VMWARE LIBVIRT_DRIVER_ARG_VBOX LIBVIRT_DRIVER_ARG_VZ -LIBVIRT_DRIVER_ARG_TEST LIBVIRT_DRIVER_ARG_NETWORK LIBVIRT_DRIVER_ARG_INTERFACE LIBVIRT_DRIVER_CHECK_VMWARE LIBVIRT_DRIVER_CHECK_VBOX LIBVIRT_DRIVER_CHECK_VZ -LIBVIRT_DRIVER_CHECK_TEST LIBVIRT_DRIVER_CHECK_NETWORK LIBVIRT_DRIVER_CHECK_INTERFACE @@ -311,7 +309,6 @@ AC_MSG_NOTICE([]) LIBVIRT_DRIVER_RESULT_VMWARE LIBVIRT_DRIVER_RESULT_VBOX LIBVIRT_DRIVER_RESULT_VZ -LIBVIRT_DRIVER_RESULT_TEST LIBVIRT_DRIVER_RESULT_NETWORK LIBVIRT_DRIVER_RESULT_INTERFACE AC_MSG_NOTICE([]) diff --git a/m4/virt-driver-test.m4 b/m4/virt-driver-test.m4 deleted file mode 100644 index 460d1f4aeea..00000000000 --- a/m4/virt-driver-test.m4 +++ /dev/null @@ -1,33 +0,0 @@ -dnl The test 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_DRIVER_ARG_TEST], [ - LIBVIRT_ARG_WITH_FEATURE([TEST], [test driver], [yes]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_CHECK_TEST], [ - if test "$with_test" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_TEST], 1, [whether Test driver is enabled]) - fi - AM_CONDITIONAL([WITH_TEST], [test "$with_test" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_RESULT_TEST], [ - LIBVIRT_RESULT([Test], [$with_test]) -]) diff --git a/meson.build b/meson.build index b7710bd0fcb..6a32554bb41 100644 --- a/meson.build +++ b/meson.build @@ -1804,6 +1804,10 @@ if not get_option('driver_qemu').disabled() endif endif +if get_option('driver_test').enabled() + conf.set('WITH_TEST', 1) +endif + # define top include directory @@ -1831,6 +1835,7 @@ driver_summary = { 'ESX': conf.has('WITH_ESX'), 'Hyper-V': conf.has('WITH_HYPERV'), 'Bhyve': conf.has('WITH_BHYVE'), + 'Test': conf.has('WITH_TEST'), 'Remote': conf.has('WITH_REMOTE'), 'Libvirtd': conf.has('WITH_LIBVIRTD'), } diff --git a/meson_options.txt b/meson_options.txt index 4f8cddd0aee..f9f9e3f79fe 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -59,3 +59,4 @@ option('qemu_user', type: 'string', value: '', description: 'username to run QEM option('qemu_group', type: 'string', value: '', description: 'groupname to run QEMU system instance as') option('driver_remote', type: 'feature', value: 'enabled', description: 'remote driver') option('remote_default_mode', type: 'combo', choices: ['legacy', 'direct'], value: 'legacy', description: 'remote driver default mode') +option('driver_test', type: 'feature', value: 'enabled', description: 'test driver') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 8 -------- m4/virt-driver-vbox.m4 | 44 ------------------------------------------ meson.build | 6 ++++++ meson_options.txt | 2 ++ 4 files changed, 8 insertions(+), 52 deletions(-) delete mode 100644 m4/virt-driver-vbox.m4 diff --git a/configure.ac b/configure.ac index ab1b2145756..c0a6da1f3c6 100644 --- a/configure.ac +++ b/configure.ac @@ -83,11 +83,6 @@ AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"]) AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"]) AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" = "yes"]) -# Stateful drivers are useful only when building the daemon. -if test "$with_libvirtd" = "no" ; then - with_vbox=no -fi - # Check for compiler and library settings. LIBVIRT_ARG_NSS @@ -103,13 +98,11 @@ dnl Virtualization drivers check dnl LIBVIRT_DRIVER_ARG_VMWARE -LIBVIRT_DRIVER_ARG_VBOX LIBVIRT_DRIVER_ARG_VZ LIBVIRT_DRIVER_ARG_NETWORK LIBVIRT_DRIVER_ARG_INTERFACE LIBVIRT_DRIVER_CHECK_VMWARE -LIBVIRT_DRIVER_CHECK_VBOX LIBVIRT_DRIVER_CHECK_VZ LIBVIRT_DRIVER_CHECK_NETWORK LIBVIRT_DRIVER_CHECK_INTERFACE @@ -307,7 +300,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Drivers]) AC_MSG_NOTICE([]) LIBVIRT_DRIVER_RESULT_VMWARE -LIBVIRT_DRIVER_RESULT_VBOX LIBVIRT_DRIVER_RESULT_VZ LIBVIRT_DRIVER_RESULT_NETWORK LIBVIRT_DRIVER_RESULT_INTERFACE diff --git a/m4/virt-driver-vbox.m4 b/m4/virt-driver-vbox.m4 deleted file mode 100644 index 589b1c3ed5e..00000000000 --- a/m4/virt-driver-vbox.m4 +++ /dev/null @@ -1,44 +0,0 @@ -dnl The VirtualBox 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_DRIVER_ARG_VBOX], [ - LIBVIRT_ARG_WITH_FEATURE([VBOX], [VirtualBox XPCOMC], [yes]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_CHECK_VBOX], [ - vbox_xpcomc_dir= - - if test "x$with_vbox" != "xyes" && test "x$with_vbox" != "xno"; then - # intentionally don't do any further checks here on the provided path - vbox_xpcomc_dir=$with_vbox - with_vbox=yes - fi - - AC_DEFINE_UNQUOTED([VBOX_XPCOMC_DIR], ["$vbox_xpcomc_dir"], - [Location of directory containing VirtualBox XPCOMC library]) - - if test "x$with_vbox" = "xyes"; then - AC_DEFINE_UNQUOTED([WITH_VBOX], 1, [whether VirtualBox driver is enabled]) - fi - AM_CONDITIONAL([WITH_VBOX], [test "$with_vbox" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_RESULT_VBOX], [ - LIBVIRT_RESULT([VBox], [$with_vbox]) -]) diff --git a/meson.build b/meson.build index 6a32554bb41..3309032face 100644 --- a/meson.build +++ b/meson.build @@ -1808,6 +1808,11 @@ if get_option('driver_test').enabled() conf.set('WITH_TEST', 1) endif +if not get_option('driver_vbox').disabled() and conf.has('WITH_LIBVIRTD') + conf.set('WITH_VBOX', 1) + conf.set_quoted('VBOX_XPCOMC_DIR', get_option('vbox_xpcomc_dir')) +endif + # define top include directory @@ -1830,6 +1835,7 @@ configure_file(output: 'meson-config.h', configuration: conf) driver_summary = { 'QEMU': conf.has('WITH_QEMU'), 'OpenVZ': conf.has('WITH_OPENVZ'), + 'VBox': conf.has('WITH_VBOX'), 'libxl': conf.has('WITH_LIBXL'), 'LXC': conf.has('WITH_LXC'), 'ESX': conf.has('WITH_ESX'), diff --git a/meson_options.txt b/meson_options.txt index f9f9e3f79fe..4ea5555a914 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -60,3 +60,5 @@ option('qemu_group', type: 'string', value: '', description: 'groupname to run Q option('driver_remote', type: 'feature', value: 'enabled', description: 'remote driver') option('remote_default_mode', type: 'combo', choices: ['legacy', 'direct'], value: 'legacy', description: 'remote driver default mode') option('driver_test', type: 'feature', value: 'enabled', description: 'test driver') +option('driver_vbox', type: 'feature', value: 'enabled', description: 'VirtualBox XPCOMC driver') +option('vbox_xpcomc_dir', type: 'string', value: '', description: 'Location of directory containing VirtualBox XPCOMC library') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-driver-vmware.m4 | 33 --------------------------------- meson.build | 6 ++++++ meson_options.txt | 1 + 4 files changed, 7 insertions(+), 36 deletions(-) delete mode 100644 m4/virt-driver-vmware.m4 diff --git a/configure.ac b/configure.ac index c0a6da1f3c6..531ff24feb8 100644 --- a/configure.ac +++ b/configure.ac @@ -97,12 +97,10 @@ dnl dnl Virtualization drivers check dnl -LIBVIRT_DRIVER_ARG_VMWARE LIBVIRT_DRIVER_ARG_VZ LIBVIRT_DRIVER_ARG_NETWORK LIBVIRT_DRIVER_ARG_INTERFACE -LIBVIRT_DRIVER_CHECK_VMWARE LIBVIRT_DRIVER_CHECK_VZ LIBVIRT_DRIVER_CHECK_NETWORK LIBVIRT_DRIVER_CHECK_INTERFACE @@ -299,7 +297,6 @@ AC_MSG_NOTICE([=====================]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Drivers]) AC_MSG_NOTICE([]) -LIBVIRT_DRIVER_RESULT_VMWARE LIBVIRT_DRIVER_RESULT_VZ LIBVIRT_DRIVER_RESULT_NETWORK LIBVIRT_DRIVER_RESULT_INTERFACE diff --git a/m4/virt-driver-vmware.m4 b/m4/virt-driver-vmware.m4 deleted file mode 100644 index 06504eb386d..00000000000 --- a/m4/virt-driver-vmware.m4 +++ /dev/null @@ -1,33 +0,0 @@ -dnl The VMware driver check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_DRIVER_ARG_VMWARE], [ - LIBVIRT_ARG_WITH_FEATURE([VMWARE], [VMware], [yes]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_CHECK_VMWARE], [ - if test "$with_vmware" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_VMWARE], 1, [whether VMware driver is enabled]) - fi - AM_CONDITIONAL([WITH_VMWARE], [test "$with_vmware" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_RESULT_VMWARE], [ - LIBVIRT_RESULT([VMware], [$with_vmware]) -]) diff --git a/meson.build b/meson.build index 3309032face..cd7ec2eaa00 100644 --- a/meson.build +++ b/meson.build @@ -1813,6 +1813,11 @@ if not get_option('driver_vbox').disabled() and conf.has('WITH_LIBVIRTD') conf.set_quoted('VBOX_XPCOMC_DIR', get_option('vbox_xpcomc_dir')) endif +if get_option('driver_vmware').enabled() + conf.set('WITH_VMWARE', 1) + conf.set('WITH_VMX', 1) +endif + # define top include directory @@ -1835,6 +1840,7 @@ configure_file(output: 'meson-config.h', configuration: conf) driver_summary = { 'QEMU': conf.has('WITH_QEMU'), 'OpenVZ': conf.has('WITH_OPENVZ'), + 'VMware': conf.has('WITH_VMWARE'), 'VBox': conf.has('WITH_VBOX'), 'libxl': conf.has('WITH_LIBXL'), 'LXC': conf.has('WITH_LXC'), diff --git a/meson_options.txt b/meson_options.txt index 4ea5555a914..b6a49991f19 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -62,3 +62,4 @@ option('remote_default_mode', type: 'combo', choices: ['legacy', 'direct'], valu option('driver_test', type: 'feature', value: 'enabled', description: 'test driver') option('driver_vbox', type: 'feature', value: 'enabled', description: 'VirtualBox XPCOMC driver') option('vbox_xpcomc_dir', type: 'string', value: '', description: 'Location of directory containing VirtualBox XPCOMC library') +option('driver_vmware', type: 'feature', value: 'enabled', description: 'VMware driver') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-driver-vz.m4 | 43 ------------------------------------------- meson.build | 7 +++++++ meson_options.txt | 1 + 4 files changed, 8 insertions(+), 46 deletions(-) delete mode 100644 m4/virt-driver-vz.m4 diff --git a/configure.ac b/configure.ac index 531ff24feb8..f2947074e5f 100644 --- a/configure.ac +++ b/configure.ac @@ -97,11 +97,9 @@ dnl dnl Virtualization drivers check dnl -LIBVIRT_DRIVER_ARG_VZ LIBVIRT_DRIVER_ARG_NETWORK LIBVIRT_DRIVER_ARG_INTERFACE -LIBVIRT_DRIVER_CHECK_VZ LIBVIRT_DRIVER_CHECK_NETWORK LIBVIRT_DRIVER_CHECK_INTERFACE @@ -297,7 +295,6 @@ AC_MSG_NOTICE([=====================]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Drivers]) AC_MSG_NOTICE([]) -LIBVIRT_DRIVER_RESULT_VZ LIBVIRT_DRIVER_RESULT_NETWORK LIBVIRT_DRIVER_RESULT_INTERFACE AC_MSG_NOTICE([]) diff --git a/m4/virt-driver-vz.m4 b/m4/virt-driver-vz.m4 deleted file mode 100644 index 11045e8b393..00000000000 --- a/m4/virt-driver-vz.m4 +++ /dev/null @@ -1,43 +0,0 @@ -dnl The Virtuozzo driver -dnl -dnl Copyright (C) 2005-2015 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_DRIVER_ARG_VZ],[ - LIBVIRT_ARG_WITH_FEATURE([VZ], [Virtuozzo], [check]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_CHECK_VZ],[ - if test "$with_vz" = "yes" || - test "$with_vz" = "check"; then - - if test "$with_vz" = "yes" && test "$PARALLELS_SDK_FOUND" = "no"; then - AC_MSG_ERROR([Parallels Virtualization SDK is needed to build the Virtuozzo driver.]) - fi - - with_vz=$PARALLELS_SDK_FOUND - if test "$with_vz" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_VZ], 1, - [whether vz driver is enabled]) - fi - fi - AM_CONDITIONAL([WITH_VZ], [test "$with_vz" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_RESULT_VZ],[ - LIBVIRT_RESULT([vz], [$with_vz]) -]) diff --git a/meson.build b/meson.build index cd7ec2eaa00..19b51890abb 100644 --- a/meson.build +++ b/meson.build @@ -1818,6 +1818,12 @@ if get_option('driver_vmware').enabled() conf.set('WITH_VMX', 1) endif +if not get_option('driver_vz').disabled() and parallels_sdk_dep.found() + conf.set('WITH_VZ', 1) +elif get_option('driver_vz').enabled() + error('Parallels Virtualization SDK is needed to build the Virtuozzo driver.') +endif + # define top include directory @@ -1846,6 +1852,7 @@ driver_summary = { 'LXC': conf.has('WITH_LXC'), 'ESX': conf.has('WITH_ESX'), 'Hyper-V': conf.has('WITH_HYPERV'), + 'vz': conf.has('WITH_VZ'), 'Bhyve': conf.has('WITH_BHYVE'), 'Test': conf.has('WITH_TEST'), 'Remote': conf.has('WITH_REMOTE'), diff --git a/meson_options.txt b/meson_options.txt index b6a49991f19..d6963fabd3c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -63,3 +63,4 @@ option('driver_test', type: 'feature', value: 'enabled', description: 'test driv option('driver_vbox', type: 'feature', value: 'enabled', description: 'VirtualBox XPCOMC driver') option('vbox_xpcomc_dir', type: 'string', value: '', description: 'Location of directory containing VirtualBox XPCOMC library') option('driver_vmware', type: 'feature', value: 'enabled', description: 'VMware driver') +option('driver_vz', type: 'feature', value: 'auto', description: 'Virtuozzo driver') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 13 --------- m4/virt-secdriver-apparmor.m4 | 50 ----------------------------------- m4/virt-secdriver-selinux.m4 | 43 ------------------------------ meson.build | 18 +++++++++++++ meson_options.txt | 4 +++ 5 files changed, 22 insertions(+), 106 deletions(-) delete mode 100644 m4/virt-secdriver-apparmor.m4 delete mode 100644 m4/virt-secdriver-selinux.m4 diff --git a/configure.ac b/configure.ac index f2947074e5f..fdc7755716c 100644 --- a/configure.ac +++ b/configure.ac @@ -144,14 +144,6 @@ dnl Need to test if pkg-config exists PKG_PROG_PKG_CONFIG -dnl Security driver checks -LIBVIRT_SECDRIVER_ARG_SELINUX -LIBVIRT_SECDRIVER_ARG_APPARMOR - -LIBVIRT_SECDRIVER_CHECK_SELINUX -LIBVIRT_SECDRIVER_CHECK_APPARMOR - - LIBVIRT_ARG_WITH_FEATURE([SECRETS], [local secrets management driver], [yes]) if test "$with_libvirtd" = "no"; then @@ -314,11 +306,6 @@ LIBVIRT_STORAGE_RESULT_GLUSTER LIBVIRT_STORAGE_RESULT_ZFS LIBVIRT_STORAGE_RESULT_VSTORAGE AC_MSG_NOTICE([]) -AC_MSG_NOTICE([Security Drivers]) -AC_MSG_NOTICE([]) -LIBVIRT_SECDRIVER_RESULT_SELINUX -LIBVIRT_SECDRIVER_RESULT_APPARMOR -AC_MSG_NOTICE([]) AC_MSG_NOTICE([Driver Loadable Modules]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_DRIVER_MODULES diff --git a/m4/virt-secdriver-apparmor.m4 b/m4/virt-secdriver-apparmor.m4 deleted file mode 100644 index 1894e66ed55..00000000000 --- a/m4/virt-secdriver-apparmor.m4 +++ /dev/null @@ -1,50 +0,0 @@ -dnl The AppArmor security 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_SECDRIVER_ARG_APPARMOR], [ - LIBVIRT_ARG_WITH([SECDRIVER_APPARMOR], [use AppArmor security driver], [check]) -]) - -AC_DEFUN([LIBVIRT_SECDRIVER_CHECK_APPARMOR], [ - AC_REQUIRE([LIBVIRT_CHECK_APPARMOR]) - - if test "$with_apparmor" != "yes" ; then - if test "$with_secdriver_apparmor" = "check" ; then - with_secdriver_apparmor=no - fi - if test "$with_secdriver_apparmor" != "no" ; then - AC_MSG_ERROR([You must install the AppArmor development package in order to compile libvirt]) - fi - elif test "with_secdriver_apparmor" != "no" ; then - with_secdriver_apparmor=yes - AC_DEFINE_UNQUOTED([WITH_SECDRIVER_APPARMOR], 1, [whether AppArmor security driver is available]) - fi - AM_CONDITIONAL([WITH_SECDRIVER_APPARMOR], [test "$with_secdriver_apparmor" != "no"]) - - LIBVIRT_ARG_WITH([APPARMOR_PROFILES], [install apparmor profiles], [no]) - if test "$with_apparmor" = "no"; then - with_apparmor_profiles="no" - fi - AM_CONDITIONAL([WITH_APPARMOR_PROFILES], [test "$with_apparmor_profiles" != "no"]) -]) - -AC_DEFUN([LIBVIRT_SECDRIVER_RESULT_APPARMOR], [ - LIBVIRT_RESULT([AppArmor], [$with_secdriver_apparmor], - [install profiles: $with_apparmor_profiles]) -]) diff --git a/m4/virt-secdriver-selinux.m4 b/m4/virt-secdriver-selinux.m4 deleted file mode 100644 index 4174249a510..00000000000 --- a/m4/virt-secdriver-selinux.m4 +++ /dev/null @@ -1,43 +0,0 @@ -dnl The SElinux security 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_SECDRIVER_ARG_SELINUX], [ - LIBVIRT_ARG_WITH([SECDRIVER_SELINUX], [use SELinux security driver], [check]) -]) - -AC_DEFUN([LIBVIRT_SECDRIVER_CHECK_SELINUX], [ - AC_REQUIRE([LIBVIRT_CHECK_SELINUX]) - - if test "$with_selinux" != "yes" ; then - if test "$with_secdriver_selinux" = "check" ; then - with_secdriver_selinux=no - fi - if test "$with_secdriver_selinux" != "no"; then - AC_MSG_ERROR([You must install the libselinux development package and enable SELinux with the --with-selinux=yes in order to compile libvirt --with-secdriver-selinux=yes]) - fi - elif test "$with_secdriver_selinux" != "no"; then - with_secdriver_selinux=yes - AC_DEFINE_UNQUOTED([WITH_SECDRIVER_SELINUX], 1, [whether SELinux security driver is available]) - fi - AM_CONDITIONAL([WITH_SECDRIVER_SELINUX], [test "$with_secdriver_selinux" != "no"]) -]) - -AC_DEFUN([LIBVIRT_SECDRIVER_RESULT_SELINUX], [ - LIBVIRT_RESULT([SELinux], [$with_secdriver_selinux]) -]) diff --git a/meson.build b/meson.build index 19b51890abb..eacfd57ee49 100644 --- a/meson.build +++ b/meson.build @@ -1824,6 +1824,18 @@ elif get_option('driver_vz').enabled() error('Parallels Virtualization SDK is needed to build the Virtuozzo driver.') endif +if not get_option('secdriver_apparmor').disabled() and apparmor_dep.found() + conf.set('WITH_SECDRIVER_APPARMOR', 1) +elif get_option('secdriver_apparmor').enabled() + error('You must install the AppArmor development package in order to compile libvirt.') +endif + +if not get_option('secdriver_selinux').disabled() and selinux_dep.found() + conf.set('WITH_SECDRIVER_SELINUX', 1) +elif get_option('secdriver_selinux').enabled() + error('You must install the libselinux development package in order to compile libvirt.') +endif + # define top include directory @@ -1860,6 +1872,12 @@ driver_summary = { } summary(driver_summary, section: 'Drivers', bool_yn: true) +secdriver_summary = { + 'SELinux': conf.has('WITH_SECDRIVER_SELINUX'), + 'AppArmor': conf.has('WITH_SECDRIVER_APPARMOR'), +} +summary(secdriver_summary, section: 'Security Drivers', bool_yn: true) + libs_summary = { 'acl': acl_dep.found(), 'apparmor': apparmor_dep.found(), diff --git a/meson_options.txt b/meson_options.txt index d6963fabd3c..fd370244f56 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -64,3 +64,7 @@ option('driver_vbox', type: 'feature', value: 'enabled', description: 'VirtualBo option('vbox_xpcomc_dir', type: 'string', value: '', description: 'Location of directory containing VirtualBox XPCOMC library') option('driver_vmware', type: 'feature', value: 'enabled', description: 'VMware driver') option('driver_vz', type: 'feature', value: 'auto', description: 'Virtuozzo driver') + +option('secdriver_apparmor', type: 'feature', value: 'auto', description: 'use AppArmor security driver') +option('apparmor_profiles', type: 'boolean', value: false, description: 'install apparmor profiles') +option('secdriver_selinux', type: 'feature', value: 'auto', description: 'use SELinux security driver') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-driver-network.m4 | 51 --------------------------------------- meson.build | 11 +++++++++ meson_options.txt | 1 + 4 files changed, 12 insertions(+), 54 deletions(-) delete mode 100644 m4/virt-driver-network.m4 diff --git a/configure.ac b/configure.ac index fdc7755716c..2100beb582d 100644 --- a/configure.ac +++ b/configure.ac @@ -97,10 +97,8 @@ dnl dnl Virtualization drivers check dnl -LIBVIRT_DRIVER_ARG_NETWORK LIBVIRT_DRIVER_ARG_INTERFACE -LIBVIRT_DRIVER_CHECK_NETWORK LIBVIRT_DRIVER_CHECK_INTERFACE @@ -287,7 +285,6 @@ AC_MSG_NOTICE([=====================]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Drivers]) AC_MSG_NOTICE([]) -LIBVIRT_DRIVER_RESULT_NETWORK LIBVIRT_DRIVER_RESULT_INTERFACE AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) diff --git a/m4/virt-driver-network.m4 b/m4/virt-driver-network.m4 deleted file mode 100644 index b98ce07c9cb..00000000000 --- a/m4/virt-driver-network.m4 +++ /dev/null @@ -1,51 +0,0 @@ -dnl The network 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_DRIVER_ARG_NETWORK], [ - LIBVIRT_ARG_WITH([NETWORK], [with virtual network driver], [yes]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_CHECK_NETWORK], [ - AC_REQUIRE([LIBVIRT_DRIVER_CHECK_LIBVIRTD]) - AC_REQUIRE([LIBVIRT_DRIVER_CHECK_QEMU]) - AC_REQUIRE([LIBVIRT_DRIVER_CHECK_LXC]) - - dnl there's no use compiling the network driver without the libvirt - dnl daemon, nor compiling it for macOS, where it breaks the compile - - if test "$with_libvirtd" = "no" || test "$with_macos" = "yes"; then - with_network=no - fi - - if test "$with_network" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_NETWORK], 1, [whether network driver is enabled]) - fi - AM_CONDITIONAL([WITH_NETWORK], [test "$with_network" = "yes"]) - - with_bridge=no - if test "$with_qemu:$with_lxc:$with_network" != "no:no:no"; then - with_bridge=yes - AC_DEFINE_UNQUOTED([WITH_BRIDGE], 1, [whether bridge code is needed]) - fi - AM_CONDITIONAL([WITH_BRIDGE], [test "$with_bridge" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_RESULT_NETWORK], [ - LIBVIRT_RESULT([Network], [$with_network]) -]) diff --git a/meson.build b/meson.build index eacfd57ee49..bbc74e32dd5 100644 --- a/meson.build +++ b/meson.build @@ -1683,6 +1683,12 @@ elif get_option('driver_lxc').enabled() error('linux and remote_driver are required for LXC') endif +# there's no use compiling the network driver without the libvirt +# daemon, nor compiling it for macOS, where it breaks the compile +if not get_option('driver_network').disabled() and conf.has('WITH_LIBVIRTD') and host_machine.system() != 'darwin' + conf.set('WITH_NETWORK', 1) +endif + if not get_option('driver_openvz').disabled() and host_machine.system() == 'linux' conf.set('WITH_OPENVZ', 1) elif get_option('driver_openvz').enabled() @@ -1836,6 +1842,10 @@ elif get_option('secdriver_selinux').enabled() error('You must install the libselinux development package in order to compile libvirt.') endif +if conf.has('WITH_QEMU') or conf.has('WITH_LXC') or conf.has('WITH_NETWORK') + conf.set('WITH_BRIDGE', 1) +endif + # define top include directory @@ -1868,6 +1878,7 @@ driver_summary = { 'Bhyve': conf.has('WITH_BHYVE'), 'Test': conf.has('WITH_TEST'), 'Remote': conf.has('WITH_REMOTE'), + 'Network': conf.has('WITH_NETWORK'), 'Libvirtd': conf.has('WITH_LIBVIRTD'), } summary(driver_summary, section: 'Drivers', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index fd370244f56..045c211ca46 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -53,6 +53,7 @@ option('driver_hyperv', type: 'feature', value: 'auto', description: 'Hyper-V dr option('driver_libvirtd', type: 'feature', value: 'auto', description: 'libvirtd driver') option('driver_libxl', type: 'feature', value: 'auto', description: 'libxenlight driver') option('driver_lxc', type: 'feature', value: 'auto', description: 'Linux Container driver') +option('driver_network', type: 'feature', value: 'auto', description: 'virtual network driver') option('driver_openvz', type: 'feature', value: 'auto', description: 'OpenVZ driver') option('driver_qemu', type: 'feature', value: 'auto', description: 'QEMU/KVM driver') option('qemu_user', type: 'string', value: '', description: 'username to run QEMU system instance as') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 14 ----------- m4/virt-driver-interface.m4 | 49 ------------------------------------- meson.build | 7 ++++++ meson_options.txt | 1 + 4 files changed, 8 insertions(+), 63 deletions(-) delete mode 100644 m4/virt-driver-interface.m4 diff --git a/configure.ac b/configure.ac index 2100beb582d..9a806517594 100644 --- a/configure.ac +++ b/configure.ac @@ -92,16 +92,6 @@ LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_PM_UTILS - -dnl -dnl Virtualization drivers check -dnl - -LIBVIRT_DRIVER_ARG_INTERFACE - -LIBVIRT_DRIVER_CHECK_INTERFACE - - dnl dnl in case someone want to build static binaries dnl STATIC_BINARIES="-static" @@ -283,10 +273,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Configuration summary]) AC_MSG_NOTICE([=====================]) AC_MSG_NOTICE([]) -AC_MSG_NOTICE([Drivers]) -AC_MSG_NOTICE([]) -LIBVIRT_DRIVER_RESULT_INTERFACE -AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) AC_MSG_NOTICE([]) LIBVIRT_STORAGE_RESULT_DIR diff --git a/m4/virt-driver-interface.m4 b/m4/virt-driver-interface.m4 deleted file mode 100644 index 68a0219502a..00000000000 --- a/m4/virt-driver-interface.m4 +++ /dev/null @@ -1,49 +0,0 @@ -dnl The interface 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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_DRIVER_ARG_INTERFACE], [ - LIBVIRT_ARG_WITH_FEATURE([INTERFACE], [host interface driver], [check]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_CHECK_INTERFACE], [ - AC_REQUIRE([LIBVIRT_DRIVER_CHECK_LIBVIRTD]) - AC_REQUIRE([LIBVIRT_CHECK_NETCF]) - AC_REQUIRE([LIBVIRT_CHECK_UDEV]) - - dnl Don't compile the interface driver without libvirtd - if test "$with_libvirtd" = "no" ; then - with_interface=no - fi - - dnl The interface driver depends on the netcf library or udev library - case $with_interface:$with_netcf:$with_udev in - check:*yes*) with_interface=yes ;; - check:no:no) with_interface=no ;; - yes:no:no) AC_MSG_ERROR([Requested the Interface driver without netcf or udev support]) ;; - esac - - if test "$with_interface" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_INTERFACE], [1], [whether the interface driver is enabled]) - fi - AM_CONDITIONAL([WITH_INTERFACE], [test "$with_interface" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_DRIVER_RESULT_INTERFACE], [ - LIBVIRT_RESULT([Interface], [$with_interface]) -]) diff --git a/meson.build b/meson.build index bbc74e32dd5..b25d07fce94 100644 --- a/meson.build +++ b/meson.build @@ -1599,6 +1599,12 @@ elif get_option('driver_hyperv').enabled() error('openwsman is required for the Hyper-V driver') endif +if not get_option('driver_interface').disabled() and conf.has('WITH_LIBVIRTD') and (udev_dep.found() or netcf_dep.found()) + conf.set('WITH_INTERFACE', 1) +elif get_option('driver_interface').enabled() + error('Requested the Interface driver without netcf or udev and libvirtd support') +endif + if not get_option('driver_libxl').disabled() and conf.has('WITH_LIBVIRTD') libxl_version = '4.6.0' libxl_dep = dependency('xenlight', version: '>=' + libxl_version, required: get_option('driver_libxl')) @@ -1880,6 +1886,7 @@ driver_summary = { 'Remote': conf.has('WITH_REMOTE'), 'Network': conf.has('WITH_NETWORK'), 'Libvirtd': conf.has('WITH_LIBVIRTD'), + 'Interface': conf.has('WITH_INTERFACE'), } summary(driver_summary, section: 'Drivers', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 045c211ca46..3d7272348af 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -50,6 +50,7 @@ option('yajl', type: 'feature', value: 'auto', description: 'yajl support') option('driver_bhyve', type: 'feature', value: 'auto', description: 'BHyVe driver') option('driver_esx', type: 'feature', value: 'enabled', description: 'esx driver') option('driver_hyperv', type: 'feature', value: 'auto', description: 'Hyper-V driver') +option('driver_interface', type: 'feature', value: 'auto', description: 'host interface driver') option('driver_libvirtd', type: 'feature', value: 'auto', description: 'libvirtd driver') option('driver_libxl', type: 'feature', value: 'auto', description: 'libxenlight driver') option('driver_lxc', type: 'feature', value: 'auto', description: 'Linux Container driver') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 11 ----------- meson.build | 4 ++++ meson_options.txt | 1 + 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index 9a806517594..0ab742c970f 100644 --- a/configure.ac +++ b/configure.ac @@ -132,17 +132,6 @@ dnl Need to test if pkg-config exists PKG_PROG_PKG_CONFIG -LIBVIRT_ARG_WITH_FEATURE([SECRETS], [local secrets management driver], [yes]) - -if test "$with_libvirtd" = "no"; then - with_secrets=no -fi -if test "$with_secrets" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_SECRETS], 1, [whether local secrets management driver is available]) -fi -AM_CONDITIONAL([WITH_SECRETS], [test "$with_secrets" = "yes"]) - - dnl dnl Storage driver checks dnl diff --git a/meson.build b/meson.build index b25d07fce94..3bd4e0423d2 100644 --- a/meson.build +++ b/meson.build @@ -1816,6 +1816,10 @@ if not get_option('driver_qemu').disabled() endif endif +if not get_option('driver_secrets').disabled() and conf.has('WITH_LIBVIRTD') + conf.set('WITH_SECRETS', 1) +endif + if get_option('driver_test').enabled() conf.set('WITH_TEST', 1) endif diff --git a/meson_options.txt b/meson_options.txt index 3d7272348af..1e40eb214bf 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -61,6 +61,7 @@ option('qemu_user', type: 'string', value: '', description: 'username to run QEM option('qemu_group', type: 'string', value: '', description: 'groupname to run QEMU system instance as') option('driver_remote', type: 'feature', value: 'enabled', description: 'remote driver') option('remote_default_mode', type: 'combo', choices: ['legacy', 'direct'], value: 'legacy', description: 'remote driver default mode') +option('driver_secrets', type: 'feature', value: 'auto', description: 'local secrets management driver') option('driver_test', type: 'feature', value: 'enabled', description: 'test driver') option('driver_vbox', type: 'feature', value: 'enabled', description: 'VirtualBox XPCOMC driver') option('vbox_xpcomc_dir', type: 'string', value: '', description: 'Location of directory containing VirtualBox XPCOMC library') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 9 --------- meson.build | 4 ++++ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 0ab742c970f..e4cd6c15e16 100644 --- a/configure.ac +++ b/configure.ac @@ -223,15 +223,6 @@ LV_LIBTOOL_OBJDIR=${lt_cv_objdir-.} AC_SUBST([LV_LIBTOOL_OBJDIR]) -with_nodedev=no; -if test "$with_hal" = "yes" || test "$with_udev" = "yes"; -then - with_nodedev=yes - AC_DEFINE_UNQUOTED([WITH_NODE_DEVICES], 1, [with node device driver]) -fi -AM_CONDITIONAL([WITH_NODE_DEVICES], [test "$with_nodedev" = "yes"]) - - GNUmakefile=GNUmakefile m4_if(m4_version_compare([2.61a.100], m4_defn([m4_PACKAGE_VERSION])), [1], [], diff --git a/meson.build b/meson.build index 3bd4e0423d2..6527473ceaf 100644 --- a/meson.build +++ b/meson.build @@ -1695,6 +1695,10 @@ if not get_option('driver_network').disabled() and conf.has('WITH_LIBVIRTD') and conf.set('WITH_NETWORK', 1) endif +if hal_dep.found() or udev_dep.found() + conf.set('WITH_NODE_DEVICES', 1) +endif + if not get_option('driver_openvz').disabled() and host_machine.system() == 'linux' conf.set('WITH_OPENVZ', 1) elif get_option('driver_openvz').enabled() -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 13 ------------- meson.build | 9 +++++++++ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index e4cd6c15e16..49ead1baa8e 100644 --- a/configure.ac +++ b/configure.ac @@ -186,19 +186,6 @@ LIBVIRT_STORAGE_CHECK_GLUSTER LIBVIRT_STORAGE_CHECK_ZFS LIBVIRT_STORAGE_CHECK_VSTORAGE -with_storage=no -for backend in dir fs lvm iscsi iscsi_direct scsi mpath rbd disk; do - if eval test \$with_storage_$backend = yes; then - with_storage=yes - break - fi -done -if test $with_storage = yes; then - AC_DEFINE([WITH_STORAGE], [1], - [Define to 1 if at least one storage backend is in use]) -fi -AM_CONDITIONAL([WITH_STORAGE], [test "$with_storage" = "yes"]) - dnl Python3 < 3.7 treats the C locale as 7-bit only. dnl We must force env vars so it treats it as UTF-8 dnl regardless of the user's locale. diff --git a/meson.build b/meson.build index 6527473ceaf..c865d6c2cbf 100644 --- a/meson.build +++ b/meson.build @@ -1861,6 +1861,15 @@ if conf.has('WITH_QEMU') or conf.has('WITH_LXC') or conf.has('WITH_NETWORK') endif +# check for storage drivers + +use_storage = false + +if use_storage + conf.set('WITH_STORAGE', 1) +endif + + # define top include directory top_inc_dir = include_directories('.') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 ---- m4/virt-storage-dir.m4 | 33 --------------------------------- meson.build | 12 ++++++++++++ meson_options.txt | 4 ++++ 4 files changed, 16 insertions(+), 37 deletions(-) delete mode 100644 m4/virt-storage-dir.m4 diff --git a/configure.ac b/configure.ac index 49ead1baa8e..1edec551fbe 100644 --- a/configure.ac +++ b/configure.ac @@ -136,7 +136,6 @@ dnl dnl Storage driver checks dnl -LIBVIRT_STORAGE_ARG_DIR LIBVIRT_STORAGE_ARG_FS LIBVIRT_STORAGE_ARG_LVM LIBVIRT_STORAGE_ARG_ISCSI @@ -151,7 +150,6 @@ LIBVIRT_STORAGE_ARG_ZFS LIBVIRT_STORAGE_ARG_VSTORAGE if test "$with_libvirtd" = "no"; then - with_storage_dir=no with_storage_fs=no with_storage_lvm=no with_storage_iscsi=no @@ -172,7 +170,6 @@ if test "$with_macos" = "yes"; then with_storage_fs=no fi -LIBVIRT_STORAGE_CHECK_DIR LIBVIRT_STORAGE_CHECK_FS LIBVIRT_STORAGE_CHECK_LVM LIBVIRT_STORAGE_CHECK_ISCSI @@ -242,7 +239,6 @@ AC_MSG_NOTICE([=====================]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) AC_MSG_NOTICE([]) -LIBVIRT_STORAGE_RESULT_DIR LIBVIRT_STORAGE_RESULT_FS LIBVIRT_STORAGE_RESULT_LVM LIBVIRT_STORAGE_RESULT_ISCSI diff --git a/m4/virt-storage-dir.m4 b/m4/virt-storage-dir.m4 deleted file mode 100644 index 798bf939e0f..00000000000 --- a/m4/virt-storage-dir.m4 +++ /dev/null @@ -1,33 +0,0 @@ -dnl The storage dir check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_STORAGE_ARG_DIR], [ - LIBVIRT_ARG_WITH_FEATURE([STORAGE_DIR], [directory backend for the storage driver], [yes]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_CHECK_DIR], [ - if test "$with_storage_dir" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_STORAGE_DIR], 1, [whether directory backend for storage driver is enabled]) - fi - AM_CONDITIONAL([WITH_STORAGE_DIR], [test "$with_storage_dir" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_RESULT_DIR], [ - LIBVIRT_RESULT([Dir], [$with_storage_dir]) -]) diff --git a/meson.build b/meson.build index c865d6c2cbf..1791e09bfa4 100644 --- a/meson.build +++ b/meson.build @@ -1865,6 +1865,13 @@ endif use_storage = false +if conf.has('WITH_LIBVIRTD') + if not get_option('storage_dir').disabled() + use_storage = true + conf.set('WITH_STORAGE_DIR', 1) + endif +endif + if use_storage conf.set('WITH_STORAGE', 1) endif @@ -1907,6 +1914,11 @@ driver_summary = { } summary(driver_summary, section: 'Drivers', bool_yn: true) +storagedriver_summary = { + 'Dir': conf.has('WITH_STORAGE_DIR'), +} +summary(storagedriver_summary, section: 'Storage Drivers', bool_yn: true) + secdriver_summary = { 'SELinux': conf.has('WITH_SECDRIVER_SELINUX'), 'AppArmor': conf.has('WITH_SECDRIVER_APPARMOR'), diff --git a/meson_options.txt b/meson_options.txt index 1e40eb214bf..e840c68b498 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -71,3 +71,7 @@ option('driver_vz', type: 'feature', value: 'auto', description: 'Virtuozzo driv option('secdriver_apparmor', type: 'feature', value: 'auto', description: 'use AppArmor security driver') option('apparmor_profiles', type: 'boolean', value: false, description: 'install apparmor profiles') option('secdriver_selinux', type: 'feature', value: 'auto', description: 'use SELinux security driver') + + +# storage driver options +option('storage_dir', type: 'feature', value: 'auto', description: 'directory backand for the storage driver') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 --- m4/virt-storage-disk.m4 | 58 ----------------------------------------- meson.build | 8 ++++++ meson_options.txt | 1 + 4 files changed, 9 insertions(+), 62 deletions(-) delete mode 100644 m4/virt-storage-disk.m4 diff --git a/configure.ac b/configure.ac index 1edec551fbe..36bcc8a39a6 100644 --- a/configure.ac +++ b/configure.ac @@ -142,7 +142,6 @@ LIBVIRT_STORAGE_ARG_ISCSI LIBVIRT_STORAGE_ARG_ISCSI_DIRECT LIBVIRT_STORAGE_ARG_SCSI LIBVIRT_STORAGE_ARG_MPATH -LIBVIRT_STORAGE_ARG_DISK LIBVIRT_STORAGE_ARG_RBD LIBVIRT_STORAGE_ARG_SHEEPDOG LIBVIRT_STORAGE_ARG_GLUSTER @@ -156,7 +155,6 @@ if test "$with_libvirtd" = "no"; then with_storage_iscsi_direct=no with_storage_scsi=no with_storage_mpath=no - with_storage_disk=no with_storage_rbd=no with_storage_sheepdog=no with_storage_gluster=no @@ -176,7 +174,6 @@ LIBVIRT_STORAGE_CHECK_ISCSI LIBVIRT_STORAGE_CHECK_ISCSI_DIRECT LIBVIRT_STORAGE_CHECK_SCSI LIBVIRT_STORAGE_CHECK_MPATH -LIBVIRT_STORAGE_CHECK_DISK LIBVIRT_STORAGE_CHECK_RBD LIBVIRT_STORAGE_CHECK_SHEEPDOG LIBVIRT_STORAGE_CHECK_GLUSTER @@ -245,7 +242,6 @@ LIBVIRT_STORAGE_RESULT_ISCSI LIBVIRT_STORAGE_RESULT_ISCSI_DIRECT LIBVIRT_STORAGE_RESULT_SCSI LIBVIRT_STORAGE_RESULT_MPATH -LIBVIRT_STORAGE_RESULT_DISK LIBVIRT_STORAGE_RESULT_RBD LIBVIRT_STORAGE_RESULT_SHEEPDOG LIBVIRT_STORAGE_RESULT_GLUSTER diff --git a/m4/virt-storage-disk.m4 b/m4/virt-storage-disk.m4 deleted file mode 100644 index 7429688f4eb..00000000000 --- a/m4/virt-storage-disk.m4 +++ /dev/null @@ -1,58 +0,0 @@ -dnl The storage disk check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_STORAGE_ARG_DISK], [ - LIBVIRT_ARG_WITH_FEATURE([STORAGE_DISK], [GPartd Disk backend for the storage driver], - [check]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_CHECK_DISK], [ - AC_REQUIRE([LIBVIRT_CHECK_DEVMAPPER]) - AC_REQUIRE([LIBVIRT_CHECK_LIBPARTED]) - - if test "$with_storage_disk" = "yes" || - test "$with_storage_disk" = "check"; then - - if test "$with_storage_disk" = "yes" && - test "$with_libparted" != "yes"; then - AC_MSG_ERROR([Need parted for disk storage driver]) - fi - - if test "$with_storage_disk" = "check"; then - with_storage_disk="$with_libparted" - fi - - if test "$with_storage_disk" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_STORAGE_DISK], 1, - [whether Disk backend for storage driver is enabled]) - fi - fi - - if test "x$with_storage_disk" = "xyes"; then - if test "x$with_devmapper" = "xno"; then - AC_MSG_ERROR([You must install device-mapper-devel/libdevmapper to compile libvirt with disk storage driver]) - fi - fi - - AM_CONDITIONAL([WITH_STORAGE_DISK], [test "$with_storage_disk" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_RESULT_DISK], [ - LIBVIRT_RESULT([Disk], [$with_storage_disk]) -]) diff --git a/meson.build b/meson.build index 1791e09bfa4..df105176b05 100644 --- a/meson.build +++ b/meson.build @@ -1870,6 +1870,13 @@ if conf.has('WITH_LIBVIRTD') use_storage = true conf.set('WITH_STORAGE_DIR', 1) endif + + if not get_option('storage_disk').disabled() and devmapper_dep.found() and libparted_dep.found() + use_storage = true + conf.set('WITH_STORAGE_DISK', 1) + elif get_option('storage_disk').enabled() + error('You must install libparted and libdevmapper to compile libvirt with disk storage driver') + endif endif if use_storage @@ -1916,6 +1923,7 @@ summary(driver_summary, section: 'Drivers', bool_yn: true) storagedriver_summary = { 'Dir': conf.has('WITH_STORAGE_DIR'), + 'Disk': conf.has('WITH_STORAGE_DISK'), } summary(storagedriver_summary, section: 'Storage Drivers', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index e840c68b498..9b695cf5ac1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -75,3 +75,4 @@ option('secdriver_selinux', type: 'feature', value: 'auto', description: 'use SE # storage driver options option('storage_dir', type: 'feature', value: 'auto', description: 'directory backand for the storage driver') +option('storage_disk', type: 'feature', value: 'auto', description: 'GPartd Disk backend for the storage driver') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 10 ----- m4/virt-storage-fs.m4 | 89 ------------------------------------------- meson.build | 45 ++++++++++++++++++++++ meson_options.txt | 1 + 4 files changed, 46 insertions(+), 99 deletions(-) delete mode 100644 m4/virt-storage-fs.m4 diff --git a/configure.ac b/configure.ac index 36bcc8a39a6..dc812c73d9a 100644 --- a/configure.ac +++ b/configure.ac @@ -136,7 +136,6 @@ dnl dnl Storage driver checks dnl -LIBVIRT_STORAGE_ARG_FS LIBVIRT_STORAGE_ARG_LVM LIBVIRT_STORAGE_ARG_ISCSI LIBVIRT_STORAGE_ARG_ISCSI_DIRECT @@ -149,7 +148,6 @@ LIBVIRT_STORAGE_ARG_ZFS LIBVIRT_STORAGE_ARG_VSTORAGE if test "$with_libvirtd" = "no"; then - with_storage_fs=no with_storage_lvm=no with_storage_iscsi=no with_storage_iscsi_direct=no @@ -162,13 +160,6 @@ if test "$with_libvirtd" = "no"; then with_storage_vstorage=no fi -dnl storage-fs does not work on macOS - -if test "$with_macos" = "yes"; then - with_storage_fs=no -fi - -LIBVIRT_STORAGE_CHECK_FS LIBVIRT_STORAGE_CHECK_LVM LIBVIRT_STORAGE_CHECK_ISCSI LIBVIRT_STORAGE_CHECK_ISCSI_DIRECT @@ -236,7 +227,6 @@ AC_MSG_NOTICE([=====================]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) AC_MSG_NOTICE([]) -LIBVIRT_STORAGE_RESULT_FS LIBVIRT_STORAGE_RESULT_LVM LIBVIRT_STORAGE_RESULT_ISCSI LIBVIRT_STORAGE_RESULT_ISCSI_DIRECT diff --git a/m4/virt-storage-fs.m4 b/m4/virt-storage-fs.m4 deleted file mode 100644 index 6c61e61fa77..00000000000 --- a/m4/virt-storage-fs.m4 +++ /dev/null @@ -1,89 +0,0 @@ -dnl The storage fs check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_STORAGE_ARG_FS], [ - LIBVIRT_ARG_WITH_FEATURE([STORAGE_FS], [FileSystem backend for the storage driver], - [check]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_CHECK_FS], [ - if test "$with_storage_fs" = "yes" || test "$with_storage_fs" = "check"; then - AC_CHECK_HEADER([mntent.h], , [ - if test "$with_storage_fs" = "check"; then - with_storage_fs=no - AC_MSG_NOTICE([<mntent.h> is required for the FS storage driver, disabling it]) - else - AC_MSG_ERROR([<mntent.h> is required for the FS storage driver]) - fi - ]) - fi - - if test "$with_storage_fs" = "yes" || test "$with_storage_fs" = "check"; then - AC_PATH_PROG([MOUNT], [mount], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([UMOUNT], [umount], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([MKFS], [mkfs], [], [$LIBVIRT_SBIN_PATH]) - if test "$with_storage_fs" = "yes" ; then - if test -z "$MOUNT" ; then - AC_MSG_ERROR([We need mount for FS storage driver]) - fi - if test -z "$UMOUNT" ; then - AC_MSG_ERROR([We need umount for FS storage driver]) - fi - if test -z "$MKFS" ; then - AC_MSG_ERROR([We need mkfs for FS storage driver]) - fi - else - if test -z "$MOUNT" ; then - with_storage_fs=no - fi - if test -z "$UMOUNT" ; then - with_storage_fs=no - fi - if test -z "$MKFS" ; then - with_storage_fs=no - fi - - if test "$with_storage_fs" = "check" ; then - with_storage_fs=yes - fi - fi - - if test "$with_storage_fs" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_STORAGE_FS], 1, - [whether FS backend for storage driver is enabled]) - AC_DEFINE_UNQUOTED([MOUNT], ["$MOUNT"], - [Location or name of the mount program]) - AC_DEFINE_UNQUOTED([UMOUNT], ["$UMOUNT"], - [Location or name of the mount program]) - AC_DEFINE_UNQUOTED([MKFS], ["$MKFS"], - [Location or name of the mkfs program]) - fi - fi - AM_CONDITIONAL([WITH_STORAGE_FS], [test "$with_storage_fs" = "yes"]) - if test "$with_storage_fs" = "yes"; then - AC_PATH_PROG([SHOWMOUNT], [showmount], [], [$LIBVIRT_SBIN_PATH]) - AC_DEFINE_UNQUOTED([SHOWMOUNT], ["$SHOWMOUNT"], - [Location or name of the showmount program]) - fi -]) - -AC_DEFUN([LIBVIRT_STORAGE_RESULT_FS], [ - LIBVIRT_RESULT([FS], [$with_storage_fs]) - LIBVIRT_RESULT([NetFS], [$with_storage_fs]) -]) diff --git a/meson.build b/meson.build index df105176b05..68fb89d7dea 100644 --- a/meson.build +++ b/meson.build @@ -1877,6 +1877,49 @@ if conf.has('WITH_LIBVIRTD') elif get_option('storage_disk').enabled() error('You must install libparted and libdevmapper to compile libvirt with disk storage driver') endif + + if not get_option('storage_fs').disabled() + fs_enable = true + + # storage-fs does not work on macOS + if host_machine.system() == 'darwin' + fs_enable = false + endif + + if fs_enable and not cc.has_header('mntent.h') + if get_option('storage_fs').enabled() + error('<mntent.h> is required for the FS storage driver') + else + fs_enable = false + endif + endif + + if fs_enable + mount_prog = find_program('mount', required: get_option('storage_fs'), dirs: libvirt_sbin_path) + umount_prog = find_program('umount', required: get_option('storage_fs'), dirs: libvirt_sbin_path) + mkfs_prog = find_program('mkfs', required: get_option('storage_fs'), dirs: libvirt_sbin_path) + + if not mount_prog.found() or not umount_prog.found() or not mkfs_prog.found() + fs_enable = false + endif + endif + + if fs_enable + use_storage = true + + conf.set('WITH_STORAGE_FS', 1) + conf.set_quoted('MOUNT', mount_prog.path()) + conf.set_quoted('UMOUNT', umount_prog.path()) + conf.set_quoted('MKFS', mkfs_prog.path()) + + showmount_prog = find_program('showmount', required: false, dirs: libvirt_sbin_path) + showmount_path = '' + if showmount_prog.found() + showmount_path = showmount_prog.path() + endif + conf.set_quoted('SHOWMOUNT', showmount_path) + endif + endif endif if use_storage @@ -1923,6 +1966,8 @@ summary(driver_summary, section: 'Drivers', bool_yn: true) storagedriver_summary = { 'Dir': conf.has('WITH_STORAGE_DIR'), + 'FS': conf.has('WITH_STORAGE_FS'), + 'NetFS': conf.has('WITH_STORAGE_FS'), 'Disk': conf.has('WITH_STORAGE_DISK'), } summary(storagedriver_summary, section: 'Storage Drivers', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 9b695cf5ac1..afa93b88418 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -76,3 +76,4 @@ option('secdriver_selinux', type: 'feature', value: 'auto', description: 'use SE # storage driver options option('storage_dir', type: 'feature', value: 'auto', description: 'directory backand for the storage driver') option('storage_disk', type: 'feature', value: 'auto', description: 'GPartd Disk backend for the storage driver') +option('storage_fs', type: 'feature', value: 'auto', description: 'FileSystem backend for the storage driver') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 ---- m4/virt-storage-gluster.m4 | 43 -------------------------------------- meson.build | 8 +++++++ meson_options.txt | 1 + 4 files changed, 9 insertions(+), 47 deletions(-) delete mode 100644 m4/virt-storage-gluster.m4 diff --git a/configure.ac b/configure.ac index dc812c73d9a..73c0f85ac74 100644 --- a/configure.ac +++ b/configure.ac @@ -143,7 +143,6 @@ LIBVIRT_STORAGE_ARG_SCSI LIBVIRT_STORAGE_ARG_MPATH LIBVIRT_STORAGE_ARG_RBD LIBVIRT_STORAGE_ARG_SHEEPDOG -LIBVIRT_STORAGE_ARG_GLUSTER LIBVIRT_STORAGE_ARG_ZFS LIBVIRT_STORAGE_ARG_VSTORAGE @@ -155,7 +154,6 @@ if test "$with_libvirtd" = "no"; then with_storage_mpath=no with_storage_rbd=no with_storage_sheepdog=no - with_storage_gluster=no with_storage_zfs=no with_storage_vstorage=no fi @@ -167,7 +165,6 @@ LIBVIRT_STORAGE_CHECK_SCSI LIBVIRT_STORAGE_CHECK_MPATH LIBVIRT_STORAGE_CHECK_RBD LIBVIRT_STORAGE_CHECK_SHEEPDOG -LIBVIRT_STORAGE_CHECK_GLUSTER LIBVIRT_STORAGE_CHECK_ZFS LIBVIRT_STORAGE_CHECK_VSTORAGE @@ -234,7 +231,6 @@ LIBVIRT_STORAGE_RESULT_SCSI LIBVIRT_STORAGE_RESULT_MPATH LIBVIRT_STORAGE_RESULT_RBD LIBVIRT_STORAGE_RESULT_SHEEPDOG -LIBVIRT_STORAGE_RESULT_GLUSTER LIBVIRT_STORAGE_RESULT_ZFS LIBVIRT_STORAGE_RESULT_VSTORAGE AC_MSG_NOTICE([]) diff --git a/m4/virt-storage-gluster.m4 b/m4/virt-storage-gluster.m4 deleted file mode 100644 index 0a2406f1fc5..00000000000 --- a/m4/virt-storage-gluster.m4 +++ /dev/null @@ -1,43 +0,0 @@ -dnl The storage Gluster check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_STORAGE_ARG_GLUSTER], [ - LIBVIRT_ARG_WITH_FEATURE([STORAGE_GLUSTER], [Gluster backend for the storage driver], - [check]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_CHECK_GLUSTER], [ - AC_REQUIRE([LIBVIRT_CHECK_GLUSTER]) - - if test "$with_storage_gluster" = "check"; then - with_storage_gluster=$with_glusterfs - fi - if test "$with_storage_gluster" = "yes"; then - if test "$with_glusterfs" = no; then - AC_MSG_ERROR([Need glusterfs (libgfapi) for gluster storage driver]) - fi - AC_DEFINE_UNQUOTED([WITH_STORAGE_GLUSTER], [1], - [whether Gluster backend for storage driver is enabled]) - fi - AM_CONDITIONAL([WITH_STORAGE_GLUSTER], [test "$with_storage_gluster" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_RESULT_GLUSTER], [ - LIBVIRT_RESULT([Gluster], [$with_storage_gluster]) -]) diff --git a/meson.build b/meson.build index 68fb89d7dea..5678038c5e8 100644 --- a/meson.build +++ b/meson.build @@ -1920,6 +1920,13 @@ if conf.has('WITH_LIBVIRTD') conf.set_quoted('SHOWMOUNT', showmount_path) endif endif + + if not get_option('storage_gluster').disabled() and glusterfs_dep.found() + use_storage = true + conf.set('WITH_STORAGE_GLUSTER', 1) + elif get_option('storage_gluster').enabled() + error('Need glusterfs (libgfapi) for gluster storage driver') + endif endif if use_storage @@ -1969,6 +1976,7 @@ storagedriver_summary = { 'FS': conf.has('WITH_STORAGE_FS'), 'NetFS': conf.has('WITH_STORAGE_FS'), 'Disk': conf.has('WITH_STORAGE_DISK'), + 'Gluster': conf.has('WITH_STORAGE_GLUSTER'), } summary(storagedriver_summary, section: 'Storage Drivers', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index afa93b88418..fe41c2671c2 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -77,3 +77,4 @@ option('secdriver_selinux', type: 'feature', value: 'auto', description: 'use SE option('storage_dir', type: 'feature', value: 'auto', description: 'directory backand for the storage driver') option('storage_disk', type: 'feature', value: 'auto', description: 'GPartd Disk backend for the storage driver') option('storage_fs', type: 'feature', value: 'auto', description: 'FileSystem backend for the storage driver') +option('storage_gluster', type: 'feature', value: 'auto', description: 'Gluster backend for the storage driver') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 ---- m4/virt-storage-iscsi.m4 | 44 ---------------------------------------- meson.build | 8 ++++++++ meson_options.txt | 1 + 4 files changed, 9 insertions(+), 48 deletions(-) delete mode 100644 m4/virt-storage-iscsi.m4 diff --git a/configure.ac b/configure.ac index 73c0f85ac74..ba2b247b926 100644 --- a/configure.ac +++ b/configure.ac @@ -137,7 +137,6 @@ dnl Storage driver checks dnl LIBVIRT_STORAGE_ARG_LVM -LIBVIRT_STORAGE_ARG_ISCSI LIBVIRT_STORAGE_ARG_ISCSI_DIRECT LIBVIRT_STORAGE_ARG_SCSI LIBVIRT_STORAGE_ARG_MPATH @@ -148,7 +147,6 @@ LIBVIRT_STORAGE_ARG_VSTORAGE if test "$with_libvirtd" = "no"; then with_storage_lvm=no - with_storage_iscsi=no with_storage_iscsi_direct=no with_storage_scsi=no with_storage_mpath=no @@ -159,7 +157,6 @@ if test "$with_libvirtd" = "no"; then fi LIBVIRT_STORAGE_CHECK_LVM -LIBVIRT_STORAGE_CHECK_ISCSI LIBVIRT_STORAGE_CHECK_ISCSI_DIRECT LIBVIRT_STORAGE_CHECK_SCSI LIBVIRT_STORAGE_CHECK_MPATH @@ -225,7 +222,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) AC_MSG_NOTICE([]) LIBVIRT_STORAGE_RESULT_LVM -LIBVIRT_STORAGE_RESULT_ISCSI LIBVIRT_STORAGE_RESULT_ISCSI_DIRECT LIBVIRT_STORAGE_RESULT_SCSI LIBVIRT_STORAGE_RESULT_MPATH diff --git a/m4/virt-storage-iscsi.m4 b/m4/virt-storage-iscsi.m4 deleted file mode 100644 index 0e04079a1cc..00000000000 --- a/m4/virt-storage-iscsi.m4 +++ /dev/null @@ -1,44 +0,0 @@ -dnl The storage iSCSI check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_STORAGE_ARG_ISCSI], [ - LIBVIRT_ARG_WITH_FEATURE([STORAGE_ISCSI], [iSCSI backend for the storage driver], - [check]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_CHECK_ISCSI], [ - if test "$with_storage_iscsi" = "yes" || test "$with_storage_iscsi" = "check"; then - if test "$with_storage_iscsi" = "yes" ; then - if test -z "$ISCSIADM" ; then AC_MSG_ERROR([We need iscsiadm for iSCSI storage driver]) ; fi - else - if test -z "$ISCSIADM" ; then with_storage_iscsi=no ; fi - - if test "$with_storage_iscsi" = "check" ; then with_storage_iscsi=yes ; fi - fi - - if test "$with_storage_iscsi" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_STORAGE_ISCSI], 1, [whether iSCSI backend for storage driver is enabled]) - fi - fi - AM_CONDITIONAL([WITH_STORAGE_ISCSI], [test "$with_storage_iscsi" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_RESULT_ISCSI], [ - LIBVIRT_RESULT([iSCSI], [$with_storage_iscsi]) -]) diff --git a/meson.build b/meson.build index 5678038c5e8..2066c537d73 100644 --- a/meson.build +++ b/meson.build @@ -1927,6 +1927,13 @@ if conf.has('WITH_LIBVIRTD') elif get_option('storage_gluster').enabled() error('Need glusterfs (libgfapi) for gluster storage driver') endif + + if not get_option('storage_iscsi').disabled() and iscsiadm_prog.found() + use_storage = true + conf.set('WITH_STORAGE_ISCSI', 1) + elif get_option('storage_iscsi').enabled() + error('We need iscsiadm for iSCSI storage driver') + endif endif if use_storage @@ -1975,6 +1982,7 @@ storagedriver_summary = { 'Dir': conf.has('WITH_STORAGE_DIR'), 'FS': conf.has('WITH_STORAGE_FS'), 'NetFS': conf.has('WITH_STORAGE_FS'), + 'iSCSI': conf.has('WITH_STORAGE_ISCSI'), 'Disk': conf.has('WITH_STORAGE_DISK'), 'Gluster': conf.has('WITH_STORAGE_GLUSTER'), } diff --git a/meson_options.txt b/meson_options.txt index fe41c2671c2..cff49277ea1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -78,3 +78,4 @@ option('storage_dir', type: 'feature', value: 'auto', description: 'directory ba option('storage_disk', type: 'feature', value: 'auto', description: 'GPartd Disk backend for the storage driver') option('storage_fs', type: 'feature', value: 'auto', description: 'FileSystem backend for the storage driver') option('storage_gluster', type: 'feature', value: 'auto', description: 'Gluster backend for the storage driver') +option('storage_iscsi', type: 'feature', value: 'auto', description: 'iscsi backend for the storage driver') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 --- m4/virt-storage-iscsi-direct.m4 | 44 --------------------------------- meson.build | 8 ++++++ meson_options.txt | 1 + 4 files changed, 9 insertions(+), 48 deletions(-) delete mode 100644 m4/virt-storage-iscsi-direct.m4 diff --git a/configure.ac b/configure.ac index ba2b247b926..688425956e1 100644 --- a/configure.ac +++ b/configure.ac @@ -137,7 +137,6 @@ dnl Storage driver checks dnl LIBVIRT_STORAGE_ARG_LVM -LIBVIRT_STORAGE_ARG_ISCSI_DIRECT LIBVIRT_STORAGE_ARG_SCSI LIBVIRT_STORAGE_ARG_MPATH LIBVIRT_STORAGE_ARG_RBD @@ -147,7 +146,6 @@ LIBVIRT_STORAGE_ARG_VSTORAGE if test "$with_libvirtd" = "no"; then with_storage_lvm=no - with_storage_iscsi_direct=no with_storage_scsi=no with_storage_mpath=no with_storage_rbd=no @@ -157,7 +155,6 @@ if test "$with_libvirtd" = "no"; then fi LIBVIRT_STORAGE_CHECK_LVM -LIBVIRT_STORAGE_CHECK_ISCSI_DIRECT LIBVIRT_STORAGE_CHECK_SCSI LIBVIRT_STORAGE_CHECK_MPATH LIBVIRT_STORAGE_CHECK_RBD @@ -222,7 +219,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) AC_MSG_NOTICE([]) LIBVIRT_STORAGE_RESULT_LVM -LIBVIRT_STORAGE_RESULT_ISCSI_DIRECT LIBVIRT_STORAGE_RESULT_SCSI LIBVIRT_STORAGE_RESULT_MPATH LIBVIRT_STORAGE_RESULT_RBD diff --git a/m4/virt-storage-iscsi-direct.m4 b/m4/virt-storage-iscsi-direct.m4 deleted file mode 100644 index dab44141691..00000000000 --- a/m4/virt-storage-iscsi-direct.m4 +++ /dev/null @@ -1,44 +0,0 @@ -dnl Iscsi-direct storage -dnl -dnl Copyright (C) 2018 Clementine Hayat. -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_STORAGE_ARG_ISCSI_DIRECT], [ - LIBVIRT_ARG_WITH_FEATURE([STORAGE_ISCSI_DIRECT], - [iscsi-direct backend for the storage driver], - [check]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_CHECK_ISCSI_DIRECT], [ - AC_REQUIRE([LIBVIRT_CHECK_LIBISCSI]) - if test "$with_storage_iscsi_direct" = "check"; then - with_storage_iscsi_direct=$with_libiscsi - fi - if test "$with_storage_iscsi_direct" = "yes"; then - if test "$with_libiscsi" = "no"; then - AC_MSG_ERROR([Need libiscsi for iscsi-direct storage driver]) - fi - AC_DEFINE_UNQUOTED([WITH_STORAGE_ISCSI_DIRECT], [1], - [whether iSCSI backend for storage driver is enabled]) - fi - AM_CONDITIONAL([WITH_STORAGE_ISCSI_DIRECT], - [test "$with_storage_iscsi_direct" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_RESULT_ISCSI_DIRECT], [ - LIBVIRT_RESULT([iscsi-direct], [$with_storage_iscsi_direct]) -]) diff --git a/meson.build b/meson.build index 2066c537d73..4576f18a6e2 100644 --- a/meson.build +++ b/meson.build @@ -1934,6 +1934,13 @@ if conf.has('WITH_LIBVIRTD') elif get_option('storage_iscsi').enabled() error('We need iscsiadm for iSCSI storage driver') endif + + if not get_option('storage_iscsi_direct').disabled() and libiscsi_dep.found() + use_storage = true + conf.set('WITH_STORAGE_ISCSI_DIRECT', 1) + elif get_option('storage_iscsi_direct').enabled() + error('Need libiscsi for iscsi-direct storage driver') + endif endif if use_storage @@ -1983,6 +1990,7 @@ storagedriver_summary = { 'FS': conf.has('WITH_STORAGE_FS'), 'NetFS': conf.has('WITH_STORAGE_FS'), 'iSCSI': conf.has('WITH_STORAGE_ISCSI'), + 'iscsi-direct': conf.has('WITH_STORAGE_ISCSI_DIRECT'), 'Disk': conf.has('WITH_STORAGE_DISK'), 'Gluster': conf.has('WITH_STORAGE_GLUSTER'), } diff --git a/meson_options.txt b/meson_options.txt index cff49277ea1..975479e7b8c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -79,3 +79,4 @@ option('storage_disk', type: 'feature', value: 'auto', description: 'GPartd Disk option('storage_fs', type: 'feature', value: 'auto', description: 'FileSystem backend for the storage driver') option('storage_gluster', type: 'feature', value: 'auto', description: 'Gluster backend for the storage driver') option('storage_iscsi', type: 'feature', value: 'auto', description: 'iscsi backend for the storage driver') +option('storage_iscsi_direct', type: 'feature', value: 'auto', description: 'iscsi-direct backend for the storage driver') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 -- m4/virt-storage-lvm.m4 | 90 ------------------------------------------ meson.build | 29 ++++++++++++++ meson_options.txt | 1 + 4 files changed, 30 insertions(+), 94 deletions(-) delete mode 100644 m4/virt-storage-lvm.m4 diff --git a/configure.ac b/configure.ac index 688425956e1..acfad8737ee 100644 --- a/configure.ac +++ b/configure.ac @@ -136,7 +136,6 @@ dnl dnl Storage driver checks dnl -LIBVIRT_STORAGE_ARG_LVM LIBVIRT_STORAGE_ARG_SCSI LIBVIRT_STORAGE_ARG_MPATH LIBVIRT_STORAGE_ARG_RBD @@ -145,7 +144,6 @@ LIBVIRT_STORAGE_ARG_ZFS LIBVIRT_STORAGE_ARG_VSTORAGE if test "$with_libvirtd" = "no"; then - with_storage_lvm=no with_storage_scsi=no with_storage_mpath=no with_storage_rbd=no @@ -154,7 +152,6 @@ if test "$with_libvirtd" = "no"; then with_storage_vstorage=no fi -LIBVIRT_STORAGE_CHECK_LVM LIBVIRT_STORAGE_CHECK_SCSI LIBVIRT_STORAGE_CHECK_MPATH LIBVIRT_STORAGE_CHECK_RBD @@ -218,7 +215,6 @@ AC_MSG_NOTICE([=====================]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) AC_MSG_NOTICE([]) -LIBVIRT_STORAGE_RESULT_LVM LIBVIRT_STORAGE_RESULT_SCSI LIBVIRT_STORAGE_RESULT_MPATH LIBVIRT_STORAGE_RESULT_RBD diff --git a/m4/virt-storage-lvm.m4 b/m4/virt-storage-lvm.m4 deleted file mode 100644 index a0ccca7a00a..00000000000 --- a/m4/virt-storage-lvm.m4 +++ /dev/null @@ -1,90 +0,0 @@ -dnl The storage LVM check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_STORAGE_ARG_LVM], [ - LIBVIRT_ARG_WITH_FEATURE([STORAGE_LVM], [LVM backend for storage driver], [check]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_CHECK_LVM], [ - if test "$with_storage_lvm" = "yes" || test "$with_storage_lvm" = "check"; then - AC_PATH_PROG([PVCREATE], [pvcreate], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([VGCREATE], [vgcreate], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([LVCREATE], [lvcreate], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([PVREMOVE], [pvremove], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([VGREMOVE], [vgremove], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([LVREMOVE], [lvremove], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([LVCHANGE], [lvchange], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([VGCHANGE], [vgchange], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([VGSCAN], [vgscan], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([PVS], [pvs], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([VGS], [vgs], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([LVS], [lvs], [], [$LIBVIRT_SBIN_PATH]) - - if test "$with_storage_lvm" = "yes" ; then - if test -z "$PVCREATE" ; then AC_MSG_ERROR([We need pvcreate for LVM storage driver]) ; fi - if test -z "$VGCREATE" ; then AC_MSG_ERROR([We need vgcreate for LVM storage driver]) ; fi - if test -z "$LVCREATE" ; then AC_MSG_ERROR([We need lvcreate for LVM storage driver]) ; fi - if test -z "$PVREMOVE" ; then AC_MSG_ERROR([We need pvremove for LVM storage driver]) ; fi - if test -z "$VGREMOVE" ; then AC_MSG_ERROR([We need vgremove for LVM storage driver]) ; fi - if test -z "$LVREMOVE" ; then AC_MSG_ERROR([We need lvremove for LVM storage driver]) ; fi - if test -z "$LVCHANGE" ; then AC_MSG_ERROR([We need lvchange for LVM storage driver]) ; fi - if test -z "$VGCHANGE" ; then AC_MSG_ERROR([We need vgchange for LVM storage driver]) ; fi - if test -z "$VGSCAN" ; then AC_MSG_ERROR([We need vgscan for LVM storage driver]) ; fi - if test -z "$PVS" ; then AC_MSG_ERROR([We need pvs for LVM storage driver]) ; fi - if test -z "$VGS" ; then AC_MSG_ERROR([We need vgs for LVM storage driver]) ; fi - if test -z "$LVS" ; then AC_MSG_ERROR([We need lvs for LVM storage driver]) ; fi - else - if test -z "$PVCREATE" ; then with_storage_lvm=no ; fi - if test -z "$VGCREATE" ; then with_storage_lvm=no ; fi - if test -z "$LVCREATE" ; then with_storage_lvm=no ; fi - if test -z "$PVREMOVE" ; then with_storage_lvm=no ; fi - if test -z "$VGREMOVE" ; then with_storage_lvm=no ; fi - if test -z "$LVREMOVE" ; then with_storage_lvm=no ; fi - if test -z "$LVCHANGE" ; then with_storage_lvm=no ; fi - if test -z "$VGCHANGE" ; then with_storage_lvm=no ; fi - if test -z "$VGSCAN" ; then with_storage_lvm=no ; fi - if test -z "$PVS" ; then with_storage_lvm=no ; fi - if test -z "$VGS" ; then with_storage_lvm=no ; fi - if test -z "$LVS" ; then with_storage_lvm=no ; fi - - if test "$with_storage_lvm" = "check" ; then with_storage_lvm=yes ; fi - fi - - if test "$with_storage_lvm" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_STORAGE_LVM], 1, [whether LVM backend for storage driver is enabled]) - AC_DEFINE_UNQUOTED([PVCREATE],["$PVCREATE"],[Location of pvcreate program]) - AC_DEFINE_UNQUOTED([VGCREATE],["$VGCREATE"],[Location of vgcreate program]) - AC_DEFINE_UNQUOTED([LVCREATE],["$LVCREATE"],[Location of lvcreate program]) - AC_DEFINE_UNQUOTED([PVREMOVE],["$PVREMOVE"],[Location of pvremove program]) - AC_DEFINE_UNQUOTED([VGREMOVE],["$VGREMOVE"],[Location of vgremove program]) - AC_DEFINE_UNQUOTED([LVREMOVE],["$LVREMOVE"],[Location of lvremove program]) - AC_DEFINE_UNQUOTED([LVCHANGE],["$LVCHANGE"],[Location of lvchange program]) - AC_DEFINE_UNQUOTED([VGCHANGE],["$VGCHANGE"],[Location of vgchange program]) - AC_DEFINE_UNQUOTED([VGSCAN],["$VGSCAN"],[Location of vgscan program]) - AC_DEFINE_UNQUOTED([PVS],["$PVS"],[Location of pvs program]) - AC_DEFINE_UNQUOTED([VGS],["$VGS"],[Location of vgs program]) - AC_DEFINE_UNQUOTED([LVS],["$LVS"],[Location of lvs program]) - fi - fi - AM_CONDITIONAL([WITH_STORAGE_LVM], [test "$with_storage_lvm" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_RESULT_LVM], [ - LIBVIRT_RESULT([LVM], [$with_storage_lvm]) -]) diff --git a/meson.build b/meson.build index 4576f18a6e2..cecc161ed85 100644 --- a/meson.build +++ b/meson.build @@ -1941,6 +1941,34 @@ if conf.has('WITH_LIBVIRTD') elif get_option('storage_iscsi_direct').enabled() error('Need libiscsi for iscsi-direct storage driver') endif + + if not get_option('storage_lvm').disabled() + lvm_enable = true + lvm_progs = [ + 'pvcreate', 'vgcreate', 'lvcreate', + 'pvremove', 'vgremove', 'lvremove', + 'lvchange', 'vgchange', 'vgscan', + 'pvs', 'vgs', 'lvs', + ] + foreach name : lvm_progs + set_variable( + '@0@_prog'.format(name), + find_program(name, required: get_option('storage_lvm'), dirs: libvirt_sbin_path) + ) + if not get_variable('@0@_prog'.format(name)).found() + lvm_enable = false + endif + endforeach + + if lvm_enable + use_storage = true + conf.set('WITH_STORAGE_LVM', 1) + + foreach name : lvm_progs + conf.set_quoted(name.to_upper(), get_variable('@0@_prog'.format(name)).path()) + endforeach + endif + endif endif if use_storage @@ -1989,6 +2017,7 @@ storagedriver_summary = { 'Dir': conf.has('WITH_STORAGE_DIR'), 'FS': conf.has('WITH_STORAGE_FS'), 'NetFS': conf.has('WITH_STORAGE_FS'), + 'LVM': conf.has('WITH_STORAGE_LVM'), 'iSCSI': conf.has('WITH_STORAGE_ISCSI'), 'iscsi-direct': conf.has('WITH_STORAGE_ISCSI_DIRECT'), 'Disk': conf.has('WITH_STORAGE_DISK'), diff --git a/meson_options.txt b/meson_options.txt index 975479e7b8c..66e232f59dc 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -80,3 +80,4 @@ option('storage_fs', type: 'feature', value: 'auto', description: 'FileSystem ba option('storage_gluster', type: 'feature', value: 'auto', description: 'Gluster backend for the storage driver') option('storage_iscsi', type: 'feature', value: 'auto', description: 'iscsi backend for the storage driver') option('storage_iscsi_direct', type: 'feature', value: 'auto', description: 'iscsi-direct backend for the storage driver') +option('storage_lvm', type: 'feature', value: 'auto', description: 'LVM backend for the storage driver') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 --- m4/virt-storage-mpath.m4 | 53 ---------------------------------------- meson.build | 8 ++++++ meson_options.txt | 1 + 4 files changed, 9 insertions(+), 57 deletions(-) delete mode 100644 m4/virt-storage-mpath.m4 diff --git a/configure.ac b/configure.ac index acfad8737ee..465d9974ac4 100644 --- a/configure.ac +++ b/configure.ac @@ -137,7 +137,6 @@ dnl Storage driver checks dnl LIBVIRT_STORAGE_ARG_SCSI -LIBVIRT_STORAGE_ARG_MPATH LIBVIRT_STORAGE_ARG_RBD LIBVIRT_STORAGE_ARG_SHEEPDOG LIBVIRT_STORAGE_ARG_ZFS @@ -145,7 +144,6 @@ LIBVIRT_STORAGE_ARG_VSTORAGE if test "$with_libvirtd" = "no"; then with_storage_scsi=no - with_storage_mpath=no with_storage_rbd=no with_storage_sheepdog=no with_storage_zfs=no @@ -153,7 +151,6 @@ if test "$with_libvirtd" = "no"; then fi LIBVIRT_STORAGE_CHECK_SCSI -LIBVIRT_STORAGE_CHECK_MPATH LIBVIRT_STORAGE_CHECK_RBD LIBVIRT_STORAGE_CHECK_SHEEPDOG LIBVIRT_STORAGE_CHECK_ZFS @@ -216,7 +213,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) AC_MSG_NOTICE([]) LIBVIRT_STORAGE_RESULT_SCSI -LIBVIRT_STORAGE_RESULT_MPATH LIBVIRT_STORAGE_RESULT_RBD LIBVIRT_STORAGE_RESULT_SHEEPDOG LIBVIRT_STORAGE_RESULT_ZFS diff --git a/m4/virt-storage-mpath.m4 b/m4/virt-storage-mpath.m4 deleted file mode 100644 index d4f8ecfb9ea..00000000000 --- a/m4/virt-storage-mpath.m4 +++ /dev/null @@ -1,53 +0,0 @@ -dnl The storage mpath check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_STORAGE_ARG_MPATH], [ - LIBVIRT_ARG_WITH_FEATURE([STORAGE_MPATH], [mpath backend for the storage driver], - [check]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_CHECK_MPATH], [ - AC_REQUIRE([LIBVIRT_CHECK_DEVMAPPER]) - - if test "$with_storage_mpath" = "check" || test "$with_storage_mpath" = "yes"; then - if test "$with_linux" = "yes"; then - with_storage_mpath=yes - - AC_DEFINE_UNQUOTED([WITH_STORAGE_MPATH], 1, - [whether mpath backend for storage driver is enabled]) - else - if test "$with_storage_mpath" = "yes"; then - AC_MSG_ERROR([mpath storage is only supported on Linux]) - fi - with_storage_mpath=no - fi - fi - - if test "x$with_storage_mpath" = "xyes"; then - if test "x$with_devmapper" = "xno"; then - AC_MSG_ERROR([You must install device-mapper-devel/libdevmapper to compile libvirt with mpath storage driver]) - fi - fi - - AM_CONDITIONAL([WITH_STORAGE_MPATH], [test "$with_storage_mpath" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_RESULT_MPATH], [ - LIBVIRT_RESULT([mpath], [$with_storage_mpath]) -]) diff --git a/meson.build b/meson.build index cecc161ed85..c30026bc696 100644 --- a/meson.build +++ b/meson.build @@ -1969,6 +1969,13 @@ if conf.has('WITH_LIBVIRTD') endforeach endif endif + + if not get_option('storage_mpath').disabled() and host_machine.system() == 'linux' and devmapper_dep.found() + use_storage = true + conf.set('WITH_STORAGE_MPATH', 1) + elif get_option('storage_mpath').enabled() + error('mpath storage driver is supported only on Linux and you must install libdevmapper') + endif endif if use_storage @@ -2020,6 +2027,7 @@ storagedriver_summary = { 'LVM': conf.has('WITH_STORAGE_LVM'), 'iSCSI': conf.has('WITH_STORAGE_ISCSI'), 'iscsi-direct': conf.has('WITH_STORAGE_ISCSI_DIRECT'), + 'mpath': conf.has('WITH_STORAGE_MPATH'), 'Disk': conf.has('WITH_STORAGE_DISK'), 'Gluster': conf.has('WITH_STORAGE_GLUSTER'), } diff --git a/meson_options.txt b/meson_options.txt index 66e232f59dc..97e18987860 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -81,3 +81,4 @@ option('storage_gluster', type: 'feature', value: 'auto', description: 'Gluster option('storage_iscsi', type: 'feature', value: 'auto', description: 'iscsi backend for the storage driver') option('storage_iscsi_direct', type: 'feature', value: 'auto', description: 'iscsi-direct backend for the storage driver') option('storage_lvm', type: 'feature', value: 'auto', description: 'LVM backend for the storage driver') +option('storage_mpath', type: 'feature', value: 'auto', description: 'mpath backend for the storage driver') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 5 ----- m4/virt-storage-rbd.m4 | 50 ------------------------------------------ meson.build | 8 +++++++ meson_options.txt | 1 + 4 files changed, 9 insertions(+), 55 deletions(-) delete mode 100644 m4/virt-storage-rbd.m4 diff --git a/configure.ac b/configure.ac index 465d9974ac4..ad43de7f39e 100644 --- a/configure.ac +++ b/configure.ac @@ -137,21 +137,18 @@ dnl Storage driver checks dnl LIBVIRT_STORAGE_ARG_SCSI -LIBVIRT_STORAGE_ARG_RBD LIBVIRT_STORAGE_ARG_SHEEPDOG LIBVIRT_STORAGE_ARG_ZFS LIBVIRT_STORAGE_ARG_VSTORAGE if test "$with_libvirtd" = "no"; then with_storage_scsi=no - with_storage_rbd=no with_storage_sheepdog=no with_storage_zfs=no with_storage_vstorage=no fi LIBVIRT_STORAGE_CHECK_SCSI -LIBVIRT_STORAGE_CHECK_RBD LIBVIRT_STORAGE_CHECK_SHEEPDOG LIBVIRT_STORAGE_CHECK_ZFS LIBVIRT_STORAGE_CHECK_VSTORAGE @@ -213,7 +210,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) AC_MSG_NOTICE([]) LIBVIRT_STORAGE_RESULT_SCSI -LIBVIRT_STORAGE_RESULT_RBD LIBVIRT_STORAGE_RESULT_SHEEPDOG LIBVIRT_STORAGE_RESULT_ZFS LIBVIRT_STORAGE_RESULT_VSTORAGE @@ -226,7 +222,6 @@ AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_NSS LIBVIRT_RESULT_PM_UTILS -LIBVIRT_RESULT_RBD AC_MSG_NOTICE([]) AC_MSG_NOTICE([Windows]) AC_MSG_NOTICE([]) diff --git a/m4/virt-storage-rbd.m4 b/m4/virt-storage-rbd.m4 deleted file mode 100644 index cd3b24ea2fa..00000000000 --- a/m4/virt-storage-rbd.m4 +++ /dev/null @@ -1,50 +0,0 @@ -dnl The storage RBD check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_STORAGE_ARG_RBD], [ - LIBVIRT_ARG_WITH_FEATURE([STORAGE_RBD], - [RADOS Block Device backend for the storage driver], [check]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_CHECK_RBD], [ - LIBRBD_LIBS= - if test "$with_storage_rbd" = "yes" || test "$with_storage_rbd" = "check"; then - if test "$LIBRBD_FOUND" = "yes"; then - with_storage_rbd=yes - AC_DEFINE_UNQUOTED([WITH_STORAGE_RBD], [1], - [whether RBD backend for storage driver is enabled]) - else - if test "$with_storage_rbd" = "yes"; then - AC_MSG_ERROR([You must install the librbd library & headers to compile libvirt]) - else - with_storage_rbd=no - fi - fi - fi - AM_CONDITIONAL([WITH_STORAGE_RBD], [test "$with_storage_rbd" = "yes"]) - AC_SUBST([LIBRBD_LIBS]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_RESULT_RBD], [ - LIBVIRT_RESULT([RBD], [$with_storage_rbd]) -]) - -AC_DEFUN([LIBVIRT_RESULT_RBD], [ - LIBVIRT_RESULT([rbd], [$with_storage_rbd], [CFLAGS='' LIBS='$LIBRBD_LIBS']) -]) diff --git a/meson.build b/meson.build index c30026bc696..b31e77b81a3 100644 --- a/meson.build +++ b/meson.build @@ -1976,6 +1976,13 @@ if conf.has('WITH_LIBVIRTD') elif get_option('storage_mpath').enabled() error('mpath storage driver is supported only on Linux and you must install libdevmapper') endif + + if not get_option('storage_rbd').disabled() and rbd_dep.found() + use_storage = true + conf.set('WITH_STORAGE_RBD', 1) + elif get_option('storage_rbd').enabled() + error('You must install the librbd library & headers to compile libvirt') + endif endif if use_storage @@ -2029,6 +2036,7 @@ storagedriver_summary = { 'iscsi-direct': conf.has('WITH_STORAGE_ISCSI_DIRECT'), 'mpath': conf.has('WITH_STORAGE_MPATH'), 'Disk': conf.has('WITH_STORAGE_DISK'), + 'RBD': conf.has('WITH_STORAGE_RBD'), 'Gluster': conf.has('WITH_STORAGE_GLUSTER'), } summary(storagedriver_summary, section: 'Storage Drivers', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 97e18987860..0e256fb1004 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -82,3 +82,4 @@ option('storage_iscsi', type: 'feature', value: 'auto', description: 'iscsi back option('storage_iscsi_direct', type: 'feature', value: 'auto', description: 'iscsi-direct backend for the storage driver') option('storage_lvm', type: 'feature', value: 'auto', description: 'LVM backend for the storage driver') option('storage_mpath', type: 'feature', value: 'auto', description: 'mpath backend for the storage driver') +option('storage_rbd', type: 'feature', value: 'auto', description: 'RADOS Block Device backend for the storage driver') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 6 ------ m4/virt-storage-scsi.m4 | 36 ------------------------------------ meson.build | 6 ++++++ meson_options.txt | 1 + 4 files changed, 7 insertions(+), 42 deletions(-) delete mode 100644 m4/virt-storage-scsi.m4 diff --git a/configure.ac b/configure.ac index ad43de7f39e..5f77e47dd10 100644 --- a/configure.ac +++ b/configure.ac @@ -75,10 +75,8 @@ esac if test $with_linux = no; then with_dtrace=no - with_storage_scsi=no fi - AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"]) AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"]) AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" = "yes"]) @@ -136,19 +134,16 @@ dnl dnl Storage driver checks dnl -LIBVIRT_STORAGE_ARG_SCSI LIBVIRT_STORAGE_ARG_SHEEPDOG LIBVIRT_STORAGE_ARG_ZFS LIBVIRT_STORAGE_ARG_VSTORAGE if test "$with_libvirtd" = "no"; then - with_storage_scsi=no with_storage_sheepdog=no with_storage_zfs=no with_storage_vstorage=no fi -LIBVIRT_STORAGE_CHECK_SCSI LIBVIRT_STORAGE_CHECK_SHEEPDOG LIBVIRT_STORAGE_CHECK_ZFS LIBVIRT_STORAGE_CHECK_VSTORAGE @@ -209,7 +204,6 @@ AC_MSG_NOTICE([=====================]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) AC_MSG_NOTICE([]) -LIBVIRT_STORAGE_RESULT_SCSI LIBVIRT_STORAGE_RESULT_SHEEPDOG LIBVIRT_STORAGE_RESULT_ZFS LIBVIRT_STORAGE_RESULT_VSTORAGE diff --git a/m4/virt-storage-scsi.m4 b/m4/virt-storage-scsi.m4 deleted file mode 100644 index ea4e47cbda8..00000000000 --- a/m4/virt-storage-scsi.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl The storage SCSI check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_STORAGE_ARG_SCSI], [ - LIBVIRT_ARG_WITH_FEATURE([STORAGE_SCSI], [SCSI backend for the storage driver], [check]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_CHECK_SCSI], [ - if test "$with_storage_scsi" = "check" || test "$with_storage_scsi" = "yes"; then - with_storage_scsi=yes - - AC_DEFINE_UNQUOTED([WITH_STORAGE_SCSI], 1, - [whether SCSI backend for storage driver is enabled]) - fi - AM_CONDITIONAL([WITH_STORAGE_SCSI], [test "$with_storage_scsi" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_RESULT_SCSI], [ - LIBVIRT_RESULT([SCSI], [$with_storage_scsi]) -]) diff --git a/meson.build b/meson.build index b31e77b81a3..1caa824ad40 100644 --- a/meson.build +++ b/meson.build @@ -1983,6 +1983,11 @@ if conf.has('WITH_LIBVIRTD') elif get_option('storage_rbd').enabled() error('You must install the librbd library & headers to compile libvirt') endif + + if not get_option('storage_scsi').disabled() and host_machine.system() == 'linux' + use_storage = true + conf.set('WITH_STORAGE_SCSI', 1) + endif endif if use_storage @@ -2034,6 +2039,7 @@ storagedriver_summary = { 'LVM': conf.has('WITH_STORAGE_LVM'), 'iSCSI': conf.has('WITH_STORAGE_ISCSI'), 'iscsi-direct': conf.has('WITH_STORAGE_ISCSI_DIRECT'), + 'SCSI': conf.has('WITH_STORAGE_SCSI'), 'mpath': conf.has('WITH_STORAGE_MPATH'), 'Disk': conf.has('WITH_STORAGE_DISK'), 'RBD': conf.has('WITH_STORAGE_RBD'), diff --git a/meson_options.txt b/meson_options.txt index 0e256fb1004..5cd4a9e28fd 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -83,3 +83,4 @@ option('storage_iscsi_direct', type: 'feature', value: 'auto', description: 'isc option('storage_lvm', type: 'feature', value: 'auto', description: 'LVM backend for the storage driver') option('storage_mpath', type: 'feature', value: 'auto', description: 'mpath backend for the storage driver') option('storage_rbd', type: 'feature', value: 'auto', description: 'RADOS Block Device backend for the storage driver') +option('storage_scsi', type: 'feature', value: 'auto', description: 'SCSI backend for the storage driver') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 --- m4/virt-storage-sheepdog.m4 | 56 ------------------------------------- meson.build | 11 ++++++++ meson_options.txt | 1 + 4 files changed, 12 insertions(+), 60 deletions(-) delete mode 100644 m4/virt-storage-sheepdog.m4 diff --git a/configure.ac b/configure.ac index 5f77e47dd10..ba15aa9bb2b 100644 --- a/configure.ac +++ b/configure.ac @@ -134,17 +134,14 @@ dnl dnl Storage driver checks dnl -LIBVIRT_STORAGE_ARG_SHEEPDOG LIBVIRT_STORAGE_ARG_ZFS LIBVIRT_STORAGE_ARG_VSTORAGE if test "$with_libvirtd" = "no"; then - with_storage_sheepdog=no with_storage_zfs=no with_storage_vstorage=no fi -LIBVIRT_STORAGE_CHECK_SHEEPDOG LIBVIRT_STORAGE_CHECK_ZFS LIBVIRT_STORAGE_CHECK_VSTORAGE @@ -204,7 +201,6 @@ AC_MSG_NOTICE([=====================]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) AC_MSG_NOTICE([]) -LIBVIRT_STORAGE_RESULT_SHEEPDOG LIBVIRT_STORAGE_RESULT_ZFS LIBVIRT_STORAGE_RESULT_VSTORAGE AC_MSG_NOTICE([]) diff --git a/m4/virt-storage-sheepdog.m4 b/m4/virt-storage-sheepdog.m4 deleted file mode 100644 index aa5587f40f9..00000000000 --- a/m4/virt-storage-sheepdog.m4 +++ /dev/null @@ -1,56 +0,0 @@ -dnl The storage Sheepdog check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_STORAGE_ARG_SHEEPDOG], [ - LIBVIRT_ARG_WITH_FEATURE([STORAGE_SHEEPDOG], - [with Sheepdog backend for the storage driver], [check]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_CHECK_SHEEPDOG], [ - if test "$with_storage_sheepdog" = "yes" || - test "$with_storage_sheepdog" = "check"; then - AC_PATH_PROGS([SHEEPDOGCLI], [collie dog], [], [$LIBVIRT_SBIN_PATH]) - - if test "$with_storage_sheepdog" = "yes"; then - if test -z "$SHEEPDOGCLI"; then - AC_MSG_ERROR([We need sheepdog client for Sheepdog storage driver]) - fi - else - if test -z "$SHEEPDOGCLI"; then - with_storage_sheepdog=no - fi - - if test "$with_storage_sheepdog" = "check"; then - with_storage_sheepdog=yes - fi - fi - - if test "$with_storage_sheepdog" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_STORAGE_SHEEPDOG], 1, - [whether Sheepdog backend for storage driver is enabled]) - AC_DEFINE_UNQUOTED([SHEEPDOGCLI], ["$SHEEPDOGCLI"], - [Location of sheepdog client program]) - fi - fi - AM_CONDITIONAL([WITH_STORAGE_SHEEPDOG], [test "$with_storage_sheepdog" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_RESULT_SHEEPDOG], [ - LIBVIRT_RESULT([Sheepdog], [$with_storage_sheepdog]) -]) diff --git a/meson.build b/meson.build index 1caa824ad40..fcd4bc5e5da 100644 --- a/meson.build +++ b/meson.build @@ -1988,6 +1988,16 @@ if conf.has('WITH_LIBVIRTD') use_storage = true conf.set('WITH_STORAGE_SCSI', 1) endif + + if not get_option('storage_sheepdog').disabled() + sheepdogcli_prog = find_program(['collie', 'dog'], required: get_option('storage_sheepdog'), dirs: libvirt_sbin_path) + + if sheepdogcli_prog.found() + use_storage = true + conf.set('WITH_STORAGE_SHEEPDOG', 1) + conf.set_quoted('SHEEPDOGCLI', sheepdogcli_prog.path()) + endif + endif endif if use_storage @@ -2043,6 +2053,7 @@ storagedriver_summary = { 'mpath': conf.has('WITH_STORAGE_MPATH'), 'Disk': conf.has('WITH_STORAGE_DISK'), 'RBD': conf.has('WITH_STORAGE_RBD'), + 'Sheepdog': conf.has('WITH_STORAGE_SHEEPDOG'), 'Gluster': conf.has('WITH_STORAGE_GLUSTER'), } summary(storagedriver_summary, section: 'Storage Drivers', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 5cd4a9e28fd..eec89eacfb3 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -84,3 +84,4 @@ option('storage_lvm', type: 'feature', value: 'auto', description: 'LVM backend option('storage_mpath', type: 'feature', value: 'auto', description: 'mpath backend for the storage driver') option('storage_rbd', type: 'feature', value: 'auto', description: 'RADOS Block Device backend for the storage driver') option('storage_scsi', type: 'feature', value: 'auto', description: 'SCSI backend for the storage driver') +option('storage_sheepdog', type: 'feature', value: 'auto', description: 'Sheepdog backend for the storage driver') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 -- m4/virt-storage-vstorage.m4 | 73 ------------------------------------- meson.build | 24 ++++++++++++ meson_options.txt | 1 + 4 files changed, 25 insertions(+), 77 deletions(-) delete mode 100644 m4/virt-storage-vstorage.m4 diff --git a/configure.ac b/configure.ac index ba15aa9bb2b..6416986c303 100644 --- a/configure.ac +++ b/configure.ac @@ -135,15 +135,12 @@ dnl Storage driver checks dnl LIBVIRT_STORAGE_ARG_ZFS -LIBVIRT_STORAGE_ARG_VSTORAGE if test "$with_libvirtd" = "no"; then with_storage_zfs=no - with_storage_vstorage=no fi LIBVIRT_STORAGE_CHECK_ZFS -LIBVIRT_STORAGE_CHECK_VSTORAGE dnl Python3 < 3.7 treats the C locale as 7-bit only. dnl We must force env vars so it treats it as UTF-8 @@ -202,7 +199,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Storage Drivers]) AC_MSG_NOTICE([]) LIBVIRT_STORAGE_RESULT_ZFS -LIBVIRT_STORAGE_RESULT_VSTORAGE AC_MSG_NOTICE([]) AC_MSG_NOTICE([Driver Loadable Modules]) AC_MSG_NOTICE([]) diff --git a/m4/virt-storage-vstorage.m4 b/m4/virt-storage-vstorage.m4 deleted file mode 100644 index e3b3bb40f0c..00000000000 --- a/m4/virt-storage-vstorage.m4 +++ /dev/null @@ -1,73 +0,0 @@ -dnl The storage vstorage check -dnl -dnl Copyright (C) 2016 Parallels IP Holdings GmbH, 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 <http://www.gnu.org/licenses/>. -dnl - - -AC_DEFUN([LIBVIRT_STORAGE_ARG_VSTORAGE], [ - LIBVIRT_ARG_WITH_FEATURE([STORAGE_VSTORAGE], - [Virtuozzo Storage backend for the storage driver], - [check]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_CHECK_VSTORAGE], [ - if test "$with_storage_vstorage" = "yes" || - test "$with_storage_vstorage" = "check"; then - AC_PATH_PROG([VSTORAGE], [vstorage], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([VSTORAGE_MOUNT], [vstorage-mount], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([UMOUNT], [umount], [], [$LIBVIRT_SBIN_PATH]) - - if test "$with_storage_vstorage" = "yes"; then - if test -z "$VSTORAGE" || test -z "$VSTORAGE_MOUNT"; then - AC_MSG_ERROR([We need vstorage and vstorage-mount tool for Vstorage storage driver]); - fi - if test -z "$UMOUNT" ; then - AC_MSG_ERROR([We need umount for Vstorage storage driver]); - fi - else - if test -z "$VSTORAGE" ; then - with_storage_vstorage=no - fi - if test -z "$VSTORAGE_MOUNT" ; then - with_storage_vstorage=no - fi - if test -z "$UMOUNT" ; then - with_storage_vstorage=no - fi - - if test "$with_storage_vstorage" = "check" ; then - with_storage_vstorage=yes - fi - fi - - if test "$with_storage_vstorage" = "yes" ; then - AC_DEFINE_UNQUOTED([WITH_STORAGE_VSTORAGE], 1, - [whether Vstorage backend for storage driver is enabled]) - AC_DEFINE_UNQUOTED([VSTORAGE], ["$VSTORAGE"], - [Location or name of the vstorage client tool]) - AC_DEFINE_UNQUOTED([VSTORAGE_MOUNT], ["$VSTORAGE_MOUNT"], - [Location or name of the vstorage mount tool]) - AC_DEFINE_UNQUOTED([UMOUNT], ["$UMOUNT"], - [Location or name of the umount programm]) - fi - fi - AM_CONDITIONAL([WITH_STORAGE_VSTORAGE], [test "$with_storage_vstorage" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_RESULT_VSTORAGE], [ - LIBVIRT_RESULT([Virtuozzo storage], [$with_storage_vstorage]) -]) diff --git a/meson.build b/meson.build index fcd4bc5e5da..83f7710f93c 100644 --- a/meson.build +++ b/meson.build @@ -1998,6 +1998,29 @@ if conf.has('WITH_LIBVIRTD') conf.set_quoted('SHEEPDOGCLI', sheepdogcli_prog.path()) endif endif + + if not get_option('storage_vstorage').disabled() + vstorage_enable = true + + foreach name : ['vstorage', 'vstorage-mount', 'umount'] + set_variable( + '@0@_prog'.format(name.underscorify()), + find_program(name, required: get_option('storage_vstorage'), dirs: libvirt_sbin_path) + ) + if not get_variable('@0@_prog'.format(name.underscorify())).found() + vstorage_enable = false + endif + endforeach + + if vstorage_enable + use_storage = true + conf.set('WITH_STORAGE_VSTORAGE', 1) + foreach name : ['vstorage', 'vstorage-mount', 'umount'] + path = get_variable('@0@_prog'.format(name.underscorify())).path() + conf.set_quoted(name.to_upper(), path) + endforeach + endif + endif endif if use_storage @@ -2055,6 +2078,7 @@ storagedriver_summary = { 'RBD': conf.has('WITH_STORAGE_RBD'), 'Sheepdog': conf.has('WITH_STORAGE_SHEEPDOG'), 'Gluster': conf.has('WITH_STORAGE_GLUSTER'), + 'Virtuozzo storage': conf.has('WITH_STORAGE_VSTORAGE'), } summary(storagedriver_summary, section: 'Storage Drivers', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index eec89eacfb3..4d8cac9254a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -85,3 +85,4 @@ option('storage_mpath', type: 'feature', value: 'auto', description: 'mpath back option('storage_rbd', type: 'feature', value: 'auto', description: 'RADOS Block Device backend for the storage driver') option('storage_scsi', type: 'feature', value: 'auto', description: 'SCSI backend for the storage driver') option('storage_sheepdog', type: 'feature', value: 'auto', description: 'Sheepdog backend for the storage driver') +option('storage_vstorage', type: 'feature', value: 'auto', description: 'Virtuozzo storage backend for the storage driver') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 16 ------------ m4/virt-storage-zfs.m4 | 56 ------------------------------------------ meson.build | 22 +++++++++++++++++ meson_options.txt | 1 + 4 files changed, 23 insertions(+), 72 deletions(-) delete mode 100644 m4/virt-storage-zfs.m4 diff --git a/configure.ac b/configure.ac index 6416986c303..030313b7ed5 100644 --- a/configure.ac +++ b/configure.ac @@ -130,18 +130,6 @@ dnl Need to test if pkg-config exists PKG_PROG_PKG_CONFIG -dnl -dnl Storage driver checks -dnl - -LIBVIRT_STORAGE_ARG_ZFS - -if test "$with_libvirtd" = "no"; then - with_storage_zfs=no -fi - -LIBVIRT_STORAGE_CHECK_ZFS - dnl Python3 < 3.7 treats the C locale as 7-bit only. dnl We must force env vars so it treats it as UTF-8 dnl regardless of the user's locale. @@ -196,10 +184,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Configuration summary]) AC_MSG_NOTICE([=====================]) AC_MSG_NOTICE([]) -AC_MSG_NOTICE([Storage Drivers]) -AC_MSG_NOTICE([]) -LIBVIRT_STORAGE_RESULT_ZFS -AC_MSG_NOTICE([]) AC_MSG_NOTICE([Driver Loadable Modules]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_DRIVER_MODULES diff --git a/m4/virt-storage-zfs.m4 b/m4/virt-storage-zfs.m4 deleted file mode 100644 index 0c52264dbe8..00000000000 --- a/m4/virt-storage-zfs.m4 +++ /dev/null @@ -1,56 +0,0 @@ -dnl The storage ZFS check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_STORAGE_ARG_ZFS], [ - LIBVIRT_ARG_WITH_FEATURE([STORAGE_ZFS], [ZFS backend for the storage driver], [check]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_CHECK_ZFS], [ - if test "$with_storage_zfs" = "yes" || - test "$with_storage_zfs" = "check"; then - AC_PATH_PROG([ZFS], [zfs], [], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([ZPOOL], [zpool], [], [$LIBVIRT_SBIN_PATH]) - - if test "$with_storage_zfs" = "yes"; then - if test -z "$ZFS" || test -z "$ZPOOL"; then - AC_MSG_ERROR([We need zfs and zpool for ZFS storage driver]) - fi - else - if test -z "$ZFS" || test -z "$ZPOOL"; then - with_storage_zfs=no - fi - - if test "$with_storage_zfs" = "check"; then - with_storage_zfs=yes - fi - fi - - if test "$with_storage_zfs" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_STORAGE_ZFS], 1, - [whether ZFS backend for storage driver is enabled]) - AC_DEFINE_UNQUOTED([ZFS], ["$ZFS"], [Location of zfs program]) - AC_DEFINE_UNQUOTED([ZPOOL], ["$ZPOOL"], [Location of zpool program]) - fi - fi - AM_CONDITIONAL([WITH_STORAGE_ZFS], [test "$with_storage_zfs" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_STORAGE_RESULT_ZFS], [ - LIBVIRT_RESULT([ZFS], [$with_storage_zfs]) -]) diff --git a/meson.build b/meson.build index 83f7710f93c..64583b3662a 100644 --- a/meson.build +++ b/meson.build @@ -2021,6 +2021,27 @@ if conf.has('WITH_LIBVIRTD') endforeach endif endif + + if not get_option('storage_zfs').disabled() + zfs_enable = true + foreach name : ['zfs', 'zpool'] + set_variable( + '@0@_prog'.format(name), + find_program(name, required: get_option('storage_zfs'), dirs: libvirt_sbin_path) + ) + if not get_variable('@0@_prog'.format(name)).found() + zfs_enable = false + endif + endforeach + + if zfs_enable + use_storage = true + conf.set('WITH_STORAGE_ZFS', 1) + foreach name : ['zfs', 'zpool'] + conf.set_quoted(name.to_upper(), get_variable('@0@_prog'.format(name)).path()) + endforeach + endif + endif endif if use_storage @@ -2078,6 +2099,7 @@ storagedriver_summary = { 'RBD': conf.has('WITH_STORAGE_RBD'), 'Sheepdog': conf.has('WITH_STORAGE_SHEEPDOG'), 'Gluster': conf.has('WITH_STORAGE_GLUSTER'), + 'ZFS': conf.has('WITH_STORAGE_ZFS'), 'Virtuozzo storage': conf.has('WITH_STORAGE_VSTORAGE'), } summary(storagedriver_summary, section: 'Storage Drivers', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 4d8cac9254a..d68712ae2be 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -86,3 +86,4 @@ option('storage_rbd', type: 'feature', value: 'auto', description: 'RADOS Block option('storage_scsi', type: 'feature', value: 'auto', description: 'SCSI backend for the storage driver') option('storage_sheepdog', type: 'feature', value: 'auto', description: 'Sheepdog backend for the storage driver') option('storage_vstorage', type: 'feature', value: 'auto', description: 'Virtuozzo storage backend for the storage driver') +option('storage_zfs', type: 'feature', value: 'auto', description: 'ZFS backend for the storage driver') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-chrdev-lock-files.m4 | 52 ------------------------------------ meson.build | 12 +++++++++ meson_options.txt | 4 +++ 4 files changed, 16 insertions(+), 55 deletions(-) delete mode 100644 m4/virt-chrdev-lock-files.m4 diff --git a/configure.ac b/configure.ac index 030313b7ed5..3a4d98f1dd9 100644 --- a/configure.ac +++ b/configure.ac @@ -105,7 +105,6 @@ LIBVIRT_ARG_DEBUG LIBVIRT_ARG_DTRACE LIBVIRT_ARG_NUMAD LIBVIRT_ARG_INIT_SCRIPT -LIBVIRT_ARG_CHRDEV_LOCK_FILES LIBVIRT_ARG_DEFAULT_EDITOR LIBVIRT_ARG_LOGIN_SHELL LIBVIRT_ARG_HOST_VALIDATE @@ -117,7 +116,6 @@ LIBVIRT_CHECK_DEBUG LIBVIRT_CHECK_DTRACE LIBVIRT_CHECK_NUMAD LIBVIRT_CHECK_INIT_SCRIPT -LIBVIRT_CHECK_CHRDEV_LOCK_FILES LIBVIRT_CHECK_DEFAULT_EDITOR LIBVIRT_CHECK_LOGIN_SHELL LIBVIRT_CHECK_HOST_VALIDATE @@ -203,7 +201,6 @@ LIBVIRT_RESULT_DEBUG LIBVIRT_RESULT_DTRACE LIBVIRT_RESULT_NUMAD LIBVIRT_RESULT_INIT_SCRIPT -LIBVIRT_RESULT_CHRDEV_LOCK_FILES LIBVIRT_RESULT_DEFAULT_EDITOR LIBVIRT_RESULT_LOGIN_SHELL LIBVIRT_RESULT_HOST_VALIDATE diff --git a/m4/virt-chrdev-lock-files.m4 b/m4/virt-chrdev-lock-files.m4 deleted file mode 100644 index 5802136b9f4..00000000000 --- a/m4/virt-chrdev-lock-files.m4 +++ /dev/null @@ -1,52 +0,0 @@ -dnl The locaton of UUCP style lock files -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_CHRDEV_LOCK_FILES], [ - LIBVIRT_ARG_WITH([CHRDEV_LOCK_FILES], - [location for UUCP style lock files for character devices ] - [(use auto for default paths on some platforms)], - [auto]) -]) - -AC_DEFUN([LIBVIRT_CHECK_CHRDEV_LOCK_FILES], [ - if test "$with_chrdev_lock_files" != "no"; then - case $with_chrdev_lock_files in - yes | auto) - dnl Default locations for platforms, or disable if unknown - if test "$with_linux" = "yes"; then - with_chrdev_lock_files=/var/lock - elif test "$with_chrdev_lock_files" = "auto"; then - with_chrdev_lock_files=no - fi - ;; - esac - if test "$with_chrdev_lock_files" = "yes"; then - AC_MSG_ERROR([You must specify path for the lock files on this platform]) - fi - if test "$with_chrdev_lock_files" != "no"; then - AC_DEFINE_UNQUOTED([VIR_CHRDEV_LOCK_FILE_PATH], "$with_chrdev_lock_files", - [path to directory containing UUCP device lock files]) - fi - fi - AM_CONDITIONAL([VIR_CHRDEV_LOCK_FILE_PATH], [test "$with_chrdev_lock_files" != "no"]) -]) - -AC_DEFUN([LIBVIRT_RESULT_CHRDEV_LOCK_FILES], [ - LIBVIRT_RESULT([Char device locks], [$with_chrdev_lock_files]) -]) diff --git a/meson.build b/meson.build index 64583b3662a..9d80aec8fd3 100644 --- a/meson.build +++ b/meson.build @@ -2049,6 +2049,17 @@ if use_storage endif +# build feature options + +chrdev_lock_files = get_option('chrdev_lock_files') +if chrdev_lock_files == '' and host_machine.system() == 'linux' + chrdev_lock_files = '/var/lock' +endif +if chrdev_lock_files != '' + conf.set_quoted('VIR_CHRDEV_LOCK_FILE_PATH', chrdev_lock_files) +endif + + # define top include directory top_inc_dir = include_directories('.') @@ -2166,6 +2177,7 @@ summary(test_summary, section: 'Test suite', bool_yn: true) misc_summary = { 'Use -Werror': cc_flags.contains('-Werror'), 'Warning Flags': supported_cc_flags, + 'Char device locks': chrdev_lock_files, } summary(misc_summary, section: 'Miscellaneous', bool_yn: true, list_sep: ' ') diff --git a/meson_options.txt b/meson_options.txt index d68712ae2be..1f32533f0f5 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -87,3 +87,7 @@ option('storage_scsi', type: 'feature', value: 'auto', description: 'SCSI backen option('storage_sheepdog', type: 'feature', value: 'auto', description: 'Sheepdog backend for the storage driver') option('storage_vstorage', type: 'feature', value: 'auto', description: 'Virtuozzo storage backend for the storage driver') option('storage_zfs', type: 'feature', value: 'auto', description: 'ZFS backend for the storage driver') + + +# build feature options +option('chrdev_lock_files', type: 'string', value: '', description: 'location for UUCP style lock files for character devices (leave empty for default paths on some platforms)') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-debug.m4 | 33 --------------------------------- meson.build | 5 +++++ meson_options.txt | 1 + 4 files changed, 6 insertions(+), 36 deletions(-) delete mode 100644 m4/virt-debug.m4 diff --git a/configure.ac b/configure.ac index 3a4d98f1dd9..2ecdd30d48f 100644 --- a/configure.ac +++ b/configure.ac @@ -101,7 +101,6 @@ dnl dnl Miscellaneous checks dnl -LIBVIRT_ARG_DEBUG LIBVIRT_ARG_DTRACE LIBVIRT_ARG_NUMAD LIBVIRT_ARG_INIT_SCRIPT @@ -112,7 +111,6 @@ LIBVIRT_ARG_TLS_PRIORITY LIBVIRT_ARG_SYSCTL_CONFIG -LIBVIRT_CHECK_DEBUG LIBVIRT_CHECK_DTRACE LIBVIRT_CHECK_NUMAD LIBVIRT_CHECK_INIT_SCRIPT @@ -197,7 +195,6 @@ LIBVIRT_WIN_RESULT_WINDRES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Miscellaneous]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_DEBUG LIBVIRT_RESULT_DTRACE LIBVIRT_RESULT_NUMAD LIBVIRT_RESULT_INIT_SCRIPT diff --git a/m4/virt-debug.m4 b/m4/virt-debug.m4 deleted file mode 100644 index d3ac0564f2e..00000000000 --- a/m4/virt-debug.m4 +++ /dev/null @@ -1,33 +0,0 @@ -dnl The debug check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_DEBUG], [ - LIBVIRT_ARG_ENABLE([DEBUG], [enable debugging output], [yes]) -]) - -AC_DEFUN([LIBVIRT_CHECK_DEBUG], [ - AM_CONDITIONAL([ENABLE_DEBUG], test x"$enable_debug" = x"yes") - if test x"$enable_debug" = x"yes"; then - AC_DEFINE([ENABLE_DEBUG], [], [whether debugging is enabled]) - fi -]) - -AC_DEFUN([LIBVIRT_RESULT_DEBUG], [ - LIBVIRT_RESULT([Debug], [$enable_debug]) -]) diff --git a/meson.build b/meson.build index 9d80aec8fd3..1a7cc483595 100644 --- a/meson.build +++ b/meson.build @@ -2059,6 +2059,10 @@ if chrdev_lock_files != '' conf.set_quoted('VIR_CHRDEV_LOCK_FILE_PATH', chrdev_lock_files) endif +if get_option('debug_logs') + conf.set('ENABLE_DEBUG', 1) +endif + # define top include directory @@ -2175,6 +2179,7 @@ test_summary = { summary(test_summary, section: 'Test suite', bool_yn: true) misc_summary = { + 'Debug': conf.has('ENABLE_DEBUG'), 'Use -Werror': cc_flags.contains('-Werror'), 'Warning Flags': supported_cc_flags, 'Char device locks': chrdev_lock_files, diff --git a/meson_options.txt b/meson_options.txt index 1f32533f0f5..a09dad02875 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -91,3 +91,4 @@ option('storage_zfs', type: 'feature', value: 'auto', description: 'ZFS backend # build feature options option('chrdev_lock_files', type: 'string', value: '', description: 'location for UUCP style lock files for character devices (leave empty for default paths on some platforms)') +option('debug_logs', type: 'boolean', value: true, description: 'enable debugging output') -- 2.26.2

On Thu, Jul 16, 2020 at 11:55:49 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-debug.m4 | 33 --------------------------------- meson.build | 5 +++++ meson_options.txt | 1 + 4 files changed, 6 insertions(+), 36 deletions(-) delete mode 100644 m4/virt-debug.m4
...
@@ -2175,6 +2179,7 @@ test_summary = { summary(test_summary, section: 'Test suite', bool_yn: true)
misc_summary = { + 'Debug': conf.has('ENABLE_DEBUG'), 'Use -Werror': cc_flags.contains('-Werror'), 'Warning Flags': supported_cc_flags, 'Char device locks': chrdev_lock_files, diff --git a/meson_options.txt b/meson_options.txt index 1f32533f0f5..a09dad02875 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -91,3 +91,4 @@ option('storage_zfs', type: 'feature', value: 'auto', description: 'ZFS backend
# build feature options option('chrdev_lock_files', type: 'string', value: '', description: 'location for UUCP style lock files for character devices (leave empty for default paths on some platforms)') +option('debug_logs', type: 'boolean', value: true, description: 'enable debugging output')
IMO, we should completely remove ENABLE_DEBUG macro. Users can configure logging via our log filters and this seems to be really pointless. (The only thing it does is to make 'VIR_DEBUG/VIR_INFO/VIR_WARN and VIR_ERROR macros do nothing)

On Wed, Jul 22, 2020 at 03:25:09PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:55:49 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-debug.m4 | 33 --------------------------------- meson.build | 5 +++++ meson_options.txt | 1 + 4 files changed, 6 insertions(+), 36 deletions(-) delete mode 100644 m4/virt-debug.m4
...
@@ -2175,6 +2179,7 @@ test_summary = { summary(test_summary, section: 'Test suite', bool_yn: true)
misc_summary = { + 'Debug': conf.has('ENABLE_DEBUG'), 'Use -Werror': cc_flags.contains('-Werror'), 'Warning Flags': supported_cc_flags, 'Char device locks': chrdev_lock_files, diff --git a/meson_options.txt b/meson_options.txt index 1f32533f0f5..a09dad02875 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -91,3 +91,4 @@ option('storage_zfs', type: 'feature', value: 'auto', description: 'ZFS backend
# build feature options option('chrdev_lock_files', type: 'string', value: '', description: 'location for UUCP style lock files for character devices (leave empty for default paths on some platforms)') +option('debug_logs', type: 'boolean', value: true, description: 'enable debugging output')
IMO, we should completely remove ENABLE_DEBUG macro. Users can configure logging via our log filters and this seems to be really pointless.
(The only thing it does is to make 'VIR_DEBUG/VIR_INFO/VIR_WARN and VIR_ERROR macros do nothing)
Sounds good to me, I'll do it if there are no objections. Pavel

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-default-editor.m4 | 32 -------------------------------- meson.build | 3 +++ meson_options.txt | 1 + 4 files changed, 4 insertions(+), 35 deletions(-) delete mode 100644 m4/virt-default-editor.m4 diff --git a/configure.ac b/configure.ac index 2ecdd30d48f..61e830a97eb 100644 --- a/configure.ac +++ b/configure.ac @@ -104,7 +104,6 @@ dnl LIBVIRT_ARG_DTRACE LIBVIRT_ARG_NUMAD LIBVIRT_ARG_INIT_SCRIPT -LIBVIRT_ARG_DEFAULT_EDITOR LIBVIRT_ARG_LOGIN_SHELL LIBVIRT_ARG_HOST_VALIDATE LIBVIRT_ARG_TLS_PRIORITY @@ -114,7 +113,6 @@ LIBVIRT_ARG_SYSCTL_CONFIG LIBVIRT_CHECK_DTRACE LIBVIRT_CHECK_NUMAD LIBVIRT_CHECK_INIT_SCRIPT -LIBVIRT_CHECK_DEFAULT_EDITOR LIBVIRT_CHECK_LOGIN_SHELL LIBVIRT_CHECK_HOST_VALIDATE LIBVIRT_CHECK_TLS_PRIORITY @@ -198,7 +196,6 @@ AC_MSG_NOTICE([]) LIBVIRT_RESULT_DTRACE LIBVIRT_RESULT_NUMAD LIBVIRT_RESULT_INIT_SCRIPT -LIBVIRT_RESULT_DEFAULT_EDITOR LIBVIRT_RESULT_LOGIN_SHELL LIBVIRT_RESULT_HOST_VALIDATE LIBVIRT_RESULT_TLS_PRIORITY diff --git a/m4/virt-default-editor.m4 b/m4/virt-default-editor.m4 deleted file mode 100644 index 4b4cad4e875..00000000000 --- a/m4/virt-default-editor.m4 +++ /dev/null @@ -1,32 +0,0 @@ -dnl The default editor check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_DEFAULT_EDITOR], [ - LIBVIRT_ARG_WITH([DEFAULT_EDITOR], - [Editor to use for interactive commands], [vi]) -]) - -AC_DEFUN([LIBVIRT_CHECK_DEFAULT_EDITOR], [ - AC_DEFINE_UNQUOTED([DEFAULT_EDITOR], ["$with_default_editor"], - [Default editor to use]) -]) - -AC_DEFUN([LIBVIRT_RESULT_DEFAULT_EDITOR], [ - LIBVIRT_RESULT([Default Editor], [$with_default_editor]) -]) diff --git a/meson.build b/meson.build index 1a7cc483595..d48912eedc9 100644 --- a/meson.build +++ b/meson.build @@ -2063,6 +2063,8 @@ if get_option('debug_logs') conf.set('ENABLE_DEBUG', 1) endif +conf.set_quoted('DEFAULT_EDITOR', get_option('default_editor')) + # define top include directory @@ -2183,6 +2185,7 @@ misc_summary = { 'Use -Werror': cc_flags.contains('-Werror'), 'Warning Flags': supported_cc_flags, 'Char device locks': chrdev_lock_files, + 'Default Editor': conf.get_unquoted('DEFAULT_EDITOR'), } summary(misc_summary, section: 'Miscellaneous', bool_yn: true, list_sep: ' ') diff --git a/meson_options.txt b/meson_options.txt index a09dad02875..476ed12a933 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -92,3 +92,4 @@ option('storage_zfs', type: 'feature', value: 'auto', description: 'ZFS backend # build feature options option('chrdev_lock_files', type: 'string', value: '', description: 'location for UUCP style lock files for character devices (leave empty for default paths on some platforms)') option('debug_logs', type: 'boolean', value: true, description: 'enable debugging output') +option('default_editor', type: 'string', value: 'vi', description: 'Editor to use for interactive commands') -- 2.26.2

On Thu, Jul 16, 2020 at 11:55:50 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-default-editor.m4 | 32 -------------------------------- meson.build | 3 +++ meson_options.txt | 1 + 4 files changed, 4 insertions(+), 35 deletions(-) delete mode 100644 m4/virt-default-editor.m4
I'd also argue for removing all of this and plainly erroring out in virsh if 'EDITOR' env variable is not set.

On Wed, Jul 22, 2020 at 04:44:32PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:55:50 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-default-editor.m4 | 32 -------------------------------- meson.build | 3 +++ meson_options.txt | 1 + 4 files changed, 4 insertions(+), 35 deletions(-) delete mode 100644 m4/virt-default-editor.m4
I'd also argue for removing all of this and plainly erroring out in virsh if 'EDITOR' env variable is not set.
I'm not so sure about this. It will probably make no difference for users but I would like to see opinion of others. Pavel

On Wed, Jul 22, 2020 at 04:44:32PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:55:50 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-default-editor.m4 | 32 -------------------------------- meson.build | 3 +++ meson_options.txt | 1 + 4 files changed, 4 insertions(+), 35 deletions(-) delete mode 100644 m4/virt-default-editor.m4
I'd also argue for removing all of this and plainly erroring out in virsh if 'EDITOR' env variable is not set.
That's a bit unkind - normal practice is to have a fallback if EDITOR or VISUAL aren't set. IIUC, POSIX suggests "vi" as the default, but we could do better and default to libreoffice writer ;-P Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Wed, Jul 22, 2020 at 16:04:36 +0100, Daniel Berrange wrote:
On Wed, Jul 22, 2020 at 04:44:32PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:55:50 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-default-editor.m4 | 32 -------------------------------- meson.build | 3 +++ meson_options.txt | 1 + 4 files changed, 4 insertions(+), 35 deletions(-) delete mode 100644 m4/virt-default-editor.m4
I'd also argue for removing all of this and plainly erroring out in virsh if 'EDITOR' env variable is not set.
That's a bit unkind - normal practice is to have a fallback if EDITOR or VISUAL aren't set. IIUC, POSIX suggests "vi" as the default, but we could do better and default to libreoffice writer ;-P
:D. Either way, we could hardcode 'vi' rather than attempting to configure it at build time.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 8 -------- m4/virt-driver-modules.m4 | 38 -------------------------------------- meson.build | 13 +++++++++++++ 3 files changed, 13 insertions(+), 46 deletions(-) delete mode 100644 m4/virt-driver-modules.m4 diff --git a/configure.ac b/configure.ac index 61e830a97eb..d97bc702299 100644 --- a/configure.ac +++ b/configure.ac @@ -136,10 +136,6 @@ LIBVIRT_WIN_CHECK_SYMBOLS LIBVIRT_WIN_CHECK_WINDRES -dnl Driver-Modules library support -LIBVIRT_CHECK_DRIVER_MODULES - - # Set LV_LIBTOOL_OBJDIR to "." or $lt_cv_objdir, depending on whether # we're building shared libraries. This is the name of the directory # in which .o files will be created. @@ -178,10 +174,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Configuration summary]) AC_MSG_NOTICE([=====================]) AC_MSG_NOTICE([]) -AC_MSG_NOTICE([Driver Loadable Modules]) -AC_MSG_NOTICE([]) -LIBVIRT_RESULT_DRIVER_MODULES -AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_NSS diff --git a/m4/virt-driver-modules.m4 b/m4/virt-driver-modules.m4 deleted file mode 100644 index f7902283884..00000000000 --- a/m4/virt-driver-modules.m4 +++ /dev/null @@ -1,38 +0,0 @@ -dnl The driver module support -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_CHECK_DRIVER_MODULES], [ - AC_REQUIRE([LIBVIRT_CHECK_DLOPEN]) - - with_driver_modules=$with_libvirtd - - DRIVER_MODULES_CFLAGS= - if test "$with_driver_modules" = "yes"; then - if test "$with_dlfcn" != "yes" || test "$with_dlopen" != "yes"; then - AC_MSG_ERROR([You must have dlfcn.h / dlopen() support to build driver modules]) - fi - - DRIVER_MODULES_LDFLAGS="-export-dynamic" - fi - AC_SUBST([DRIVER_MODULES_LDFLAGS]) -]) - -AC_DEFUN([LIBVIRT_RESULT_DRIVER_MODULES], [ - LIBVIRT_RESULT_LIB([DRIVER_MODULES]) -]) diff --git a/meson.build b/meson.build index d48912eedc9..681874fd447 100644 --- a/meson.build +++ b/meson.build @@ -2065,6 +2065,14 @@ endif conf.set_quoted('DEFAULT_EDITOR', get_option('default_editor')) +driver_modules_flags = [] +if conf.has('WITH_LIBVIRTD') + if not conf.has('HAVE_DLFCN_H') or not dlopen_dep.found() + error('You must have dlfcn.h / dlopen() support to build driver modules') + endif + driver_modules_flags = libvirt_export_dynamic +endif + # define top include directory @@ -2127,6 +2135,11 @@ secdriver_summary = { } summary(secdriver_summary, section: 'Security Drivers', bool_yn: true) +drivermod_summary = { + 'driver_modules': driver_modules_flags.length() > 0, +} +summary(drivermod_summary, section: 'Driver Loadable Modules', bool_yn: true) + libs_summary = { 'acl': acl_dep.found(), 'apparmor': apparmor_dep.found(), -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 7 ------- m4/virt-dtrace.m4 | 45 --------------------------------------------- meson.build | 8 ++++++++ meson_options.txt | 1 + 4 files changed, 9 insertions(+), 52 deletions(-) delete mode 100644 m4/virt-dtrace.m4 diff --git a/configure.ac b/configure.ac index d97bc702299..2f486df2e23 100644 --- a/configure.ac +++ b/configure.ac @@ -73,10 +73,6 @@ case $host in *-*-mingw* | *-*-msvc* ) with_win=yes ;; esac -if test $with_linux = no; then - with_dtrace=no -fi - AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"]) AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"]) AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" = "yes"]) @@ -101,7 +97,6 @@ dnl dnl Miscellaneous checks dnl -LIBVIRT_ARG_DTRACE LIBVIRT_ARG_NUMAD LIBVIRT_ARG_INIT_SCRIPT LIBVIRT_ARG_LOGIN_SHELL @@ -110,7 +105,6 @@ LIBVIRT_ARG_TLS_PRIORITY LIBVIRT_ARG_SYSCTL_CONFIG -LIBVIRT_CHECK_DTRACE LIBVIRT_CHECK_NUMAD LIBVIRT_CHECK_INIT_SCRIPT LIBVIRT_CHECK_LOGIN_SHELL @@ -185,7 +179,6 @@ LIBVIRT_WIN_RESULT_WINDRES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Miscellaneous]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_DTRACE LIBVIRT_RESULT_NUMAD LIBVIRT_RESULT_INIT_SCRIPT LIBVIRT_RESULT_LOGIN_SHELL diff --git a/m4/virt-dtrace.m4 b/m4/virt-dtrace.m4 deleted file mode 100644 index 3dc20d53436..00000000000 --- a/m4/virt-dtrace.m4 +++ /dev/null @@ -1,45 +0,0 @@ -dnl The DTrace static probes -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_DTRACE], [ - LIBVIRT_ARG_WITH([DTRACE], [use dtrace for static probing], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_DTRACE], [ - if test "$with_dtrace" != "no" ; then - AC_PATH_PROG([DTRACE], [dtrace], [], [$LIBVIRT_SBIN_PATH]) - if test -z "$DTRACE" ; then - if test "$with_dtrace" = "check"; then - with_dtrace=no - else - AC_MSG_ERROR([You must install the 'dtrace' binary to enable libvirt static probes]) - fi - else - with_dtrace=yes - fi - if test "$with_dtrace" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_DTRACE_PROBES], 1, [whether DTrace static probes are available]) - fi - fi - AM_CONDITIONAL([WITH_DTRACE_PROBES], [test "$with_dtrace" != "no"]) -]) - -AC_DEFUN([LIBVIRT_RESULT_DTRACE], [ - LIBVIRT_RESULT([DTrace], [$with_dtrace]) -]) diff --git a/meson.build b/meson.build index 681874fd447..c7c5cdd3b40 100644 --- a/meson.build +++ b/meson.build @@ -2073,6 +2073,13 @@ if conf.has('WITH_LIBVIRTD') driver_modules_flags = libvirt_export_dynamic endif +if host_machine.system() == 'linux' + dtrace_prog = find_program('dtrace', required: get_option('dtrace'), dirs: libvirt_sbin_path) + if dtrace_prog.found() + conf.set('WITH_DTRACE_PROBES', 1) + endif +endif + # define top include directory @@ -2197,6 +2204,7 @@ misc_summary = { 'Debug': conf.has('ENABLE_DEBUG'), 'Use -Werror': cc_flags.contains('-Werror'), 'Warning Flags': supported_cc_flags, + 'DTrace': conf.has('WITH_DTRACE_PROBES'), 'Char device locks': chrdev_lock_files, 'Default Editor': conf.get_unquoted('DEFAULT_EDITOR'), } diff --git a/meson_options.txt b/meson_options.txt index 476ed12a933..b12d0aa3d7b 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -93,3 +93,4 @@ option('storage_zfs', type: 'feature', value: 'auto', description: 'ZFS backend option('chrdev_lock_files', type: 'string', value: '', description: 'location for UUCP style lock files for character devices (leave empty for default paths on some platforms)') option('debug_logs', type: 'boolean', value: true, description: 'enable debugging output') option('default_editor', type: 'string', value: 'vi', description: 'Editor to use for interactive commands') +option('dtrace', type: 'feature', value: 'auto', description: 'use dtrace for static probing') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-host-validate.m4 | 43 ---------------------------------------- meson.build | 7 +++++++ meson_options.txt | 1 + 4 files changed, 8 insertions(+), 46 deletions(-) delete mode 100644 m4/virt-host-validate.m4 diff --git a/configure.ac b/configure.ac index 2f486df2e23..eaa7b57380e 100644 --- a/configure.ac +++ b/configure.ac @@ -100,7 +100,6 @@ dnl LIBVIRT_ARG_NUMAD LIBVIRT_ARG_INIT_SCRIPT LIBVIRT_ARG_LOGIN_SHELL -LIBVIRT_ARG_HOST_VALIDATE LIBVIRT_ARG_TLS_PRIORITY LIBVIRT_ARG_SYSCTL_CONFIG @@ -108,7 +107,6 @@ LIBVIRT_ARG_SYSCTL_CONFIG LIBVIRT_CHECK_NUMAD LIBVIRT_CHECK_INIT_SCRIPT LIBVIRT_CHECK_LOGIN_SHELL -LIBVIRT_CHECK_HOST_VALIDATE LIBVIRT_CHECK_TLS_PRIORITY LIBVIRT_CHECK_SYSCTL_CONFIG LIBVIRT_CHECK_NSS @@ -182,6 +180,5 @@ AC_MSG_NOTICE([]) LIBVIRT_RESULT_NUMAD LIBVIRT_RESULT_INIT_SCRIPT LIBVIRT_RESULT_LOGIN_SHELL -LIBVIRT_RESULT_HOST_VALIDATE LIBVIRT_RESULT_TLS_PRIORITY AC_MSG_NOTICE([]) diff --git a/m4/virt-host-validate.m4 b/m4/virt-host-validate.m4 deleted file mode 100644 index e43cec53665..00000000000 --- 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 <http://www.gnu.org/licenses/>. - -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" != "xno"; then - if test "x$with_win" = "xyes"; then - if test "x$with_host_validate" = "xyes"; then - AC_MSG_ERROR([virt-host-validate is not supported on Windows]) - else - with_host_validate=no; - fi - else - with_host_validate=yes; - fi - fi - - if test "x$with_host_validate" = "xyes" ; then - AC_DEFINE_UNQUOTED([WITH_HOST_VALIDATE], 1, [whether virt-host-validate is built]) - fi - AM_CONDITIONAL([WITH_HOST_VALIDATE], [test "x$with_host_validate" = "xyes"]) -]) - -AC_DEFUN([LIBVIRT_RESULT_HOST_VALIDATE], [ - LIBVIRT_RESULT([virt-host-validate], [$with_host_validate]) -]) diff --git a/meson.build b/meson.build index c7c5cdd3b40..ece7c90e26d 100644 --- a/meson.build +++ b/meson.build @@ -2080,6 +2080,12 @@ if host_machine.system() == 'linux' endif endif +if not get_option('host_validate').disabled() and host_machine.system() != 'windows' + conf.set('WITH_HOST_VALIDATE', 1) +elif get_option('host_validate').enabled() + error('virt-host-validate is not supported on Windows') +endif + # define top include directory @@ -2207,6 +2213,7 @@ misc_summary = { 'DTrace': conf.has('WITH_DTRACE_PROBES'), 'Char device locks': chrdev_lock_files, 'Default Editor': conf.get_unquoted('DEFAULT_EDITOR'), + 'virt-host-validate': conf.has('WITH_HOST_VALIDATE'), } summary(misc_summary, section: 'Miscellaneous', bool_yn: true, list_sep: ' ') diff --git a/meson_options.txt b/meson_options.txt index b12d0aa3d7b..80a11df4679 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -94,3 +94,4 @@ option('chrdev_lock_files', type: 'string', value: '', description: 'location fo option('debug_logs', type: 'boolean', value: true, description: 'enable debugging output') option('default_editor', type: 'string', value: 'vi', description: 'Editor to use for interactive commands') option('dtrace', type: 'feature', value: 'auto', description: 'use dtrace for static probing') +option('host_validate', type: 'feature', value: 'auto', description: 'build virt-host-validate') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-init-script.m4 | 61 ------------------------------------------ meson.build | 15 +++++++++++ meson_options.txt | 1 + 4 files changed, 16 insertions(+), 64 deletions(-) delete mode 100644 m4/virt-init-script.m4 diff --git a/configure.ac b/configure.ac index eaa7b57380e..e73b3f617ca 100644 --- a/configure.ac +++ b/configure.ac @@ -98,14 +98,12 @@ dnl Miscellaneous checks dnl LIBVIRT_ARG_NUMAD -LIBVIRT_ARG_INIT_SCRIPT LIBVIRT_ARG_LOGIN_SHELL LIBVIRT_ARG_TLS_PRIORITY LIBVIRT_ARG_SYSCTL_CONFIG LIBVIRT_CHECK_NUMAD -LIBVIRT_CHECK_INIT_SCRIPT LIBVIRT_CHECK_LOGIN_SHELL LIBVIRT_CHECK_TLS_PRIORITY LIBVIRT_CHECK_SYSCTL_CONFIG @@ -178,7 +176,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Miscellaneous]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_NUMAD -LIBVIRT_RESULT_INIT_SCRIPT LIBVIRT_RESULT_LOGIN_SHELL LIBVIRT_RESULT_TLS_PRIORITY AC_MSG_NOTICE([]) diff --git a/m4/virt-init-script.m4 b/m4/virt-init-script.m4 deleted file mode 100644 index 676135866f9..00000000000 --- a/m4/virt-init-script.m4 +++ /dev/null @@ -1,61 +0,0 @@ -dnl Init script type -dnl -dnl Copyright (C) 2005-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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_INIT_SCRIPT],[ - LIBVIRT_ARG_WITH([INIT_SCRIPT], - [Style of init script to install: systemd, openrc, check, none], - [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_INIT_SCRIPT],[ - AC_MSG_CHECKING([for init script type]) - - if test "$with_init_script" = check && test "$cross_compiling" = yes; then - with_init_script=none - fi - if test "$with_init_script" = check && type systemctl >/dev/null 2>&1; then - with_init_script=systemd - fi - if test "$with_init_script" = check && type openrc >/dev/null 2>&1; then - with_init_script=openrc - fi - if test "$with_init_script" = check; then - with_init_script=none - fi - - AS_CASE([$with_init_script], - [systemd],[], - [openrc],[], - [none],[], - [*],[ - AC_MSG_ERROR([Unknown initscript flavour $with_init_script]) - ] - ) - - AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_SYSTEMD], - [test "$with_init_script" = "systemd"]) - AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_OPENRC], - [test "$with_init_script" = "openrc"]) - - AC_MSG_RESULT($with_init_script) -]) - -AC_DEFUN([LIBVIRT_RESULT_INIT_SCRIPT],[ - LIBVIRT_RESULT([Init script], [$with_init_script]) -]) diff --git a/meson.build b/meson.build index ece7c90e26d..e9186e38cfd 100644 --- a/meson.build +++ b/meson.build @@ -2086,6 +2086,20 @@ elif get_option('host_validate').enabled() error('virt-host-validate is not supported on Windows') endif +if get_option('init_script') == 'check' + if meson.is_cross_build() + init_script = 'none' + elif find_program('systemctl', required: false).found() + init_script = 'systemd' + elif find_program('openrc', required: false).found() + init_script = 'openrc' + else + init_script = 'none' + endif +else + init_script = get_option('init_script') +endif + # define top include directory @@ -2211,6 +2225,7 @@ misc_summary = { 'Use -Werror': cc_flags.contains('-Werror'), 'Warning Flags': supported_cc_flags, 'DTrace': conf.has('WITH_DTRACE_PROBES'), + 'Init script': init_script, 'Char device locks': chrdev_lock_files, 'Default Editor': conf.get_unquoted('DEFAULT_EDITOR'), 'virt-host-validate': conf.has('WITH_HOST_VALIDATE'), diff --git a/meson_options.txt b/meson_options.txt index 80a11df4679..0e7b6659e2f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -95,3 +95,4 @@ option('debug_logs', type: 'boolean', value: true, description: 'enable debuggin option('default_editor', type: 'string', value: 'vi', description: 'Editor to use for interactive commands') option('dtrace', type: 'feature', value: 'auto', description: 'use dtrace for static probing') option('host_validate', type: 'feature', value: 'auto', description: 'build virt-host-validate') +option('init_script', type: 'combo', choices: ['systemd', 'openrc', 'check', 'none'], value: 'check', description: 'Style of init script to install') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-login-shell.m4 | 43 ------------------------------------------ meson.build | 7 +++++++ meson_options.txt | 1 + 4 files changed, 8 insertions(+), 46 deletions(-) delete mode 100644 m4/virt-login-shell.m4 diff --git a/configure.ac b/configure.ac index e73b3f617ca..cfe0545685f 100644 --- a/configure.ac +++ b/configure.ac @@ -98,13 +98,11 @@ dnl Miscellaneous checks dnl LIBVIRT_ARG_NUMAD -LIBVIRT_ARG_LOGIN_SHELL LIBVIRT_ARG_TLS_PRIORITY LIBVIRT_ARG_SYSCTL_CONFIG LIBVIRT_CHECK_NUMAD -LIBVIRT_CHECK_LOGIN_SHELL LIBVIRT_CHECK_TLS_PRIORITY LIBVIRT_CHECK_SYSCTL_CONFIG LIBVIRT_CHECK_NSS @@ -176,6 +174,5 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Miscellaneous]) AC_MSG_NOTICE([]) LIBVIRT_RESULT_NUMAD -LIBVIRT_RESULT_LOGIN_SHELL LIBVIRT_RESULT_TLS_PRIORITY AC_MSG_NOTICE([]) diff --git a/m4/virt-login-shell.m4 b/m4/virt-login-shell.m4 deleted file mode 100644 index 713c488599e..00000000000 --- a/m4/virt-login-shell.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 <http://www.gnu.org/licenses/>. - -AC_DEFUN([LIBVIRT_ARG_LOGIN_SHELL], [ - LIBVIRT_ARG_WITH([LOGIN_SHELL], [build virt-login-shell], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_LOGIN_SHELL], [ - if test "x$with_login_shell" != "xno"; then - if test "x$with_linux" != "xyes"; then - if test "x$with_login_shell" = "xyes"; then - AC_MSG_ERROR([virt-login-shell is supported on Linux only]) - else - with_login_shell=no; - fi - else - with_login_shell=yes; - fi - fi - - if test "x$with_login_shell" = "xyes" ; then - AC_DEFINE_UNQUOTED([WITH_LOGIN_SHELL], 1, [whether virt-login-shell is built]) - fi - AM_CONDITIONAL([WITH_LOGIN_SHELL], [test "$with_login_shell" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_RESULT_LOGIN_SHELL], [ - LIBVIRT_RESULT([virt-login-shell], [$with_login_shell]) -]) diff --git a/meson.build b/meson.build index e9186e38cfd..4c7345c81e3 100644 --- a/meson.build +++ b/meson.build @@ -2100,6 +2100,12 @@ else init_script = get_option('init_script') endif +if not get_option('login_shell').disabled() and host_machine.system() == 'linux' + conf.set('WITH_LOGIN_SHELL', 1) +elif get_option('login_shell').enabled() + error('virt-login-shell is supported on Linux only') +endif + # define top include directory @@ -2228,6 +2234,7 @@ misc_summary = { 'Init script': init_script, 'Char device locks': chrdev_lock_files, 'Default Editor': conf.get_unquoted('DEFAULT_EDITOR'), + 'virt-login-shell': conf.has('WITH_LOGIN_SHELL'), 'virt-host-validate': conf.has('WITH_HOST_VALIDATE'), } summary(misc_summary, section: 'Miscellaneous', bool_yn: true, list_sep: ' ') diff --git a/meson_options.txt b/meson_options.txt index 0e7b6659e2f..6a3c98fc697 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -96,3 +96,4 @@ option('default_editor', type: 'string', value: 'vi', description: 'Editor to us option('dtrace', type: 'feature', value: 'auto', description: 'use dtrace for static probing') option('host_validate', type: 'feature', value: 'auto', description: 'build virt-host-validate') option('init_script', type: 'combo', choices: ['systemd', 'openrc', 'check', 'none'], value: 'check', description: 'Style of init script to install') +option('login_shell', type: 'feature', value: 'auto', description: 'build virt-login-shell') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 -- m4/virt-nss.m4 | 86 ----------------------------------------------- meson.build | 41 ++++++++++++++++++++++ meson_options.txt | 1 + 4 files changed, 42 insertions(+), 89 deletions(-) delete mode 100644 m4/virt-nss.m4 diff --git a/configure.ac b/configure.ac index cfe0545685f..b1faa47f81c 100644 --- a/configure.ac +++ b/configure.ac @@ -79,7 +79,6 @@ AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" = "yes"]) # Check for compiler and library settings. -LIBVIRT_ARG_NSS LIBVIRT_ARG_PM_UTILS LIBVIRT_CHECK_NWFILTER @@ -105,7 +104,6 @@ LIBVIRT_ARG_SYSCTL_CONFIG LIBVIRT_CHECK_NUMAD LIBVIRT_CHECK_TLS_PRIORITY LIBVIRT_CHECK_SYSCTL_CONFIG -LIBVIRT_CHECK_NSS dnl Need to test if pkg-config exists @@ -164,7 +162,6 @@ AC_MSG_NOTICE([=====================]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_NSS LIBVIRT_RESULT_PM_UTILS AC_MSG_NOTICE([]) AC_MSG_NOTICE([Windows]) diff --git a/m4/virt-nss.m4 b/m4/virt-nss.m4 deleted file mode 100644 index b519c36e859..00000000000 --- a/m4/virt-nss.m4 +++ /dev/null @@ -1,86 +0,0 @@ -dnl The libvirt nsswitch plugin -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_NSS],[ - LIBVIRT_ARG_WITH([NSS_PLUGIN], - [enable Name Service Switch plugin for resolving guest - IP addresses], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_NSS],[ - bsd_nss=no - fail=0 - if test "x$with_nss_plugin" != "xno" ; then - if test "x$with_yajl" != "xyes" ; then - if test "x$with_nss_plugin" = "xyes" ; then - AC_MSG_ERROR([Can't build nss plugin without yajl]) - else - with_nss_plugin=no - fi - fi - - if test "x$with_network" != "xyes" ; then - if test "x$with_nss_plugin" = "xyes" ; then - AC_MSG_ERROR([Can't build nss plugin without network]) - else - with_nss_plugin=no - fi - fi - - if test "x$with_nss_plugin" != "xno" ; then - AC_CHECK_HEADERS([nss.h], [ - with_nss_plugin=yes - ],[ - if test "x$with_nss_plugin" = "xyes" ; then - fail = 1 - fi - ]) - - if test $fail = 1 ; then - AC_MSG_ERROR([Can't build nss plugin without nss.h]) - fi - fi - - if test "x$with_nss_plugin" = "xyes" ; then - AC_DEFINE_UNQUOTED([WITH_NSS], 1, [whether nss plugin is enabled]) - - AC_CHECK_TYPE([struct gaih_addrtuple], - [AC_DEFINE([HAVE_STRUCT_GAIH_ADDRTUPLE], [1], - [Defined if struct gaih_addrtuple exists in nss.h])], - [], [[#include <nss.h> - ]]) - - AC_CHECK_TYPES([ns_mtab, nss_module_unregister_fn], - [AC_DEFINE([HAVE_BSD_NSS], - [1], - [whether using BSD style NSS]) - bsd_nss=yes - ], - [], - [#include <nsswitch.h>]) - fi - fi - - AM_CONDITIONAL(WITH_NSS, [test "x$with_nss_plugin" = "xyes"]) - AM_CONDITIONAL(WITH_BSD_NSS, [test "x$bsd_nss" = "xyes"]) -]) - -AC_DEFUN([LIBVIRT_RESULT_NSS],[ - LIBVIRT_RESULT([nss], [$with_nss_plugin]) -]) diff --git a/meson.build b/meson.build index 4c7345c81e3..b1bbd0f4351 100644 --- a/meson.build +++ b/meson.build @@ -2106,6 +2106,46 @@ elif get_option('login_shell').enabled() error('virt-login-shell is supported on Linux only') endif +if not get_option('nss').disabled() + use_nss = true + if not yajl_dep.found() + if get_option('nss').enabled() + error('Can\'t build nss plugin without yajl') + else + use_nss = false + endif + endif + + if use_nss and not conf.has('WITH_NETWORK') + if get_option('nss').enabled() + error('Can\'t build nss plugin without network') + else + use_nss = false + endif + endif + + if use_nss and not cc.has_header('nss.h') + if get_option('nss').enabled() + error('Can\'t build nss plugin without nss.h') + else + use_nss = false + endif + endif + + if use_nss + conf.set('WITH_NSS', 1) + + if cc.has_type('struct gaih_addrtuple', prefix: '#include <nss.h>') + conf.set('HAVE_STRUCT_GAIH_ADDRTUPLE', 1) + endif + + if (cc.has_type('ns_mtab', prefix: '#include <nsswitch.h>') and + cc.has_type('nss_module_unregister_fn', prefix: '#include <nsswitch.h>')) + conf.set('WITH_BSD_NSS', 1) + endif + endif +endif + # define top include directory @@ -2200,6 +2240,7 @@ libs_summary = { 'macvtap': conf.has('WITH_MACVTAP'), 'netcf': netcf_dep.found(), 'NLS': have_gnu_gettext_tools, + 'nss': conf.has('WITH_NSS'), 'numaclt': numactl_dep.found(), 'openwsman': openwsman_dep.found(), 'pciaccess': pciaccess_dep.found(), diff --git a/meson_options.txt b/meson_options.txt index 6a3c98fc697..b7a4fddb8a2 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -97,3 +97,4 @@ option('dtrace', type: 'feature', value: 'auto', description: 'use dtrace for st option('host_validate', type: 'feature', value: 'auto', description: 'build virt-host-validate') option('init_script', type: 'combo', choices: ['systemd', 'openrc', 'check', 'none'], value: 'check', description: 'Style of init script to install') option('login_shell', type: 'feature', value: 'auto', description: 'build virt-login-shell') +option('nss', type: 'feature', value: 'auto', description: 'enable Name Service Switch plugin for resolving guest IP addresses') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- m4/virt-numad.m4 | 58 ----------------------------------------------- meson.build | 11 +++++++++ meson_options.txt | 1 + 4 files changed, 12 insertions(+), 61 deletions(-) delete mode 100644 m4/virt-numad.m4 diff --git a/configure.ac b/configure.ac index b1faa47f81c..82c166b760d 100644 --- a/configure.ac +++ b/configure.ac @@ -96,12 +96,10 @@ dnl dnl Miscellaneous checks dnl -LIBVIRT_ARG_NUMAD LIBVIRT_ARG_TLS_PRIORITY LIBVIRT_ARG_SYSCTL_CONFIG -LIBVIRT_CHECK_NUMAD LIBVIRT_CHECK_TLS_PRIORITY LIBVIRT_CHECK_SYSCTL_CONFIG @@ -170,6 +168,5 @@ LIBVIRT_WIN_RESULT_WINDRES AC_MSG_NOTICE([]) AC_MSG_NOTICE([Miscellaneous]) AC_MSG_NOTICE([]) -LIBVIRT_RESULT_NUMAD LIBVIRT_RESULT_TLS_PRIORITY AC_MSG_NOTICE([]) diff --git a/m4/virt-numad.m4 b/m4/virt-numad.m4 deleted file mode 100644 index 378eba3c97d..00000000000 --- a/m4/virt-numad.m4 +++ /dev/null @@ -1,58 +0,0 @@ -dnl The numad binary check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_NUMAD], [ - LIBVIRT_ARG_WITH([NUMAD], [use numad to manage CPU placement dynamically], - [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_NUMAD], [ - AC_REQUIRE([LIBVIRT_CHECK_NUMACTL]) - - if test "$with_numad" != "no" ; then - fail=0 - - AC_PATH_PROG([NUMAD], [numad], [], [$LIBVIRT_SBIN_PATH]) - - if test "$with_numad" = "check"; then - test "$with_numactl" = "yes" || fail=1 - if test -z "$NUMAD" || test $fail = 1; then - with_numad="no" - else - with_numad="yes" - fi - else - test -z "$NUMAD" && - AC_MSG_ERROR([You must install numad package to manage CPU and memory placement dynamically]) - - test "$with_numactl" = "yes" || fail=1 - test $fail = 1 && - AC_MSG_ERROR([You must install the numactl development package in order to compile and run libvirt]) - fi - fi - if test "$with_numad" = "yes"; then - AC_DEFINE_UNQUOTED([HAVE_NUMAD], 1, [whether numad is available]) - AC_DEFINE_UNQUOTED([NUMAD],["$NUMAD"], [Location or name of the numad program]) - fi - AM_CONDITIONAL([HAVE_NUMAD], [test "$with_numad" != "no"]) -]) - -AC_DEFUN([LIBVIRT_RESULT_NUMAD], [ - LIBVIRT_RESULT([numad], [$with_numad]) -]) diff --git a/meson.build b/meson.build index b1bbd0f4351..f09538bdf13 100644 --- a/meson.build +++ b/meson.build @@ -2146,6 +2146,16 @@ if not get_option('nss').disabled() endif endif +if not get_option('numad').disabled() and numactl_dep.found() + numad_prog = find_program('numad', required: get_option('numad'), dirs: libvirt_sbin_path) + if numad_prog.found() + conf.set('HAVE_NUMAD', 1) + conf.set_quoted('NUMAD', numad_prog.path()) + endif +elif get_option('numad').enabled() + error('You must have numactl enabled for numad support.') +endif + # define top include directory @@ -2272,6 +2282,7 @@ misc_summary = { 'Use -Werror': cc_flags.contains('-Werror'), 'Warning Flags': supported_cc_flags, 'DTrace': conf.has('WITH_DTRACE_PROBES'), + 'numad': conf.has('HAVE_NUMAD'), 'Init script': init_script, 'Char device locks': chrdev_lock_files, 'Default Editor': conf.get_unquoted('DEFAULT_EDITOR'), diff --git a/meson_options.txt b/meson_options.txt index b7a4fddb8a2..16acb4f3c50 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -98,3 +98,4 @@ option('host_validate', type: 'feature', value: 'auto', description: 'build virt option('init_script', type: 'combo', choices: ['systemd', 'openrc', 'check', 'none'], value: 'check', description: 'Style of init script to install') option('login_shell', type: 'feature', value: 'auto', description: 'build virt-login-shell') option('nss', type: 'feature', value: 'auto', description: 'enable Name Service Switch plugin for resolving guest IP addresses') +option('numad', type: 'feature', value: 'auto', description: 'use numad to manage CPU placement dynamically') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 1 - m4/virt-nwfilter.m4 | 32 -------------------------------- meson.build | 6 ++++++ 3 files changed, 6 insertions(+), 33 deletions(-) delete mode 100644 m4/virt-nwfilter.m4 diff --git a/configure.ac b/configure.ac index 82c166b760d..90868fdb351 100644 --- a/configure.ac +++ b/configure.ac @@ -81,7 +81,6 @@ AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" = "yes"]) LIBVIRT_ARG_PM_UTILS -LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_PM_UTILS diff --git a/m4/virt-nwfilter.m4 b/m4/virt-nwfilter.m4 deleted file mode 100644 index 759059cc8f2..00000000000 --- a/m4/virt-nwfilter.m4 +++ /dev/null @@ -1,32 +0,0 @@ -dnl The nwfilter support -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_CHECK_NWFILTER], [ - dnl nwfilter should only be compiled for linux, and only if the - dnl libvirt daemon is also being compiled - - with_nwfilter=yes - if test "$with_libvirtd" = "no" || test "$with_linux" != "yes"; then - with_nwfilter=no - fi - if test "$with_nwfilter" = "yes" ; then - AC_DEFINE([WITH_NWFILTER], 1, [whether local network filter management driver is available]) - fi - AM_CONDITIONAL([WITH_NWFILTER], [test "$with_nwfilter" = "yes"]) -]) diff --git a/meson.build b/meson.build index f09538bdf13..24e42b0c421 100644 --- a/meson.build +++ b/meson.build @@ -2156,6 +2156,12 @@ elif get_option('numad').enabled() error('You must have numactl enabled for numad support.') endif +# nwfilter should only be compiled for linux, and only if the +# libvirt daemon is also being compiled +if conf.has('WITH_LIBVIRTD') and host_machine.system() == 'linux' + conf.set('WITH_NWFILTER', 1) +endif + # define top include directory -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 10 ---------- m4/virt-pm-utils.m4 | 45 --------------------------------------------- meson.build | 12 ++++++++++++ meson_options.txt | 1 + 4 files changed, 13 insertions(+), 55 deletions(-) delete mode 100644 m4/virt-pm-utils.m4 diff --git a/configure.ac b/configure.ac index 90868fdb351..f5b567806e3 100644 --- a/configure.ac +++ b/configure.ac @@ -77,12 +77,6 @@ AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"]) AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"]) AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" = "yes"]) -# Check for compiler and library settings. - -LIBVIRT_ARG_PM_UTILS - -LIBVIRT_CHECK_PM_UTILS - dnl dnl in case someone want to build static binaries @@ -157,10 +151,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Configuration summary]) AC_MSG_NOTICE([=====================]) AC_MSG_NOTICE([]) -AC_MSG_NOTICE([Libraries]) -AC_MSG_NOTICE([]) -LIBVIRT_RESULT_PM_UTILS -AC_MSG_NOTICE([]) AC_MSG_NOTICE([Windows]) AC_MSG_NOTICE([]) LIBVIRT_WIN_RESULT_WINDRES diff --git a/m4/virt-pm-utils.m4 b/m4/virt-pm-utils.m4 deleted file mode 100644 index 02bf41e627b..00000000000 --- a/m4/virt-pm-utils.m4 +++ /dev/null @@ -1,45 +0,0 @@ -dnl The pm-utils support check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_PM_UTILS], [ - LIBVIRT_ARG_WITH([PM_UTILS], [use pm-utils for power management], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_PM_UTILS], [ - AC_REQUIRE([LIBVIRT_CHECK_DBUS]) - AC_REQUIRE([LIBVIRT_CHECK_INIT_SCRIPT]) - - if test "$with_pm_utils" = "check"; then - with_pm_utils=yes - if test "$with_dbus" = "yes"; then - if test "$init_systemd" = "yes"; then - with_pm_utils=no - fi - fi - fi - - if test "$with_pm_utils" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_PM_UTILS], 1, [whether to use pm-utils]) - fi - AM_CONDITIONAL([WITH_PM_UTILS], [test "$with_pm_utils" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_RESULT_PM_UTILS], [ - LIBVIRT_RESULT_LIB([PM_UTILS]) -]) diff --git a/meson.build b/meson.build index 24e42b0c421..e7efcb82b9b 100644 --- a/meson.build +++ b/meson.build @@ -2162,6 +2162,17 @@ if conf.has('WITH_LIBVIRTD') and host_machine.system() == 'linux' conf.set('WITH_NWFILTER', 1) endif +if not get_option('pm_utils').disabled() + use_pm_utils = true + if dbus_dep.found() and init_script == 'systemd' + use_pm_utils = false + endif + + if use_pm_utils + conf.set('WITH_PM_UTILS', 1) + endif +endif + # define top include directory @@ -2260,6 +2271,7 @@ libs_summary = { 'numaclt': numactl_dep.found(), 'openwsman': openwsman_dep.found(), 'pciaccess': pciaccess_dep.found(), + 'pm_utils': conf.has('WITH_PM_UTILS'), 'polkit': conf.has('WITH_POLKIT'), 'rbd': rbd_dep.found(), 'readline': readline_dep.found(), diff --git a/meson_options.txt b/meson_options.txt index 16acb4f3c50..7d18f80d61f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -99,3 +99,4 @@ option('init_script', type: 'combo', choices: ['systemd', 'openrc', 'check', 'no option('login_shell', type: 'feature', value: 'auto', description: 'build virt-login-shell') option('nss', type: 'feature', value: 'auto', description: 'enable Name Service Switch plugin for resolving guest IP addresses') option('numad', type: 'feature', value: 'auto', description: 'use numad to manage CPU placement dynamically') +option('pm_utils', type: 'feature', value: 'auto', description: 'use pm-utils for power management') -- 2.26.2

On Thu, Jul 16, 2020 at 11:55:59 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 10 ---------- m4/virt-pm-utils.m4 | 45 --------------------------------------------- meson.build | 12 ++++++++++++ meson_options.txt | 1 + 4 files changed, 13 insertions(+), 55 deletions(-) delete mode 100644 m4/virt-pm-utils.m4
diff --git a/configure.ac b/configure.ac index 90868fdb351..f5b567806e3 100644 --- a/configure.ac +++ b/configure.ac @@ -77,12 +77,6 @@ AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"]) AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"]) AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" = "yes"])
-# Check for compiler and library settings. - -LIBVIRT_ARG_PM_UTILS - -LIBVIRT_CHECK_PM_UTILS -
dnl dnl in case someone want to build static binaries @@ -157,10 +151,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Configuration summary]) AC_MSG_NOTICE([=====================]) AC_MSG_NOTICE([]) -AC_MSG_NOTICE([Libraries]) -AC_MSG_NOTICE([]) -LIBVIRT_RESULT_PM_UTILS -AC_MSG_NOTICE([]) AC_MSG_NOTICE([Windows]) AC_MSG_NOTICE([]) LIBVIRT_WIN_RESULT_WINDRES diff --git a/m4/virt-pm-utils.m4 b/m4/virt-pm-utils.m4 deleted file mode 100644 index 02bf41e627b..00000000000 --- a/m4/virt-pm-utils.m4 +++ /dev/null @@ -1,45 +0,0 @@ -dnl The pm-utils support check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_PM_UTILS], [ - LIBVIRT_ARG_WITH([PM_UTILS], [use pm-utils for power management], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_PM_UTILS], [ - AC_REQUIRE([LIBVIRT_CHECK_DBUS]) - AC_REQUIRE([LIBVIRT_CHECK_INIT_SCRIPT]) - - if test "$with_pm_utils" = "check"; then - with_pm_utils=yes - if test "$with_dbus" = "yes"; then - if test "$init_systemd" = "yes"; then - with_pm_utils=no - fi - fi - fi - - if test "$with_pm_utils" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_PM_UTILS], 1, [whether to use pm-utils]) - fi - AM_CONDITIONAL([WITH_PM_UTILS], [test "$with_pm_utils" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_RESULT_PM_UTILS], [ - LIBVIRT_RESULT_LIB([PM_UTILS]) -]) diff --git a/meson.build b/meson.build index 24e42b0c421..e7efcb82b9b 100644 --- a/meson.build +++ b/meson.build @@ -2162,6 +2162,17 @@ if conf.has('WITH_LIBVIRTD') and host_machine.system() == 'linux' conf.set('WITH_NWFILTER', 1) endif
+if not get_option('pm_utils').disabled() + use_pm_utils = true + if dbus_dep.found() and init_script == 'systemd'
The original impl seems to ask whether 'systemd' is used as init script and not whether the systemd unit files have to be installed. e.g. one could disable installation of the unit files but this one still must be set.

On Wed, Jul 22, 2020 at 04:50:01PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:55:59 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 10 ---------- m4/virt-pm-utils.m4 | 45 --------------------------------------------- meson.build | 12 ++++++++++++ meson_options.txt | 1 + 4 files changed, 13 insertions(+), 55 deletions(-) delete mode 100644 m4/virt-pm-utils.m4
diff --git a/configure.ac b/configure.ac index 90868fdb351..f5b567806e3 100644 --- a/configure.ac +++ b/configure.ac @@ -77,12 +77,6 @@ AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"]) AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"]) AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" = "yes"])
-# Check for compiler and library settings. - -LIBVIRT_ARG_PM_UTILS - -LIBVIRT_CHECK_PM_UTILS -
dnl dnl in case someone want to build static binaries @@ -157,10 +151,6 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Configuration summary]) AC_MSG_NOTICE([=====================]) AC_MSG_NOTICE([]) -AC_MSG_NOTICE([Libraries]) -AC_MSG_NOTICE([]) -LIBVIRT_RESULT_PM_UTILS -AC_MSG_NOTICE([]) AC_MSG_NOTICE([Windows]) AC_MSG_NOTICE([]) LIBVIRT_WIN_RESULT_WINDRES diff --git a/m4/virt-pm-utils.m4 b/m4/virt-pm-utils.m4 deleted file mode 100644 index 02bf41e627b..00000000000 --- a/m4/virt-pm-utils.m4 +++ /dev/null @@ -1,45 +0,0 @@ -dnl The pm-utils support check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_PM_UTILS], [ - LIBVIRT_ARG_WITH([PM_UTILS], [use pm-utils for power management], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_PM_UTILS], [ - AC_REQUIRE([LIBVIRT_CHECK_DBUS]) - AC_REQUIRE([LIBVIRT_CHECK_INIT_SCRIPT]) - - if test "$with_pm_utils" = "check"; then - with_pm_utils=yes - if test "$with_dbus" = "yes"; then - if test "$init_systemd" = "yes"; then - with_pm_utils=no - fi - fi - fi - - if test "$with_pm_utils" = "yes"; then - AC_DEFINE_UNQUOTED([WITH_PM_UTILS], 1, [whether to use pm-utils]) - fi - AM_CONDITIONAL([WITH_PM_UTILS], [test "$with_pm_utils" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_RESULT_PM_UTILS], [ - LIBVIRT_RESULT_LIB([PM_UTILS]) -]) diff --git a/meson.build b/meson.build index 24e42b0c421..e7efcb82b9b 100644 --- a/meson.build +++ b/meson.build @@ -2162,6 +2162,17 @@ if conf.has('WITH_LIBVIRTD') and host_machine.system() == 'linux' conf.set('WITH_NWFILTER', 1) endif
+if not get_option('pm_utils').disabled() + use_pm_utils = true + if dbus_dep.found() and init_script == 'systemd'
The original impl seems to ask whether 'systemd' is used as init script and not whether the systemd unit files have to be installed.
e.g. one could disable installation of the unit files but this one still must be set.
The original implementation is broken as I explained here [1]. In autoconf init_systemd should be with_init_script. Pavel [1] <https://www.redhat.com/archives/libvir-list/2020-July/msg01327.html>

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 2 -- m4/virt-sysctl.m4 | 43 ------------------------------------------- meson.build | 6 ++++++ meson_options.txt | 1 + 4 files changed, 7 insertions(+), 45 deletions(-) delete mode 100644 m4/virt-sysctl.m4 diff --git a/configure.ac b/configure.ac index f5b567806e3..00b547b1a75 100644 --- a/configure.ac +++ b/configure.ac @@ -90,11 +90,9 @@ dnl Miscellaneous checks dnl LIBVIRT_ARG_TLS_PRIORITY -LIBVIRT_ARG_SYSCTL_CONFIG LIBVIRT_CHECK_TLS_PRIORITY -LIBVIRT_CHECK_SYSCTL_CONFIG dnl Need to test if pkg-config exists diff --git a/m4/virt-sysctl.m4 b/m4/virt-sysctl.m4 deleted file mode 100644 index 3a59e3e6e66..00000000000 --- a/m4/virt-sysctl.m4 +++ /dev/null @@ -1,43 +0,0 @@ -dnl sysctl config check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_SYSCTL_CONFIG], [ - LIBVIRT_ARG_WITH([SYSCTL], [Whether to install sysctl configs], [check]) -]) - -AC_DEFUN([LIBVIRT_CHECK_SYSCTL_CONFIG], [ - AC_MSG_CHECKING([for whether to install sysctl config]) - if test "$with_sysctl" = "yes" || test "$with_sysctl" = "check" - then - case $host in - *-*-linux*) - with_sysctl=yes - ;; - *) - if test "$with_sysctl" = "yes"; then - AC_MSG_ERROR([No sysctl configuration supported for $host]) - else - with_sysctl=no - fi - ;; - esac - fi - AM_CONDITIONAL([WITH_SYSCTL], test "$with_sysctl" = "yes") - AC_MSG_RESULT($with_sysctl) -]) diff --git a/meson.build b/meson.build index e7efcb82b9b..7de11d8bf38 100644 --- a/meson.build +++ b/meson.build @@ -2173,6 +2173,12 @@ if not get_option('pm_utils').disabled() endif endif +if not get_option('sysctl_config').disabled() and host_machine.system() == 'linux' + conf.set('WITH_SYSCTL', 1) +elif get_option('sysctl_config').enabled() + error('sysctl configuration is supported only on linux') +endif + # define top include directory diff --git a/meson_options.txt b/meson_options.txt index 7d18f80d61f..9da3455e788 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -100,3 +100,4 @@ option('login_shell', type: 'feature', value: 'auto', description: 'build virt-l option('nss', type: 'feature', value: 'auto', description: 'enable Name Service Switch plugin for resolving guest IP addresses') option('numad', type: 'feature', value: 'auto', description: 'use numad to manage CPU placement dynamically') option('pm_utils', type: 'feature', value: 'auto', description: 'use pm-utils for power management') +option('sysctl_config', type: 'feature', value: 'auto', description: 'Whether to install sysctl configs') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 13 ------------- m4/virt-tls-priority.m4 | 33 --------------------------------- meson.build | 3 +++ meson_options.txt | 1 + 4 files changed, 4 insertions(+), 46 deletions(-) delete mode 100644 m4/virt-tls-priority.m4 diff --git a/configure.ac b/configure.ac index 00b547b1a75..5f931071b06 100644 --- a/configure.ac +++ b/configure.ac @@ -85,15 +85,6 @@ dnl STATIC_BINARIES= AC_SUBST([STATIC_BINARIES]) -dnl -dnl Miscellaneous checks -dnl - -LIBVIRT_ARG_TLS_PRIORITY - - -LIBVIRT_CHECK_TLS_PRIORITY - dnl Need to test if pkg-config exists PKG_PROG_PKG_CONFIG @@ -153,7 +144,3 @@ AC_MSG_NOTICE([Windows]) AC_MSG_NOTICE([]) LIBVIRT_WIN_RESULT_WINDRES AC_MSG_NOTICE([]) -AC_MSG_NOTICE([Miscellaneous]) -AC_MSG_NOTICE([]) -LIBVIRT_RESULT_TLS_PRIORITY -AC_MSG_NOTICE([]) diff --git a/m4/virt-tls-priority.m4 b/m4/virt-tls-priority.m4 deleted file mode 100644 index 44d9f68f426..00000000000 --- a/m4/virt-tls-priority.m4 +++ /dev/null @@ -1,33 +0,0 @@ -dnl The TLS priority check -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_ARG_TLS_PRIORITY], [ - LIBVIRT_ARG_WITH([TLS_PRIORITY], - [set the default TLS session priority string], - [NORMAL]) -]) - -AC_DEFUN([LIBVIRT_CHECK_TLS_PRIORITY], [ - AC_DEFINE_UNQUOTED([TLS_PRIORITY], ["$with_tls_priority"], - [TLS default priority string]) -]) - -AC_DEFUN([LIBVIRT_RESULT_TLS_PRIORITY], [ - LIBVIRT_RESULT([ TLS priority], [$with_tls_priority]) -]) diff --git a/meson.build b/meson.build index 7de11d8bf38..9e0cbbad6d7 100644 --- a/meson.build +++ b/meson.build @@ -2179,6 +2179,8 @@ elif get_option('sysctl_config').enabled() error('sysctl configuration is supported only on linux') endif +conf.set_quoted('TLS_PRIORITY', get_option('tls_priority')) + # define top include directory @@ -2312,6 +2314,7 @@ misc_summary = { 'Default Editor': conf.get_unquoted('DEFAULT_EDITOR'), 'virt-login-shell': conf.has('WITH_LOGIN_SHELL'), 'virt-host-validate': conf.has('WITH_HOST_VALIDATE'), + 'TLS priority': conf.get_unquoted('TLS_PRIORITY'), } summary(misc_summary, section: 'Miscellaneous', bool_yn: true, list_sep: ' ') diff --git a/meson_options.txt b/meson_options.txt index 9da3455e788..dbbacf7e8ff 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -101,3 +101,4 @@ option('nss', type: 'feature', value: 'auto', description: 'enable Name Service option('numad', type: 'feature', value: 'auto', description: 'use numad to manage CPU placement dynamically') option('pm_utils', type: 'feature', value: 'auto', description: 'use pm-utils for power management') option('sysctl_config', type: 'feature', value: 'auto', description: 'Whether to install sysctl configs') +option('tls_priority', type: 'string', value: 'NORMAL', description: 'set the default TLS session priority string') -- 2.26.2

With meson we have to use both env vars and wrapper script to run python with correct LANG settings. run_command() and test() have 'env' attribute so we can use it, but custom_target() doesn't support that attribute. Environment variables cannot by configured using 'command' because meson checks if the first item in the list is executable so we have to use a wrapper. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 7 ------- meson.build | 7 +++++++ scripts/meson-python.sh | 3 +++ scripts/meson.build | 1 + 4 files changed, 11 insertions(+), 7 deletions(-) create mode 100755 scripts/meson-python.sh diff --git a/configure.ac b/configure.ac index 5f931071b06..e6c7e50bb14 100644 --- a/configure.ac +++ b/configure.ac @@ -90,13 +90,6 @@ dnl Need to test if pkg-config exists PKG_PROG_PKG_CONFIG -dnl Python3 < 3.7 treats the C locale as 7-bit only. -dnl We must force env vars so it treats it as UTF-8 -dnl regardless of the user's locale. -RUNUTF8="LC_ALL= LANG=C LC_CTYPE=en_US.UTF-8" -AC_SUBST(RUNUTF8) - - dnl MinGW checks LIBVIRT_WIN_CHECK_SYMBOLS LIBVIRT_WIN_CHECK_WINDRES diff --git a/meson.build b/meson.build index 9e0cbbad6d7..48db9aa0d0a 100644 --- a/meson.build +++ b/meson.build @@ -2182,6 +2182,13 @@ endif conf.set_quoted('TLS_PRIORITY', get_option('tls_priority')) +# Various definitions + +# Python3 < 3.7 treats the C locale as 7-bit only. We must force env vars so +# it treats it as UTF-8 regardless of the user's locale. +runutf8 = [ 'LC_ALL=', 'LANG=C', 'LC_CTYPE=en_US.UTF-8' ] + + # define top include directory top_inc_dir = include_directories('.') diff --git a/scripts/meson-python.sh b/scripts/meson-python.sh new file mode 100755 index 00000000000..9ba670fc1a5 --- /dev/null +++ b/scripts/meson-python.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +LC_ALL= LANG=C LC_CTYPE=en_US.UTF-8 "$@" diff --git a/scripts/meson.build b/scripts/meson.build index 941e40a0917..5d3f0af4793 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -18,6 +18,7 @@ scripts = [ 'header-ifdef.py', 'hvsupport.py', 'hyperv_wmi_generator.py', + 'meson-python.sh', 'mock-noinline.py', 'prohibit-duplicate-header.py', 'test-wrap-argv.py', -- 2.26.2

WARN_FLAGS are not relevant for meson as all warning flags are set to the whole project using add_project_arguments(). Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- meson.build | 2 ++ src/Makefile.am | 19 +------------------ src/meson.build | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 18 deletions(-) create mode 100644 src/meson.build diff --git a/meson.build b/meson.build index 48db9aa0d0a..457d752ffb5 100644 --- a/meson.build +++ b/meson.build @@ -2200,6 +2200,8 @@ subdir('scripts') subdir('include') +subdir('src') + # generate meson-config.h file configure_file(output: 'meson-config.h', configuration: conf) diff --git a/src/Makefile.am b/src/Makefile.am index 6cf23bb0bdf..7d0e7b2e96c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,28 +19,11 @@ # No libraries with the exception of LIBXML should be listed # here. List them against the individual XXX_la_CFLAGS targets # that actually use them. -AM_CPPFLAGS = -I$(top_srcdir) \ - -I../include \ - -I$(top_srcdir)/include \ +AM_CPPFLAGS = \ -I$(srcdir)/util \ -I./util \ - -DIN_LIBVIRT \ - -Dabs_top_builddir="\"$(abs_top_builddir)\"" \ - -Dabs_top_srcdir="\"$(abs_top_srcdir)\"" \ $(NULL) -AM_CFLAGS = $(LIBXML_CFLAGS) \ - $(GLIB_CFLAGS) \ - $(WARN_CFLAGS) \ - $(WIN32_EXTRA_CFLAGS) \ - $(COVERAGE_CFLAGS) \ - $(NULL) -AM_LDFLAGS = $(DRIVER_MODULES_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ - $(RELRO_LDFLAGS) \ - $(NO_INDIRECT_LDFLAGS) \ - $(MINGW_EXTRA_LDFLAGS) \ - $(NULL) AM_LDFLAGS_MOD = \ -module \ -avoid-version \ diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 00000000000..0f5b83744fd --- /dev/null +++ b/src/meson.build @@ -0,0 +1,19 @@ +src_inc_dir = include_directories('.') + +src_dep = declare_dependency( + compile_args: [ + '-DIN_LIBVIRT', + '-Dabs_top_builddir="@0@"'.format(meson.build_root()), + '-Dabs_top_srcdir="@0@"'.format(meson.source_root()), + ] + coverage_flags + win32_flags, + dependencies: [ + glib_dep, + libxml_dep, + ], + include_directories: [ + libvirt_inc, + src_inc_dir, + top_inc_dir, + ], + link_args: libvirt_relro + libvirt_no_indirect + coverage_flags + driver_modules_flags + win32_link_flags, +) -- 2.26.2

On Thu, Jul 16, 2020 at 11:56:03 +0200, Pavel Hrdina wrote:
WARN_FLAGS are not relevant for meson as all warning flags are set to the whole project using add_project_arguments().
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> ---
diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 00000000000..0f5b83744fd --- /dev/null +++ b/src/meson.build @@ -0,0 +1,19 @@ +src_inc_dir = include_directories('.') + +src_dep = declare_dependency( + compile_args: [ + '-DIN_LIBVIRT', + '-Dabs_top_builddir="@0@"'.format(meson.build_root()), + '-Dabs_top_srcdir="@0@"'.format(meson.source_root()), + ] + coverage_flags + win32_flags, + dependencies: [ + glib_dep, + libxml_dep, + ], + include_directories: [ + libvirt_inc, + src_inc_dir, + top_inc_dir, + ], + link_args: libvirt_relro + libvirt_no_indirect + coverage_flags + driver_modules_flags + win32_link_flags,
Could we do thes one per line?
+) -- 2.26.2

On Wed, Jul 22, 2020 at 04:55:27PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:56:03 +0200, Pavel Hrdina wrote:
WARN_FLAGS are not relevant for meson as all warning flags are set to the whole project using add_project_arguments().
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> ---
diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 00000000000..0f5b83744fd --- /dev/null +++ b/src/meson.build @@ -0,0 +1,19 @@ +src_inc_dir = include_directories('.') + +src_dep = declare_dependency( + compile_args: [ + '-DIN_LIBVIRT', + '-Dabs_top_builddir="@0@"'.format(meson.build_root()), + '-Dabs_top_srcdir="@0@"'.format(meson.source_root()), + ] + coverage_flags + win32_flags, + dependencies: [ + glib_dep, + libxml_dep, + ], + include_directories: [ + libvirt_inc, + src_inc_dir, + top_inc_dir, + ], + link_args: libvirt_relro + libvirt_no_indirect + coverage_flags + driver_modules_flags + win32_link_flags,
Could we do thes one per line?
Sure, originally I tried using: link_args: [ libvirt_relro, libvirt_no_indirect, coverage_flags, driver_modules_flags, win32_link_flags, ], but Meson complains here that the items has to be strings, which is sad, I should probably report this. I guess it's only declare_dependency() related as in other functions it's happy with this and will expand the inner arrays. I tried and this works so I'll go with it: link_args: ( libvirt_relro + libvirt_no_indirect + coverage_flags + driver_modules_flags + win32_link_flags ), Pavel

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 12 ------------ src/meson.build | 11 +++++++++++ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 7d0e7b2e96c..4eed047926d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -105,18 +105,6 @@ include storage/Makefile.inc.am include remote/Makefile.inc.am -SECDRIVER_CFLAGS = -SECDRIVER_LIBS = -if WITH_SECDRIVER_SELINUX -SECDRIVER_CFLAGS += $(SELINUX_CFLAGS) -SECDRIVER_LIBS += $(SELINUX_LIBS) -endif WITH_SECDRIVER_SELINUX -if WITH_SECDRIVER_APPARMOR -SECDRIVER_CFLAGS += $(APPARMOR_CFLAGS) -SECDRIVER_LIBS += $(APPARMOR_LIBS) -endif WITH_SECDRIVER_APPARMOR - - moddir = $(libdir)/libvirt/connection-driver confdir = $(sysconfdir)/libvirt diff --git a/src/meson.build b/src/meson.build index 0f5b83744fd..453691dc902 100644 --- a/src/meson.build +++ b/src/meson.build @@ -17,3 +17,14 @@ src_dep = declare_dependency( ], link_args: libvirt_relro + libvirt_no_indirect + coverage_flags + driver_modules_flags + win32_link_flags, ) + + +# define secdriver_dep + +secdriver_dep = [] +if conf.has('WITH_SECDRIVER_SELINUX') + secdriver_dep += selinux_dep +endif +if conf.has('WITH_SECDRIVER_APPARMOR') + secdriver_dep += apparmor_dep +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 24 +----------------------- src/meson.build | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 23 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 4eed047926d..4c0ef6283a0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -400,24 +400,7 @@ libvirt_la_BUILT_LIBADD += libvirt_probes.lo libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o nodist_libvirt_la_SOURCES = libvirt_probes.h -tapsetdir = $(datadir)/systemtap/tapset -tapset_DATA += libvirt_probes.stp libvirt_functions.stp - -%_probes.h: %_probes.d - $(AM_V_GEN)$(DTRACE) -o $@ -h -s $< - -.PRECIOUS: %_probes.o -%_probes.o: %_probes.d - $(AM_V_GEN)$(DTRACE) -o $@ -G -s $< - -%_probes.lo: %_probes.o - $(AM_V_GEN)printf %s\\n \ - '# $@ - a libtool object file' \ - '# Generated by libtool (GNU libtool) 2.4' \ - '# Actually generated by Makefile.am, in order to shut up libtool' \ - "pic_object='$<'" \ - "non_pic_object='$<'" \ - > $@ +tapset_DATA += libvirt_functions.stp # Keep this list synced with PROTOCOL_STRUCTS RPC_PROBE_FILES += $(srcdir)/rpc/virnetprotocol.x \ @@ -431,11 +414,6 @@ libvirt_functions.stp: $(RPC_PROBE_FILES) $(top_srcdir)/scripts/gensystemtap.py $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/gensystemtap.py \ $(RPC_PROBE_FILES) > $@ -%_probes.stp: %_probes.d $(top_srcdir)/scripts/dtrace2systemtap.py \ - $(top_builddir)/config.status - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/dtrace2systemtap.py \ - $(bindir) $(sbindir) $(libdir) $< > $@ - endif WITH_DTRACE_PROBES libvirt_qemu_la_SOURCES = libvirt-qemu.c diff --git a/src/meson.build b/src/meson.build index 453691dc902..9796d344b4a 100644 --- a/src/meson.build +++ b/src/meson.build @@ -28,3 +28,42 @@ endif if conf.has('WITH_SECDRIVER_APPARMOR') secdriver_dep += apparmor_dep endif + + +# generate systemtap files + +systemtap_dir = datadir / 'systemtap' / 'tapset' + +dtrace_gen_headers = [] +dtrace_gen_objects = [] + +if conf.has('WITH_DTRACE_PROBES') + infile = 'libvirt_probes.d' + out_h = 'libvirt_probes.h' + out_o = 'libvirt_probes.o' + out_stp = 'libvirt_probes.stp' + + dtrace_gen_headers += custom_target( + out_h, + input: infile, + output: out_h, + command: [ dtrace_prog, '-o', '@OUTPUT@', '-h', '-s', '@INPUT@' ], + ) + + dtrace_gen_objects += custom_target( + out_o, + input: infile, + output: out_o, + command: [ dtrace_prog, '-o', '@OUTPUT@', '-G', '-s', '@INPUT@' ], + ) + + custom_target( + out_stp, + input: infile, + output: out_stp, + command: [ meson_python_prog, dtrace2systemtap_prog, bindir, sbindir, libdir, '@INPUT@' ], + capture: true, + install: true, + install_dir: systemtap_dir, + ) +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 5 - src/meson.build | 10 ++ src/util/Makefile.inc.am | 307 --------------------------------------- src/util/meson.build | 196 +++++++++++++++++++++++++ 4 files changed, 206 insertions(+), 312 deletions(-) create mode 100644 src/util/meson.build diff --git a/src/Makefile.am b/src/Makefile.am index 4c0ef6283a0..e533e27b344 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,11 +19,6 @@ # No libraries with the exception of LIBXML should be listed # here. List them against the individual XXX_la_CFLAGS targets # that actually use them. -AM_CPPFLAGS = \ - -I$(srcdir)/util \ - -I./util \ - $(NULL) - AM_LDFLAGS_MOD = \ -module \ -avoid-version \ diff --git a/src/meson.build b/src/meson.build index 9796d344b4a..9f3dd9fca8f 100644 --- a/src/meson.build +++ b/src/meson.build @@ -67,3 +67,13 @@ if conf.has('WITH_DTRACE_PROBES') install_dir: systemtap_dir, ) endif + + +# list subdirectories + +subdir('util') + +src_dep = declare_dependency( + dependencies: [ src_dep ], + include_directories: [ util_inc_dir ], +) diff --git a/src/util/Makefile.inc.am b/src/util/Makefile.inc.am index ca25f983090..879b3d9e398 100644 --- a/src/util/Makefile.inc.am +++ b/src/util/Makefile.inc.am @@ -1,310 +1,3 @@ # vim: filetype=automake -# These files are not related to driver APIs. Simply generic -# helper APIs for various purposes -UTIL_SOURCES = \ - util/glibcompat.c \ - util/glibcompat.h \ - util/viralloc.c \ - util/viralloc.h \ - util/virarch.c \ - util/virarch.h \ - util/virarptable.c \ - util/virarptable.h \ - util/viraudit.c \ - util/viraudit.h \ - util/virauth.c \ - util/virauth.h \ - util/virauthconfig.c \ - util/virauthconfig.h \ - util/virbitmap.c \ - util/virbitmap.h \ - util/virbpf.c \ - util/virbpf.h \ - util/virbuffer.c \ - util/virbuffer.h \ - util/virperf.c \ - util/virperf.h \ - util/vircgroup.c \ - util/vircgroup.h util/vircgrouppriv.h \ - util/vircgroupbackend.c \ - util/vircgroupbackend.h \ - util/vircgroupv1.c \ - util/vircgroupv1.h \ - util/vircgroupv2.c \ - util/vircgroupv2.h \ - util/vircgroupv2devices.c \ - util/vircgroupv2devices.h \ - util/vircommand.c \ - util/vircommand.h \ - util/vircommandpriv.h \ - util/virconf.c \ - util/virconf.h \ - util/vircrypto.c \ - util/vircrypto.h \ - util/virdaemon.c \ - util/virdaemon.h \ - util/virdbus.c \ - util/virdbus.h \ - util/virdbuspriv.h \ - util/virdevmapper.c \ - util/virdevmapper.h \ - util/virdnsmasq.c \ - util/virdnsmasq.h \ - util/virebtables.c \ - util/virebtables.h \ - util/virendian.h \ - util/virenum.h \ - util/virenum.c \ - util/virerror.c \ - util/virerror.h \ - util/virerrorpriv.h \ - util/virevent.c \ - util/virevent.h \ - util/vireventglib.c \ - util/vireventglib.h \ - util/vireventglibwatch.c \ - util/vireventglibwatch.h \ - util/vireventthread.c \ - util/vireventthread.h \ - util/virfcp.c \ - util/virfcp.h \ - util/virfdstream.c \ - util/virfdstream.h \ - util/virfile.c \ - util/virfile.h \ - util/virfirewall.c \ - util/virfirewall.h \ - util/virfirewallpriv.h \ - util/virfirewalld.c \ - util/virfirewalld.h \ - util/virfirewalldpriv.h \ - util/virfirmware.c \ - util/virfirmware.h \ - util/virgettext.c \ - util/virgettext.h \ - util/virgic.c \ - util/virgic.h \ - util/virhash.c \ - util/virhash.h \ - util/virhashcode.c \ - util/virhashcode.h \ - util/virhook.c \ - util/virhook.h \ - util/virhostcpu.c \ - util/virhostcpu.h \ - util/virhostcpupriv.h \ - util/virhostmem.c \ - util/virhostmem.h \ - util/virhostuptime.c \ - util/virhostuptime.h \ - util/viridentity.c \ - util/viridentity.h \ - util/virinitctl.c \ - util/virinitctl.h \ - util/viriptables.c \ - util/viriptables.h \ - util/viriscsi.c \ - util/viriscsi.h \ - util/virjson.c \ - util/virjson.h \ - util/virkeycode.c \ - util/virkeycode.h \ - util/virlease.c \ - util/virlease.h \ - util/virlockspace.c \ - util/virlockspace.h \ - util/virlog.c \ - util/virlog.h \ - util/virmacaddr.c \ - util/virmacaddr.h \ - util/virmacmap.c \ - util/virmacmap.h \ - util/virmodule.c \ - util/virmodule.h \ - util/virnetdev.c \ - util/virnetdev.h \ - util/virnetdevbandwidth.c \ - util/virnetdevbandwidth.h \ - util/virnetdevbridge.c \ - util/virnetdevbridge.h \ - util/virnetdevip.c \ - util/virnetdevip.h \ - util/virnetdevmacvlan.c \ - util/virnetdevmacvlan.h \ - util/virnetdevmidonet.c \ - util/virnetdevmidonet.h \ - util/virnetdevopenvswitch.c \ - util/virnetdevopenvswitch.h \ - util/virnetdevtap.c \ - util/virnetdevtap.h \ - util/virnetdevveth.c \ - util/virnetdevveth.h \ - util/virnetdevvlan.c \ - util/virnetdevvlan.h \ - util/virnetdevvportprofile.c \ - util/virnetdevvportprofile.h \ - util/virnetlink.c \ - util/virnetlink.h \ - util/virnodesuspend.c \ - util/virnodesuspend.h \ - util/virnvme.c \ - util/virnvme.h \ - util/virkmod.c \ - util/virkmod.h \ - util/virnuma.c \ - util/virnuma.h \ - util/virobject.c \ - util/virobject.h \ - util/virpci.c \ - util/virpci.h \ - util/virpidfile.c \ - util/virpidfile.h \ - util/virpolkit.c \ - util/virpolkit.h \ - util/virportallocator.c \ - util/virportallocator.h \ - util/virprobe.h \ - util/virprocess.c \ - util/virprocess.h \ - util/virqemu.c \ - util/virqemu.h \ - util/virrandom.c \ - util/virrandom.h \ - util/virresctrl.c \ - util/virresctrl.h \ - util/virresctrlpriv.h \ - util/virrotatingfile.c \ - util/virrotatingfile.h \ - util/virscsi.c \ - util/virscsi.h \ - util/virscsihost.c \ - util/virscsihost.h \ - util/virscsivhost.c \ - util/virscsivhost.h \ - util/virseclabel.c \ - util/virseclabel.h \ - util/virsecret.c \ - util/virsecret.h \ - util/virsocket.c \ - util/virsocket.h \ - util/virsocketaddr.c \ - util/virsocketaddr.h \ - util/virstorageencryption.c \ - util/virstorageencryption.h \ - util/virstoragefile.c \ - util/virstoragefile.h \ - util/virstoragefilebackend.c \ - util/virstoragefilebackend.h \ - util/virstring.c \ - util/virstring.h \ - util/virsysinfo.c \ - util/virsysinfo.h \ - util/virsysinfopriv.h \ - util/virsystemd.c \ - util/virsystemd.h \ - util/virsystemdpriv.h \ - util/virthread.c \ - util/virthread.h \ - util/virthreadjob.c \ - util/virthreadjob.h \ - util/virthreadpool.c \ - util/virthreadpool.h \ - util/virtime.c \ - util/virtime.h \ - util/virtpm.c \ - util/virtpm.h \ - util/virtypedparam-public.c \ - util/virtypedparam.c \ - util/virtypedparam.h \ - util/virusb.c \ - util/virusb.h \ - util/viruri.c \ - util/viruri.h \ - util/virutil.c \ - util/virutil.h \ - util/viruuid.c \ - util/viruuid.h \ - util/virvhba.c \ - util/virvhba.h \ - util/virvsock.c \ - util/virvsock.h \ - util/virxdrdefs.h \ - util/virxml.c \ - util/virxml.h \ - util/virmdev.c \ - util/virmdev.h \ - util/virfilecache.c \ - util/virfilecache.h \ - $(NULL) - - -# Sync with docs/ -KEYCODES = linux osx atset1 atset2 atset3 xtkbd usb win32 qnum -KEYNAMES = linux osx win32 - -KEYTABLES = \ - $(KEYCODES:%=util/virkeycodetable_%.h) \ - $(KEYNAMES:%=util/virkeynametable_%.h) \ - $(NULL) - UTIL_IO_HELPER_SOURCES = util/iohelper.c - -noinst_LTLIBRARIES += libvirt_util.la -libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD) -libvirt_la_BUILT_LIBADD += libvirt_util.la -libvirt_util_la_SOURCES = \ - $(UTIL_SOURCES) \ - $(NULL) -nodist_libvirt_util_la_SOURCES = \ - $(KEYTABLES) \ - $(NULL) -libvirt_util_la_CFLAGS = \ - $(CAPNG_CFLAGS) \ - $(YAJL_CFLAGS) \ - $(LIBNL_CFLAGS) \ - $(AM_CFLAGS) \ - $(AUDIT_CFLAGS) \ - $(DEVMAPPER_CFLAGS) \ - $(DBUS_CFLAGS) \ - $(NUMACTL_CFLAGS) \ - $(GNUTLS_CFLAGS) \ - $(ACL_CFLAGS) \ - $(NULL) -libvirt_util_la_LIBADD = \ - -lm \ - $(CAPNG_LIBS) \ - $(YAJL_LIBS) \ - $(LIBNL_LIBS) \ - $(THREAD_LIBS) \ - $(AUDIT_LIBS) \ - $(DEVMAPPER_LIBS) \ - $(DBUS_LIBS) \ - $(WIN32_EXTRA_LIBS) \ - $(LIBXML_LIBS) \ - $(SECDRIVER_LIBS) \ - $(NUMACTL_LIBS) \ - $(ACL_LIBS) \ - $(GNUTLS_LIBS) \ - $(NULL) - - -util/virkeycodetable_%.h: $(srcdir)/keycodemapdb/data/keymaps.csv \ - $(srcdir)/keycodemapdb/tools/keymap-gen Makefile.am - $(AM_V_GEN)export NAME=`echo $@ | sed -e 's,util/virkeycodetable_,,' \ - -e 's,\.h,,'` && \ - $(MKDIR_P) util/ && \ - $(RUNUTF8) $(PYTHON) $(srcdir)/keycodemapdb/tools/keymap-gen \ - code-table --lang stdc --varname virKeyCodeTable_$$NAME \ - $(srcdir)/keycodemapdb/data/keymaps.csv $$NAME > $@-tmp && \ - mv $@-tmp $@ || rm -f $@-tmp - -util/virkeynametable_%.h: $(srcdir)/keycodemapdb/data/keymaps.csv \ - $(srcdir)/keycodemapdb/tools/keymap-gen Makefile.am - $(AM_V_GEN)export NAME=`echo $@ | sed -e 's,util/virkeynametable_,,' \ - -e 's,\.h,,'` && \ - $(MKDIR_P) util/ && \ - $(RUNUTF8) $(PYTHON) $(srcdir)/keycodemapdb/tools/keymap-gen \ - name-table --lang stdc --varname virKeyNameTable_$$NAME \ - $(srcdir)/keycodemapdb/data/keymaps.csv $$NAME > $@-tmp && \ - mv $@-tmp $@ || rm -f $@-tmp diff --git a/src/util/meson.build b/src/util/meson.build new file mode 100644 index 00000000000..59a531f6af1 --- /dev/null +++ b/src/util/meson.build @@ -0,0 +1,196 @@ +util_sources = [ + 'glibcompat.c', + 'viralloc.c', + 'virarch.c', + 'virarptable.c', + 'viraudit.c', + 'virauth.c', + 'virauthconfig.c', + 'virbitmap.c', + 'virbpf.c', + 'virbuffer.c', + 'vircgroup.c', + 'vircgroupbackend.c', + 'vircgroupv1.c', + 'vircgroupv2.c', + 'vircgroupv2devices.c', + 'vircommand.c', + 'virconf.c', + 'vircrypto.c', + 'virdaemon.c', + 'virdbus.c', + 'virdevmapper.c', + 'virdnsmasq.c', + 'virebtables.c', + 'virenum.c', + 'vireventglib.c', + 'vireventglibwatch.c', + 'vireventthread.c', + 'virfcp.c', + 'virfdstream.c', + 'virfile.c', + 'virfilecache.c', + 'virfirewall.c', + 'virfirewalld.c', + 'virfirmware.c', + 'virgettext.c', + 'virgic.c', + 'virhash.c', + 'virhashcode.c', + 'virhook.c', + 'virhostcpu.c', + 'virhostmem.c', + 'virhostuptime.c', + 'viridentity.c', + 'virinitctl.c', + 'viriptables.c', + 'viriscsi.c', + 'virjson.c', + 'virkeycode.c', + 'virkmod.c', + 'virlease.c', + 'virlockspace.c', + 'virlog.c', + 'virmacaddr.c', + 'virmacmap.c', + 'virmdev.c', + 'virmodule.c', + 'virnetdev.c', + 'virnetdevbandwidth.c', + 'virnetdevbridge.c', + 'virnetdevip.c', + 'virnetdevmacvlan.c', + 'virnetdevmidonet.c', + 'virnetdevopenvswitch.c', + 'virnetdevtap.c', + 'virnetdevveth.c', + 'virnetdevvlan.c', + 'virnetdevvportprofile.c', + 'virnetlink.c', + 'virnodesuspend.c', + 'virnuma.c', + 'virnvme.c', + 'virobject.c', + 'virpci.c', + 'virperf.c', + 'virpidfile.c', + 'virpolkit.c', + 'virportallocator.c', + 'virprocess.c', + 'virqemu.c', + 'virrandom.c', + 'virresctrl.c', + 'virrotatingfile.c', + 'virscsi.c', + 'virscsihost.c', + 'virscsivhost.c', + 'virseclabel.c', + 'virsecret.c', + 'virsocket.c', + 'virsocketaddr.c', + 'virstorageencryption.c', + 'virstoragefile.c', + 'virstoragefilebackend.c', + 'virstring.c', + 'virsysinfo.c', + 'virsystemd.c', + 'virthread.c', + 'virthreadjob.c', + 'virthreadpool.c', + 'virtime.c', + 'virtpm.c', + 'virtypedparam.c', + 'viruri.c', + 'virusb.c', + 'virutil.c', + 'viruuid.c', + 'virvhba.c', + 'virvsock.c', + 'virxml.c', +] + +util_public_sources = files( + 'virerror.c', + 'virevent.c', + 'virtypedparam-public.c', +) + +keycode_gen_sources = [] + +keycode_list = [ + 'atset1', + 'atset2', + 'atset3', + 'linux', + 'osx', + 'qnum', + 'usb', + 'win32', + 'xtkbd', +] + +keyname_list = [ + 'linux', + 'osx', + 'win32', +] + +keymap_gen_prog = find_program('@0@/src/keycodemapdb/tools/keymap-gen'.format(meson.source_root())) +keymap_src_file = '@0@/src/keycodemapdb/data/keymaps.csv'.format(meson.source_root()) + +foreach name : keycode_list + keycode_gen_sources += custom_target( + 'virt_keycode_@0@'.format(name), + input: keymap_src_file, + output: 'virkeycodetable_@0@.h'.format(name), + command: [ + meson_python_prog, python3_prog, keymap_gen_prog, 'code-table', + '--lang', 'stdc', + '--varname', 'virKeyCodeTable_@0@'.format(name), + '@INPUT@', name, + ], + capture: true, + ) +endforeach + +foreach name : keyname_list + keycode_gen_sources += custom_target( + 'keyname_@0@'.format(name), + input: keymap_src_file, + output: 'virkeynametable_@0@.h'.format(name), + command: [ + meson_python_prog, python3_prog, keymap_gen_prog, 'name-table', + '--lang', 'stdc', + '--varname', 'virKeyNameTable_@0@'.format(name), + '@INPUT@', name, + ], + capture: true, + ) +endforeach + +virt_util_lib = static_library( + 'virt_util', + [ + util_sources, + util_public_sources, + keycode_gen_sources, + dtrace_gen_headers, + ], + dependencies: [ + acl_dep, + audit_dep, + capng_dep, + dbus_dep, + devmapper_dep, + gnutls_dep, + libnl_dep, + numactl_dep, + secdriver_dep, + src_dep, + thread_dep, + win32_dep, + yajl_dep, + ], +) + +util_inc_dir = include_directories('.') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 1 - src/conf/Makefile.inc.am | 191 --------------------------------------- src/conf/meson.build | 108 ++++++++++++++++++++++ src/meson.build | 2 + 4 files changed, 110 insertions(+), 192 deletions(-) delete mode 100644 src/conf/Makefile.inc.am create mode 100644 src/conf/meson.build diff --git a/src/Makefile.am b/src/Makefile.am index e533e27b344..01ae2596c31 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -69,7 +69,6 @@ COMMON_UNIT_VARS = \ lib_LTLIBRARIES += libvirt.la libvirt-qemu.la libvirt-lxc.la include util/Makefile.inc.am -include conf/Makefile.inc.am include cpu/Makefile.inc.am include cpu_map/Makefile.inc.am include security/Makefile.inc.am diff --git a/src/conf/Makefile.inc.am b/src/conf/Makefile.inc.am deleted file mode 100644 index debc6f4eef0..00000000000 --- a/src/conf/Makefile.inc.am +++ /dev/null @@ -1,191 +0,0 @@ -# vim: filetype=automake - -NETDEV_CONF_SOURCES = \ - conf/netdev_bandwidth_conf.h \ - conf/netdev_bandwidth_conf.c \ - conf/netdev_vport_profile_conf.h \ - conf/netdev_vport_profile_conf.c \ - conf/netdev_vlan_conf.h \ - conf/netdev_vlan_conf.c \ - conf/virnetworkportdef.h \ - conf/virnetworkportdef.c \ - $(NULL) - -DOMAIN_CONF_SOURCES = \ - conf/backup_conf.c \ - conf/backup_conf.h \ - conf/capabilities.c \ - conf/capabilities.h \ - conf/checkpoint_conf.c \ - conf/checkpoint_conf.h \ - conf/domain_addr.c \ - conf/domain_addr.h \ - conf/domain_capabilities.c \ - conf/domain_capabilities.h \ - conf/domain_conf.c \ - conf/domain_conf.h \ - conf/domain_audit.c \ - conf/domain_audit.h \ - conf/domain_nwfilter.c \ - conf/domain_nwfilter.h \ - conf/virsavecookie.c \ - conf/virsavecookie.h \ - conf/moment_conf.c \ - conf/moment_conf.h \ - conf/snapshot_conf.c \ - conf/snapshot_conf.h \ - conf/snapshot_conf_priv.h \ - conf/numa_conf.c \ - conf/numa_conf.h \ - conf/virconftypes.h \ - conf/virdomaincheckpointobjlist.c \ - conf/virdomaincheckpointobjlist.h \ - conf/virdomainobjlist.c \ - conf/virdomainobjlist.h \ - conf/virdomainmomentobjlist.c \ - conf/virdomainmomentobjlist.h \ - conf/virdomainsnapshotobjlist.c \ - conf/virdomainsnapshotobjlist.h \ - $(NULL) - -OBJECT_EVENT_SOURCES = \ - conf/object_event.c \ - conf/object_event.h \ - conf/object_event_private.h \ - $(NULL) - -DOMAIN_EVENT_SOURCES = \ - conf/domain_event.c \ - conf/domain_event.h \ - $(NULL) - -NETWORK_EVENT_SOURCES = \ - conf/network_event.c \ - conf/network_event.h \ - $(NULL) - -STORAGE_EVENT_SOURCES = \ - conf/storage_event.c \ - conf/storage_event.h \ - $(NULL) - -NODE_DEVICE_EVENT_SOURCES = \ - conf/node_device_event.c \ - conf/node_device_event.h \ - $(NULL) - -SECRET_EVENT_SOURCES = \ - conf/secret_event.c \ - conf/secret_event.h \ - $(NULL) - -NETWORK_CONF_SOURCES = \ - conf/network_conf.c \ - conf/network_conf.h \ - conf/virnetworkobj.c \ - conf/virnetworkobj.h \ - conf/networkcommon_conf.c \ - conf/networkcommon_conf.h \ - $(NULL) - -NWFILTER_PARAM_CONF_SOURCES = \ - conf/nwfilter_params.c \ - conf/nwfilter_params.h \ - conf/nwfilter_ipaddrmap.c \ - conf/nwfilter_ipaddrmap.h \ - conf/nwfilter_conf.h \ - conf/virnwfilterobj.h \ - $(NULL) - -NWFILTER_CONF_SOURCES = \ - $(NWFILTER_PARAM_CONF_SOURCES) \ - conf/nwfilter_conf.c \ - conf/nwfilter_conf.h \ - conf/virnwfilterobj.c \ - conf/virnwfilterobj.h \ - conf/virnwfilterbindingdef.c \ - conf/virnwfilterbindingdef.h \ - conf/virnwfilterbindingobj.c \ - conf/virnwfilterbindingobj.h \ - conf/virnwfilterbindingobjlist.c \ - conf/virnwfilterbindingobjlist.h \ - $(NULL) - -STORAGE_CONF_SOURCES = \ - conf/storage_adapter_conf.h \ - conf/storage_adapter_conf.c \ - conf/storage_capabilities.h \ - conf/storage_capabilities.c \ - conf/storage_conf.h \ - conf/storage_conf.c \ - conf/virstorageobj.h \ - conf/virstorageobj.c \ - $(NULL) - -INTERFACE_CONF_SOURCES = \ - conf/interface_conf.c \ - conf/interface_conf.h \ - conf/virinterfaceobj.c \ - conf/virinterfaceobj.h \ - $(NULL) - -SECRET_CONF_SOURCES = \ - conf/secret_conf.h \ - conf/secret_conf.c \ - conf/virsecretobj.h \ - conf/virsecretobj.c \ - $(NULL) - -NODE_DEVICE_CONF_SOURCES = \ - conf/node_device_conf.c \ - conf/node_device_conf.h \ - conf/node_device_util.c \ - conf/node_device_util.h \ - conf/virnodedeviceobj.c \ - conf/virnodedeviceobj.h \ - $(NULL) - -CPU_CONF_SOURCES = \ - conf/cpu_conf.c \ - conf/cpu_conf.h \ - $(NULL) - -CHRDEV_CONF_SOURCES = \ - conf/virchrdev.c \ - conf/virchrdev.h \ - $(NULL) - -DEVICE_CONF_SOURCES = \ - conf/device_conf.c \ - conf/device_conf.h \ - $(NULL) - -CONF_SOURCES = \ - $(NETDEV_CONF_SOURCES) \ - $(DOMAIN_CONF_SOURCES) \ - $(OBJECT_EVENT_SOURCES) \ - $(DOMAIN_EVENT_SOURCES) \ - $(NETWORK_EVENT_SOURCES) \ - $(STORAGE_EVENT_SOURCES) \ - $(NODE_DEVICE_EVENT_SOURCES) \ - $(SECRET_EVENT_SOURCES) \ - $(NETWORK_CONF_SOURCES) \ - $(NWFILTER_CONF_SOURCES) \ - $(NODE_DEVICE_CONF_SOURCES) \ - $(STORAGE_CONF_SOURCES) \ - $(INTERFACE_CONF_SOURCES) \ - $(SECRET_CONF_SOURCES) \ - $(CPU_CONF_SOURCES) \ - $(CHRDEV_CONF_SOURCES) \ - $(DEVICE_CONF_SOURCES) \ - $(NULL) - -noinst_LTLIBRARIES += libvirt_conf.la -libvirt_la_BUILT_LIBADD += libvirt_conf.la -libvirt_conf_la_SOURCES = $(CONF_SOURCES) -libvirt_conf_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS) -libvirt_conf_la_LIBADD = $(LIBXML_LIBS) diff --git a/src/conf/meson.build b/src/conf/meson.build new file mode 100644 index 00000000000..394cca4e6a1 --- /dev/null +++ b/src/conf/meson.build @@ -0,0 +1,108 @@ +netdev_conf_sources = [ + 'netdev_bandwidth_conf.c', + 'netdev_vlan_conf.c', + 'netdev_vport_profile_conf.c', + 'virnetworkportdef.c', +] + +domain_conf_sources = [ + 'backup_conf.c', + 'capabilities.c', + 'checkpoint_conf.c', + 'domain_addr.c', + 'domain_audit.c', + 'domain_capabilities.c', + 'domain_conf.c', + 'domain_nwfilter.c', + 'moment_conf.c', + 'numa_conf.c', + 'snapshot_conf.c', + 'virdomaincheckpointobjlist.c', + 'virdomainmomentobjlist.c', + 'virdomainobjlist.c', + 'virdomainsnapshotobjlist.c', + 'virsavecookie.c', +] + +event_conf_sources = [ + 'domain_event.c', + 'network_event.c', + 'node_device_event.c', + 'object_event.c', + 'secret_event.c', + 'storage_event.c', +] + +network_conf_sources = [ + 'network_conf.c', + 'networkcommon_conf.c', + 'virnetworkobj.c', +] + +nwfilter_conf_sources = [ + 'nwfilter_conf.c', + 'nwfilter_ipaddrmap.c', + 'nwfilter_params.c', + 'virnwfilterbindingdef.c', + 'virnwfilterbindingobj.c', + 'virnwfilterbindingobjlist.c', + 'virnwfilterobj.c', +] + +storage_conf_sources = [ + 'storage_adapter_conf.c', + 'storage_capabilities.c', + 'storage_conf.c', + 'virstorageobj.c', +] + +interface_conf_sources = [ + 'interface_conf.c', + 'virinterfaceobj.c', +] + +secret_conf_sources = [ + 'secret_conf.c', + 'virsecretobj.c', +] + +node_device_conf_sources = [ + 'node_device_conf.c', + 'node_device_util.c', + 'virnodedeviceobj.c', +] + +cpu_conf_sources = [ + 'cpu_conf.c', +] + +chrdev_conf_sources = [ + 'virchrdev.c', +] + +device_conf_sources = [ + 'device_conf.c', +] + +virt_conf_lib = static_library( + 'virt_conf', + [ + chrdev_conf_sources, + cpu_conf_sources, + device_conf_sources, + domain_conf_sources, + event_conf_sources, + interface_conf_sources, + netdev_conf_sources, + network_conf_sources, + node_device_conf_sources, + nwfilter_conf_sources, + secret_conf_sources, + storage_conf_sources, + ], + dependencies: [ + src_dep, + ], +) + +conf_inc_dir = include_directories('.') diff --git a/src/meson.build b/src/meson.build index 9f3dd9fca8f..34babecd9b0 100644 --- a/src/meson.build +++ b/src/meson.build @@ -77,3 +77,5 @@ src_dep = declare_dependency( dependencies: [ src_dep ], include_directories: [ util_inc_dir ], ) + +subdir('conf') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 10 ---- src/meson.build | 1 + src/rpc/Makefile.inc.am | 119 ---------------------------------------- src/rpc/meson.build | 108 ++++++++++++++++++++++++++++++++++++ 4 files changed, 109 insertions(+), 129 deletions(-) delete mode 100644 src/rpc/Makefile.inc.am create mode 100644 src/rpc/meson.build diff --git a/src/Makefile.am b/src/Makefile.am index 01ae2596c31..ecc757c455a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -76,7 +76,6 @@ include access/Makefile.inc.am include logging/Makefile.inc.am include locking/Makefile.inc.am include admin/Makefile.inc.am -include rpc/Makefile.inc.am include test/Makefile.inc.am include hypervisor/Makefile.inc.am include esx/Makefile.inc.am @@ -272,15 +271,6 @@ GENERATED_SYM_FILES += \ $(NULL) - -%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \ - $< $(subst $(srcdir)/,,$@) - -%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \ - $< $(subst $(srcdir)/,,$@) - check-local: check-augeas check-augeas: $(augeas_DATA) $(augeastest_DATA) diff --git a/src/meson.build b/src/meson.build index 34babecd9b0..4a2998f4bfc 100644 --- a/src/meson.build +++ b/src/meson.build @@ -79,3 +79,4 @@ src_dep = declare_dependency( ) subdir('conf') +subdir('rpc') diff --git a/src/rpc/Makefile.inc.am b/src/rpc/Makefile.inc.am deleted file mode 100644 index fe23b17a62b..00000000000 --- a/src/rpc/Makefile.inc.am +++ /dev/null @@ -1,119 +0,0 @@ -# vim: filetype=automake - -VIR_NET_RPC_GENERATED = \ - rpc/virnetprotocol.h \ - rpc/virnetprotocol.c \ - rpc/virkeepaliveprotocol.h \ - rpc/virkeepaliveprotocol.c \ - $(NULL) - -noinst_LTLIBRARIES += \ - libvirt-net-rpc.la \ - libvirt-net-rpc-server.la \ - libvirt-net-rpc-client.la \ - $(NULL) - -libvirt_la_BUILT_LIBADD += \ - libvirt-net-rpc.la \ - libvirt-net-rpc-server.la \ - libvirt-net-rpc-client.la \ - $(NULL) - -libvirt_net_rpc_la_SOURCES = \ - rpc/virnetmessage.h \ - rpc/virnetmessage.c \ - rpc/virnettlscontext.h \ - rpc/virnettlscontext.c \ - rpc/virnetsocket.h \ - rpc/virnetsocket.c \ - rpc/virkeepalive.h \ - rpc/virkeepalive.c \ - $(NULL) - -nodist_libvirt_net_rpc_la_SOURCES = \ - $(VIR_NET_RPC_GENERATED) \ - $(NULL) - -if WITH_SSH2 -libvirt_net_rpc_la_SOURCES += \ - rpc/virnetsshsession.h \ - rpc/virnetsshsession.c \ - $(NULL) -endif ! WITH_SSH2 - -if WITH_SASL -libvirt_net_rpc_la_SOURCES += \ - rpc/virnetsaslcontext.h \ - rpc/virnetsaslcontext.c \ - $(NULL) -endif ! WITH_SASL - -if WITH_LIBSSH -libvirt_net_rpc_la_SOURCES += \ - rpc/virnetlibsshsession.h \ - rpc/virnetlibsshsession.c \ - $(NULL) -endif ! WITH_LIBSSH - -libvirt_net_rpc_la_CFLAGS = \ - -I$(builddir)/rpc \ - $(GNUTLS_CFLAGS) \ - $(SASL_CFLAGS) \ - $(SSH2_CFLAGS) \ - $(LIBSSH_CFLAGS) \ - $(XDR_CFLAGS) \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_net_rpc_la_LDFLAGS = \ - $(GNUTLS_LIBS) \ - $(SASL_LIBS) \ - $(SSH2_LIBS)\ - $(LIBSSH_LIBS) \ - $(SECDRIVER_LIBS) \ - $(AM_LDFLAGS) \ - $(NULL) - -libvirt_net_rpc_server_la_SOURCES = \ - rpc/virnetserverprogram.h \ - rpc/virnetserverprogram.c \ - rpc/virnetserverservice.h \ - rpc/virnetserverservice.c \ - rpc/virnetserverclient.h \ - rpc/virnetserverclient.c \ - rpc/virnetdaemon.h \ - rpc/virnetdaemon.c \ - rpc/virnetserver.h \ - rpc/virnetserver.c \ - $(NULL) -libvirt_net_rpc_server_la_CFLAGS = \ - -I$(builddir)/rpc \ - $(DBUS_CFLAGS) \ - $(XDR_CFLAGS) \ - $(SASL_CFLAGS) \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_net_rpc_server_la_LDFLAGS = \ - $(AM_LDFLAGS) \ - $(DBUS_LIBS) \ - $(NULL) - -libvirt_net_rpc_client_la_SOURCES = \ - rpc/virnetclientprogram.h \ - rpc/virnetclientprogram.c \ - rpc/virnetclientstream.h \ - rpc/virnetclientstream.c \ - rpc/virnetclient.h \ - rpc/virnetclient.c \ - $(NULL) -libvirt_net_rpc_client_la_CFLAGS = \ - -I$(builddir)/rpc \ - $(AM_CFLAGS) \ - $(XDR_CFLAGS) \ - $(NULL) -libvirt_net_rpc_client_la_LDFLAGS = $(AM_LDFLAGS) - -if WITH_SASL -libvirt_net_rpc_client_la_CFLAGS += \ - $(SASL_CFLAGS) \ - $(NULL) -endif WITH_SASL diff --git a/src/rpc/meson.build b/src/rpc/meson.build new file mode 100644 index 00000000000..b26939db9cc --- /dev/null +++ b/src/rpc/meson.build @@ -0,0 +1,108 @@ +genprotocol_prog = find_program('genprotocol.pl') + +rpc_sources = [ + 'virnetmessage.c', + 'virnettlscontext.c', + 'virnetsocket.c', + 'virkeepalive.c', +] + +if libssh_dep.found() + rpc_sources += 'virnetlibsshsession.c' +endif + +if libssh2_dep.found() + rpc_sources += 'virnetsshsession.c' +endif + +if sasl_dep.found() + rpc_sources += 'virnetsaslcontext.c' +endif + +rpc_gen_headers = [] +rpc_gen_sources = [] + +foreach name : [ 'virnet', 'virkeepalive' ] + protocol_file = files('@0@protocol.x'.format(name)) + header_file = '@0@protocol.h'.format(name) + source_file = '@0@protocol.c'.format(name) + + rpc_gen_headers += custom_target( + header_file, + input: protocol_file, + output: header_file, + command: [ + genprotocol_prog, rpcgen_prog, '-h', '@INPUT@', '@OUTPUT@', + ], + ) + + rpc_gen_sources += custom_target( + source_file, + input: protocol_file, + output: source_file, + command: [ + genprotocol_prog, rpcgen_prog, '-c', '@INPUT@', '@OUTPUT@', + ], + ) +endforeach + +rpc_server_sources = [ + 'virnetserverprogram.c', + 'virnetserverservice.c', + 'virnetserverclient.c', + 'virnetdaemon.c', + 'virnetserver.c', +] + +rpc_client_sources = [ + 'virnetclientprogram.c', + 'virnetclientstream.c', + 'virnetclient.c', +] + +virt_rpc_lib = static_library( + 'virt_net_rpc', + [ + rpc_sources, + rpc_gen_headers, + rpc_gen_sources, + ], + dependencies: [ + gnutls_dep, + libssh2_dep, + libssh_dep, + sasl_dep, + secdriver_dep, + src_dep, + xdr_dep, + ], +) + +virt_rpc_server_lib = static_library( + 'virt_net_rpc_server', + [ + rpc_server_sources, + rpc_gen_headers, + ], + dependencies: [ + dbus_dep, + sasl_dep, + src_dep, + xdr_dep, + ], +) + +virt_rpc_client_lib = static_library( + 'virt_net_rpc_client', + [ + rpc_client_sources, + rpc_gen_headers, + ], + dependencies: [ + sasl_dep, + src_dep, + xdr_dep, + ], +) + +rpc_inc_dir = include_directories('.') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/access/Makefile.inc.am | 75 -------------------------------------- src/access/meson.build | 72 ++++++++++++++++++++++++++++++++++++ src/meson.build | 1 + src/rpc/meson.build | 1 + 4 files changed, 74 insertions(+), 75 deletions(-) create mode 100644 src/access/meson.build diff --git a/src/access/Makefile.inc.am b/src/access/Makefile.inc.am index d58d5166bef..da9b5ef31b3 100644 --- a/src/access/Makefile.inc.am +++ b/src/access/Makefile.inc.am @@ -1,14 +1,5 @@ # vim: filetype=automake -ACCESS_DRIVER_GENERATED = \ - access/viraccessapicheck.h \ - access/viraccessapicheck.c \ - access/viraccessapicheckqemu.h \ - access/viraccessapicheckqemu.c \ - access/viraccessapichecklxc.h \ - access/viraccessapichecklxc.c \ - $(NULL) - ACCESS_DRIVER_SYM_FILES = \ libvirt_access.syms \ libvirt_access_qemu.syms \ @@ -21,44 +12,11 @@ ACCESS_DRIVER_API_FILES = \ libvirt_access_lxc.xml \ $(NULL) -ACCESS_DRIVER_SOURCES = \ - access/viraccessperm.h \ - access/viraccessperm.c \ - access/viraccessmanager.h \ - access/viraccessmanager.c \ - access/viraccessdriver.h \ - access/viraccessdrivernop.h \ - access/viraccessdrivernop.c \ - access/viraccessdriverstack.h \ - access/viraccessdriverstack.c \ - $(NULL) - -ACCESS_DRIVER_POLKIT_SOURCES = \ - access/viraccessdriverpolkit.h \ - access/viraccessdriverpolkit.c \ - $(NULL) - ACCESS_DRIVER_POLKIT_POLICY = access/org.libvirt.api.policy GENERATED_SYM_FILES += $(ACCESS_DRIVER_SYM_FILES) -libvirt_driver_access_la_SOURCES = \ - $(ACCESS_DRIVER_SOURCES) \ - $(NULL) -nodist_libvirt_driver_access_la_SOURCES = \ - $(ACCESS_DRIVER_GENERATED) \ - $(NULL) -noinst_LTLIBRARIES += libvirt_driver_access.la libvirt_la_BUILT_LIBADD += libvirt_driver_access.la -libvirt_driver_access_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS) -libvirt_driver_access_la_LIBADD = \ - $(GLIB_LIBS) \ - $(NULL) - $(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \ $(top_srcdir)/scripts/genpolkit.py Makefile.am @@ -66,7 +24,6 @@ $(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \ $(top_srcdir)/scripts/genpolkit.py $< > $@ || rm -f $@ if WITH_POLKIT -libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES) polkitactiondir = $(datadir)/polkit-1/actions if WITH_LIBVIRTD @@ -101,35 +58,3 @@ libvirt_access_lxc.xml: $(srcdir)/rpc/gendispatch.pl \ $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclapi \ lxc LXC $(LXC_PROTOCOL) > $@ -access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \ - $(REMOTE_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \ - remote REMOTE $(REMOTE_PROTOCOL) \ - > access/viraccessapicheck.h -access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \ - $(REMOTE_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \ - remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \ - > access/viraccessapicheck.c - -access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \ - $(QEMU_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \ - qemu QEMU $(QEMU_PROTOCOL) \ - > access/viraccessapicheckqemu.h -access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \ - $(QEMU_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \ - qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h \ - > access/viraccessapicheckqemu.c - -access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \ - $(LXC_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \ - lxc LXC $(LXC_PROTOCOL) \ - > access/viraccessapichecklxc.h -access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \ - $(LXC_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \ - lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \ - > access/viraccessapichecklxc.c diff --git a/src/access/meson.build b/src/access/meson.build new file mode 100644 index 00000000000..c5784fa4a98 --- /dev/null +++ b/src/access/meson.build @@ -0,0 +1,72 @@ +access_sources = [ + 'viraccessperm.c', + 'viraccessmanager.c', + 'viraccessdrivernop.c', + 'viraccessdriverstack.c', +] + +access_polkit_sources = [ + 'viraccessdriverpolkit.c', +] + +remote_path = meson.source_root() / 'src' / 'remote' + +access_gen_headers = [] +access_gen_sources = [] + +foreach name : [ 'remote', 'qemu', 'lxc' ] + if name == 'remote' + header_file = 'viraccessapicheck.h' + source_file = 'viraccessapicheck.c' + else + header_file = 'viraccessapicheck@0@.h'.format(name) + source_file = 'viraccessapicheck@0@.c'.format(name) + endif + protocol_file = remote_path / '@0@_protocol.x'.format(name) + + access_gen_headers += custom_target( + header_file, + output: header_file, + command: [ + gendispatch_prog, '--mode=aclheader', name, name.to_upper(), protocol_file, + ], + capture: true, + ) + + access_gen_sources += custom_target( + source_file, + output: source_file, + command: [ + gendispatch_prog, '--mode=aclbody', name, name.to_upper(), + protocol_file, header_file, + ], + capture: true, + ) +endforeach + +if conf.has('WITH_POLKIT') + access_sources += access_polkit_sources +endif + +virt_access_lib = static_library( + 'virt_access', + [ + access_sources, + access_gen_headers, + access_gen_sources, + ], + dependencies: [ + src_dep, + ], + include_directories: [ + conf_inc_dir, + ] +) + +access_inc_dir = include_directories('.') + +# Used by others where generated headers are required +access_dep = declare_dependency( + include_directories: access_inc_dir, + sources: access_gen_headers, +) diff --git a/src/meson.build b/src/meson.build index 4a2998f4bfc..c7993517760 100644 --- a/src/meson.build +++ b/src/meson.build @@ -80,3 +80,4 @@ src_dep = declare_dependency( subdir('conf') subdir('rpc') +subdir('access') diff --git a/src/rpc/meson.build b/src/rpc/meson.build index b26939db9cc..f6e8c7adba5 100644 --- a/src/rpc/meson.build +++ b/src/rpc/meson.build @@ -1,4 +1,5 @@ genprotocol_prog = find_program('genprotocol.pl') +gendispatch_prog = find_program('gendispatch.pl') rpc_sources = [ 'virnetmessage.c', -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/admin/Makefile.inc.am | 36 ---------------------------- src/admin/meson.build | 50 +++++++++++++++++++++++++++++++++++++++ src/meson.build | 2 ++ src/rpc/meson.build | 5 ++++ 4 files changed, 57 insertions(+), 36 deletions(-) create mode 100644 src/admin/meson.build diff --git a/src/admin/Makefile.inc.am b/src/admin/Makefile.inc.am index 2d94ead73e1..afe44437b74 100644 --- a/src/admin/Makefile.inc.am +++ b/src/admin/Makefile.inc.am @@ -3,39 +3,9 @@ ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x ADMIN_PROTOCOL_GENERATED = \ - admin/admin_protocol.c \ - admin/admin_protocol.h \ admin/admin_client.h \ - admin/admin_server_dispatch_stubs.h \ $(NULL) -admin/admin_server_dispatch.c: admin/admin_server_dispatch_stubs.h - -noinst_LTLIBRARIES += libvirt_driver_admin.la -libvirt_driver_admin_la_SOURCES = \ - admin/admin_server.c \ - admin/admin_server.h \ - admin/admin_server_dispatch.c \ - admin/admin_server_dispatch.h \ - $(NULL) -nodist_libvirt_driver_admin_la_SOURCES = \ - $(ADMIN_PROTOCOL_GENERATED) -libvirt_driver_admin_la_CFLAGS = \ - $(AM_CFLAGS) \ - $(XDR_CFLAGS) \ - -I$(top_srcdir)/src/admin \ - -I$(top_builddir)/src/admin \ - -I$(top_srcdir)/src/util \ - -I$(top_builddir)/src/rpc \ - $(NULL) -libvirt_driver_admin_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS) - -if WITH_SASL -libvirt_driver_admin_la_CFLAGS += \ - $(SASL_CFLAGS) \ - $(NULL) -endif WITH_SASL - GENERATED_SYM_FILES += admin/libvirt_admin.syms admin/libvirt_admin.def ADMIN_SYM_FILES = $(srcdir)/admin/libvirt_admin_private.syms @@ -114,12 +84,6 @@ admin/admin_client.h: $(srcdir)/rpc/gendispatch.pl \ admin ADMIN $(ADMIN_PROTOCOL) \ > admin/admin_client.h -admin/admin_server_dispatch_stubs.h: $(srcdir)/rpc/gendispatch.pl \ - $(ADMIN_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \ - admin ADMIN $(ADMIN_PROTOCOL) \ - > admin/admin_server_dispatch_stubs.h - admin/libvirt_admin.syms: admin/libvirt_admin_public.syms $(ADMIN_SYM_FILES) \ $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-tmp $@ ; \ diff --git a/src/admin/meson.build b/src/admin/meson.build new file mode 100644 index 00000000000..cf2f206e34a --- /dev/null +++ b/src/admin/meson.build @@ -0,0 +1,50 @@ +admin_driver_sources = [ + 'admin_server.c', + 'admin_server_dispatch.c', +] + +admin_driver_protocol = files('admin_protocol.x') + +admin_driver_generated = [] + +admin_driver_generated += custom_target( + 'admin_protocol.h', + input: admin_driver_protocol, + output: 'admin_protocol.h', + command: [ + genprotocol_prog, rpcgen_prog, '-h', '@INPUT@', '@OUTPUT@', + ], +) + +admin_driver_generated += custom_target( + 'admin_protocol.c', + input: admin_driver_protocol, + output: 'admin_protocol.c', + command: [ + genprotocol_prog, rpcgen_prog, '-c', '@INPUT@', '@OUTPUT@', + ], +) + +admin_driver_generated += custom_target( + 'admin_server_dispatch_stubs.h', + input: admin_driver_protocol, + output: 'admin_server_dispatch_stubs.h', + command: [ + gendispatch_prog, '--mode=server', 'admin', 'ADMIN', '@INPUT@', + ], + capture: true, +) + +admin_driver_lib = static_library( + 'virt_admin_driver', + [ + admin_driver_sources, + admin_driver_generated, + ], + dependencies: [ + rpc_dep, + sasl_dep, + src_dep, + xdr_dep, + ], +) diff --git a/src/meson.build b/src/meson.build index c7993517760..c2a4ccb17fd 100644 --- a/src/meson.build +++ b/src/meson.build @@ -81,3 +81,5 @@ src_dep = declare_dependency( subdir('conf') subdir('rpc') subdir('access') + +subdir('admin') diff --git a/src/rpc/meson.build b/src/rpc/meson.build index f6e8c7adba5..b8fbe0c38b1 100644 --- a/src/rpc/meson.build +++ b/src/rpc/meson.build @@ -107,3 +107,8 @@ virt_rpc_client_lib = static_library( ) rpc_inc_dir = include_directories('.') + +rpc_dep = declare_dependency( + include_directories: [ rpc_inc_dir ], + sources: [ rpc_gen_headers ], +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 1 - src/cpu/Makefile.inc.am | 27 --------------------------- src/cpu/meson.build | 19 +++++++++++++++++++ src/meson.build | 1 + 4 files changed, 20 insertions(+), 28 deletions(-) delete mode 100644 src/cpu/Makefile.inc.am create mode 100644 src/cpu/meson.build diff --git a/src/Makefile.am b/src/Makefile.am index ecc757c455a..24c4a7cb194 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -69,7 +69,6 @@ COMMON_UNIT_VARS = \ lib_LTLIBRARIES += libvirt.la libvirt-qemu.la libvirt-lxc.la include util/Makefile.inc.am -include cpu/Makefile.inc.am include cpu_map/Makefile.inc.am include security/Makefile.inc.am include access/Makefile.inc.am diff --git a/src/cpu/Makefile.inc.am b/src/cpu/Makefile.inc.am deleted file mode 100644 index 228112a3c6c..00000000000 --- a/src/cpu/Makefile.inc.am +++ /dev/null @@ -1,27 +0,0 @@ -# vim: filetype=automake - -CPU_SOURCES = \ - cpu/cpu.h \ - cpu/cpu.c \ - cpu/cpu_x86.h \ - cpu/cpu_x86.c \ - cpu/cpu_x86_data.h \ - cpu/cpu_s390.h \ - cpu/cpu_s390.c \ - cpu/cpu_arm.h \ - cpu/cpu_arm_data.h \ - cpu/cpu_arm.c \ - cpu/cpu_ppc64.h \ - cpu/cpu_ppc64.c \ - cpu/cpu_ppc64_data.h \ - cpu/cpu_map.h \ - cpu/cpu_map.c \ - $(NULL) - -noinst_LTLIBRARIES += libvirt_cpu.la -libvirt_la_BUILT_LIBADD += libvirt_cpu.la -libvirt_cpu_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_cpu_la_SOURCES = $(CPU_SOURCES) diff --git a/src/cpu/meson.build b/src/cpu/meson.build new file mode 100644 index 00000000000..2404dc6b76f --- /dev/null +++ b/src/cpu/meson.build @@ -0,0 +1,19 @@ +cpu_sources = [ + 'cpu.c', + 'cpu_arm.c', + 'cpu_map.c', + 'cpu_ppc64.c', + 'cpu_s390.c', + 'cpu_x86.c', +] + +cpu_lib = static_library( + 'virt_cpu', + cpu_sources, + dependencies: [ + src_dep, + ], + include_directories: [ + conf_inc_dir, + ], +) diff --git a/src/meson.build b/src/meson.build index c2a4ccb17fd..866763e08d4 100644 --- a/src/meson.build +++ b/src/meson.build @@ -81,5 +81,6 @@ src_dep = declare_dependency( subdir('conf') subdir('rpc') subdir('access') +subdir('cpu') subdir('admin') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/meson.build | 2 ++ src/vmx/Makefile.inc.am | 15 --------------- src/vmx/meson.build | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 src/vmx/meson.build diff --git a/src/meson.build b/src/meson.build index 866763e08d4..59ddae341f7 100644 --- a/src/meson.build +++ b/src/meson.build @@ -83,4 +83,6 @@ subdir('rpc') subdir('access') subdir('cpu') +subdir('vmx') + subdir('admin') diff --git a/src/vmx/Makefile.inc.am b/src/vmx/Makefile.inc.am index 88df423fed5..8912f6ee21c 100644 --- a/src/vmx/Makefile.inc.am +++ b/src/vmx/Makefile.inc.am @@ -1,20 +1,5 @@ # vim: filetype=automake -VMX_SOURCES = \ - vmx/vmx.c \ - vmx/vmx.h \ - $(NULL) - -if WITH_VMX -noinst_LTLIBRARIES += libvirt_vmx.la -libvirt_la_BUILT_LIBADD += libvirt_vmx.la -libvirt_vmx_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_vmx_la_SOURCES = $(VMX_SOURCES) -endif WITH_VMX - if WITH_VMX USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms else ! WITH_VMX diff --git a/src/vmx/meson.build b/src/vmx/meson.build new file mode 100644 index 00000000000..b09225cab68 --- /dev/null +++ b/src/vmx/meson.build @@ -0,0 +1,18 @@ +vmx_sources = [ + 'vmx.c', +] + +if conf.has('WITH_VMX') + vmx_lib = static_library( + 'virt_vmx', + [ + vmx_sources, + ], + dependencies: [ + src_dep, + ], + include_directories: [ + conf_inc_dir, + ], + ) +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/meson.build | 2 ++ src/vmware/Makefile.inc.am | 20 -------------------- src/vmware/meson.build | 18 ++++++++++++++++++ src/vmx/meson.build | 2 ++ 4 files changed, 22 insertions(+), 20 deletions(-) create mode 100644 src/vmware/meson.build diff --git a/src/meson.build b/src/meson.build index 59ddae341f7..84e810edfd2 100644 --- a/src/meson.build +++ b/src/meson.build @@ -86,3 +86,5 @@ subdir('cpu') subdir('vmx') subdir('admin') + +subdir('vmware') diff --git a/src/vmware/Makefile.inc.am b/src/vmware/Makefile.inc.am index 3caa6340daf..125e0304618 100644 --- a/src/vmware/Makefile.inc.am +++ b/src/vmware/Makefile.inc.am @@ -1,25 +1,5 @@ # vim: filetype=automake -VMWARE_DRIVER_SOURCES = \ - vmware/vmware_driver.c \ - vmware/vmware_driver.h \ - vmware/vmware_conf.c \ - vmware/vmware_conf.h \ - $(NULL) - -DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(VMWARE_DRIVER_SOURCES)) - -if WITH_VMWARE -noinst_LTLIBRARIES += libvirt_driver_vmware.la -libvirt_la_BUILT_LIBADD += libvirt_driver_vmware.la -libvirt_driver_vmware_la_CFLAGS = \ - -I$(srcdir)/conf \ - -I$(srcdir)/vmx \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_driver_vmware_la_SOURCES = $(VMWARE_DRIVER_SOURCES) -endif WITH_VMWARE - if WITH_VMWARE USED_SYM_FILES += $(srcdir)/libvirt_vmware.syms else ! WITH_VMWARE diff --git a/src/vmware/meson.build b/src/vmware/meson.build new file mode 100644 index 00000000000..285cc5eb9a3 --- /dev/null +++ b/src/vmware/meson.build @@ -0,0 +1,18 @@ +vmware_sources = [ + 'vmware_conf.c', + 'vmware_driver.c', +] + +if conf.has('WITH_VMWARE') + vmware_lib = static_library( + 'virt_vmware', + vmware_sources, + dependencies: [ + src_dep, + ], + include_directories: [ + conf_inc_dir, + vmx_inc_dir, + ], + ) +endif diff --git a/src/vmx/meson.build b/src/vmx/meson.build index b09225cab68..8bed1fac9fa 100644 --- a/src/vmx/meson.build +++ b/src/vmx/meson.build @@ -16,3 +16,5 @@ if conf.has('WITH_VMX') ], ) endif + +vmx_inc_dir = include_directories('.') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/esx/Makefile.inc.am | 70 ----------------------------------------- src/esx/meson.build | 57 +++++++++++++++++++++++++++++++++ src/meson.build | 1 + 3 files changed, 58 insertions(+), 70 deletions(-) create mode 100644 src/esx/meson.build diff --git a/src/esx/Makefile.inc.am b/src/esx/Makefile.inc.am index 89e7b18d344..2e776d1ebec 100644 --- a/src/esx/Makefile.inc.am +++ b/src/esx/Makefile.inc.am @@ -1,77 +1,7 @@ # vim: filetype=automake -ESX_DRIVER_SOURCES = \ - esx/esx_private.h \ - esx/esx_driver.c \ - esx/esx_driver.h \ - esx/esx_interface_driver.c \ - esx/esx_interface_driver.h \ - esx/esx_network_driver.c \ - esx/esx_network_driver.h \ - esx/esx_storage_driver.c \ - esx/esx_storage_driver.h \ - esx/esx_storage_backend_vmfs.c \ - esx/esx_storage_backend_vmfs.h \ - esx/esx_storage_backend_iscsi.c \ - esx/esx_storage_backend_iscsi.h \ - esx/esx_stream.c \ - esx/esx_stream.h \ - esx/esx_util.c \ - esx/esx_util.h \ - esx/esx_vi.c \ - esx/esx_vi.h \ - esx/esx_vi_methods.c \ - esx/esx_vi_methods.h \ - esx/esx_vi_types.c \ - esx/esx_vi_types.h \ - $(NULL) - -ESX_DRIVER_GENERATED = \ - esx/esx_vi_methods.generated.c \ - esx/esx_vi_methods.generated.h \ - esx/esx_vi_methods.generated.macro \ - esx/esx_vi_types.generated.c \ - esx/esx_vi_types.generated.h \ - esx/esx_vi_types.generated.typedef \ - esx/esx_vi_types.generated.typeenum \ - esx/esx_vi_types.generated.typetostring \ - esx/esx_vi_types.generated.typefromstring \ - esx/esx_vi.generated.c \ - esx/esx_vi.generated.h \ - $(NULL) - -ESX_GENERATED_STAMP = .esx_vi_generator.stamp - -DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(ESX_DRIVER_SOURCES)) - -$(ESX_DRIVER_GENERATED): $(ESX_GENERATED_STAMP) - -$(ESX_GENERATED_STAMP): $(srcdir)/esx/esx_vi_generator.input \ - $(top_srcdir)/scripts/esx_vi_generator.py - $(AM_V_GEN) $(RUNUTF8) $(PYTHON) \ - $(top_srcdir)/scripts/esx_vi_generator.py \ - $(srcdir) $(builddir) && touch $@ - if WITH_ESX USED_SYM_FILES += $(srcdir)/libvirt_esx.syms else ! WITH_ESX SYM_FILES += $(srcdir)/libvirt_esx.syms endif ! WITH_ESX - - -if WITH_ESX -noinst_LTLIBRARIES += libvirt_driver_esx.la -libvirt_la_BUILT_LIBADD += libvirt_driver_esx.la -libvirt_driver_esx_la_CFLAGS = \ - $(CURL_CFLAGS) \ - -I$(srcdir)/conf \ - -I$(builddir)/esx \ - -I$(srcdir)/vmx \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_driver_esx_la_LDFLAGS = $(AM_LDFLAGS) -libvirt_driver_esx_la_LIBADD = $(CURL_LIBS) -libvirt_driver_esx_la_SOURCES = $(ESX_DRIVER_SOURCES) -libvirt_driver_esx_la_DEPENDENCIES = $(ESX_DRIVER_GENERATED) - -endif WITH_ESX diff --git a/src/esx/meson.build b/src/esx/meson.build new file mode 100644 index 00000000000..6d7e2311bff --- /dev/null +++ b/src/esx/meson.build @@ -0,0 +1,57 @@ +esx_sources = [ + 'esx_driver.c', + 'esx_interface_driver.c', + 'esx_network_driver.c', + 'esx_storage_driver.c', + 'esx_storage_backend_vmfs.c', + 'esx_storage_backend_iscsi.c', + 'esx_stream.c', + 'esx_util.c', + 'esx_vi.c', + 'esx_vi_methods.c', + 'esx_vi_types.c', +] + +esx_gen_sources = custom_target( + 'virtesxgen', + input: [ + 'esx_vi_generator.input', + ], + output: [ + 'esx_vi.generated.c', + 'esx_vi.generated.h', + 'esx_vi_methods.generated.c', + 'esx_vi_methods.generated.h', + 'esx_vi_methods.generated.macro', + 'esx_vi_types.generated.c', + 'esx_vi_types.generated.h', + 'esx_vi_types.generated.typedef', + 'esx_vi_types.generated.typeenum', + 'esx_vi_types.generated.typefromstring', + 'esx_vi_types.generated.typetostring', + ], + command: [ + meson_python_prog, + esx_vi_generator_prog, + meson.source_root() / 'src', + meson.build_root() / 'src', + ], +) + +if conf.has('WITH_ESX') + esx_lib = static_library( + 'virt_driver_esx', + [ + esx_sources, + esx_gen_sources[1], + ], + dependencies: [ + curl_dep, + src_dep, + ], + include_directories: [ + conf_inc_dir, + vmx_inc_dir, + ], + ) +endif diff --git a/src/meson.build b/src/meson.build index 84e810edfd2..794c717f136 100644 --- a/src/meson.build +++ b/src/meson.build @@ -87,4 +87,5 @@ subdir('vmx') subdir('admin') +subdir('esx') subdir('vmware') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 1 - src/hyperv/Makefile.inc.am | 46 -------------------------------------- src/hyperv/meson.build | 41 +++++++++++++++++++++++++++++++++ src/meson.build | 1 + 4 files changed, 42 insertions(+), 47 deletions(-) delete mode 100644 src/hyperv/Makefile.inc.am create mode 100644 src/hyperv/meson.build diff --git a/src/Makefile.am b/src/Makefile.am index 24c4a7cb194..daab843febd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -78,7 +78,6 @@ include admin/Makefile.inc.am include test/Makefile.inc.am include hypervisor/Makefile.inc.am include esx/Makefile.inc.am -include hyperv/Makefile.inc.am include vmx/Makefile.inc.am include vmware/Makefile.inc.am include vbox/Makefile.inc.am diff --git a/src/hyperv/Makefile.inc.am b/src/hyperv/Makefile.inc.am deleted file mode 100644 index 6e15f0682d9..00000000000 --- a/src/hyperv/Makefile.inc.am +++ /dev/null @@ -1,46 +0,0 @@ -# vim: filetype=automake - -HYPERV_DRIVER_SOURCES = \ - hyperv/hyperv_private.h \ - hyperv/hyperv_driver.c \ - hyperv/hyperv_driver.h \ - hyperv/hyperv_util.c \ - hyperv/hyperv_util.h \ - hyperv/hyperv_wmi.c \ - hyperv/hyperv_wmi.h \ - hyperv/hyperv_wmi_classes.c \ - hyperv/hyperv_wmi_classes.h \ - hyperv/openwsman.h \ - $(NULL) - -HYPERV_DRIVER_GENERATED = \ - hyperv/hyperv_wmi_classes.generated.c \ - hyperv/hyperv_wmi_classes.generated.h \ - hyperv/hyperv_wmi_classes.generated.typedef \ - $(NULL) - -HYPERV_GENERATED_STAMP = .hyperv_wmi_generator.stamp - -DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(HYPERV_DRIVER_SOURCES)) - -$(HYPERV_DRIVER_GENERATED): $(HYPERV_GENERATED_STAMP) - -$(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \ - $(top_srcdir)/scripts/hyperv_wmi_generator.py - $(AM_V_GEN) $(RUNUTF8) $(PYTHON) \ - $(top_srcdir)/scripts/hyperv_wmi_generator.py $(srcdir) $(builddir) \ - && touch $@ - -if WITH_HYPERV -noinst_LTLIBRARIES += libvirt_driver_hyperv.la -libvirt_la_BUILT_LIBADD += libvirt_driver_hyperv.la -libvirt_driver_hyperv_la_CFLAGS = \ - $(OPENWSMAN_CFLAGS) \ - -I$(srcdir)/conf \ - -I$(builddir)/hyperv \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_driver_hyperv_la_LDFLAGS = $(AM_LDFLAGS) -libvirt_driver_hyperv_la_LIBADD = $(OPENWSMAN_LIBS) -libvirt_driver_hyperv_la_SOURCES = $(HYPERV_DRIVER_SOURCES) -endif WITH_HYPERV diff --git a/src/hyperv/meson.build b/src/hyperv/meson.build new file mode 100644 index 00000000000..71382e3db0e --- /dev/null +++ b/src/hyperv/meson.build @@ -0,0 +1,41 @@ +hyperv_sources = [ + 'hyperv_driver.c', + 'hyperv_util.c', + 'hyperv_wmi.c', + 'hyperv_wmi_classes.c', +] + +hyperv_gen_sources = custom_target( + 'virthypervgen', + input: [ + 'hyperv_wmi_generator.input', + ], + output: [ + 'hyperv_wmi_classes.generated.c', + 'hyperv_wmi_classes.generated.h', + 'hyperv_wmi_classes.generated.typedef', + ], + command: [ + meson_python_prog, + hyperv_wmi_generator_prog, + meson.source_root() / 'src', + meson.build_root() / 'src', + ], +) + +if conf.has('WITH_HYPERV') + hyperv_lib = static_library( + 'virt_driver_hyperv', + [ + hyperv_sources, + hyperv_gen_sources[1], + ], + dependencies: [ + openwsman_dep, + src_dep, + ], + include_directories: [ + conf_inc_dir, + ] + ) +endif diff --git a/src/meson.build b/src/meson.build index 794c717f136..3186f1c13e3 100644 --- a/src/meson.build +++ b/src/meson.build @@ -88,4 +88,5 @@ subdir('vmx') subdir('admin') subdir('esx') +subdir('hyperv') subdir('vmware') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 1 - src/hypervisor/Makefile.inc.am | 20 -------------------- src/hypervisor/meson.build | 21 +++++++++++++++++++++ src/meson.build | 1 + 4 files changed, 22 insertions(+), 21 deletions(-) delete mode 100644 src/hypervisor/Makefile.inc.am create mode 100644 src/hypervisor/meson.build diff --git a/src/Makefile.am b/src/Makefile.am index daab843febd..b7fd239d0fb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -76,7 +76,6 @@ include logging/Makefile.inc.am include locking/Makefile.inc.am include admin/Makefile.inc.am include test/Makefile.inc.am -include hypervisor/Makefile.inc.am include esx/Makefile.inc.am include vmx/Makefile.inc.am include vmware/Makefile.inc.am diff --git a/src/hypervisor/Makefile.inc.am b/src/hypervisor/Makefile.inc.am deleted file mode 100644 index bc48ab12661..00000000000 --- a/src/hypervisor/Makefile.inc.am +++ /dev/null @@ -1,20 +0,0 @@ -# vim: filetype=automake - -HYPERVISOR_SOURCES = \ - hypervisor/domain_cgroup.h \ - hypervisor/domain_cgroup.c \ - hypervisor/domain_driver.h \ - hypervisor/domain_driver.c \ - hypervisor/virclosecallbacks.h \ - hypervisor/virclosecallbacks.c \ - hypervisor/virhostdev.h \ - hypervisor/virhostdev.c \ - $(NULL) - -noinst_LTLIBRARIES += libvirt_hypervisor.la -libvirt_la_BUILT_LIBADD += libvirt_hypervisor.la -libvirt_hypervisor_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_hypervisor_la_SOURCES = $(HYPERVISOR_SOURCES) diff --git a/src/hypervisor/meson.build b/src/hypervisor/meson.build new file mode 100644 index 00000000000..ea1dddfe983 --- /dev/null +++ b/src/hypervisor/meson.build @@ -0,0 +1,21 @@ +hypervisor_sources = [ + 'domain_cgroup.c', + 'domain_driver.c', + 'virclosecallbacks.c', + 'virhostdev.c', +] + +hypervisor_lib = static_library( + 'virt_hypervisor', + [ + hypervisor_sources, + ], + dependencies: [ + src_dep, + ], + include_directories: [ + conf_inc_dir, + ], +) + +hypervisor_inc_dir = include_directories('.') diff --git a/src/meson.build b/src/meson.build index 3186f1c13e3..bf918d91ffe 100644 --- a/src/meson.build +++ b/src/meson.build @@ -83,6 +83,7 @@ subdir('rpc') subdir('access') subdir('cpu') +subdir('hypervisor') subdir('vmx') subdir('admin') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/meson.build | 1 + src/openvz/Makefile.inc.am | 21 --------------------- src/openvz/meson.build | 20 ++++++++++++++++++++ 3 files changed, 21 insertions(+), 21 deletions(-) create mode 100644 src/openvz/meson.build diff --git a/src/meson.build b/src/meson.build index bf918d91ffe..61be43904e8 100644 --- a/src/meson.build +++ b/src/meson.build @@ -90,4 +90,5 @@ subdir('admin') subdir('esx') subdir('hyperv') +subdir('openvz') subdir('vmware') diff --git a/src/openvz/Makefile.inc.am b/src/openvz/Makefile.inc.am index 65b750b35af..c01e33124ac 100644 --- a/src/openvz/Makefile.inc.am +++ b/src/openvz/Makefile.inc.am @@ -1,26 +1,5 @@ # vim: filetype=automake -OPENVZ_DRIVER_SOURCES = \ - openvz/openvz_conf.c \ - openvz/openvz_conf.h \ - openvz/openvz_driver.c \ - openvz/openvz_driver.h \ - openvz/openvz_util.c \ - openvz/openvz_util.h \ - $(NULL) - -DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(OPENVZ_DRIVER_SOURCES)) - -if WITH_OPENVZ -noinst_LTLIBRARIES += libvirt_driver_openvz.la -libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la -libvirt_driver_openvz_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_driver_openvz_la_SOURCES = $(OPENVZ_DRIVER_SOURCES) -endif WITH_OPENVZ - if WITH_OPENVZ USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms else ! WITH_OPENVZ diff --git a/src/openvz/meson.build b/src/openvz/meson.build new file mode 100644 index 00000000000..b4e3befccb5 --- /dev/null +++ b/src/openvz/meson.build @@ -0,0 +1,20 @@ +openvz_sources = [ + 'openvz_conf.c', + 'openvz_driver.c', + 'openvz_util.c', +] + +if conf.has('WITH_OPENVZ') + openvz_lib = static_library( + 'virt_openvz', + [ + openvz_sources, + ], + dependencies: [ + src_dep, + ], + include_directories: [ + conf_inc_dir, + ], + ) +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 1 - src/meson.build | 1 + src/test/Makefile.inc.am | 23 ----------------------- src/test/meson.build | 24 ++++++++++++++++++++++++ 4 files changed, 25 insertions(+), 24 deletions(-) delete mode 100644 src/test/Makefile.inc.am create mode 100644 src/test/meson.build diff --git a/src/Makefile.am b/src/Makefile.am index b7fd239d0fb..555c677c615 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -75,7 +75,6 @@ include access/Makefile.inc.am include logging/Makefile.inc.am include locking/Makefile.inc.am include admin/Makefile.inc.am -include test/Makefile.inc.am include esx/Makefile.inc.am include vmx/Makefile.inc.am include vmware/Makefile.inc.am diff --git a/src/meson.build b/src/meson.build index 61be43904e8..af9dcfbb5f5 100644 --- a/src/meson.build +++ b/src/meson.build @@ -91,4 +91,5 @@ subdir('admin') subdir('esx') subdir('hyperv') subdir('openvz') +subdir('test') subdir('vmware') diff --git a/src/test/Makefile.inc.am b/src/test/Makefile.inc.am deleted file mode 100644 index c209414745e..00000000000 --- a/src/test/Makefile.inc.am +++ /dev/null @@ -1,23 +0,0 @@ -# vim: filetype=automake - -TEST_DRIVER_SOURCES = \ - test/test_driver.c \ - test/test_driver.h \ - $(NULL) -TEST_DRIVER_ASSETS = test/test-screenshot.png - -DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(TEST_DRIVER_SOURCES)) - -if WITH_TEST - -driver_test_asset_DATA = $(TEST_DRIVER_ASSETS) -driver_test_assetdir = $(pkgdatadir) - -noinst_LTLIBRARIES += libvirt_driver_test.la -libvirt_la_BUILT_LIBADD += libvirt_driver_test.la -libvirt_driver_test_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_driver_test_la_SOURCES = $(TEST_DRIVER_SOURCES) -endif WITH_TEST diff --git a/src/test/meson.build b/src/test/meson.build new file mode 100644 index 00000000000..ec7b12304ec --- /dev/null +++ b/src/test/meson.build @@ -0,0 +1,24 @@ +test_driver_sources = [ + 'test_driver.c', +] + +test_driver_assets = [ + 'test-screenshot.png', +] + +if conf.has('WITH_TEST') + test_lib = static_library( + 'virt_test', + [ + test_driver_sources, + ], + dependencies: [ + src_dep, + ], + include_directories: [ + conf_inc_dir, + ], + ) + + install_data(test_driver_assets, install_dir: pkgdatadir) +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/locking/Makefile.inc.am | 21 --------------------- src/locking/meson.build | 18 ++++++++++++++++++ src/meson.build | 1 + 3 files changed, 19 insertions(+), 21 deletions(-) create mode 100644 src/locking/meson.build diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index b75588f9fce..3afc9803ce0 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -1,15 +1,5 @@ # vim: filetype=automake -LOCK_DRIVER_SOURCES = \ - locking/lock_manager.c \ - locking/lock_manager.h \ - locking/lock_driver.h \ - locking/lock_driver_nop.h \ - locking/lock_driver_nop.c \ - locking/domain_lock.h \ - locking/domain_lock.c \ - $(NULL) - LOCK_DRIVER_SANLOCK_SOURCES = \ locking/lock_driver_sanlock.c @@ -60,17 +50,6 @@ OPENRC_INIT_FILES_IN += \ locking/virtlockd.init.in \ $(NULL) -noinst_LTLIBRARIES += libvirt_driver_lock.la - -libvirt_la_BUILT_LIBADD += libvirt_driver_lock.la -libvirt_driver_lock_la_SOURCES = \ - $(LOCK_DRIVER_SOURCES) \ - $(NULL) -libvirt_driver_lock_la_CFLAGS = \ - $(AM_CFLAGS) \ - -I$(srcdir)/conf \ - $(NULL) - lockdriverdir = $(libdir)/libvirt/lock-driver lockdriver_LTLIBRARIES = diff --git a/src/locking/meson.build b/src/locking/meson.build new file mode 100644 index 00000000000..67822486253 --- /dev/null +++ b/src/locking/meson.build @@ -0,0 +1,18 @@ +lock_driver_sources = [ + 'lock_manager.c', + 'lock_driver_nop.c', + 'domain_lock.c', +] + +lock_driver_lib = static_library( + 'virt_lock_driver', + [ + lock_driver_sources, + ], + dependencies: [ + src_dep, + ], + include_directories: [ + conf_inc_dir, + ], +) diff --git a/src/meson.build b/src/meson.build index af9dcfbb5f5..96e49f2059c 100644 --- a/src/meson.build +++ b/src/meson.build @@ -87,6 +87,7 @@ subdir('hypervisor') subdir('vmx') subdir('admin') +subdir('locking') subdir('esx') subdir('hyperv') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/logging/Makefile.inc.am | 21 -------------------- src/logging/meson.build | 38 +++++++++++++++++++++++++++++++++++++ src/meson.build | 1 + 3 files changed, 39 insertions(+), 21 deletions(-) create mode 100644 src/logging/meson.build diff --git a/src/logging/Makefile.inc.am b/src/logging/Makefile.inc.am index 9aa634b126b..b88e0c8766e 100644 --- a/src/logging/Makefile.inc.am +++ b/src/logging/Makefile.inc.am @@ -9,11 +9,6 @@ LOG_DAEMON_GENERATED = \ logging/log_daemon_dispatch_stubs.h $(NULL) -LOG_DRIVER_SOURCES = \ - logging/log_manager.c \ - logging/log_manager.h \ - $(NULL) - LOG_DAEMON_SOURCES = \ logging/log_daemon.h \ logging/log_daemon.c \ @@ -45,22 +40,6 @@ OPENRC_INIT_FILES_IN += \ logging/virtlogd.init.in \ $(NULL) -noinst_LTLIBRARIES += libvirt_driver_log.la - -libvirt_la_BUILT_LIBADD += libvirt_driver_log.la -libvirt_driver_log_la_SOURCES = \ - $(LOG_DRIVER_SOURCES) \ - $(NULL) -nodist_libvirt_driver_log_la_SOURCES = \ - $(LOG_PROTOCOL_GENERATED) \ - $(NULL) -libvirt_driver_log_la_CFLAGS = \ - -I$(builddir)/logging \ - -I$(builddir)/rpc \ - $(AM_CFLAGS) \ - $(XDR_CFLAGS) \ - $(NULL) - if WITH_LIBVIRTD sbin_PROGRAMS += virtlogd diff --git a/src/logging/meson.build b/src/logging/meson.build new file mode 100644 index 00000000000..a9c30efe063 --- /dev/null +++ b/src/logging/meson.build @@ -0,0 +1,38 @@ +log_driver_sources = [ + 'log_manager.c', +] + +log_protocol = 'log_protocol.x' + +log_protocol_generated = [] + +log_protocol_generated += custom_target( + 'log_protocol.h', + input: log_protocol, + output: 'log_protocol.h', + command: [ + genprotocol_prog, rpcgen_prog, '-h', '@INPUT@', '@OUTPUT@' + ], +) + +log_protocol_generated += custom_target( + 'log_protocol.c', + input: log_protocol, + output: 'log_protocol.c', + command: [ + genprotocol_prog, rpcgen_prog, '-c', '@INPUT@', '@OUTPUT@' + ], +) + +log_driver_lib = static_library( + 'virt_log_driver', + [ + log_driver_sources, + log_protocol_generated, + ], + dependencies: [ + rpc_dep, + src_dep, + xdr_dep, + ], +) diff --git a/src/meson.build b/src/meson.build index 96e49f2059c..2297721e58b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -88,6 +88,7 @@ subdir('vmx') subdir('admin') subdir('locking') +subdir('logging') subdir('esx') subdir('hyperv') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/meson.build | 2 ++ src/remote/Makefile.inc.am | 68 -------------------------------------- src/remote/meson.build | 59 +++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 68 deletions(-) create mode 100644 src/remote/meson.build diff --git a/src/meson.build b/src/meson.build index 2297721e58b..637f86b5ee4 100644 --- a/src/meson.build +++ b/src/meson.build @@ -86,6 +86,8 @@ subdir('cpu') subdir('hypervisor') subdir('vmx') +subdir('remote') + subdir('admin') subdir('locking') subdir('logging') diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 341f429b773..1dff8ec67e1 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -1,22 +1,5 @@ # vim: filetype=automake -REMOTE_DRIVER_GENERATED = \ - remote/remote_protocol.c \ - remote/remote_protocol.h \ - remote/remote_client_bodies.h \ - remote/lxc_protocol.c \ - remote/lxc_protocol.h \ - remote/lxc_client_bodies.h \ - remote/qemu_protocol.c \ - remote/qemu_protocol.h \ - remote/qemu_client_bodies.h \ - $(NULL) - -REMOTE_DRIVER_SOURCES = \ - remote/remote_driver.c \ - remote/remote_driver.h \ - $(NULL) - REMOTE_DAEMON_GENERATED = \ remote/remote_daemon_dispatch_stubs.h \ remote/lxc_daemon_dispatch_stubs.h \ @@ -144,39 +127,6 @@ REMOTE_DRIVER_PROTOCOL = \ $(LXC_PROTOCOL) \ $(NULL) -DRIVER_SOURCE_FILES += \ - $(REMOTE_DRIVER_GENERATED) \ - $(addprefix $(srcdir)/,$(REMOTE_DRIVER_SOURCES)) - -if WITH_REMOTE -noinst_LTLIBRARIES += libvirt_driver_remote.la -libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la -libvirt_driver_remote_la_CFLAGS = \ - $(XDR_CFLAGS) \ - -I$(srcdir)/conf \ - -I$(srcdir)/rpc \ - -I$(builddir)/rpc \ - -I$(builddir)/remote \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS) -libvirt_driver_remote_la_SOURCES = \ - $(REMOTE_DRIVER_SOURCES) -nodist_libvirt_driver_remote_la_SOURCES = \ - $(REMOTE_DRIVER_GENERATED) - -if WITH_DTRACE_PROBES -nodist_libvirt_driver_remote_la_SOURCES += libvirt_probes.h -endif WITH_DTRACE_PROBES - -if WITH_SASL -libvirt_driver_remote_la_CFLAGS += \ - $(SASL_CFLAGS) \ - $(NULL) -endif WITH_SASL - -endif WITH_REMOTE - if WITH_REMOTE USED_SYM_FILES += $(srcdir)/libvirt_remote.syms else ! WITH_REMOTE @@ -420,24 +370,6 @@ virt-guest-shutdown.target: remote/virt-guest-shutdown.target.in \ $(AM_V_GEN)cp $< $@ -remote/remote_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \ - $(REMOTE_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \ - remote REMOTE $(REMOTE_PROTOCOL) \ - > remote/remote_client_bodies.h - -remote/lxc_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \ - $(LXC_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \ - lxc LXC $(LXC_PROTOCOL) \ - > remote/lxc_client_bodies.h - -remote/qemu_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \ - $(QEMU_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \ - qemu QEMU $(QEMU_PROTOCOL) \ - > remote/qemu_client_bodies.h - remote/remote_daemon_dispatch_stubs.h: $(srcdir)/rpc/gendispatch.pl \ $(REMOTE_PROTOCOL) Makefile.am $(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \ diff --git a/src/remote/meson.build b/src/remote/meson.build new file mode 100644 index 00000000000..383b265ea21 --- /dev/null +++ b/src/remote/meson.build @@ -0,0 +1,59 @@ +remote_driver_sources = [ + 'remote_driver.c', +] + +remote_driver_generated = [] + +foreach name : [ 'remote', 'qemu', 'lxc' ] + client_bodies_h = '@0@_client_bodies.h'.format(name) + protocol_c = '@0@_protocol.c'.format(name) + protocol_h = '@0@_protocol.h'.format(name) + protocol_x = '@0@_protocol.x'.format(name) + + remote_driver_generated += custom_target( + client_bodies_h, + input: protocol_x, + output: client_bodies_h, + command: [ + gendispatch_prog, '--mode=client', name, name.to_upper(), '@INPUT@', + ], + capture: true, + ) + + remote_driver_generated += custom_target( + protocol_h, + input: protocol_x, + output: protocol_h, + command: [ + genprotocol_prog, rpcgen_prog, '-h', '@INPUT@', '@OUTPUT@', + ], + ) + + remote_driver_generated += custom_target( + protocol_c, + input: protocol_x, + output: protocol_c, + command: [ + genprotocol_prog, rpcgen_prog, '-c', '@INPUT@', '@OUTPUT@', + ], + ) +endforeach + +if conf.has('WITH_REMOTE') + remote_driver_lib = static_library( + 'virt_remote_driver', + [ + remote_driver_sources, + remote_driver_generated, + ], + dependencies: [ + rpc_dep, + sasl_dep, + src_dep, + xdr_dep, + ], + include_directories: [ + conf_inc_dir, + ], + ) +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/meson.build | 1 + src/security/Makefile.inc.am | 43 ------------------------------------ src/security/meson.build | 31 ++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 43 deletions(-) create mode 100644 src/security/meson.build diff --git a/src/meson.build b/src/meson.build index 637f86b5ee4..d416531c12b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -91,6 +91,7 @@ subdir('remote') subdir('admin') subdir('locking') subdir('logging') +subdir('security') subdir('esx') subdir('hyperv') diff --git a/src/security/Makefile.inc.am b/src/security/Makefile.inc.am index ec24931a80a..12afd7f8db0 100644 --- a/src/security/Makefile.inc.am +++ b/src/security/Makefile.inc.am @@ -5,31 +5,6 @@ SECURITY_DRIVER_APPARMOR_HELPER_SOURCES = \ security/virt-aa-helper.c \ $(NULL) -SECURITY_DRIVER_SOURCES = \ - security/security_driver.h \ - security/security_driver.c \ - security/security_nop.h \ - security/security_nop.c \ - security/security_stack.h \ - security/security_stack.c \ - security/security_dac.h \ - security/security_dac.c \ - security/security_manager.h \ - security/security_manager.c \ - security/security_util.h \ - security/security_util.c \ - $(NULL) - -SECURITY_DRIVER_SELINUX_SOURCES = \ - security/security_selinux.h \ - security/security_selinux.c \ - $(NULL) - -SECURITY_DRIVER_APPARMOR_SOURCES = \ - security/security_apparmor.h \ - security/security_apparmor.c \ - $(NULL) - SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES_IN = \ security/apparmor/usr.lib.libvirt.virt-aa-helper.in \ security/apparmor/usr.sbin.libvirtd.in \ @@ -48,25 +23,7 @@ security/apparmor/%: $(srcdir)/security/apparmor/%.in -e 's|[@]libexecdir[@]|@libexecdir@|' \ $< > $@ -libvirt_security_manager_la_SOURCES = $(SECURITY_DRIVER_SOURCES) -noinst_LTLIBRARIES += libvirt_security_manager.la -libvirt_la_BUILT_LIBADD += libvirt_security_manager.la -libvirt_security_manager_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS) -libvirt_security_manager_la_LIBADD = - -if WITH_SECDRIVER_SELINUX -libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES) -libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS) -endif WITH_SECDRIVER_SELINUX - if WITH_SECDRIVER_APPARMOR -libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES) -libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS) - if WITH_LIBVIRTD libexec_PROGRAMS += virt-aa-helper diff --git a/src/security/meson.build b/src/security/meson.build new file mode 100644 index 00000000000..3dc88c2c546 --- /dev/null +++ b/src/security/meson.build @@ -0,0 +1,31 @@ +security_driver_sources = [ + 'security_dac.c', + 'security_driver.c', + 'security_manager.c', + 'security_nop.c', + 'security_stack.c', + 'security_util.c', +] + +if conf.has('WITH_SECDRIVER_APPARMOR') + security_driver_sources += 'security_apparmor.c' +endif + +if conf.has('WITH_SECDRIVER_SELINUX') + security_driver_sources += 'security_selinux.c' +endif + +security_driver_lib = static_library( + 'virt_security_manager', + [ + security_driver_sources, + ], + dependencies: [ + apparmor_dep, + selinux_dep, + src_dep, + ], + include_directories: [ + conf_inc_dir, + ], +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 2 -- src/meson.build | 7 +++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 555c677c615..b948ac47a6d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -103,8 +103,6 @@ augeasdir = $(datadir)/augeas/lenses augeastestdir = $(datadir)/augeas/lenses/tests -# Internal generic driver infrastructure -DATATYPES_SOURCES = datatypes.h datatypes.c DRIVER_SOURCES += \ driver.c driver.h \ driver-hypervisor.h \ diff --git a/src/meson.build b/src/meson.build index d416531c12b..2c56caf5442 100644 --- a/src/meson.build +++ b/src/meson.build @@ -30,6 +30,13 @@ if conf.has('WITH_SECDRIVER_APPARMOR') endif +# Internal generic driver infrastructure + +datatypes_sources = [ + 'datatypes.c', +] + + # generate systemtap files systemtap_dir = datadir / 'systemtap' / 'tapset' -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 41 ----------------------------------------- src/meson.build | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 41 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index b948ac47a6d..50807ee7491 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -56,7 +56,6 @@ OPENRC_CONF_FILES = SYSCONF_FILES = sbin_PROGRAMS = bin_PROGRAMS = -DRIVER_SOURCES = COMMON_UNIT_VARS = \ -e 's|[@]runstatedir[@]|$(runstatedir)|g' \ @@ -103,36 +102,6 @@ augeasdir = $(datadir)/augeas/lenses augeastestdir = $(datadir)/augeas/lenses/tests -DRIVER_SOURCES += \ - driver.c driver.h \ - driver-hypervisor.h \ - driver-interface.h \ - driver-network.h \ - driver-nodedev.h \ - driver-nwfilter.h \ - driver-secret.h \ - driver-state.h \ - driver-storage.h \ - driver-stream.h \ - internal.h \ - $(DATATYPES_SOURCES) \ - libvirt.c libvirt_internal.h \ - libvirt-domain.c \ - libvirt-domain-checkpoint.c \ - libvirt-domain-snapshot.c \ - libvirt-host.c \ - libvirt-interface.c \ - libvirt-network.c \ - libvirt-nodedev.c \ - libvirt-nwfilter.c \ - libvirt-secret.c \ - libvirt-storage.c \ - libvirt-stream.c \ - $(NULL) - - - - # .libs/libvirt.so is built by libtool as a side-effect of the Makefile # rule for libvirt.la. However, checking symbols relies on Linux ELF layout if WITH_LINUX @@ -246,16 +215,6 @@ check-local: check-protocol check-symfile check-symsorting \ # First deal with sources usable in non-daemon context -noinst_LTLIBRARIES += libvirt_driver.la -libvirt_la_BUILT_LIBADD += libvirt_driver.la -libvirt_driver_la_SOURCES = $(DRIVER_SOURCES) - -libvirt_driver_la_CFLAGS = \ - $(GNUTLS_CFLAGS) $(CURL_CFLAGS) $(XDR_CFLAGS) \ - -I$(srcdir)/conf $(AM_CFLAGS) -libvirt_driver_la_LIBADD = \ - $(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS) - # All .syms files should be placed in exactly one of these three lists, # depending on whether they are stored in git and/or used in the build. SYM_FILES += $(USED_SYM_FILES) diff --git a/src/meson.build b/src/meson.build index 2c56caf5442..753d93253ea 100644 --- a/src/meson.build +++ b/src/meson.build @@ -105,3 +105,38 @@ subdir('hyperv') subdir('openvz') subdir('test') subdir('vmware') + + +driver_sources = [ + 'driver.c', + 'libvirt.c', + 'libvirt-domain.c', + 'libvirt-domain-checkpoint.c', + 'libvirt-domain-snapshot.c', + 'libvirt-host.c', + 'libvirt-interface.c', + 'libvirt-network.c', + 'libvirt-nodedev.c', + 'libvirt-nwfilter.c', + 'libvirt-secret.c', + 'libvirt-storage.c', + 'libvirt-stream.c', +] + +driver_lib = static_library( + 'virt_driver', + [ + driver_sources, + datatypes_sources, + ], + dependencies: [ + curl_dep, + dlopen_dep, + gnutls_dep, + src_dep, + xdr_dep, + ], + include_directories: [ + conf_inc_dir, + ], +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- scripts/gen-def-files.sh | 5 +++++ scripts/meson.build | 1 + src/Makefile.am | 8 -------- 3 files changed, 6 insertions(+), 8 deletions(-) create mode 100755 scripts/gen-def-files.sh diff --git a/scripts/gen-def-files.sh b/scripts/gen-def-files.sh new file mode 100755 index 00000000000..1ec7b083802 --- /dev/null +++ b/scripts/gen-def-files.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +printf 'EXPORTS\n' +sed -e '/^$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d' \ + -e 's/[ ]*\(.*\)\;/ \1/g' $1 diff --git a/scripts/meson.build b/scripts/meson.build index 5d3f0af4793..aa8c872a814 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -11,6 +11,7 @@ scripts = [ 'check-symsorting.py', 'dtrace2systemtap.py', 'esx_vi_generator.py', + 'gen-def-files.sh', 'genaclperms.py', 'genpolkit.py', 'gensystemtap.py', diff --git a/src/Makefile.am b/src/Makefile.am index 50807ee7491..b98169f27e7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -302,14 +302,6 @@ libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \ chmod a-w $@-tmp && \ mv $@-tmp libvirt.syms -%.def: %.syms - $(AM_V_GEN)rm -f -- $@-tmp $@ ; \ - printf 'EXPORTS\n' > $@-tmp && \ - sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d' \ - -e 's/[ ]*\(.*\)\;/ \1/g' $^ >> $@-tmp && \ - chmod a-w $@-tmp && \ - mv $@-tmp $@ - # Empty source list - it merely links a bunch of convenience libs together libvirt_la_SOURCES = libvirt_la_LDFLAGS = \ -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- scripts/gen-sym-files.sh | 15 +++++++++++++++ scripts/meson.build | 1 + src/Makefile.am | 14 -------------- 3 files changed, 16 insertions(+), 14 deletions(-) create mode 100755 scripts/gen-sym-files.sh diff --git a/scripts/gen-sym-files.sh b/scripts/gen-sym-files.sh new file mode 100755 index 00000000000..913a684d064 --- /dev/null +++ b/scripts/gen-sym-files.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +version="$1" +shift +public="$1" +shift +private="$@" + +printf "# WARNING: generated from the following files:\n\n" +cat $public +printf "\n\n# Private symbols\n\n" +printf "$version {\n\n" +printf "global:\n\n" +cat $private +printf "\n\nlocal:\n*;\n\n};" diff --git a/scripts/meson.build b/scripts/meson.build index aa8c872a814..0d2e48c3a36 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -12,6 +12,7 @@ scripts = [ 'dtrace2systemtap.py', 'esx_vi_generator.py', 'gen-def-files.sh', + 'gen-sym-files.sh', 'genaclperms.py', 'genpolkit.py', 'gensystemtap.py', diff --git a/src/Makefile.am b/src/Makefile.am index b98169f27e7..b0990e94ec1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -288,20 +288,6 @@ else ! WITH_LIBSSH SYM_FILES += $(srcdir)/libvirt_libssh.syms endif ! WITH_LIBSSH -libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \ - $(ACCESS_DRIVER_SYM_FILES) \ - $(top_builddir)/config.status - $(AM_V_GEN)rm -f $@-tmp $@ ; \ - printf '# WARNING: generated from the following:\n# $^\n\n' >$@-tmp && \ - cat $(srcdir)/libvirt_public.syms >>$@-tmp && \ - printf '\n\n# Private symbols\n\n' >>$@-tmp && \ - printf 'LIBVIRT_PRIVATE_$(VERSION) {\n\n' >>$@-tmp && \ - printf 'global:\n\n' >>$@-tmp && \ - cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \ - printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \ - chmod a-w $@-tmp && \ - mv $@-tmp libvirt.syms - # Empty source list - it merely links a bunch of convenience libs together libvirt_la_SOURCES = libvirt_la_LDFLAGS = \ -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-win-symbols.m4 | 3 -- src/Makefile.am | 53 +-------------------------- src/access/Makefile.inc.am | 22 ----------- src/access/meson.build | 14 +++++++ src/esx/Makefile.inc.am | 7 ---- src/esx/meson.build | 6 +++ src/meson.build | 75 ++++++++++++++++++++++++++++++++++++++ src/openvz/Makefile.inc.am | 7 ---- src/openvz/meson.build | 6 +++ src/remote/Makefile.inc.am | 6 --- src/remote/meson.build | 6 +++ src/vmware/Makefile.inc.am | 7 ---- src/vmware/meson.build | 6 +++ src/vmx/Makefile.inc.am | 7 ---- src/vmx/meson.build | 6 +++ 15 files changed, 120 insertions(+), 111 deletions(-) delete mode 100644 src/esx/Makefile.inc.am delete mode 100644 src/openvz/Makefile.inc.am delete mode 100644 src/vmware/Makefile.inc.am delete mode 100644 src/vmx/Makefile.inc.am diff --git a/m4/virt-win-symbols.m4 b/m4/virt-win-symbols.m4 index eba5596e4b4..f7b8e612a8d 100644 --- a/m4/virt-win-symbols.m4 +++ b/m4/virt-win-symbols.m4 @@ -18,7 +18,6 @@ dnl <http://www.gnu.org/licenses/>. dnl AC_DEFUN([LIBVIRT_WIN_CHECK_SYMBOLS], [ - LIBVIRT_SYMBOL_FILE=libvirt.syms LIBVIRT_ADMIN_SYMBOL_FILE=admin/libvirt_admin.syms LIBVIRT_LXC_SYMBOL_FILE='$(srcdir)/libvirt_lxc.syms' LIBVIRT_QEMU_SYMBOL_FILE='$(srcdir)/libvirt_qemu.syms' @@ -27,13 +26,11 @@ AC_DEFUN([LIBVIRT_WIN_CHECK_SYMBOLS], [ # Also set the symbol file to .def, so src/Makefile generates libvirt.def # from libvirt.syms and passes libvirt.def instead of libvirt.syms to the # linker - LIBVIRT_SYMBOL_FILE=libvirt.def LIBVIRT_ADMIN_SYMBOL_FILE=admin/libvirt_admin.def LIBVIRT_LXC_SYMBOL_FILE=libvirt_lxc.def LIBVIRT_QEMU_SYMBOL_FILE=libvirt_qemu.def ;; esac - AC_SUBST([LIBVIRT_SYMBOL_FILE]) AC_SUBST([LIBVIRT_ADMIN_SYMBOL_FILE]) AC_SUBST([LIBVIRT_LXC_SYMBOL_FILE]) AC_SUBST([LIBVIRT_QEMU_SYMBOL_FILE]) diff --git a/src/Makefile.am b/src/Makefile.am index b0990e94ec1..3ad565f7775 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -74,11 +74,7 @@ include access/Makefile.inc.am include logging/Makefile.inc.am include locking/Makefile.inc.am include admin/Makefile.inc.am -include esx/Makefile.inc.am -include vmx/Makefile.inc.am -include vmware/Makefile.inc.am include vbox/Makefile.inc.am -include openvz/Makefile.inc.am include qemu/Makefile.inc.am include bhyve/Makefile.inc.am include libxl/Makefile.inc.am @@ -218,9 +214,8 @@ check-local: check-protocol check-symfile check-symsorting \ # All .syms files should be placed in exactly one of these three lists, # depending on whether they are stored in git and/or used in the build. SYM_FILES += $(USED_SYM_FILES) -USED_SYM_FILES += $(srcdir)/libvirt_private.syms GENERATED_SYM_FILES += \ - libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \ + libvirt_qemu.def libvirt_lxc.def \ $(NULL) @@ -242,52 +237,6 @@ check-augeas: $(augeas_DATA) $(augeastest_DATA) AUG_GENTEST_SCRIPT = $(top_srcdir)/scripts/augeas-gentest.py AUG_GENTEST = $(RUNUTF8) $(PYTHON) $(AUG_GENTEST_SCRIPT) - -# -# Build our version script. This is composed of three parts: -# -# 1. libvirt_public.syms - public API. These functions are always -# present in the library and should never change incompatibly. -# -# 2. libvirt_private.syms - private API. These symbols are private and -# semantics may change on every release, hence the version number is -# spliced in at build time. This ensures that if libvirtd, virsh, or a -# driver module was built against one libvirt release, it will refuse to -# load with another where symbols may have same names but different -# semantics. Such symbols should never be visible in an (installed) -# public header file. -# -# 3. libvirt_*.syms - dynamic private API. Like libvirt_private.syms, -# except that build options (such as --enable-debug) can mean these -# symbols aren't present at all. -# - -USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms - -if WITH_LINUX -USED_SYM_FILES += $(srcdir)/libvirt_linux.syms -else ! WITH_LINUX -SYM_FILES += $(srcdir)/libvirt_linux.syms -endif ! WITH_LINUX - -if WITH_SASL -USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms -else ! WITH_SASL -SYM_FILES += $(srcdir)/libvirt_sasl.syms -endif ! WITH_SASL - -if WITH_SSH2 -USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms -else ! WITH_SSH2 -SYM_FILES += $(srcdir)/libvirt_libssh2.syms -endif ! WITH_SSH2 - -if WITH_LIBSSH -USED_SYM_FILES += $(srcdir)/libvirt_libssh.syms -else ! WITH_LIBSSH -SYM_FILES += $(srcdir)/libvirt_libssh.syms -endif ! WITH_LIBSSH - # Empty source list - it merely links a bunch of convenience libs together libvirt_la_SOURCES = libvirt_la_LDFLAGS = \ diff --git a/src/access/Makefile.inc.am b/src/access/Makefile.inc.am index da9b5ef31b3..bd1d51dd777 100644 --- a/src/access/Makefile.inc.am +++ b/src/access/Makefile.inc.am @@ -1,11 +1,5 @@ # vim: filetype=automake -ACCESS_DRIVER_SYM_FILES = \ - libvirt_access.syms \ - libvirt_access_qemu.syms \ - libvirt_access_lxc.syms \ - $(NULL) - ACCESS_DRIVER_API_FILES = \ libvirt_access.xml \ libvirt_access_qemu.xml \ @@ -14,8 +8,6 @@ ACCESS_DRIVER_API_FILES = \ ACCESS_DRIVER_POLKIT_POLICY = access/org.libvirt.api.policy -GENERATED_SYM_FILES += $(ACCESS_DRIVER_SYM_FILES) - libvirt_la_BUILT_LIBADD += libvirt_driver_access.la $(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \ @@ -31,20 +23,6 @@ polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY) endif WITH_LIBVIRTD endif ! WITH_POLKIT - -libvirt_access.syms: $(srcdir)/rpc/gendispatch.pl \ - $(REMOTE_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclsym \ - remote REMOTE $(REMOTE_PROTOCOL) > $@ -libvirt_access_qemu.syms: $(srcdir)/rpc/gendispatch.pl \ - $(QEMU_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclsym \ - qemu QEMU $(QEMU_PROTOCOL) > $@ -libvirt_access_lxc.syms: $(srcdir)/rpc/gendispatch.pl \ - $(LXC_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclsym \ - lxc LXC $(LXC_PROTOCOL) > $@ - libvirt_access.xml: $(srcdir)/rpc/gendispatch.pl \ $(REMOTE_PROTOCOL) Makefile.am $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclapi \ diff --git a/src/access/meson.build b/src/access/meson.build index c5784fa4a98..dc962166873 100644 --- a/src/access/meson.build +++ b/src/access/meson.build @@ -13,14 +13,17 @@ remote_path = meson.source_root() / 'src' / 'remote' access_gen_headers = [] access_gen_sources = [] +access_gen_sym = [] foreach name : [ 'remote', 'qemu', 'lxc' ] if name == 'remote' header_file = 'viraccessapicheck.h' source_file = 'viraccessapicheck.c' + syms_file = 'libvirt_access.syms' else header_file = 'viraccessapicheck@0@.h'.format(name) source_file = 'viraccessapicheck@0@.c'.format(name) + syms_file = 'libvirt_access_@0@.syms'.format(name) endif protocol_file = remote_path / '@0@_protocol.x'.format(name) @@ -42,6 +45,15 @@ foreach name : [ 'remote', 'qemu', 'lxc' ] ], capture: true, ) + + access_gen_sym += custom_target( + syms_file, + output: syms_file, + capture: true, + command: [ + gendispatch_prog, '--mode=aclsym', name, name.to_upper(), protocol_file, + ] + ) endforeach if conf.has('WITH_POLKIT') @@ -70,3 +82,5 @@ access_dep = declare_dependency( include_directories: access_inc_dir, sources: access_gen_headers, ) + +generated_sym_files += access_gen_sym diff --git a/src/esx/Makefile.inc.am b/src/esx/Makefile.inc.am deleted file mode 100644 index 2e776d1ebec..00000000000 --- a/src/esx/Makefile.inc.am +++ /dev/null @@ -1,7 +0,0 @@ -# vim: filetype=automake - -if WITH_ESX -USED_SYM_FILES += $(srcdir)/libvirt_esx.syms -else ! WITH_ESX -SYM_FILES += $(srcdir)/libvirt_esx.syms -endif ! WITH_ESX diff --git a/src/esx/meson.build b/src/esx/meson.build index 6d7e2311bff..08d8a542498 100644 --- a/src/esx/meson.build +++ b/src/esx/meson.build @@ -55,3 +55,9 @@ if conf.has('WITH_ESX') ], ) endif + +if conf.has('WITH_ESX') + used_sym_files += 'libvirt_esx.syms' +else + sym_files += 'libvirt_esx.syms' +endif diff --git a/src/meson.build b/src/meson.build index 753d93253ea..257cdbe4090 100644 --- a/src/meson.build +++ b/src/meson.build @@ -76,6 +76,44 @@ if conf.has('WITH_DTRACE_PROBES') endif +# symbol files + +public_sym_file = 'libvirt_public.syms' + +used_sym_files = [ + 'libvirt_private.syms', + 'libvirt_driver_modules.syms', +] + +generated_sym_files = [] + +sym_files = [] + +if host_machine.system() == 'linux' + used_sym_files += 'libvirt_linux.syms' +else + sym_files += 'libvirt_linux.syms' +endif + +if conf.has('WITH_SASL') + used_sym_files += 'libvirt_sasl.syms' +else + sym_files += 'libvirt_sasl.syms' +endif + +if conf.has('WITH_LIBSSH') + used_sym_files += 'libvirt_libssh.syms' +else + sym_files += 'libvirt_libssh.syms' +endif + +if conf.has('WITH_SSH2') + used_sym_files += 'libvirt_libssh2.syms' +else + sym_files += 'libvirt_libssh2.syms' +endif + + # list subdirectories subdir('util') @@ -140,3 +178,40 @@ driver_lib = static_library( conf_inc_dir, ], ) + + +# symbol files for libvirt.so + +# Build our version script. This is composed of three parts: +# +# 1. libvirt_public.syms - public API. These functions are always +# present in the library and should never change incompatibly. +# +# 2. libvirt_private.syms - private API. These symbols are private and +# semantics may change on every release, hence the version number is +# spliced in at build time. This ensures that if libvirtd, virsh, or a +# driver module was built against one libvirt release, it will refuse to +# load with another where symbols may have same names but different +# semantics. Such symbols should never be visible in an (installed) +# public header file. +# +# 3. libvirt_*.syms - dynamic private API. Like libvirt_private.syms, +# except that build options (such as --enable-debug) can mean these +# symbols aren't present at all. + +libvirt_syms = custom_target( + 'libvirt.syms', + input: [ public_sym_file ] + used_sym_files + generated_sym_files, + output: 'libvirt.syms', + command: [ gen_sym_files_prog, 'LIBVIRT_PRIVATE_' + meson.project_version(), '@INPUT@' ], + capture: true, +) +if host_machine.system() == 'windows' + libvirt_def = custom_target( + 'libvirt.def', + input: libvirt_syms, + output: 'libvirt.def', + command: [ gen_def_files_prog, '@INPUT@' ], + capture: true, + ) +endif diff --git a/src/openvz/Makefile.inc.am b/src/openvz/Makefile.inc.am deleted file mode 100644 index c01e33124ac..00000000000 --- a/src/openvz/Makefile.inc.am +++ /dev/null @@ -1,7 +0,0 @@ -# vim: filetype=automake - -if WITH_OPENVZ -USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms -else ! WITH_OPENVZ -SYM_FILES += $(srcdir)/libvirt_openvz.syms -endif ! WITH_OPENVZ diff --git a/src/openvz/meson.build b/src/openvz/meson.build index b4e3befccb5..427b25fed1c 100644 --- a/src/openvz/meson.build +++ b/src/openvz/meson.build @@ -18,3 +18,9 @@ if conf.has('WITH_OPENVZ') ], ) endif + +if conf.has('WITH_OPENVZ') + used_sym_files += 'libvirt_openvz.syms' +else + sym_files += 'libvirt_openvz.syms' +endif diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 1dff8ec67e1..421f7337217 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -127,12 +127,6 @@ REMOTE_DRIVER_PROTOCOL = \ $(LXC_PROTOCOL) \ $(NULL) -if WITH_REMOTE -USED_SYM_FILES += $(srcdir)/libvirt_remote.syms -else ! WITH_REMOTE -SYM_FILES += $(srcdir)/libvirt_remote.syms -endif ! WITH_REMOTE - if WITH_LIBVIRTD sbin_PROGRAMS += libvirtd virtproxyd diff --git a/src/remote/meson.build b/src/remote/meson.build index 383b265ea21..f029edefd7e 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -57,3 +57,9 @@ if conf.has('WITH_REMOTE') ], ) endif + +if conf.has('WITH_REMOTE') + used_sym_files += 'libvirt_remote.syms' +else + sym_files += 'libvirt_remote.syms' +endif diff --git a/src/vmware/Makefile.inc.am b/src/vmware/Makefile.inc.am deleted file mode 100644 index 125e0304618..00000000000 --- a/src/vmware/Makefile.inc.am +++ /dev/null @@ -1,7 +0,0 @@ -# vim: filetype=automake - -if WITH_VMWARE -USED_SYM_FILES += $(srcdir)/libvirt_vmware.syms -else ! WITH_VMWARE -SYM_FILES += $(srcdir)/libvirt_vmware.syms -endif ! WITH_VMWARE diff --git a/src/vmware/meson.build b/src/vmware/meson.build index 285cc5eb9a3..dc2a32a1610 100644 --- a/src/vmware/meson.build +++ b/src/vmware/meson.build @@ -16,3 +16,9 @@ if conf.has('WITH_VMWARE') ], ) endif + +if conf.has('WITH_VMWARE') + used_sym_files += 'libvirt_vmware.syms' +else + sym_files += 'libvirt_vmware.syms' +endif diff --git a/src/vmx/Makefile.inc.am b/src/vmx/Makefile.inc.am deleted file mode 100644 index 8912f6ee21c..00000000000 --- a/src/vmx/Makefile.inc.am +++ /dev/null @@ -1,7 +0,0 @@ -# vim: filetype=automake - -if WITH_VMX -USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms -else ! WITH_VMX -SYM_FILES += $(srcdir)/libvirt_vmx.syms -endif ! WITH_VMX diff --git a/src/vmx/meson.build b/src/vmx/meson.build index 8bed1fac9fa..25e3d1a6fca 100644 --- a/src/vmx/meson.build +++ b/src/vmx/meson.build @@ -18,3 +18,9 @@ if conf.has('WITH_VMX') endif vmx_inc_dir = include_directories('.') + +if conf.has('WITH_VMX') + used_sym_files += 'libvirt_vmx.syms' +else + sym_files += 'libvirt_vmx.syms' +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 35 +-------------------------------- src/access/Makefile.inc.am | 2 -- src/access/meson.build | 2 ++ src/admin/meson.build | 2 ++ src/conf/meson.build | 2 ++ src/cpu/meson.build | 2 ++ src/esx/meson.build | 2 ++ src/hyperv/meson.build | 2 ++ src/hypervisor/meson.build | 2 ++ src/locking/meson.build | 2 ++ src/logging/meson.build | 2 ++ src/meson.build | 40 ++++++++++++++++++++++++++++++++++++++ src/openvz/meson.build | 2 ++ src/remote/meson.build | 2 ++ src/rpc/meson.build | 6 ++++++ src/security/meson.build | 2 ++ src/test/meson.build | 2 ++ src/util/meson.build | 2 ++ src/vmware/meson.build | 2 ++ src/vmx/meson.build | 2 ++ 20 files changed, 79 insertions(+), 36 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 3ad565f7775..b83a087b716 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -35,7 +35,6 @@ mod_LTLIBRARIES = INSTALL_DATA_DIRS = INSTALL_DATA_LOCAL = UNINSTALL_LOCAL = -libvirt_la_BUILT_LIBADD = SYM_FILES = USED_SYM_FILES = GENERATED_SYM_FILES = @@ -65,7 +64,7 @@ COMMON_UNIT_VARS = \ # Set these variables before we include any of the subdirs as libvirt-admin.la # has to be installed after libvirt.la. -lib_LTLIBRARIES += libvirt.la libvirt-qemu.la libvirt-lxc.la +lib_LTLIBRARIES += libvirt-qemu.la libvirt-lxc.la include util/Makefile.inc.am include cpu_map/Makefile.inc.am @@ -204,13 +203,6 @@ check-local: check-protocol check-symfile check-symsorting \ .PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct) -######################### -# -# Build up list of libvirt.la source files based on configure conditions -# -# First deal with sources usable in non-daemon context - - # All .syms files should be placed in exactly one of these three lists, # depending on whether they are stored in git and/or used in the build. SYM_FILES += $(USED_SYM_FILES) @@ -237,32 +229,7 @@ check-augeas: $(augeas_DATA) $(augeastest_DATA) AUG_GENTEST_SCRIPT = $(top_srcdir)/scripts/augeas-gentest.py AUG_GENTEST = $(RUNUTF8) $(PYTHON) $(AUG_GENTEST_SCRIPT) -# Empty source list - it merely links a bunch of convenience libs together -libvirt_la_SOURCES = -libvirt_la_LDFLAGS = \ - $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \ - -version-info $(LIBVIRT_VERSION_INFO) \ - $(LIBVIRT_NODELETE) \ - $(NO_UNDEFINED_LDFLAGS) \ - $(FLAT_NAMESPACE_FLAGS) \ - $(AM_LDFLAGS) \ - $(NULL) -libvirt_la_LIBADD += \ - $(DLOPEN_LIBS) \ - $(XDR_LIBS) \ - $(NULL) -libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS) -# Because we specify libvirt_la_DEPENDENCIES for $(LIBVIRT_SYMBOL_FILE), we -# lose automake's automatic dependencies on an appropriate subset of -# $(libvirt_la_LIBADD). But we were careful to create -# $(libvirt_la_BUILT_LIBADD) as the subset that automake would have -# picked out for us. -libvirt_la_DEPENDENCIES = $(libvirt_la_BUILT_LIBADD) $(LIBVIRT_SYMBOL_FILE) - if WITH_DTRACE_PROBES -libvirt_la_BUILT_LIBADD += libvirt_probes.lo -libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o -nodist_libvirt_la_SOURCES = libvirt_probes.h tapset_DATA += libvirt_functions.stp diff --git a/src/access/Makefile.inc.am b/src/access/Makefile.inc.am index bd1d51dd777..72c62a0d2cd 100644 --- a/src/access/Makefile.inc.am +++ b/src/access/Makefile.inc.am @@ -8,8 +8,6 @@ ACCESS_DRIVER_API_FILES = \ ACCESS_DRIVER_POLKIT_POLICY = access/org.libvirt.api.policy -libvirt_la_BUILT_LIBADD += libvirt_driver_access.la - $(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \ $(top_srcdir)/scripts/genpolkit.py Makefile.am $(AM_V_GEN)$(RUNUTF8) $(PYTHON) \ diff --git a/src/access/meson.build b/src/access/meson.build index dc962166873..f3b605f0009 100644 --- a/src/access/meson.build +++ b/src/access/meson.build @@ -75,6 +75,8 @@ virt_access_lib = static_library( ] ) +libvirt_libs += virt_access_lib + access_inc_dir = include_directories('.') # Used by others where generated headers are required diff --git a/src/admin/meson.build b/src/admin/meson.build index cf2f206e34a..31d1a437fbe 100644 --- a/src/admin/meson.build +++ b/src/admin/meson.build @@ -48,3 +48,5 @@ admin_driver_lib = static_library( xdr_dep, ], ) + +libvirt_libs += admin_driver_lib diff --git a/src/conf/meson.build b/src/conf/meson.build index 394cca4e6a1..03b90aa6f60 100644 --- a/src/conf/meson.build +++ b/src/conf/meson.build @@ -105,4 +105,6 @@ virt_conf_lib = static_library( ], ) +libvirt_libs += virt_conf_lib + conf_inc_dir = include_directories('.') diff --git a/src/cpu/meson.build b/src/cpu/meson.build index 2404dc6b76f..b4ad95e46d5 100644 --- a/src/cpu/meson.build +++ b/src/cpu/meson.build @@ -17,3 +17,5 @@ cpu_lib = static_library( conf_inc_dir, ], ) + +libvirt_libs += cpu_lib diff --git a/src/esx/meson.build b/src/esx/meson.build index 08d8a542498..1718411d759 100644 --- a/src/esx/meson.build +++ b/src/esx/meson.build @@ -54,6 +54,8 @@ if conf.has('WITH_ESX') vmx_inc_dir, ], ) + + libvirt_libs += esx_lib endif if conf.has('WITH_ESX') diff --git a/src/hyperv/meson.build b/src/hyperv/meson.build index 71382e3db0e..d499889b01b 100644 --- a/src/hyperv/meson.build +++ b/src/hyperv/meson.build @@ -38,4 +38,6 @@ if conf.has('WITH_HYPERV') conf_inc_dir, ] ) + + libvirt_libs += hyperv_lib endif diff --git a/src/hypervisor/meson.build b/src/hypervisor/meson.build index ea1dddfe983..85149c683ee 100644 --- a/src/hypervisor/meson.build +++ b/src/hypervisor/meson.build @@ -18,4 +18,6 @@ hypervisor_lib = static_library( ], ) +libvirt_libs += hypervisor_lib + hypervisor_inc_dir = include_directories('.') diff --git a/src/locking/meson.build b/src/locking/meson.build index 67822486253..18b2e3c72a6 100644 --- a/src/locking/meson.build +++ b/src/locking/meson.build @@ -16,3 +16,5 @@ lock_driver_lib = static_library( conf_inc_dir, ], ) + +libvirt_libs += lock_driver_lib diff --git a/src/logging/meson.build b/src/logging/meson.build index a9c30efe063..5d1f30ac08f 100644 --- a/src/logging/meson.build +++ b/src/logging/meson.build @@ -36,3 +36,5 @@ log_driver_lib = static_library( xdr_dep, ], ) + +libvirt_libs += log_driver_lib diff --git a/src/meson.build b/src/meson.build index 257cdbe4090..b6b9da32df6 100644 --- a/src/meson.build +++ b/src/meson.build @@ -114,6 +114,11 @@ else endif +# variables filled by subdirectories + +libvirt_libs = [] + + # list subdirectories subdir('util') @@ -179,6 +184,8 @@ driver_lib = static_library( ], ) +libvirt_libs += driver_lib + # symbol files for libvirt.so @@ -206,6 +213,7 @@ libvirt_syms = custom_target( command: [ gen_sym_files_prog, 'LIBVIRT_PRIVATE_' + meson.project_version(), '@INPUT@' ], capture: true, ) +libvirt_syms_file = libvirt_syms if host_machine.system() == 'windows' libvirt_def = custom_target( 'libvirt.def', @@ -214,4 +222,36 @@ if host_machine.system() == 'windows' command: [ gen_def_files_prog, '@INPUT@' ], capture: true, ) + libvirt_syms_file = libvirt_def endif + + +# libvirt.so library + +libvirt_syms_flags = '@0@@1@'.format( + version_script_flags, + libvirt_syms_file.full_path(), +) + +libvirt_lib = shared_library( + 'virt', + dtrace_gen_objects, + dependencies: [ + src_dep, + ], + link_args: [ + libvirt_flat_namespace, + libvirt_no_undefined, + libvirt_nodelete, + libvirt_syms_flags, + ], + link_whole: [ + libvirt_libs, + ], + link_depends: [ + libvirt_syms_file, + ], + install: true, + version: libvirt_lib_version, + soversion: libvirt_so_version, +) diff --git a/src/openvz/meson.build b/src/openvz/meson.build index 427b25fed1c..66048098774 100644 --- a/src/openvz/meson.build +++ b/src/openvz/meson.build @@ -17,6 +17,8 @@ if conf.has('WITH_OPENVZ') conf_inc_dir, ], ) + + libvirt_libs += openvz_lib endif if conf.has('WITH_OPENVZ') diff --git a/src/remote/meson.build b/src/remote/meson.build index f029edefd7e..a667f15ecf2 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -56,6 +56,8 @@ if conf.has('WITH_REMOTE') conf_inc_dir, ], ) + + libvirt_libs += remote_driver_lib endif if conf.has('WITH_REMOTE') diff --git a/src/rpc/meson.build b/src/rpc/meson.build index b8fbe0c38b1..8f4372bb3e2 100644 --- a/src/rpc/meson.build +++ b/src/rpc/meson.build @@ -112,3 +112,9 @@ rpc_dep = declare_dependency( include_directories: [ rpc_inc_dir ], sources: [ rpc_gen_headers ], ) + +libvirt_libs += [ + virt_rpc_lib, + virt_rpc_client_lib, + virt_rpc_server_lib, +] diff --git a/src/security/meson.build b/src/security/meson.build index 3dc88c2c546..1e85d8dcf5f 100644 --- a/src/security/meson.build +++ b/src/security/meson.build @@ -29,3 +29,5 @@ security_driver_lib = static_library( conf_inc_dir, ], ) + +libvirt_libs += security_driver_lib diff --git a/src/test/meson.build b/src/test/meson.build index ec7b12304ec..f54585adfd1 100644 --- a/src/test/meson.build +++ b/src/test/meson.build @@ -20,5 +20,7 @@ if conf.has('WITH_TEST') ], ) + libvirt_libs += test_lib + install_data(test_driver_assets, install_dir: pkgdatadir) endif diff --git a/src/util/meson.build b/src/util/meson.build index 59a531f6af1..3c728b355ee 100644 --- a/src/util/meson.build +++ b/src/util/meson.build @@ -193,4 +193,6 @@ virt_util_lib = static_library( ], ) +libvirt_libs += virt_util_lib + util_inc_dir = include_directories('.') diff --git a/src/vmware/meson.build b/src/vmware/meson.build index dc2a32a1610..2021b4ffa44 100644 --- a/src/vmware/meson.build +++ b/src/vmware/meson.build @@ -15,6 +15,8 @@ if conf.has('WITH_VMWARE') vmx_inc_dir, ], ) + + libvirt_libs += vmware_lib endif if conf.has('WITH_VMWARE') diff --git a/src/vmx/meson.build b/src/vmx/meson.build index 25e3d1a6fca..e599b8de39b 100644 --- a/src/vmx/meson.build +++ b/src/vmx/meson.build @@ -15,6 +15,8 @@ if conf.has('WITH_VMX') conf_inc_dir, ], ) + + libvirt_libs += vmx_lib endif vmx_inc_dir = include_directories('.') -- 2.26.2

On Thu, Jul 16, 2020 at 11:56:28 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> ---
[...]
diff --git a/src/admin/meson.build b/src/admin/meson.build index cf2f206e34a..31d1a437fbe 100644 --- a/src/admin/meson.build +++ b/src/admin/meson.build @@ -48,3 +48,5 @@ admin_driver_lib = static_library( xdr_dep, ], ) + +libvirt_libs += admin_driver_lib
As Daniel mentioned, this probably pulls in the admin stuff into libvirt.so which is not desired.

On Thu, Jul 23, 2020 at 11:47:00AM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:56:28 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> ---
[...]
diff --git a/src/admin/meson.build b/src/admin/meson.build index cf2f206e34a..31d1a437fbe 100644 --- a/src/admin/meson.build +++ b/src/admin/meson.build @@ -48,3 +48,5 @@ admin_driver_lib = static_library( xdr_dep, ], ) + +libvirt_libs += admin_driver_lib
As Daniel mentioned, this probably pulls in the admin stuff into libvirt.so which is not desired.
Correct, already fixed in gitlab. :)

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 1 - src/cpu_map/Makefile.inc.am | 78 ------------------------------------- src/cpu_map/meson.build | 75 +++++++++++++++++++++++++++++++++++ src/meson.build | 2 + 4 files changed, 77 insertions(+), 79 deletions(-) delete mode 100644 src/cpu_map/Makefile.inc.am create mode 100644 src/cpu_map/meson.build diff --git a/src/Makefile.am b/src/Makefile.am index b83a087b716..e727ad32944 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -67,7 +67,6 @@ COMMON_UNIT_VARS = \ lib_LTLIBRARIES += libvirt-qemu.la libvirt-lxc.la include util/Makefile.inc.am -include cpu_map/Makefile.inc.am include security/Makefile.inc.am include access/Makefile.inc.am include logging/Makefile.inc.am diff --git a/src/cpu_map/Makefile.inc.am b/src/cpu_map/Makefile.inc.am deleted file mode 100644 index d3ccb880733..00000000000 --- a/src/cpu_map/Makefile.inc.am +++ /dev/null @@ -1,78 +0,0 @@ -# vim: filetype=automake - -cpumapdir = $(pkgdatadir)/cpu_map -cpumap_DATA = \ - cpu_map/arm_cortex-a53.xml \ - cpu_map/arm_cortex-a57.xml \ - cpu_map/arm_cortex-a72.xml \ - cpu_map/arm_features.xml \ - cpu_map/arm_Kunpeng-920.xml \ - cpu_map/arm_ThunderX299xx.xml \ - cpu_map/arm_Falkor.xml \ - cpu_map/arm_vendors.xml \ - cpu_map/index.xml \ - cpu_map/ppc64_vendors.xml \ - cpu_map/ppc64_POWER7.xml \ - cpu_map/ppc64_POWER9.xml \ - cpu_map/ppc64_POWERPC_e6500.xml \ - cpu_map/ppc64_POWER6.xml \ - cpu_map/ppc64_POWER8.xml \ - cpu_map/ppc64_POWERPC_e5500.xml \ - cpu_map/x86_features.xml \ - cpu_map/x86_vendors.xml \ - cpu_map/x86_486.xml \ - cpu_map/x86_athlon.xml \ - cpu_map/x86_Broadwell.xml \ - cpu_map/x86_Broadwell-IBRS.xml \ - cpu_map/x86_Broadwell-noTSX.xml \ - cpu_map/x86_Broadwell-noTSX-IBRS.xml \ - cpu_map/x86_Cascadelake-Server.xml \ - cpu_map/x86_Cascadelake-Server-noTSX.xml \ - cpu_map/x86_Conroe.xml \ - cpu_map/x86_Cooperlake.xml \ - cpu_map/x86_core2duo.xml \ - cpu_map/x86_coreduo.xml \ - cpu_map/x86_cpu64-rhel5.xml \ - cpu_map/x86_cpu64-rhel6.xml \ - cpu_map/x86_Dhyana.xml \ - cpu_map/x86_EPYC.xml \ - cpu_map/x86_EPYC-IBPB.xml \ - cpu_map/x86_Haswell.xml \ - cpu_map/x86_Haswell-IBRS.xml \ - cpu_map/x86_Haswell-noTSX.xml \ - cpu_map/x86_Haswell-noTSX-IBRS.xml \ - cpu_map/x86_Icelake-Client.xml \ - cpu_map/x86_Icelake-Client-noTSX.xml \ - cpu_map/x86_Icelake-Server.xml \ - cpu_map/x86_Icelake-Server-noTSX.xml \ - cpu_map/x86_IvyBridge.xml \ - cpu_map/x86_IvyBridge-IBRS.xml \ - cpu_map/x86_kvm32.xml \ - cpu_map/x86_kvm64.xml \ - cpu_map/x86_n270.xml \ - cpu_map/x86_Nehalem.xml \ - cpu_map/x86_Nehalem-IBRS.xml \ - cpu_map/x86_Opteron_G1.xml \ - cpu_map/x86_Opteron_G2.xml \ - cpu_map/x86_Opteron_G3.xml \ - cpu_map/x86_Opteron_G4.xml \ - cpu_map/x86_Opteron_G5.xml \ - cpu_map/x86_Penryn.xml \ - cpu_map/x86_pentium.xml \ - cpu_map/x86_pentium2.xml \ - cpu_map/x86_pentium3.xml \ - cpu_map/x86_pentiumpro.xml \ - cpu_map/x86_phenom.xml \ - cpu_map/x86_qemu32.xml \ - cpu_map/x86_qemu64.xml \ - cpu_map/x86_SandyBridge.xml \ - cpu_map/x86_SandyBridge-IBRS.xml \ - cpu_map/x86_Skylake-Client.xml \ - cpu_map/x86_Skylake-Client-IBRS.xml \ - cpu_map/x86_Skylake-Client-noTSX-IBRS.xml \ - cpu_map/x86_Skylake-Server.xml \ - cpu_map/x86_Skylake-Server-IBRS.xml \ - cpu_map/x86_Skylake-Server-noTSX-IBRS.xml \ - cpu_map/x86_Westmere.xml \ - cpu_map/x86_Westmere-IBRS.xml \ - $(NULL) diff --git a/src/cpu_map/meson.build b/src/cpu_map/meson.build new file mode 100644 index 00000000000..d89106dfcbd --- /dev/null +++ b/src/cpu_map/meson.build @@ -0,0 +1,75 @@ +cpumap_data = [ + 'arm_cortex-a53.xml', + 'arm_cortex-a57.xml', + 'arm_cortex-a72.xml', + 'arm_Falkor.xml', + 'arm_features.xml', + 'arm_Kunpeng-920.xml', + 'arm_ThunderX299xx.xml', + 'arm_vendors.xml', + 'index.xml', + 'ppc64_POWER6.xml', + 'ppc64_POWER7.xml', + 'ppc64_POWER8.xml', + 'ppc64_POWER9.xml', + 'ppc64_POWERPC_e5500.xml', + 'ppc64_POWERPC_e6500.xml', + 'ppc64_vendors.xml', + 'x86_486.xml', + 'x86_athlon.xml', + 'x86_Broadwell-IBRS.xml', + 'x86_Broadwell-noTSX-IBRS.xml', + 'x86_Broadwell-noTSX.xml', + 'x86_Broadwell.xml', + 'x86_Cascadelake-Server.xml', + 'x86_Conroe.xml', + 'x86_Cooperlake.xml', + 'x86_core2duo.xml', + 'x86_coreduo.xml', + 'x86_cpu64-rhel5.xml', + 'x86_cpu64-rhel6.xml', + 'x86_EPYC-IBPB.xml', + 'x86_EPYC.xml', + 'x86_features.xml', + 'x86_Haswell-IBRS.xml', + 'x86_Haswell-noTSX-IBRS.xml', + 'x86_Haswell-noTSX.xml', + 'x86_Haswell.xml', + 'x86_Icelake-Client-noTSX.xml', + 'x86_Icelake-Client.xml', + 'x86_Icelake-Server-noTSX.xml', + 'x86_Icelake-Server.xml', + 'x86_IvyBridge-IBRS.xml', + 'x86_IvyBridge.xml', + 'x86_kvm32.xml', + 'x86_kvm64.xml', + 'x86_n270.xml', + 'x86_Nehalem-IBRS.xml', + 'x86_Nehalem.xml', + 'x86_Opteron_G1.xml', + 'x86_Opteron_G2.xml', + 'x86_Opteron_G3.xml', + 'x86_Opteron_G4.xml', + 'x86_Opteron_G5.xml', + 'x86_Penryn.xml', + 'x86_pentium.xml', + 'x86_pentium2.xml', + 'x86_pentium3.xml', + 'x86_pentiumpro.xml', + 'x86_phenom.xml', + 'x86_qemu32.xml', + 'x86_qemu64.xml', + 'x86_SandyBridge-IBRS.xml', + 'x86_SandyBridge.xml', + 'x86_Skylake-Client-IBRS.xml', + 'x86_Skylake-Client-noTSX-IBRS.xml', + 'x86_Skylake-Client.xml', + 'x86_Skylake-Server-IBRS.xml', + 'x86_Skylake-Server-noTSX-IBRS.xml', + 'x86_Skylake-Server.xml', + 'x86_vendors.xml', + 'x86_Westmere-IBRS.xml', + 'x86_Westmere.xml', +] + +install_data(cpumap_data, install_dir: pkgdatadir / 'cpu_map') diff --git a/src/meson.build b/src/meson.build index b6b9da32df6..748bb7a9914 100644 --- a/src/meson.build +++ b/src/meson.build @@ -121,6 +121,8 @@ libvirt_libs = [] # list subdirectories +subdir('cpu_map') + subdir('util') src_dep = declare_dependency( -- 2.26.2

On Thu, Jul 16, 2020 at 11:56:29 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 1 - src/cpu_map/Makefile.inc.am | 78 ------------------------------------- src/cpu_map/meson.build | 75 +++++++++++++++++++++++++++++++++++ src/meson.build | 2 + 4 files changed, 77 insertions(+), 79 deletions(-) delete mode 100644 src/cpu_map/Makefile.inc.am create mode 100644 src/cpu_map/meson.build
As noted elsewhere, some files were missing.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-win-symbols.m4 | 3 --- src/Makefile.am | 14 ++---------- src/meson.build | 48 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 15 deletions(-) diff --git a/m4/virt-win-symbols.m4 b/m4/virt-win-symbols.m4 index f7b8e612a8d..dc5c5daa660 100644 --- a/m4/virt-win-symbols.m4 +++ b/m4/virt-win-symbols.m4 @@ -20,7 +20,6 @@ dnl AC_DEFUN([LIBVIRT_WIN_CHECK_SYMBOLS], [ LIBVIRT_ADMIN_SYMBOL_FILE=admin/libvirt_admin.syms LIBVIRT_LXC_SYMBOL_FILE='$(srcdir)/libvirt_lxc.syms' - LIBVIRT_QEMU_SYMBOL_FILE='$(srcdir)/libvirt_qemu.syms' case "$host" in *-*-mingw* ) # Also set the symbol file to .def, so src/Makefile generates libvirt.def @@ -28,10 +27,8 @@ AC_DEFUN([LIBVIRT_WIN_CHECK_SYMBOLS], [ # linker LIBVIRT_ADMIN_SYMBOL_FILE=admin/libvirt_admin.def LIBVIRT_LXC_SYMBOL_FILE=libvirt_lxc.def - LIBVIRT_QEMU_SYMBOL_FILE=libvirt_qemu.def ;; esac AC_SUBST([LIBVIRT_ADMIN_SYMBOL_FILE]) AC_SUBST([LIBVIRT_LXC_SYMBOL_FILE]) - AC_SUBST([LIBVIRT_QEMU_SYMBOL_FILE]) ]) diff --git a/src/Makefile.am b/src/Makefile.am index e727ad32944..5655655ee32 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -64,7 +64,7 @@ COMMON_UNIT_VARS = \ # Set these variables before we include any of the subdirs as libvirt-admin.la # has to be installed after libvirt.la. -lib_LTLIBRARIES += libvirt-qemu.la libvirt-lxc.la +lib_LTLIBRARIES += libvirt-lxc.la include util/Makefile.inc.am include security/Makefile.inc.am @@ -206,7 +206,7 @@ check-local: check-protocol check-symfile check-symsorting \ # depending on whether they are stored in git and/or used in the build. SYM_FILES += $(USED_SYM_FILES) GENERATED_SYM_FILES += \ - libvirt_qemu.def libvirt_lxc.def \ + libvirt_lxc.def \ $(NULL) @@ -246,16 +246,6 @@ libvirt_functions.stp: $(RPC_PROBE_FILES) $(top_srcdir)/scripts/gensystemtap.py endif WITH_DTRACE_PROBES -libvirt_qemu_la_SOURCES = libvirt-qemu.c -libvirt_qemu_la_LDFLAGS = \ - $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \ - -version-info $(LIBVIRT_VERSION_INFO) \ - $(LIBVIRT_NODELETE) \ - $(AM_LDFLAGS) \ - $(NULL) -libvirt_qemu_la_CFLAGS = $(AM_CFLAGS) -libvirt_qemu_la_LIBADD = libvirt.la - libvirt_lxc_la_SOURCES = libvirt-lxc.c libvirt_lxc_la_LDFLAGS = \ $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \ diff --git a/src/meson.build b/src/meson.build index 748bb7a9914..a7fbff674c6 100644 --- a/src/meson.build +++ b/src/meson.build @@ -257,3 +257,51 @@ libvirt_lib = shared_library( version: libvirt_lib_version, soversion: libvirt_so_version, ) + + +# libvirt-qemu.syms symbol files + +libvirt_qemu_syms = meson.current_source_dir() / 'libvirt_qemu.syms' +libvirt_qemu_syms_file = libvirt_qemu_syms +libvirt_qemu_syms_path = libvirt_qemu_syms +if host_machine.system() == 'windows' + libvirt_qemu_def = custom_target( + 'libvirt_qemu.def', + input: libvirt_qemu_syms, + output: 'libvirt_qemu.def', + command: [ gen_def_files_prog, '@INPUT@' ], + capture: true, + ) + libvirt_qemu_syms_file = libvirt_qemu_def + libvirt_qemu_syms_path = libvirt_qemu_def.full_path() +endif + + +# libvirt-qemu.so + +libvirt_qemu_syms_flags = '@0@@1@'.format( + version_script_flags, + libvirt_qemu_syms_path, +) + +libvirt_qemu_lib = shared_library( + 'virt-qemu', + 'libvirt-qemu.c', + dependencies: [ + src_dep, + ], + link_args: [ + libvirt_nodelete, + libvirt_qemu_syms_flags, + ], + link_with: [ + libvirt_lib, + ], + link_depends: [ + libvirt_qemu_syms_file, + ], + install: true, + install_rpath: libdir, + version: libvirt_lib_version, + soversion: libvirt_so_version, +) -- 2.26.2

There are two extra dependencies compared to automake, apparmor and selinux. It looks like libtool is doing some magic and inheriting dependencies from libvirt.la which inherits these dependencies from other libraries. Without these two dependencies in meson the compilation fails. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- m4/virt-win-symbols.m4 | 3 --- src/Makefile.am | 18 --------------- src/meson.build | 50 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 21 deletions(-) diff --git a/m4/virt-win-symbols.m4 b/m4/virt-win-symbols.m4 index dc5c5daa660..5ffee491877 100644 --- a/m4/virt-win-symbols.m4 +++ b/m4/virt-win-symbols.m4 @@ -19,16 +19,13 @@ dnl AC_DEFUN([LIBVIRT_WIN_CHECK_SYMBOLS], [ LIBVIRT_ADMIN_SYMBOL_FILE=admin/libvirt_admin.syms - LIBVIRT_LXC_SYMBOL_FILE='$(srcdir)/libvirt_lxc.syms' case "$host" in *-*-mingw* ) # Also set the symbol file to .def, so src/Makefile generates libvirt.def # from libvirt.syms and passes libvirt.def instead of libvirt.syms to the # linker LIBVIRT_ADMIN_SYMBOL_FILE=admin/libvirt_admin.def - LIBVIRT_LXC_SYMBOL_FILE=libvirt_lxc.def ;; esac AC_SUBST([LIBVIRT_ADMIN_SYMBOL_FILE]) - AC_SUBST([LIBVIRT_LXC_SYMBOL_FILE]) ]) diff --git a/src/Makefile.am b/src/Makefile.am index 5655655ee32..45aee9bea1d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -37,7 +37,6 @@ INSTALL_DATA_LOCAL = UNINSTALL_LOCAL = SYM_FILES = USED_SYM_FILES = -GENERATED_SYM_FILES = augeas_DATA = augeastest_DATA = conf_DATA = @@ -62,10 +61,6 @@ COMMON_UNIT_VARS = \ -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ $(NULL) -# Set these variables before we include any of the subdirs as libvirt-admin.la -# has to be installed after libvirt.la. -lib_LTLIBRARIES += libvirt-lxc.la - include util/Makefile.inc.am include security/Makefile.inc.am include access/Makefile.inc.am @@ -205,9 +200,6 @@ check-local: check-protocol check-symfile check-symsorting \ # All .syms files should be placed in exactly one of these three lists, # depending on whether they are stored in git and/or used in the build. SYM_FILES += $(USED_SYM_FILES) -GENERATED_SYM_FILES += \ - libvirt_lxc.def \ - $(NULL) check-local: check-augeas @@ -246,16 +238,6 @@ libvirt_functions.stp: $(RPC_PROBE_FILES) $(top_srcdir)/scripts/gensystemtap.py endif WITH_DTRACE_PROBES -libvirt_lxc_la_SOURCES = libvirt-lxc.c -libvirt_lxc_la_LDFLAGS = \ - $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \ - -version-info $(LIBVIRT_VERSION_INFO) \ - $(LIBVIRT_NODELETE) \ - $(AM_LDFLAGS) \ - $(NULL) -libvirt_lxc_la_CFLAGS = $(AM_CFLAGS) -libvirt_lxc_la_LIBADD = libvirt.la - install-sysconfig: $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig for f in $(SYSCONF_FILES:%.sysconf=%) ; \ diff --git a/src/meson.build b/src/meson.build index a7fbff674c6..f324b165f99 100644 --- a/src/meson.build +++ b/src/meson.build @@ -305,3 +305,53 @@ libvirt_qemu_lib = shared_library( version: libvirt_lib_version, soversion: libvirt_so_version, ) + + +# libvirt-lxc.so symbol files + +libvirt_lxc_syms = meson.current_source_dir() / 'libvirt_lxc.syms' +libvirt_lxc_syms_file = libvirt_lxc_syms +libvirt_lxc_syms_path = libvirt_lxc_syms +if host_machine.system() == 'windows' + libvirt_lxc_def = custom_target( + 'libvirt_lxc.def', + input: libvirt_lxc_syms, + output: 'libvirt_lxc.def', + command: [ gen_def_files_prog, '@INPUT@' ], + capture: true, + ) + libvirt_lxc_syms_file = libvirt_lxc_def + libvirt_lxc_syms_path = libvirt_lxc_def.full_path() +endif + + +# libvirt-lxc.so + +libvirt_lxc_syms_flags = '@0@@1@'.format( + version_script_flags, + libvirt_lxc_syms_path, +) + +libvirt_lxc_lib = shared_library( + 'virt-lxc', + 'libvirt-lxc.c', + dependencies: [ + apparmor_dep, + selinux_dep, + src_dep, + ], + link_args: [ + libvirt_nodelete, + libvirt_lxc_syms_flags, + ], + link_with: [ + libvirt_lib, + ], + link_depends: [ + libvirt_lxc_syms_file, + ], + install: true, + install_rpath: libdir, + version: libvirt_lib_version, + soversion: libvirt_so_version, +) -- 2.26.2

We have to compile the libvirt-admin.so outside of src/admin directory because it depends on libvirt.so. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 1 - m4/virt-win-symbols.m4 | 31 ---------------- src/Makefile.am | 1 - src/admin/Makefile.inc.am | 75 --------------------------------------- src/admin/meson.build | 43 ++++++++++++++++++++++ src/meson.build | 44 +++++++++++++++++++++++ src/remote/meson.build | 2 ++ 7 files changed, 89 insertions(+), 108 deletions(-) delete mode 100644 m4/virt-win-symbols.m4 diff --git a/configure.ac b/configure.ac index e6c7e50bb14..af52f957cb2 100644 --- a/configure.ac +++ b/configure.ac @@ -91,7 +91,6 @@ PKG_PROG_PKG_CONFIG dnl MinGW checks -LIBVIRT_WIN_CHECK_SYMBOLS LIBVIRT_WIN_CHECK_WINDRES diff --git a/m4/virt-win-symbols.m4 b/m4/virt-win-symbols.m4 deleted file mode 100644 index 5ffee491877..00000000000 --- a/m4/virt-win-symbols.m4 +++ /dev/null @@ -1,31 +0,0 @@ -dnl The MinGW symbols checks -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_WIN_CHECK_SYMBOLS], [ - LIBVIRT_ADMIN_SYMBOL_FILE=admin/libvirt_admin.syms - case "$host" in - *-*-mingw* ) - # Also set the symbol file to .def, so src/Makefile generates libvirt.def - # from libvirt.syms and passes libvirt.def instead of libvirt.syms to the - # linker - LIBVIRT_ADMIN_SYMBOL_FILE=admin/libvirt_admin.def - ;; - esac - AC_SUBST([LIBVIRT_ADMIN_SYMBOL_FILE]) -]) diff --git a/src/Makefile.am b/src/Makefile.am index 45aee9bea1d..71a55e235f2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -29,7 +29,6 @@ AM_LDFLAGS_MOD_NOUNDEF = $(AM_LDFLAGS_MOD) $(NO_UNDEFINED_LDFLAGS) nodist_conf_DATA = DRIVER_SOURCE_FILES = STATEFUL_DRIVER_SOURCE_FILES = -lib_LTLIBRARIES = noinst_LTLIBRARIES = mod_LTLIBRARIES = INSTALL_DATA_DIRS = diff --git a/src/admin/Makefile.inc.am b/src/admin/Makefile.inc.am index afe44437b74..bdaed14cd19 100644 --- a/src/admin/Makefile.inc.am +++ b/src/admin/Makefile.inc.am @@ -1,65 +1,9 @@ # vim: filetype=automake -ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x - -ADMIN_PROTOCOL_GENERATED = \ - admin/admin_client.h \ - $(NULL) - -GENERATED_SYM_FILES += admin/libvirt_admin.syms admin/libvirt_admin.def - ADMIN_SYM_FILES = $(srcdir)/admin/libvirt_admin_private.syms conf_DATA += admin/libvirt-admin.conf -lib_LTLIBRARIES += libvirt-admin.la - -libvirt_admin_la_SOURCES = \ - admin/libvirt-admin.c \ - $(DATATYPES_SOURCES) - -nodist_libvirt_admin_la_SOURCES = \ - $(ADMIN_PROTOCOL_GENERATED) - -libvirt_admin_la_LDFLAGS = \ - $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_ADMIN_SYMBOL_FILE) \ - -version-info $(LIBVIRT_VERSION_INFO) \ - $(LIBVIRT_NODELETE) \ - $(AM_LDFLAGS) \ - $(NULL) - -libvirt_admin_la_LIBADD = \ - libvirt.la \ - $(XDR_LIBS) \ - $(CAPNG_LIBS) \ - $(YAJL_LIBS) \ - $(DEVMAPPER_LIBS) \ - $(LIBXML_LIBS) \ - $(GLIB_LIBS) \ - $(SSH2_LIBS) \ - $(SASL_LIBS) \ - $(GNUTLS_LIBS) \ - $(LIBSSH_LIBS) - -if WITH_DTRACE_PROBES -libvirt_admin_la_LIBADD += libvirt_probes.lo -endif WITH_DTRACE_PROBES - -libvirt_admin_la_CFLAGS = \ - $(AM_CFLAGS) \ - -I$(builddir)/admin \ - -I$(builddir)/access \ - -I$(srcdir)/remote \ - -I$(srcdir)/rpc \ - -I$(builddir)/rpc \ - $(XDR_CFLAGS) \ - $(CAPNG_CFLAGS) \ - $(YAJL_CFLAGS) \ - $(SSH2_CFLAGS) \ - $(SASL_CFLAGS) \ - $(GNUTLS_CFLAGS) \ - $(LIBSSH_CFLAGS) - if WITH_LINUX check-admin-symfile: admin/libvirt_admin.syms libvirt-admin.la $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-symfile.py \ @@ -77,22 +21,3 @@ check-admin-drivername: $(srcdir)/admin/libvirt_admin_public.syms check-admin: check-admin-symfile check-admin-symsorting check-admin-drivername - -admin/admin_client.h: $(srcdir)/rpc/gendispatch.pl \ - $(ADMIN_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \ - admin ADMIN $(ADMIN_PROTOCOL) \ - > admin/admin_client.h - -admin/libvirt_admin.syms: admin/libvirt_admin_public.syms $(ADMIN_SYM_FILES) \ - $(top_builddir)/config.status - $(AM_V_GEN)rm -f $@-tmp $@ ; \ - printf '# WARNING: generated from the following:\n# $^\n\n' >$@-tmp && \ - cat $(srcdir)/admin/libvirt_admin_public.syms >>$@-tmp && \ - printf '\n\n# Private symbols\n\n' >>$@-tmp && \ - printf 'LIBVIRT_ADMIN_PRIVATE_$(VERSION) {\n\n' >>$@-tmp && \ - printf 'global:\n\n' >>$@-tmp && \ - cat $(ADMIN_SYM_FILES) >>$@-tmp && \ - printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \ - chmod a-w $@-tmp && \ - mv $@-tmp admin/libvirt_admin.syms diff --git a/src/admin/meson.build b/src/admin/meson.build index 31d1a437fbe..3522d789a00 100644 --- a/src/admin/meson.build +++ b/src/admin/meson.build @@ -35,6 +35,47 @@ admin_driver_generated += custom_target( capture: true, ) +admin_sources = files( + 'libvirt-admin.c', +) + +admin_client_generated = custom_target( + 'admin_client.h', + input: admin_driver_protocol, + output: 'admin_client.h', + command: [ + gendispatch_prog, '--mode=client', 'admin', 'ADMIN', '@INPUT@', + ], + capture: true, +) + +libvirt_admin_syms = custom_target( + 'libvirt_admin.syms', + input: [ + 'libvirt_admin_public.syms', + 'libvirt_admin_private.syms', + ], + output: 'libvirt_admin.syms', + command: [ gen_sym_files_prog, 'LIBVIRT_ADMIN_PRIVATE_' + meson.project_version(), '@INPUT@' ], + capture: true, +) +libvirt_admin_syms_file = libvirt_admin_syms +if host_machine.system() == 'windows' + libvirt_admin_def = custom_target( + 'libvirt_admin.def', + input: libvirt_admin_syms, + output: 'libvirt_admin.def', + command: [ gen_def_files_prog, '@INPUT@' ], + capture: true, + ) + libvirt_admin_syms_file = libvirt_admin_def +endif + +libvirt_admin_syms_flags = '@0@@1@'.format( + version_script_flags, + libvirt_admin_syms_file.full_path(), +) + admin_driver_lib = static_library( 'virt_admin_driver', [ @@ -50,3 +91,5 @@ admin_driver_lib = static_library( ) libvirt_libs += admin_driver_lib + +admin_inc_dir = include_directories('.') diff --git a/src/meson.build b/src/meson.build index f324b165f99..9c088014415 100644 --- a/src/meson.build +++ b/src/meson.build @@ -355,3 +355,47 @@ libvirt_lxc_lib = shared_library( version: libvirt_lib_version, soversion: libvirt_so_version, ) + + +# libvirt-admin.so + +libvirt_admin_lib = shared_library( + 'virt-admin', + [ + admin_sources, + admin_client_generated, + admin_driver_generated, + datatypes_sources, + dtrace_gen_objects, + ], + dependencies: [ + capng_dep, + devmapper_dep, + gnutls_dep, + libssh2_dep, + libssh_dep, + sasl_dep, + src_dep, + rpc_dep, + xdr_dep, + yajl_dep, + ], + include_directories: [ + admin_inc_dir, + remote_inc_dir, + ], + link_args: [ + libvirt_admin_syms_flags, + libvirt_nodelete, + ], + link_with: [ + libvirt_lib, + ], + link_depends: [ + libvirt_admin_syms_file, + ], + install: true, + install_rpath: libdir, + version: libvirt_lib_version, + soversion: libvirt_so_version, +) diff --git a/src/remote/meson.build b/src/remote/meson.build index a667f15ecf2..3de6c5ee1f4 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -65,3 +65,5 @@ if conf.has('WITH_REMOTE') else sym_files += 'libvirt_remote.syms' endif + +remote_inc_dir = include_directories('.') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/bhyve/Makefile.inc.am | 34 ---------------------------------- src/bhyve/meson.build | 28 ++++++++++++++++++++++++++++ src/meson.build | 1 + 3 files changed, 29 insertions(+), 34 deletions(-) create mode 100644 src/bhyve/meson.build diff --git a/src/bhyve/Makefile.inc.am b/src/bhyve/Makefile.inc.am index f75194fd3c8..3433e6a3dab 100644 --- a/src/bhyve/Makefile.inc.am +++ b/src/bhyve/Makefile.inc.am @@ -1,33 +1,9 @@ # vim: filetype=automake -BHYVE_DRIVER_SOURCES = \ - bhyve/bhyve_capabilities.c \ - bhyve/bhyve_capabilities.h \ - bhyve/bhyve_command.c \ - bhyve/bhyve_command.h \ - bhyve/bhyve_conf.c \ - bhyve/bhyve_conf.h \ - bhyve/bhyve_parse_command.c \ - bhyve/bhyve_parse_command.h \ - bhyve/bhyve_device.c \ - bhyve/bhyve_device.h \ - bhyve/bhyve_domain.c \ - bhyve/bhyve_domain.h \ - bhyve/bhyve_driver.h \ - bhyve/bhyve_driver.c \ - bhyve/bhyve_monitor.c \ - bhyve/bhyve_monitor.h \ - bhyve/bhyve_process.c \ - bhyve/bhyve_process.h \ - bhyve/bhyve_utils.h \ - $(NULL) - DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(BHYVE_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(BHYVE_DRIVER_SOURCES)) - if WITH_BHYVE -noinst_LTLIBRARIES += libvirt_driver_bhyve_impl.la libvirt_driver_bhyve_la_SOURCES = libvirt_driver_bhyve_la_LIBADD = \ libvirt_driver_bhyve_impl.la \ @@ -37,16 +13,6 @@ libvirt_driver_bhyve_la_LIBADD = \ mod_LTLIBRARIES += libvirt_driver_bhyve.la libvirt_driver_bhyve_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) -libvirt_driver_bhyve_impl_la_CFLAGS = \ - -I$(srcdir)/access \ - -I$(builddir)/access \ - -I$(srcdir)/conf \ - -I$(srcdir)/hypervisor \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_driver_bhyve_impl_la_LDFLAGS = $(AM_LDFLAGS) -libvirt_driver_bhyve_impl_la_SOURCES = $(BHYVE_DRIVER_SOURCES) - sbin_PROGRAMS += virtbhyved nodist_conf_DATA += bhyve/virtbhyved.conf diff --git a/src/bhyve/meson.build b/src/bhyve/meson.build new file mode 100644 index 00000000000..a9af677440b --- /dev/null +++ b/src/bhyve/meson.build @@ -0,0 +1,28 @@ +bhyve_sources = files( + 'bhyve_capabilities.c', + 'bhyve_command.c', + 'bhyve_conf.c', + 'bhyve_parse_command.c', + 'bhyve_device.c', + 'bhyve_domain.c', + 'bhyve_driver.c', + 'bhyve_monitor.c', + 'bhyve_process.c', +) + +if conf.has('WITH_BHYVE') + bhyve_driver_impl = static_library( + 'virt_driver_bhyve_impl', + [ + bhyve_sources, + ], + dependencies: [ + access_dep, + src_dep, + ], + include_directories: [ + conf_inc_dir, + hypervisor_inc_dir, + ], + ) +endif diff --git a/src/meson.build b/src/meson.build index 9c088014415..ca94fe64bd9 100644 --- a/src/meson.build +++ b/src/meson.build @@ -145,6 +145,7 @@ subdir('locking') subdir('logging') subdir('security') +subdir('bhyve') subdir('esx') subdir('hyperv') subdir('openvz') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/libxl/Makefile.inc.am | 39 --------------------------------------- src/libxl/meson.build | 29 +++++++++++++++++++++++++++++ src/meson.build | 1 + 3 files changed, 30 insertions(+), 39 deletions(-) create mode 100644 src/libxl/meson.build diff --git a/src/libxl/Makefile.inc.am b/src/libxl/Makefile.inc.am index db1f51e3ef8..c7ac93a75b7 100644 --- a/src/libxl/Makefile.inc.am +++ b/src/libxl/Makefile.inc.am @@ -1,32 +1,9 @@ # vim: filetype=automake -LIBXL_DRIVER_SOURCES = \ - libxl/xenxs_private.h \ - libxl/xen_common.c \ - libxl/xen_common.h \ - libxl/xen_xl.c \ - libxl/xen_xl.h \ - libxl/xen_xm.c \ - libxl/xen_xm.h \ - libxl/libxl_conf.c \ - libxl/libxl_conf.h \ - libxl/libxl_capabilities.c \ - libxl/libxl_capabilities.h \ - libxl/libxl_domain.c \ - libxl/libxl_domain.h \ - libxl/libxl_driver.c \ - libxl/libxl_driver.h \ - libxl/libxl_logger.c \ - libxl/libxl_logger.h \ - libxl/libxl_migration.c \ - libxl/libxl_migration.h \ - $(NULL) - DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(LIBXL_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(LIBXL_DRIVER_SOURCES)) if WITH_LIBXL -noinst_LTLIBRARIES += libvirt_driver_libxl_impl.la libvirt_driver_libxl_la_SOURCES = libvirt_driver_libxl_la_LIBADD = \ libvirt_driver_libxl_impl.la \ @@ -36,22 +13,6 @@ libvirt_driver_libxl_la_LIBADD = \ mod_LTLIBRARIES += libvirt_driver_libxl.la libvirt_driver_libxl_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) -libvirt_driver_libxl_impl_la_CFLAGS = \ - $(LIBXL_CFLAGS) \ - $(LIBXML_CFLAGS) \ - -I$(srcdir)/access \ - -I$(builddir)/access \ - -I$(srcdir)/conf \ - -I$(srcdir)/hypervisor \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_driver_libxl_impl_la_LDFLAGS = $(AM_LDFLAGS) -libvirt_driver_libxl_impl_la_LIBADD = \ - $(LIBXL_LIBS) \ - $(LIBXML_LIBS) \ - $(NULL) -libvirt_driver_libxl_impl_la_SOURCES = $(LIBXL_DRIVER_SOURCES) - sbin_PROGRAMS += virtxend nodist_conf_DATA += libxl/virtxend.conf diff --git a/src/libxl/meson.build b/src/libxl/meson.build new file mode 100644 index 00000000000..7747bb61a75 --- /dev/null +++ b/src/libxl/meson.build @@ -0,0 +1,29 @@ +libxl_driver_sources = [ + 'libxl_capabilities.c', + 'libxl_conf.c', + 'libxl_domain.c', + 'libxl_driver.c', + 'libxl_logger.c', + 'libxl_migration.c', + 'xen_common.c', + 'xen_xl.c', + 'xen_xm.c', +] + +if conf.has('WITH_LIBXL') + libxl_driver_imp = static_library( + 'virt_driver_libxl_impl', + [ + libxl_driver_sources, + ], + dependencies: [ + access_dep, + libxl_dep, + src_dep, + ], + include_directories: [ + conf_inc_dir, + hypervisor_inc_dir, + ], + ) +endif diff --git a/src/meson.build b/src/meson.build index ca94fe64bd9..44992fac02b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -148,6 +148,7 @@ subdir('security') subdir('bhyve') subdir('esx') subdir('hyperv') +subdir('libxl') subdir('openvz') subdir('test') subdir('vmware') -- 2.26.2

This introduces intermediate static library that is required for following remote protocol check. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/locking/Makefile.inc.am | 34 ++-------------------------- src/locking/meson.build | 45 +++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 32 deletions(-) diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index 3afc9803ce0..b8eac29d242 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -6,22 +6,10 @@ LOCK_DRIVER_SANLOCK_SOURCES = \ LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \ locking/sanlock_helper.c -LOCK_PROTOCOL_GENERATED = \ - locking/lock_protocol.h \ - locking/lock_protocol.c \ - $(NULL) - LOCK_DAEMON_GENERATED = \ locking/lock_daemon_dispatch_stubs.h $(NULL) -LOCK_PROTOCOL = $(srcdir)/locking/lock_protocol.x - -LOCK_DRIVER_LOCKD_SOURCES = \ - locking/lock_driver_lockd.c \ - locking/lock_driver_lockd.h \ - $(NULL) - LOCK_DAEMON_SOURCES = \ locking/lock_daemon.h \ locking/lock_daemon.c \ @@ -55,23 +43,11 @@ lockdriver_LTLIBRARIES = if WITH_LIBVIRTD lockdriver_LTLIBRARIES += lockd.la -lockd_la_SOURCES = \ - $(LOCK_DRIVER_LOCKD_SOURCES) \ - $(NULL) -nodist_lockd_la_SOURCES = \ - $(LOCK_PROTOCOL_GENERATED) \ - $(NULL) -lockd_la_CFLAGS = \ - -I$(srcdir)/conf \ - -I$(srcdir)/locking \ - -I$(builddir)/locking \ - -I$(builddir)/rpc \ - $(XDR_CFLAGS) \ - $(AM_CFLAGS) \ - $(NULL) +lockd_la_SOURCES = lockd_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) lockd_la_LIBADD = \ libvirt.la \ + libvirt_lockd_impl.la \ $(GLIB_LIBS) \ $(XDR_LIBS) \ $(NULL) @@ -80,12 +56,6 @@ if WITH_DTRACE_PROBES lockd_la_LIBADD += libvirt_probes.lo endif WITH_DTRACE_PROBES -if WITH_SASL -lockd_la_CFLAGS += \ - $(SASL_CFLAGS) \ - $(NULL) -endif WITH_SASL - if WITH_QEMU augeastest_DATA += locking/test_libvirt_lockd.aug nodist_conf_DATA += locking/qemu-lockd.conf diff --git a/src/locking/meson.build b/src/locking/meson.build index 18b2e3c72a6..d8255d00f64 100644 --- a/src/locking/meson.build +++ b/src/locking/meson.build @@ -1,9 +1,35 @@ +lock_protocol = 'lock_protocol.x' + lock_driver_sources = [ 'lock_manager.c', 'lock_driver_nop.c', 'domain_lock.c', ] +lock_driver_lockd_sources = [ + 'lock_driver_lockd.c', +] + +lock_protocol_generated = [] + +lock_protocol_generated += custom_target( + 'lock_protocol.h', + input: lock_protocol, + output: 'lock_protocol.h', + command: [ + genprotocol_prog, rpcgen_prog, '-h', '@INPUT@', '@OUTPUT@', + ], +) + +lock_protocol_generated += custom_target( + 'lock_protocol.c', + input: lock_protocol, + output: 'lock_protocol.c', + command: [ + genprotocol_prog, rpcgen_prog, '-c', '@INPUT@', '@OUTPUT@', + ], +) + lock_driver_lib = static_library( 'virt_lock_driver', [ @@ -18,3 +44,22 @@ lock_driver_lib = static_library( ) libvirt_libs += lock_driver_lib + +if conf.has('WITH_LIBVIRTD') + lockd_lib_impl = static_library( + 'lockd_impl', + [ + files(lock_driver_lockd_sources), + lock_protocol_generated, + ], + include_directories: [ + conf_inc_dir, + ], + dependencies: [ + rpc_dep, + sasl_dep, + src_dep, + xdr_dep, + ], + ) +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/lxc/Makefile.inc.am | 60 ------------------------------------ src/lxc/meson.build | 67 +++++++++++++++++++++++++++++++++++++++++ src/meson.build | 1 + 3 files changed, 68 insertions(+), 60 deletions(-) create mode 100644 src/lxc/meson.build diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am index 031aed14203..b0a12fdda50 100644 --- a/src/lxc/Makefile.inc.am +++ b/src/lxc/Makefile.inc.am @@ -21,29 +21,6 @@ LXC_GENERATED = \ LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x -LXC_DRIVER_SOURCES = \ - lxc/lxc_conf.c \ - lxc/lxc_conf.h \ - lxc/lxc_container.c \ - lxc/lxc_container.h \ - lxc/lxc_cgroup.c \ - lxc/lxc_cgroup.h \ - lxc/lxc_domain.c \ - lxc/lxc_domain.h \ - lxc/lxc_hostdev.c \ - lxc/lxc_hostdev.h \ - lxc/lxc_monitor.c \ - lxc/lxc_monitor.h \ - lxc/lxc_process.c \ - lxc/lxc_process.h \ - lxc/lxc_fuse.c \ - lxc/lxc_fuse.h \ - lxc/lxc_native.c \ - lxc/lxc_native.h \ - lxc/lxc_driver.c \ - lxc/lxc_driver.h \ - $(NULL) - LXC_CONTROLLER_SOURCES = \ lxc/lxc_conf.c \ lxc/lxc_conf.h \ @@ -70,7 +47,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_LXC -noinst_LTLIBRARIES += libvirt_driver_lxc_impl.la libvirt_driver_lxc_la_SOURCES = libvirt_driver_lxc_la_LIBADD = \ libvirt_driver_lxc_impl.la \ @@ -80,36 +56,6 @@ libvirt_driver_lxc_la_LIBADD = \ mod_LTLIBRARIES += libvirt_driver_lxc.la libvirt_driver_lxc_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) -libvirt_driver_lxc_impl_la_CFLAGS = \ - $(LIBNL_CFLAGS) \ - $(FUSE_CFLAGS) \ - $(XDR_CFLAGS) \ - -I$(srcdir)/access \ - -I$(builddir)/access \ - -I$(srcdir)/conf \ - -I$(builddir)/lxc \ - -I$(builddir)/rpc \ - -I$(srcdir)/hypervisor \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_driver_lxc_impl_la_LIBADD = \ - $(CAPNG_LIBS) \ - $(LIBNL_LIBS) \ - $(LIBXML_LIBS) \ - $(FUSE_LIBS) \ - $(NULL) - -if WITH_BLKID -libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS) -libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS) -endif WITH_BLKID -libvirt_driver_lxc_impl_la_LIBADD += $(SECDRIVER_LIBS) -libvirt_driver_lxc_impl_la_SOURCES = \ - $(LXC_DRIVER_SOURCES) -nodist_libvirt_driver_lxc_impl_la_SOURCES = \ - $(LXC_MONITOR_PROTOCOL_GENERATED) \ - $(LXC_MONITOR_GENERATED) - sbin_PROGRAMS += virtlxcd @@ -258,12 +204,6 @@ uninstall-data-lxc: endif WITH_LXC -lxc/lxc_monitor_dispatch.h: $(srcdir)/rpc/gendispatch.pl \ - $(LXC_MONITOR_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \ - virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \ - lxc/lxc_monitor_dispatch.h - lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \ $(REMOTE_PROTOCOL) Makefile.am $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \ diff --git a/src/lxc/meson.build b/src/lxc/meson.build new file mode 100644 index 00000000000..438cedd287c --- /dev/null +++ b/src/lxc/meson.build @@ -0,0 +1,67 @@ +lxc_driver_sources = [ + 'lxc_cgroup.c', + 'lxc_conf.c', + 'lxc_container.c', + 'lxc_domain.c', + 'lxc_driver.c', + 'lxc_fuse.c', + 'lxc_hostdev.c', + 'lxc_monitor.c', + 'lxc_native.c', + 'lxc_process.c', +] + +lxc_monitor_protocol = files('lxc_monitor_protocol.x') + +lxc_monitor_protocol_generated = [] + +lxc_monitor_protocol_generated += custom_target( + 'lxc_monitor_protocol_h', + input: lxc_monitor_protocol, + output: 'lxc_monitor_protocol.h', + command: [ genprotocol_prog, rpcgen_prog, '-h', '@INPUT@', '@OUTPUT@' ] +) + +lxc_monitor_protocol_generated += custom_target( + 'lxc_monitor_protocol_c', + input: lxc_monitor_protocol, + output: 'lxc_monitor_protocol.c', + command: [ genprotocol_prog, rpcgen_prog, '-c', '@INPUT@', '@OUTPUT@' ] +) + +lxc_monitor_generated = custom_target( + 'lxc_monitor_dispatch_h', + input: lxc_monitor_protocol, + output: 'lxc_monitor_dispatch.h', + command: [ + gendispatch_prog, '--mode=client', + 'virLXCMonitor', 'VIR_LXC_MONITOR', '@INPUT@' + ], + capture: true, +) + +if conf.has('WITH_LXC') + lxc_driver_impl_lib = static_library( + 'virt_driver_lxc_impl', + [ + lxc_driver_sources, + lxc_monitor_protocol_generated, + lxc_monitor_generated, + ], + dependencies: [ + access_dep, + blkid_dep, + capng_dep, + fuse_dep, + libnl_dep, + secdriver_dep, + src_dep, + rpc_dep, + xdr_dep, + ], + include_directories: [ + conf_inc_dir, + hypervisor_inc_dir, + ], + ) +endif diff --git a/src/meson.build b/src/meson.build index 44992fac02b..217ceb2d6ef 100644 --- a/src/meson.build +++ b/src/meson.build @@ -149,6 +149,7 @@ subdir('bhyve') subdir('esx') subdir('hyperv') subdir('libxl') +subdir('lxc') subdir('openvz') subdir('test') subdir('vmware') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/meson.build | 1 + src/network/Makefile.inc.am | 23 ----------------------- src/network/meson.build | 22 ++++++++++++++++++++++ 3 files changed, 23 insertions(+), 23 deletions(-) create mode 100644 src/network/meson.build diff --git a/src/meson.build b/src/meson.build index 217ceb2d6ef..aab85399948 100644 --- a/src/meson.build +++ b/src/meson.build @@ -143,6 +143,7 @@ subdir('remote') subdir('admin') subdir('locking') subdir('logging') +subdir('network') subdir('security') subdir('bhyve') diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am index 5a5d1630a08..c93b2e693d0 100644 --- a/src/network/Makefile.inc.am +++ b/src/network/Makefile.inc.am @@ -1,17 +1,5 @@ # vim: filetype=automake -NETWORK_DRIVER_SOURCES = \ - network/bridge_driver.h \ - network/bridge_driver.c \ - network/bridge_driver_platform.h \ - network/bridge_driver_platform.c \ - $(NULL) - -NETWORK_DRIVER_PLATFORM_INC = \ - network/bridge_driver_linux.c \ - network/bridge_driver_nop.c \ - $(NULL) - NETWORK_LEASES_HELPER_SOURCES = \ network/leaseshelper.c \ $(NULL) @@ -35,17 +23,6 @@ libvirt_driver_network_la_LIBADD = \ mod_LTLIBRARIES += libvirt_driver_network.la libvirt_driver_network_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) -libvirt_driver_network_impl_la_CFLAGS = \ - $(LIBNL_CFLAGS) \ - $(DBUS_CFLAGS) \ - -I$(srcdir)/access \ - -I$(builddir)/access \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES) -libvirt_driver_network_impl_la_LIBADD = $(DBUS_LIBS) $(LIBXML_LIBS) - sbin_PROGRAMS += virtnetworkd nodist_conf_DATA += network/virtnetworkd.conf diff --git a/src/network/meson.build b/src/network/meson.build new file mode 100644 index 00000000000..2b05544fd22 --- /dev/null +++ b/src/network/meson.build @@ -0,0 +1,22 @@ +network_driver_sources = [ + 'bridge_driver.c', + 'bridge_driver_platform.c', +] + +if conf.has('WITH_NETWORK') + network_driver_impl = static_library( + 'virt_driver_network_impl', + [ + network_driver_sources, + ], + dependencies: [ + access_dep, + dbus_dep, + libnl_dep, + src_dep, + ], + include_directories: [ + conf_inc_dir, + ], + ) +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/meson.build | 1 + src/node_device/Makefile.inc.am | 47 --------------------------------- src/node_device/meson.build | 31 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 47 deletions(-) create mode 100644 src/node_device/meson.build diff --git a/src/meson.build b/src/meson.build index aab85399948..12dea398679 100644 --- a/src/meson.build +++ b/src/meson.build @@ -144,6 +144,7 @@ subdir('admin') subdir('locking') subdir('logging') subdir('network') +subdir('node_device') subdir('security') subdir('bhyve') diff --git a/src/node_device/Makefile.inc.am b/src/node_device/Makefile.inc.am index 8a8bbea01e9..d3261cb15c4 100644 --- a/src/node_device/Makefile.inc.am +++ b/src/node_device/Makefile.inc.am @@ -1,20 +1,5 @@ # vim: filetype=automake -NODE_DEVICE_DRIVER_SOURCES = \ - node_device/node_device_driver.c \ - node_device/node_device_driver.h \ - $(NULL) - -NODE_DEVICE_DRIVER_HAL_SOURCES = \ - node_device/node_device_hal.c \ - node_device/node_device_hal.h \ - $(NULL) - -NODE_DEVICE_DRIVER_UDEV_SOURCES = \ - node_device/node_device_udev.c \ - node_device/node_device_udev.h \ - $(NULL) - DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(NODE_DEVICE_DRIVER_SOURCES)) \ $(addprefix $(srcdir)/,$(NODE_DEVICE_DRIVER_HAL_SOURCES)) \ @@ -27,42 +12,10 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_NODE_DEVICES -# Needed to keep automake quiet about conditionals -noinst_LTLIBRARIES += libvirt_driver_nodedev_impl.la libvirt_driver_nodedev_la_SOURCES = libvirt_driver_nodedev_la_LIBADD = libvirt_driver_nodedev_impl.la libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) mod_LTLIBRARIES += libvirt_driver_nodedev.la -libvirt_driver_nodedev_impl_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES) - -libvirt_driver_nodedev_impl_la_CFLAGS = \ - -I$(srcdir)/access \ - -I$(builddir)/access \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(LIBNL_CFLAGS) \ - $(NULL) -libvirt_driver_nodedev_impl_la_LIBADD = \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) - -if WITH_HAL -libvirt_driver_nodedev_impl_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES) -libvirt_driver_nodedev_impl_la_CFLAGS += $(HAL_CFLAGS) -libvirt_driver_nodedev_impl_la_LIBADD += $(HAL_LIBS) -endif WITH_HAL -if WITH_UDEV -libvirt_driver_nodedev_impl_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES) -libvirt_driver_nodedev_impl_la_CFLAGS += \ - $(UDEV_CFLAGS) \ - $(PCIACCESS_CFLAGS) \ - $(NULL) -libvirt_driver_nodedev_impl_la_LIBADD += \ - $(UDEV_LIBS) \ - $(PCIACCESS_LIBS) \ - $(NULL) -endif WITH_UDEV sbin_PROGRAMS += virtnodedevd diff --git a/src/node_device/meson.build b/src/node_device/meson.build new file mode 100644 index 00000000000..4ee64f56433 --- /dev/null +++ b/src/node_device/meson.build @@ -0,0 +1,31 @@ +node_device_driver_sources = [ + 'node_device_driver.c', +] + +if conf.has('WITH_HAL') + node_device_driver_sources += 'node_device_hal.c' +endif + +if conf.has('WITH_UDEV') + node_device_driver_sources += 'node_device_udev.c' +endif + +if conf.has('WITH_NODE_DEVICES') + node_device_driver_impl = static_library( + 'virt_driver_nodedev_impl', + [ + node_device_driver_sources, + ], + dependencies: [ + access_dep, + hal_dep, + libnl_dep, + pciaccess_dep, + src_dep, + udev_dep, + ], + include_directories: [ + conf_inc_dir, + ], + ) +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/meson.build | 1 + src/nwfilter/Makefile.inc.am | 37 +++--------------------------------- src/nwfilter/meson.build | 26 +++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 34 deletions(-) create mode 100644 src/nwfilter/meson.build diff --git a/src/meson.build b/src/meson.build index 12dea398679..66af0e3051c 100644 --- a/src/meson.build +++ b/src/meson.build @@ -145,6 +145,7 @@ subdir('locking') subdir('logging') subdir('network') subdir('node_device') +subdir('nwfilter') subdir('security') subdir('bhyve') diff --git a/src/nwfilter/Makefile.inc.am b/src/nwfilter/Makefile.inc.am index 758370e1a74..ba07992027c 100644 --- a/src/nwfilter/Makefile.inc.am +++ b/src/nwfilter/Makefile.inc.am @@ -2,20 +2,6 @@ NWFILTER_XML_FILES = $(wildcard $(srcdir)/nwfilter/xml/*.xml) -NWFILTER_DRIVER_SOURCES = \ - nwfilter/nwfilter_driver.h \ - nwfilter/nwfilter_driver.c \ - nwfilter/nwfilter_tech_driver.h \ - nwfilter/nwfilter_gentech_driver.c \ - nwfilter/nwfilter_gentech_driver.h \ - nwfilter/nwfilter_dhcpsnoop.c \ - nwfilter/nwfilter_dhcpsnoop.h \ - nwfilter/nwfilter_ebiptables_driver.c \ - nwfilter/nwfilter_ebiptables_driver.h \ - nwfilter/nwfilter_learnipaddr.c \ - nwfilter/nwfilter_learnipaddr.h \ - $(NULL) - DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(NWFILTER_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(NWFILTER_DRIVER_SOURCES)) @@ -25,29 +11,12 @@ if WITH_NWFILTER nwfilterxmldir = $(sysconfdir)/libvirt/nwfilter nwfilterxml_DATA = $(NWFILTER_XML_FILES) -noinst_LTLIBRARIES += libvirt_driver_nwfilter_impl.la libvirt_driver_nwfilter_la_SOURCES = -libvirt_driver_nwfilter_la_LIBADD = libvirt_driver_nwfilter_impl.la +libvirt_driver_nwfilter_la_LIBADD = \ + libvirt_driver_nwfilter_impl.la \ + libvirt.la mod_LTLIBRARIES += libvirt_driver_nwfilter.la libvirt_driver_nwfilter_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) -libvirt_driver_nwfilter_impl_la_CFLAGS = \ - $(LIBPCAP_CFLAGS) \ - $(LIBNL_CFLAGS) \ - $(DBUS_CFLAGS) \ - -I$(srcdir)/access \ - -I$(builddir)/access \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_driver_nwfilter_impl_la_LDFLAGS = $(AM_LDFLAGS) -libvirt_driver_nwfilter_impl_la_LIBADD = \ - libvirt.la \ - $(LIBPCAP_LIBS) \ - $(LIBNL_LIBS) \ - $(DBUS_LIBS) \ - $(GLIB_LIBS) \ - $(NULL) -libvirt_driver_nwfilter_impl_la_SOURCES = $(NWFILTER_DRIVER_SOURCES) sbin_PROGRAMS += virtnwfilterd diff --git a/src/nwfilter/meson.build b/src/nwfilter/meson.build new file mode 100644 index 00000000000..fe792058b94 --- /dev/null +++ b/src/nwfilter/meson.build @@ -0,0 +1,26 @@ +nwfilter_driver_sources = [ + 'nwfilter_driver.c', + 'nwfilter_gentech_driver.c', + 'nwfilter_dhcpsnoop.c', + 'nwfilter_ebiptables_driver.c', + 'nwfilter_learnipaddr.c', +] + +if conf.has('WITH_NWFILTER') + nwfilter_driver_impl = static_library( + 'virt_driver_nwfilter_impl', + [ + nwfilter_driver_sources, + ], + dependencies: [ + access_dep, + dbus_dep, + libnl_dep, + libpcap_dep, + src_dep, + ], + include_directories: [ + conf_inc_dir, + ], + ) +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/meson.build | 1 + src/qemu/Makefile.inc.am | 106 --------------------------- src/{ => qemu}/libvirt_qemu_probes.d | 0 src/qemu/meson.build | 95 ++++++++++++++++++++++++ 4 files changed, 96 insertions(+), 106 deletions(-) rename src/{ => qemu}/libvirt_qemu_probes.d (100%) create mode 100644 src/qemu/meson.build diff --git a/src/meson.build b/src/meson.build index 66af0e3051c..bfc60fc967e 100644 --- a/src/meson.build +++ b/src/meson.build @@ -154,6 +154,7 @@ subdir('hyperv') subdir('libxl') subdir('lxc') subdir('openvz') +subdir('qemu') subdir('test') subdir('vmware') diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am index 5aee568ed90..3d703d15d33 100644 --- a/src/qemu/Makefile.inc.am +++ b/src/qemu/Makefile.inc.am @@ -1,90 +1,9 @@ # vim: filetype=automake -QEMU_DRIVER_SOURCES = \ - qemu/qemu_agent.c \ - qemu/qemu_agent.h \ - qemu/qemu_alias.c \ - qemu/qemu_alias.h \ - qemu/qemu_block.c \ - qemu/qemu_block.h \ - qemu/qemu_blockjob.c \ - qemu/qemu_blockjob.h \ - qemu/qemu_capabilities.c \ - qemu/qemu_capabilities.h \ - qemu/qemu_command.c \ - qemu/qemu_command.h \ - qemu/qemu_dbus.c \ - qemu/qemu_dbus.h \ - qemu/qemu_domain.c \ - qemu/qemu_domain.h \ - qemu/qemu_domainjob.c \ - qemu/qemu_domainjob.h \ - qemu/qemu_domain_address.c \ - qemu/qemu_domain_address.h \ - qemu/qemu_cgroup.c \ - qemu/qemu_cgroup.h \ - qemu/qemu_extdevice.c \ - qemu/qemu_extdevice.h \ - qemu/qemu_firmware.c \ - qemu/qemu_firmware.h \ - qemu/qemu_hostdev.c \ - qemu/qemu_hostdev.h \ - qemu/qemu_hotplug.c \ - qemu/qemu_hotplug.h \ - qemu/qemu_conf.c \ - qemu/qemu_conf.h \ - qemu/qemu_interop_config.c \ - qemu/qemu_interop_config.h \ - qemu/qemu_process.c \ - qemu/qemu_process.h \ - qemu/qemu_processpriv.h \ - qemu/qemu_migration.c \ - qemu/qemu_migration.h \ - qemu/qemu_migration_cookie.c \ - qemu/qemu_migration_cookie.h \ - qemu/qemu_migration_params.c \ - qemu/qemu_migration_params.h \ - qemu/qemu_migration_paramspriv.h \ - qemu/qemu_monitor.c \ - qemu/qemu_monitor.h \ - qemu/qemu_monitor_priv.h \ - qemu/qemu_monitor_text.c \ - qemu/qemu_monitor_text.h \ - qemu/qemu_monitor_json.c \ - qemu/qemu_monitor_json.h \ - qemu/qemu_driver.c \ - qemu/qemu_driver.h \ - qemu/qemu_interface.c \ - qemu/qemu_interface.h \ - qemu/qemu_capspriv.h \ - qemu/qemu_security.c \ - qemu/qemu_security.h \ - qemu/qemu_qapi.c \ - qemu/qemu_qapi.h \ - qemu/qemu_slirp.c \ - qemu/qemu_slirp.h \ - qemu/qemu_tpm.c \ - qemu/qemu_tpm.h \ - qemu/qemu_vhost_user.c \ - qemu/qemu_vhost_user.h \ - qemu/qemu_vhost_user_gpu.c \ - qemu/qemu_vhost_user_gpu.h \ - qemu/qemu_virtiofs.c \ - qemu/qemu_virtiofs.h \ - qemu/qemu_checkpoint.c \ - qemu/qemu_checkpoint.h \ - qemu/qemu_backup.c \ - qemu/qemu_backup.h \ - qemu/qemu_validate.c \ - qemu/qemu_validate.h \ - $(NULL) - - DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES)) if WITH_QEMU -noinst_LTLIBRARIES += libvirt_driver_qemu_impl.la libvirt_driver_qemu_la_SOURCES = libvirt_driver_qemu_la_LIBADD = \ libvirt_driver_qemu_impl.la \ @@ -94,33 +13,8 @@ libvirt_driver_qemu_la_LIBADD = \ mod_LTLIBRARIES += libvirt_driver_qemu.la libvirt_driver_qemu_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) -libvirt_driver_qemu_impl_la_CFLAGS = \ - $(GNUTLS_CFLAGS) \ - $(LIBNL_CFLAGS) \ - $(SELINUX_CFLAGS) \ - $(XDR_CFLAGS) \ - -I$(srcdir)/access \ - -I$(builddir)/access \ - -I$(srcdir)/conf \ - -I$(srcdir)/hypervisor \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_driver_qemu_impl_la_LDFLAGS = $(AM_LDFLAGS) -libvirt_driver_qemu_impl_la_LIBADD = \ - $(CAPNG_LIBS) \ - $(GNUTLS_LIBS) \ - $(LIBNL_LIBS) \ - $(SELINUX_LIBS) \ - $(LIBXML_LIBS) \ - $(NULL) -libvirt_driver_qemu_impl_la_SOURCES = $(QEMU_DRIVER_SOURCES) - if WITH_DTRACE_PROBES libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.lo -nodist_libvirt_driver_qemu_la_SOURCES = libvirt_qemu_probes.h - -tapset_DATA += libvirt_qemu_probes.stp - endif WITH_DTRACE_PROBES sbin_PROGRAMS += virtqemud diff --git a/src/libvirt_qemu_probes.d b/src/qemu/libvirt_qemu_probes.d similarity index 100% rename from src/libvirt_qemu_probes.d rename to src/qemu/libvirt_qemu_probes.d diff --git a/src/qemu/meson.build b/src/qemu/meson.build new file mode 100644 index 00000000000..14b700558df --- /dev/null +++ b/src/qemu/meson.build @@ -0,0 +1,95 @@ +qemu_driver_sources = [ + 'qemu_agent.c', + 'qemu_alias.c', + 'qemu_backup.c', + 'qemu_block.c', + 'qemu_blockjob.c', + 'qemu_capabilities.c', + 'qemu_cgroup.c', + 'qemu_checkpoint.c', + 'qemu_command.c', + 'qemu_conf.c', + 'qemu_dbus.c', + 'qemu_domain.c', + 'qemu_domain_address.c', + 'qemu_domainjob.c', + 'qemu_driver.c', + 'qemu_extdevice.c', + 'qemu_firmware.c', + 'qemu_hostdev.c', + 'qemu_hotplug.c', + 'qemu_interface.c', + 'qemu_interop_config.c', + 'qemu_migration.c', + 'qemu_migration_cookie.c', + 'qemu_migration_params.c', + 'qemu_monitor.c', + 'qemu_monitor_json.c', + 'qemu_monitor_text.c', + 'qemu_process.c', + 'qemu_qapi.c', + 'qemu_security.c', + 'qemu_slirp.c', + 'qemu_tpm.c', + 'qemu_validate.c', + 'qemu_vhost_user.c', + 'qemu_vhost_user_gpu.c', + 'qemu_virtiofs.c', +] + +qemu_dtrace_gen_headers = [] +qemu_dtrace_gen_objects = [] + +if conf.has('WITH_DTRACE_PROBES') + infile = 'libvirt_qemu_probes.d' + out_h = 'libvirt_qemu_probes.h' + out_o = 'libvirt_qemu_probes.o' + out_stp = 'libvirt_qemu_probes.stp' + + qemu_dtrace_gen_headers += custom_target( + out_h, + input: infile, + output: out_h, + command: [ dtrace_prog, '-o', '@OUTPUT@', '-h', '-s', '@INPUT@' ], + ) + + qemu_dtrace_gen_objects += custom_target( + out_o, + input: infile, + output: out_o, + command: [ dtrace_prog, '-o', '@OUTPUT@', '-G', '-s', '@INPUT@' ], + ) + + qemu_dtrace_gen_stp = custom_target( + out_stp, + input: infile, + output: out_stp, + command: [ meson_python_prog, dtrace2systemtap_prog, bindir, sbindir, libdir, '@INPUT@' ], + capture: true, + install: conf.has('WITH_QEMU'), + install_dir: systemtap_dir, + ) +endif + +if conf.has('WITH_QEMU') + qemu_driver_impl = static_library( + 'virt_driver_qemu_impl', + [ + qemu_driver_sources, + qemu_dtrace_gen_headers, + ], + dependencies: [ + access_dep, + capng_dep, + gnutls_dep, + libnl_dep, + selinux_dep, + src_dep, + xdr_dep, + ], + include_directories: [ + conf_inc_dir, + hypervisor_inc_dir, + ], + ) +endif -- 2.26.2

On Thu, Jul 16, 2020 at 11:56:40 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/meson.build | 1 + src/qemu/Makefile.inc.am | 106 --------------------------- src/{ => qemu}/libvirt_qemu_probes.d | 0 src/qemu/meson.build | 95 ++++++++++++++++++++++++ 4 files changed, 96 insertions(+), 106 deletions(-) rename src/{ => qemu}/libvirt_qemu_probes.d (100%) create mode 100644 src/qemu/meson.build
[...]
+if conf.has('WITH_QEMU') + qemu_driver_impl = static_library( + 'virt_driver_qemu_impl', + [ + qemu_driver_sources, + qemu_dtrace_gen_headers, + ], + dependencies: [ + access_dep, + capng_dep, + gnutls_dep, + libnl_dep, + selinux_dep, + src_dep, + xdr_dep,
Isn't yajl missing here?

On Thu, Jul 23, 2020 at 12:18:45 +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:56:40 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/meson.build | 1 + src/qemu/Makefile.inc.am | 106 --------------------------- src/{ => qemu}/libvirt_qemu_probes.d | 0 src/qemu/meson.build | 95 ++++++++++++++++++++++++ 4 files changed, 96 insertions(+), 106 deletions(-) rename src/{ => qemu}/libvirt_qemu_probes.d (100%) create mode 100644 src/qemu/meson.build
[...]
+if conf.has('WITH_QEMU') + qemu_driver_impl = static_library( + 'virt_driver_qemu_impl', + [ + qemu_driver_sources, + qemu_dtrace_gen_headers, + ], + dependencies: [ + access_dep, + capng_dep, + gnutls_dep, + libnl_dep, + selinux_dep, + src_dep, + xdr_dep,
Isn't yajl missing here?
Oh, never-mind. I've didn't notice at first glance that src_dep actually includes dependencies from util.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/meson.build | 1 + src/storage/Makefile.inc.am | 30 ------------------------------ src/storage/meson.build | 27 +++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 30 deletions(-) create mode 100644 src/storage/meson.build diff --git a/src/meson.build b/src/meson.build index bfc60fc967e..aac5a256b07 100644 --- a/src/meson.build +++ b/src/meson.build @@ -147,6 +147,7 @@ subdir('network') subdir('node_device') subdir('nwfilter') subdir('security') +subdir('storage') subdir('bhyve') subdir('esx') diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index e201b9938d9..87ba8c0bd16 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -1,18 +1,5 @@ # vim: filetype=automake -STORAGE_DRIVER_BACKEND_SOURCES = \ - storage/storage_backend.h \ - storage/storage_backend.c \ - $(NULL) - -STORAGE_DRIVER_SOURCES = \ - storage/storage_driver.h \ - storage/storage_driver.c \ - $(STORAGE_DRIVER_BACKEND_SOURCES) \ - storage/storage_util.h \ - storage/storage_util.c \ - $(NULL) - STORAGE_DRIVER_FS_SOURCES = \ storage/storage_backend_fs.h \ storage/storage_backend_fs.c \ @@ -98,23 +85,7 @@ storagebackend_LTLIBRARIES = storagefiledir = $(libdir)/libvirt/storage-file storagefile_LTLIBRARIES = -# Needed to keep automake quiet about conditionals -libvirt_driver_storage_impl_la_SOURCES = -libvirt_driver_storage_impl_la_CFLAGS = \ - -I$(srcdir)/access \ - -I$(builddir)/access \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_driver_storage_impl_la_LDFLAGS = $(AM_LDFLAGS) -libvirt_driver_storage_impl_la_LIBADD = $(SECDRIVER_LIBS) $(LIBXML_LIBS) -if WITH_BLKID -libvirt_driver_storage_impl_la_CFLAGS += $(BLKID_CFLAGS) -libvirt_driver_storage_impl_la_LIBADD += $(BLKID_LIBS) -endif WITH_BLKID - if WITH_STORAGE -noinst_LTLIBRARIES += libvirt_driver_storage_impl.la libvirt_driver_storage_la_SOURCES = libvirt_driver_storage_la_LIBADD = \ libvirt_driver_storage_impl.la \ @@ -123,7 +94,6 @@ libvirt_driver_storage_la_LIBADD = \ $(NULL) mod_LTLIBRARIES += libvirt_driver_storage.la libvirt_driver_storage_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) -libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES) sbin_PROGRAMS += virtstoraged diff --git a/src/storage/meson.build b/src/storage/meson.build new file mode 100644 index 00000000000..36ef45b10ab --- /dev/null +++ b/src/storage/meson.build @@ -0,0 +1,27 @@ +storage_driver_backend_sources = [ + 'storage_backend.c', +] + +storage_driver_sources = [ + 'storage_driver.c', + 'storage_util.c', + storage_driver_backend_sources, +] + +if conf.has('WITH_STORAGE') + storage_driver_impl_lib = static_library( + 'virt_storage_driver_impl', + [ + storage_driver_sources, + ], + dependencies: [ + access_dep, + blkid_dep, + secdriver_dep, + src_dep, + ], + include_directories: [ + conf_inc_dir, + ], + ) +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/meson.build | 1 + src/vbox/Makefile.inc.am | 34 ---------------------------------- src/vbox/meson.build | 31 +++++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 34 deletions(-) create mode 100644 src/vbox/meson.build diff --git a/src/meson.build b/src/meson.build index aac5a256b07..87d1410b218 100644 --- a/src/meson.build +++ b/src/meson.build @@ -157,6 +157,7 @@ subdir('lxc') subdir('openvz') subdir('qemu') subdir('test') +subdir('vbox') subdir('vmware') diff --git a/src/vbox/Makefile.inc.am b/src/vbox/Makefile.inc.am index 8acbdc84609..19ffff223b1 100644 --- a/src/vbox/Makefile.inc.am +++ b/src/vbox/Makefile.inc.am @@ -1,26 +1,5 @@ # vim: filetype=automake -VBOX_DRIVER_SOURCES = \ - vbox/vbox_driver.c \ - vbox/vbox_driver.h \ - vbox/vbox_snapshot_conf.c \ - vbox/vbox_snapshot_conf.h \ - vbox/vbox_V5_2.c \ - vbox/vbox_CAPI_v5_2.h \ - vbox/vbox_CAPI_v6_0.h \ - vbox/vbox_V6_0.c \ - vbox/vbox_CAPI_v6_1.h \ - vbox/vbox_V6_1.c \ - vbox/vbox_common.c \ - vbox/vbox_common.h \ - vbox/vbox_uniformed_api.h \ - vbox/vbox_get_driver.h \ - vbox/vbox_network.c \ - vbox/vbox_storage.c \ - vbox/vbox_XPCOMCGlue.c \ - vbox/vbox_XPCOMCGlue.h \ - $(NULL) - DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(VBOX_DRIVER_SOURCES)) \ $(srcdir)/vbox/vbox_tmpl.c \ @@ -37,19 +16,6 @@ libvirt_driver_vbox_la_LIBADD = \ mod_LTLIBRARIES += libvirt_driver_vbox.la libvirt_driver_vbox_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) -libvirt_driver_vbox_impl_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - -DVBOX_DRIVER \ - $(NULL) -libvirt_driver_vbox_impl_la_LDFLAGS = $(AM_LDFLAGS) -libvirt_driver_vbox_impl_la_LIBADD = \ - $(DLOPEN_LIBS) \ - $(WIN32_EXTRA_LIBS) \ - $(LIBXML_LIBS) \ - $(NULL) -libvirt_driver_vbox_impl_la_SOURCES = $(VBOX_DRIVER_SOURCES) - sbin_PROGRAMS += virtvboxd nodist_conf_DATA += vbox/virtvboxd.conf diff --git a/src/vbox/meson.build b/src/vbox/meson.build new file mode 100644 index 00000000000..c27f9418249 --- /dev/null +++ b/src/vbox/meson.build @@ -0,0 +1,31 @@ +vbox_driver_sources = [ + 'vbox_V5_2.c', + 'vbox_V6_0.c', + 'vbox_V6_1.c', + 'vbox_common.c', + 'vbox_driver.c', + 'vbox_network.c', + 'vbox_snapshot_conf.c', + 'vbox_storage.c', + 'vbox_XPCOMCGlue.c', +] + +if conf.has('WITH_VBOX') + vbox_driver_impl = static_library( + 'virt_driver_vbox_impl', + [ + vbox_driver_sources, + ], + c_args: [ + '-DVBOX_DRIVER', + ], + dependencies: [ + dlopen_dep, + src_dep, + win32_dep, + ], + include_directories: [ + conf_inc_dir, + ], + ) +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/meson.build | 1 + src/vz/Makefile.inc.am | 24 ------------------------ src/vz/meson.build | 23 +++++++++++++++++++++++ 3 files changed, 24 insertions(+), 24 deletions(-) create mode 100644 src/vz/meson.build diff --git a/src/meson.build b/src/meson.build index 87d1410b218..50f428da2ef 100644 --- a/src/meson.build +++ b/src/meson.build @@ -159,6 +159,7 @@ subdir('qemu') subdir('test') subdir('vbox') subdir('vmware') +subdir('vz') driver_sources = [ diff --git a/src/vz/Makefile.inc.am b/src/vz/Makefile.inc.am index 7782fd89d75..d5d19a6f2ea 100644 --- a/src/vz/Makefile.inc.am +++ b/src/vz/Makefile.inc.am @@ -1,21 +1,10 @@ # vim: filetype=automake -VZ_DRIVER_SOURCES = \ - vz/vz_driver.h \ - vz/vz_driver.c \ - vz/vz_utils.c \ - vz/vz_utils.h \ - vz/vz_sdk.h \ - vz/vz_sdk.c \ - $(NULL) - - DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(VZ_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(VZ_DRIVER_SOURCES)) if WITH_VZ -noinst_LTLIBRARIES += libvirt_driver_vz_impl.la libvirt_driver_vz_la_SOURCES = libvirt_driver_vz_la_LIBADD = \ libvirt_driver_vz_impl.la \ @@ -24,19 +13,6 @@ libvirt_driver_vz_la_LIBADD = \ $(NULL) mod_LTLIBRARIES += libvirt_driver_vz.la libvirt_driver_vz_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) -libvirt_driver_vz_impl_la_CFLAGS = \ - -I$(srcdir)/conf \ - -I$(srcdir)/access \ - -I$(builddir)/access \ - $(AM_CFLAGS) \ - $(PARALLELS_SDK_CFLAGS) \ - $(LIBNL_CFLAGS) \ - $(NULL) -libvirt_driver_vz_impl_la_SOURCES = $(VZ_DRIVER_SOURCES) -libvirt_driver_vz_impl_la_LIBADD = \ - $(PARALLELS_SDK_LIBS) \ - $(LIBNL_LIBS) \ - $(NULL) sbin_PROGRAMS += virtvzd diff --git a/src/vz/meson.build b/src/vz/meson.build new file mode 100644 index 00000000000..1f0c04bb8f2 --- /dev/null +++ b/src/vz/meson.build @@ -0,0 +1,23 @@ +vz_driver_sources = [ + 'vz_driver.c', + 'vz_utils.c', + 'vz_sdk.c', +] + +if conf.has('WITH_VZ') + vz_driver_impl = static_library( + 'virt_driver_vz_impl', + [ + vz_driver_sources, + ], + dependencies: [ + access_dep, + libnl_dep, + parallels_sdk_dep, + src_dep, + ], + include_directories: [ + conf_inc_dir, + ], + ) +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 8 -------- src/meson.build | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 71a55e235f2..a9fce0444ed 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,12 +19,6 @@ # No libraries with the exception of LIBXML should be listed # here. List them against the individual XXX_la_CFLAGS targets # that actually use them. -AM_LDFLAGS_MOD = \ - -module \ - -avoid-version \ - $(LIBVIRT_NODELETE) \ - $(AM_LDFLAGS) -AM_LDFLAGS_MOD_NOUNDEF = $(AM_LDFLAGS_MOD) $(NO_UNDEFINED_LDFLAGS) nodist_conf_DATA = DRIVER_SOURCE_FILES = @@ -81,8 +75,6 @@ include storage/Makefile.inc.am include remote/Makefile.inc.am -moddir = $(libdir)/libvirt/connection-driver - confdir = $(sysconfdir)/libvirt conf_DATA += libvirt.conf diff --git a/src/meson.build b/src/meson.build index 50f428da2ef..991991118ba 100644 --- a/src/meson.build +++ b/src/meson.build @@ -118,6 +118,19 @@ endif libvirt_libs = [] +# virt_modules: +# each entry is a dictionary with following items: +# * name - module name (required) +# * sources - module sources (optional, default []) +# * name_prefix - resulting library prefix (optional, default 'lib') +# * include - include_directories (optional, default []) +# * deps - dependencies (optional, default []) +# * link_with - static libraries to link with (optional, default []) +# * link_whole - static libraries to include (optional, default []) +# * link_args - arguments for linker (optional, default []) +# * install_dir - installation directory (optional, default libdir / 'libvirt' / 'connection-driver' +virt_modules = [] + # list subdirectories @@ -409,3 +422,37 @@ libvirt_admin_lib = shared_library( version: libvirt_lib_version, soversion: libvirt_so_version, ) + + +# build libvirt shared modules + +foreach module : virt_modules + mod = shared_module( + module['name'], + module.get('sources', []), + name_prefix: module.get('name_prefix', 'lib'), + include_directories: [ + conf_inc_dir, + module.get('include', []), + ], + dependencies: [ + src_dep, + module.get('deps', []), + ], + link_with: [ + libvirt_lib, + module.get('link_with', []), + ], + link_whole: [ + module.get('link_whole', []), + ], + link_args: [ + libvirt_nodelete, + module.get('link_args', []), + ], + install: true, + install_dir: module.get('install_dir', libdir / 'libvirt' / 'connection-driver'), + install_rpath: libdir, + ) + set_variable('@0@_module'.format(module['name'].underscorify()), mod) +endforeach -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/bhyve/Makefile.inc.am | 9 --------- src/bhyve/meson.build | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/bhyve/Makefile.inc.am b/src/bhyve/Makefile.inc.am index 3433e6a3dab..40384e1c714 100644 --- a/src/bhyve/Makefile.inc.am +++ b/src/bhyve/Makefile.inc.am @@ -4,15 +4,6 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(BHYVE_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(BHYVE_DRIVER_SOURCES)) if WITH_BHYVE -libvirt_driver_bhyve_la_SOURCES = -libvirt_driver_bhyve_la_LIBADD = \ - libvirt_driver_bhyve_impl.la \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -mod_LTLIBRARIES += libvirt_driver_bhyve.la -libvirt_driver_bhyve_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) - sbin_PROGRAMS += virtbhyved nodist_conf_DATA += bhyve/virtbhyved.conf diff --git a/src/bhyve/meson.build b/src/bhyve/meson.build index a9af677440b..83d8c366635 100644 --- a/src/bhyve/meson.build +++ b/src/bhyve/meson.build @@ -25,4 +25,14 @@ if conf.has('WITH_BHYVE') hypervisor_inc_dir, ], ) + + virt_modules += { + 'name': 'virt_driver_bhyve', + 'link_whole': [ + bhyve_driver_impl, + ], + 'link_args': [ + libvirt_no_undefined, + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/interface/Makefile.inc.am | 33 --------------------------------- src/interface/meson.build | 29 +++++++++++++++++++++++++++++ src/meson.build | 1 + 3 files changed, 30 insertions(+), 33 deletions(-) create mode 100644 src/interface/meson.build diff --git a/src/interface/Makefile.inc.am b/src/interface/Makefile.inc.am index deff49fa65d..9a56e0b4e0f 100644 --- a/src/interface/Makefile.inc.am +++ b/src/interface/Makefile.inc.am @@ -1,43 +1,10 @@ # vim: filetype=automake -INTERFACE_DRIVER_SOURCES = \ - interface/interface_driver.h \ - interface/interface_driver.c \ - $(NULL) - -INTERFACE_DRIVER_NETCF_SOURCES = interface/interface_backend_netcf.c -INTERFACE_DRIVER_UDEV_SOURCES = interface/interface_backend_udev.c - DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(INTERFACE_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(INTERFACE_DRIVER_SOURCES)) if WITH_INTERFACE -mod_LTLIBRARIES += libvirt_driver_interface.la -libvirt_driver_interface_la_CFLAGS = \ - -I$(srcdir)/access \ - -I$(builddir)/access \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(LIBNL_CFLAGS) \ - $(NULL) -libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) -libvirt_driver_interface_la_LIBADD = \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES) -if WITH_NETCF -libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS) -libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS) -libvirt_driver_interface_la_SOURCES += $(INTERFACE_DRIVER_NETCF_SOURCES) -endif WITH_NETCF -if WITH_UDEV -libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS) -libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS) -libvirt_driver_interface_la_SOURCES += $(INTERFACE_DRIVER_UDEV_SOURCES) -endif WITH_UDEV - sbin_PROGRAMS += virtinterfaced nodist_conf_DATA += interface/virtinterfaced.conf diff --git a/src/interface/meson.build b/src/interface/meson.build new file mode 100644 index 00000000000..bb08706f21c --- /dev/null +++ b/src/interface/meson.build @@ -0,0 +1,29 @@ +interface_driver_sources = [ + 'interface_driver.c', +] + +if conf.has('WITH_NETCF') + interface_driver_sources += 'interface_backend_netcf.c' +endif + +if conf.has('WITH_UDEV') + interface_driver_sources += 'interface_backend_udev.c' +endif + +if conf.has('WITH_INTERFACE') + virt_modules += { + 'name': 'virt_driver_interface', + 'sources': [ + files(interface_driver_sources), + ], + 'deps': [ + access_dep, + libnl_dep, + netcf_dep, + udev_dep, + ], + 'link_args': [ + libvirt_no_undefined, + ], + } +endif diff --git a/src/meson.build b/src/meson.build index 991991118ba..92f80b5838b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -154,6 +154,7 @@ subdir('vmx') subdir('remote') subdir('admin') +subdir('interface') subdir('locking') subdir('logging') subdir('network') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/libxl/Makefile.inc.am | 9 --------- src/libxl/meson.build | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/libxl/Makefile.inc.am b/src/libxl/Makefile.inc.am index c7ac93a75b7..35e6b3bbcd9 100644 --- a/src/libxl/Makefile.inc.am +++ b/src/libxl/Makefile.inc.am @@ -4,15 +4,6 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(LIBXL_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(LIBXL_DRIVER_SOURCES)) if WITH_LIBXL -libvirt_driver_libxl_la_SOURCES = -libvirt_driver_libxl_la_LIBADD = \ - libvirt_driver_libxl_impl.la \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -mod_LTLIBRARIES += libvirt_driver_libxl.la -libvirt_driver_libxl_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) - sbin_PROGRAMS += virtxend nodist_conf_DATA += libxl/virtxend.conf diff --git a/src/libxl/meson.build b/src/libxl/meson.build index 7747bb61a75..484f3805851 100644 --- a/src/libxl/meson.build +++ b/src/libxl/meson.build @@ -26,4 +26,14 @@ if conf.has('WITH_LIBXL') hypervisor_inc_dir, ], ) + + virt_modules += { + 'name': 'virt_driver_libxl', + 'link_whole': [ + libxl_driver_imp, + ], + 'link_args': [ + libvirt_no_undefined, + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/lxc/Makefile.inc.am | 10 ---------- src/lxc/meson.build | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am index b0a12fdda50..3bf8d9dfb05 100644 --- a/src/lxc/Makefile.inc.am +++ b/src/lxc/Makefile.inc.am @@ -47,16 +47,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_LXC -libvirt_driver_lxc_la_SOURCES = -libvirt_driver_lxc_la_LIBADD = \ - libvirt_driver_lxc_impl.la \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -mod_LTLIBRARIES += libvirt_driver_lxc.la -libvirt_driver_lxc_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) - - sbin_PROGRAMS += virtlxcd nodist_conf_DATA += lxc/virtlxcd.conf diff --git a/src/lxc/meson.build b/src/lxc/meson.build index 438cedd287c..5d8a20bd9f7 100644 --- a/src/lxc/meson.build +++ b/src/lxc/meson.build @@ -64,4 +64,14 @@ if conf.has('WITH_LXC') hypervisor_inc_dir, ], ) + + virt_modules += { + 'name': 'virt_driver_lxc', + 'link_whole': [ + lxc_driver_impl_lib, + ], + 'link_args': [ + libvirt_no_undefined, + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/network/Makefile.inc.am | 13 ------------- src/network/meson.build | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am index c93b2e693d0..523ae453797 100644 --- a/src/network/Makefile.inc.am +++ b/src/network/Makefile.inc.am @@ -10,19 +10,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_NETWORK - -noinst_LTLIBRARIES += libvirt_driver_network_impl.la -libvirt_driver_network_la_SOURCES = -libvirt_driver_network_la_LIBADD = \ - libvirt_driver_network_impl.la \ - libvirt.la \ - $(GLIB_LIBS) \ - $(LIBNL_LIBS) \ - $(DBUS_LIBS) \ - $(NULL) -mod_LTLIBRARIES += libvirt_driver_network.la -libvirt_driver_network_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) - sbin_PROGRAMS += virtnetworkd nodist_conf_DATA += network/virtnetworkd.conf diff --git a/src/network/meson.build b/src/network/meson.build index 2b05544fd22..879a5731a6e 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -19,4 +19,18 @@ if conf.has('WITH_NETWORK') conf_inc_dir, ], ) + + virt_modules += { + 'name': 'virt_driver_network', + 'deps': [ + dbus_dep, + libnl_dep, + ], + 'link_whole': [ + network_driver_impl, + ], + 'link_args': [ + libvirt_no_undefined, + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/node_device/Makefile.inc.am | 5 ----- src/node_device/meson.build | 10 ++++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/node_device/Makefile.inc.am b/src/node_device/Makefile.inc.am index d3261cb15c4..d7d80f61fbb 100644 --- a/src/node_device/Makefile.inc.am +++ b/src/node_device/Makefile.inc.am @@ -12,11 +12,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_NODE_DEVICES -libvirt_driver_nodedev_la_SOURCES = -libvirt_driver_nodedev_la_LIBADD = libvirt_driver_nodedev_impl.la -libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) -mod_LTLIBRARIES += libvirt_driver_nodedev.la - sbin_PROGRAMS += virtnodedevd nodist_conf_DATA += node_device/virtnodedevd.conf diff --git a/src/node_device/meson.build b/src/node_device/meson.build index 4ee64f56433..00fa7e0ea9c 100644 --- a/src/node_device/meson.build +++ b/src/node_device/meson.build @@ -28,4 +28,14 @@ if conf.has('WITH_NODE_DEVICES') conf_inc_dir, ], ) + + virt_modules += { + 'name': 'virt_driver_nodedev', + 'link_whole': [ + node_device_driver_impl, + ], + 'link_args': [ + libvirt_no_undefined, + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/nwfilter/Makefile.inc.am | 7 ------- src/nwfilter/meson.build | 10 ++++++++++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/nwfilter/Makefile.inc.am b/src/nwfilter/Makefile.inc.am index ba07992027c..d853282b705 100644 --- a/src/nwfilter/Makefile.inc.am +++ b/src/nwfilter/Makefile.inc.am @@ -11,13 +11,6 @@ if WITH_NWFILTER nwfilterxmldir = $(sysconfdir)/libvirt/nwfilter nwfilterxml_DATA = $(NWFILTER_XML_FILES) -libvirt_driver_nwfilter_la_SOURCES = -libvirt_driver_nwfilter_la_LIBADD = \ - libvirt_driver_nwfilter_impl.la \ - libvirt.la -mod_LTLIBRARIES += libvirt_driver_nwfilter.la -libvirt_driver_nwfilter_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) - sbin_PROGRAMS += virtnwfilterd nodist_conf_DATA += nwfilter/virtnwfilterd.conf diff --git a/src/nwfilter/meson.build b/src/nwfilter/meson.build index fe792058b94..8da853c3ecb 100644 --- a/src/nwfilter/meson.build +++ b/src/nwfilter/meson.build @@ -23,4 +23,14 @@ if conf.has('WITH_NWFILTER') conf_inc_dir, ], ) + + virt_modules += { + 'name': 'virt_driver_nwfilter', + 'link_whole': [ + nwfilter_driver_impl, + ], + 'link_args': [ + libvirt_no_undefined, + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/Makefile.inc.am | 13 ------------- src/qemu/meson.build | 13 +++++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am index 3d703d15d33..f2b5e3a77f6 100644 --- a/src/qemu/Makefile.inc.am +++ b/src/qemu/Makefile.inc.am @@ -4,19 +4,6 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES)) if WITH_QEMU -libvirt_driver_qemu_la_SOURCES = -libvirt_driver_qemu_la_LIBADD = \ - libvirt_driver_qemu_impl.la \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -mod_LTLIBRARIES += libvirt_driver_qemu.la -libvirt_driver_qemu_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) - -if WITH_DTRACE_PROBES -libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.lo -endif WITH_DTRACE_PROBES - sbin_PROGRAMS += virtqemud nodist_conf_DATA += qemu/virtqemud.conf diff --git a/src/qemu/meson.build b/src/qemu/meson.build index 14b700558df..209cb5f4956 100644 --- a/src/qemu/meson.build +++ b/src/qemu/meson.build @@ -92,4 +92,17 @@ if conf.has('WITH_QEMU') hypervisor_inc_dir, ], ) + + virt_modules += { + 'name': 'virt_driver_qemu', + 'sources': [ + qemu_dtrace_gen_objects, + ], + 'link_whole': [ + qemu_driver_impl, + ], + 'link_args': [ + libvirt_no_undefined, + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/meson.build | 1 + src/secret/Makefile.inc.am | 21 --------------------- src/secret/meson.build | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 21 deletions(-) create mode 100644 src/secret/meson.build diff --git a/src/meson.build b/src/meson.build index 92f80b5838b..13f231f4345 100644 --- a/src/meson.build +++ b/src/meson.build @@ -160,6 +160,7 @@ subdir('logging') subdir('network') subdir('node_device') subdir('nwfilter') +subdir('secret') subdir('security') subdir('storage') diff --git a/src/secret/Makefile.inc.am b/src/secret/Makefile.inc.am index 586e6e372fd..e47aa678a6c 100644 --- a/src/secret/Makefile.inc.am +++ b/src/secret/Makefile.inc.am @@ -1,31 +1,10 @@ # vim: filetype=automake -SECRET_DRIVER_SOURCES = \ - secret/secret_driver.h \ - secret/secret_driver.c \ - $(NULL) - - DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(SECRET_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(SECRET_DRIVER_SOURCES)) - if WITH_SECRETS -mod_LTLIBRARIES += libvirt_driver_secret.la -libvirt_driver_secret_la_CFLAGS = \ - -I$(srcdir)/access \ - -I$(builddir)/access \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_driver_secret_la_LIBADD = \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -libvirt_driver_secret_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) -libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES) - sbin_PROGRAMS += virtsecretd nodist_conf_DATA += secret/virtsecretd.conf diff --git a/src/secret/meson.build b/src/secret/meson.build new file mode 100644 index 00000000000..a6d0a321938 --- /dev/null +++ b/src/secret/meson.build @@ -0,0 +1,18 @@ +secret_driver_sources = [ + 'secret_driver.c', +] + +if conf.has('WITH_SECRETS') + virt_modules += { + 'name': 'virt_driver_secret', + 'sources': [ + files(secret_driver_sources), + ], + 'deps': [ + access_dep, + ], + 'link_args': [ + libvirt_no_undefined, + ], + } +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/vbox/Makefile.inc.am | 10 ---------- src/vbox/meson.build | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/vbox/Makefile.inc.am b/src/vbox/Makefile.inc.am index 19ffff223b1..e61c3df40d6 100644 --- a/src/vbox/Makefile.inc.am +++ b/src/vbox/Makefile.inc.am @@ -6,16 +6,6 @@ DRIVER_SOURCE_FILES += \ $(NULL) if WITH_VBOX -noinst_LTLIBRARIES += libvirt_driver_vbox_impl.la -libvirt_driver_vbox_la_SOURCES = -libvirt_driver_vbox_la_LIBADD = \ - libvirt_driver_vbox_impl.la \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -mod_LTLIBRARIES += libvirt_driver_vbox.la -libvirt_driver_vbox_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) - sbin_PROGRAMS += virtvboxd nodist_conf_DATA += vbox/virtvboxd.conf diff --git a/src/vbox/meson.build b/src/vbox/meson.build index c27f9418249..5af671c00cb 100644 --- a/src/vbox/meson.build +++ b/src/vbox/meson.build @@ -28,4 +28,14 @@ if conf.has('WITH_VBOX') conf_inc_dir, ], ) + + virt_modules += { + 'name': 'virt_driver_vbox', + 'link_whole': [ + vbox_driver_impl, + ], + 'link_args': [ + libvirt_no_undefined, + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/vz/Makefile.inc.am | 9 --------- src/vz/meson.build | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/vz/Makefile.inc.am b/src/vz/Makefile.inc.am index d5d19a6f2ea..f55d03d400a 100644 --- a/src/vz/Makefile.inc.am +++ b/src/vz/Makefile.inc.am @@ -5,15 +5,6 @@ STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(VZ_DRIVER_SOURCES)) if WITH_VZ -libvirt_driver_vz_la_SOURCES = -libvirt_driver_vz_la_LIBADD = \ - libvirt_driver_vz_impl.la \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -mod_LTLIBRARIES += libvirt_driver_vz.la -libvirt_driver_vz_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) - sbin_PROGRAMS += virtvzd nodist_conf_DATA += vz/virtvzd.conf diff --git a/src/vz/meson.build b/src/vz/meson.build index 1f0c04bb8f2..41cce92de2f 100644 --- a/src/vz/meson.build +++ b/src/vz/meson.build @@ -20,4 +20,14 @@ if conf.has('WITH_VZ') conf_inc_dir, ], ) + + virt_modules += { + 'name': 'virt_driver_vz', + 'link_whole': [ + vz_driver_impl, + ], + 'link_args': [ + libvirt_no_undefined, + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/locking/Makefile.inc.am | 13 ------------- src/locking/meson.build | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index b8eac29d242..5b00f5a0c9e 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -38,23 +38,10 @@ OPENRC_INIT_FILES_IN += \ locking/virtlockd.init.in \ $(NULL) -lockdriverdir = $(libdir)/libvirt/lock-driver lockdriver_LTLIBRARIES = if WITH_LIBVIRTD -lockdriver_LTLIBRARIES += lockd.la -lockd_la_SOURCES = -lockd_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) -lockd_la_LIBADD = \ - libvirt.la \ - libvirt_lockd_impl.la \ - $(GLIB_LIBS) \ - $(XDR_LIBS) \ - $(NULL) augeas_DATA += locking/libvirt_lockd.aug -if WITH_DTRACE_PROBES -lockd_la_LIBADD += libvirt_probes.lo -endif WITH_DTRACE_PROBES if WITH_QEMU augeastest_DATA += locking/test_libvirt_lockd.aug diff --git a/src/locking/meson.build b/src/locking/meson.build index d8255d00f64..af4245ec37a 100644 --- a/src/locking/meson.build +++ b/src/locking/meson.build @@ -62,4 +62,21 @@ if conf.has('WITH_LIBVIRTD') xdr_dep, ], ) + + lockdriver_dir = libdir / 'libvirt' / 'lock-driver' + + virt_modules += { + 'name': 'lockd', + 'name_prefix': '', + 'sources': [ + dtrace_gen_objects, + ], + 'link_whole': [ + lockd_lib_impl, + ], + 'link_args': [ + libvirt_no_undefined, + ], + 'install_dir': lockdriver_dir, + } endif -- 2.26.2

On Thu, Jul 16, 2020 at 11:56:56 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/locking/Makefile.inc.am | 13 ------------- src/locking/meson.build | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 13 deletions(-)
[...]
diff --git a/src/locking/meson.build b/src/locking/meson.build index d8255d00f64..af4245ec37a 100644 --- a/src/locking/meson.build +++ b/src/locking/meson.build @@ -62,4 +62,21 @@ if conf.has('WITH_LIBVIRTD') xdr_dep, ], ) + + lockdriver_dir = libdir / 'libvirt' / 'lock-driver' + + virt_modules += { + 'name': 'lockd', + 'name_prefix': '',
Pre-existing, but weird that we don't have the 'libvirt' prefix.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/locking/Makefile.inc.am | 15 --------------- src/locking/meson.build | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index 5b00f5a0c9e..49cf0252162 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -1,8 +1,5 @@ # vim: filetype=automake -LOCK_DRIVER_SANLOCK_SOURCES = \ - locking/lock_driver_sanlock.c - LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \ locking/sanlock_helper.c @@ -38,8 +35,6 @@ OPENRC_INIT_FILES_IN += \ locking/virtlockd.init.in \ $(NULL) -lockdriver_LTLIBRARIES = - if WITH_LIBVIRTD augeas_DATA += locking/libvirt_lockd.aug @@ -89,16 +84,6 @@ virtlockd_CFLAGS += \ endif WITH_SASL if WITH_SANLOCK -lockdriver_LTLIBRARIES += sanlock.la -sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES) -sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS) -sanlock_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) -sanlock_la_LIBADD = \ - -lsanlock_client \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) - augeas_DATA += locking/libvirt_sanlock.aug if WITH_QEMU diff --git a/src/locking/meson.build b/src/locking/meson.build index af4245ec37a..4767ee9c869 100644 --- a/src/locking/meson.build +++ b/src/locking/meson.build @@ -30,6 +30,10 @@ lock_protocol_generated += custom_target( ], ) +sanlock_sources = [ + 'lock_driver_sanlock.c', +] + lock_driver_lib = static_library( 'virt_lock_driver', [ @@ -79,4 +83,21 @@ if conf.has('WITH_LIBVIRTD') ], 'install_dir': lockdriver_dir, } + + if conf.has('WITH_SANLOCK') + virt_modules += { + 'name': 'sanlock', + 'name_prefix': '', + 'sources': [ + files(sanlock_sources), + ], + 'deps': [ + sanlock_dep, + ], + 'link_args': [ + libvirt_no_undefined, + ], + 'install_dir': lockdriver_dir, + } + endif endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 1 - src/storage/Makefile.inc.am | 9 --------- src/storage/meson.build | 10 ++++++++++ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index a9fce0444ed..e309a96cbb3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -24,7 +24,6 @@ nodist_conf_DATA = DRIVER_SOURCE_FILES = STATEFUL_DRIVER_SOURCE_FILES = noinst_LTLIBRARIES = -mod_LTLIBRARIES = INSTALL_DATA_DIRS = INSTALL_DATA_LOCAL = UNINSTALL_LOCAL = diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index 87ba8c0bd16..c30743a1b48 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -86,15 +86,6 @@ storagefiledir = $(libdir)/libvirt/storage-file storagefile_LTLIBRARIES = if WITH_STORAGE -libvirt_driver_storage_la_SOURCES = -libvirt_driver_storage_la_LIBADD = \ - libvirt_driver_storage_impl.la \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -mod_LTLIBRARIES += libvirt_driver_storage.la -libvirt_driver_storage_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF) - sbin_PROGRAMS += virtstoraged nodist_conf_DATA += storage/virtstoraged.conf diff --git a/src/storage/meson.build b/src/storage/meson.build index 36ef45b10ab..675c8a2c827 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -24,4 +24,14 @@ if conf.has('WITH_STORAGE') conf_inc_dir, ], ) + + virt_modules += { + 'name': 'virt_driver_storage', + 'link_whole': [ + storage_driver_impl_lib, + ], + 'link_args': [ + libvirt_no_undefined, + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/storage/Makefile.inc.am | 19 ------------------- src/storage/meson.build | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index c30743a1b48..15de3311c41 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -1,10 +1,5 @@ # vim: filetype=automake -STORAGE_DRIVER_FS_SOURCES = \ - storage/storage_backend_fs.h \ - storage/storage_backend_fs.c \ - $(NULL) - STORAGE_FILE_FS_SOURCES = \ storage/storage_file_fs.h \ storage/storage_file_fs.c \ @@ -79,7 +74,6 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(STORAGE_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(STORAGE_DRIVER_SOURCES)) -storagebackenddir = $(libdir)/libvirt/storage-backend storagebackend_LTLIBRARIES = storagefiledir = $(libdir)/libvirt/storage-file @@ -163,19 +157,6 @@ storage/test_virtstoraged.aug: remote/test_libvirtd.aug.in \ > $@ || rm -f $@ -libvirt_storage_backend_fs_la_SOURCES = $(STORAGE_DRIVER_FS_SOURCES) -libvirt_storage_backend_fs_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) - -storagebackend_LTLIBRARIES += libvirt_storage_backend_fs.la -libvirt_storage_backend_fs_la_LDFLAGS = $(AM_LDFLAGS_MOD) -libvirt_storage_backend_fs_la_LIBADD = \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) - libvirt_storage_file_fs_la_SOURCES = $(STORAGE_FILE_FS_SOURCES) libvirt_storage_file_fs_la_CFLAGS = \ -I$(srcdir)/conf \ diff --git a/src/storage/meson.build b/src/storage/meson.build index 675c8a2c827..cad3654135c 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -8,6 +8,12 @@ storage_driver_sources = [ storage_driver_backend_sources, ] +storage_backend_fs_sources = [ + 'storage_backend_fs.c', +] + +storage_backend_install_dir = libdir / 'libvirt' / 'storage-backend' + if conf.has('WITH_STORAGE') storage_driver_impl_lib = static_library( 'virt_storage_driver_impl', @@ -34,4 +40,12 @@ if conf.has('WITH_STORAGE') libvirt_no_undefined, ], } + + virt_modules += { + 'name': 'virt_storage_backend_fs', + 'sources': [ + files(storage_backend_fs_sources), + ], + 'install_dir': storage_backend_install_dir, + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/storage/Makefile.inc.am | 18 ------------------ src/storage/meson.build | 13 +++++++++++++ 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index 15de3311c41..404a870d357 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -1,10 +1,5 @@ # vim: filetype=automake -STORAGE_FILE_FS_SOURCES = \ - storage/storage_file_fs.h \ - storage/storage_file_fs.c \ - $(NULL) - STORAGE_DRIVER_LVM_SOURCES = \ storage/storage_backend_logical.h \ storage/storage_backend_logical.c \ @@ -76,7 +71,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ storagebackend_LTLIBRARIES = -storagefiledir = $(libdir)/libvirt/storage-file storagefile_LTLIBRARIES = if WITH_STORAGE @@ -157,18 +151,6 @@ storage/test_virtstoraged.aug: remote/test_libvirtd.aug.in \ > $@ || rm -f $@ -libvirt_storage_file_fs_la_SOURCES = $(STORAGE_FILE_FS_SOURCES) -libvirt_storage_file_fs_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) - -storagefile_LTLIBRARIES += libvirt_storage_file_fs.la -libvirt_storage_file_fs_la_LDFLAGS = $(AM_LDFLAGS_MOD) -libvirt_storage_file_fs_la_LIBADD = \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) endif WITH_STORAGE if WITH_STORAGE_LVM diff --git a/src/storage/meson.build b/src/storage/meson.build index cad3654135c..a44bfaabac6 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -12,7 +12,12 @@ storage_backend_fs_sources = [ 'storage_backend_fs.c', ] +stoarge_file_fs_sources = [ + 'storage_file_fs.c', +] + storage_backend_install_dir = libdir / 'libvirt' / 'storage-backend' +storage_file_install_dir = libdir / 'libvirt' / 'storage-file' if conf.has('WITH_STORAGE') storage_driver_impl_lib = static_library( @@ -48,4 +53,12 @@ if conf.has('WITH_STORAGE') ], 'install_dir': storage_backend_install_dir, } + + virt_modules += { + 'name': 'virt_storage_file_fs', + 'sources': [ + files(stoarge_file_fs_sources), + ], + 'install_dir': storage_file_install_dir, + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/storage/Makefile.inc.am | 20 -------------------- src/storage/meson.build | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index 404a870d357..17a2d975cb5 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -1,10 +1,5 @@ # vim: filetype=automake -STORAGE_DRIVER_LVM_SOURCES = \ - storage/storage_backend_logical.h \ - storage/storage_backend_logical.c \ - $(NULL) - STORAGE_DRIVER_ISCSI_SOURCES = \ storage/storage_backend_iscsi.h \ storage/storage_backend_iscsi.c \ @@ -153,21 +148,6 @@ storage/test_virtstoraged.aug: remote/test_libvirtd.aug.in \ endif WITH_STORAGE -if WITH_STORAGE_LVM -libvirt_storage_backend_logical_la_SOURCES = $(STORAGE_DRIVER_LVM_SOURCES) -libvirt_storage_backend_logical_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) - -storagebackend_LTLIBRARIES += libvirt_storage_backend_logical.la -libvirt_storage_backend_logical_la_LDFLAGS = $(AM_LDFLAGS_MOD) -libvirt_storage_backend_logical_la_LIBADD = \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -endif WITH_STORAGE_LVM - if WITH_STORAGE_ISCSI libvirt_storage_backend_iscsi_la_SOURCES = $(STORAGE_DRIVER_ISCSI_SOURCES) libvirt_storage_backend_iscsi_la_CFLAGS = \ diff --git a/src/storage/meson.build b/src/storage/meson.build index a44bfaabac6..8ac52f059ed 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -16,6 +16,10 @@ stoarge_file_fs_sources = [ 'storage_file_fs.c', ] +storage_lvm_backend_sources = [ + 'storage_backend_logical.c', +] + storage_backend_install_dir = libdir / 'libvirt' / 'storage-backend' storage_file_install_dir = libdir / 'libvirt' / 'storage-file' @@ -62,3 +66,13 @@ if conf.has('WITH_STORAGE') 'install_dir': storage_file_install_dir, } endif + +if conf.has('WITH_STORAGE_LVM') + virt_modules += { + 'name': 'virt_storage_backend_logical', + 'sources': [ + files(storage_lvm_backend_sources), + ], + 'install_dir': storage_backend_install_dir, + } +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/storage/Makefile.inc.am | 20 -------------------- src/storage/meson.build | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index 17a2d975cb5..78c2e0d3bf4 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -1,10 +1,5 @@ # vim: filetype=automake -STORAGE_DRIVER_ISCSI_SOURCES = \ - storage/storage_backend_iscsi.h \ - storage/storage_backend_iscsi.c \ - $(NULL) - STORAGE_DRIVER_ISCSI_DIRECT_SOURCES = \ storage/storage_backend_iscsi_direct.h \ storage/storage_backend_iscsi_direct.c \ @@ -148,21 +143,6 @@ storage/test_virtstoraged.aug: remote/test_libvirtd.aug.in \ endif WITH_STORAGE -if WITH_STORAGE_ISCSI -libvirt_storage_backend_iscsi_la_SOURCES = $(STORAGE_DRIVER_ISCSI_SOURCES) -libvirt_storage_backend_iscsi_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) - -storagebackend_LTLIBRARIES += libvirt_storage_backend_iscsi.la -libvirt_storage_backend_iscsi_la_LDFLAGS = $(AM_LDFLAGS_MOD) -libvirt_storage_backend_iscsi_la_LIBADD = \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -endif WITH_STORAGE_ISCSI - if WITH_STORAGE_ISCSI_DIRECT libvirt_storage_backend_iscsi_direct_la_SOURCES = \ $(STORAGE_DRIVER_ISCSI_DIRECT_SOURCES) diff --git a/src/storage/meson.build b/src/storage/meson.build index 8ac52f059ed..0b0f3af3054 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -16,6 +16,10 @@ stoarge_file_fs_sources = [ 'storage_file_fs.c', ] +storage_backend_iscsi_sources = [ + 'storage_backend_iscsi.c', +] + storage_lvm_backend_sources = [ 'storage_backend_logical.c', ] @@ -67,6 +71,16 @@ if conf.has('WITH_STORAGE') } endif +if conf.has('WITH_STORAGE_ISCSI') + virt_modules += { + 'name': 'virt_storage_backend_iscsi', + 'sources': [ + files(storage_backend_iscsi_sources), + ], + 'install_dir': storage_backend_install_dir, + } +endif + if conf.has('WITH_STORAGE_LVM') virt_modules += { 'name': 'virt_storage_backend_logical', -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/storage/Makefile.inc.am | 23 ----------------------- src/storage/meson.build | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index 78c2e0d3bf4..47843cc5d48 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -1,10 +1,5 @@ # vim: filetype=automake -STORAGE_DRIVER_ISCSI_DIRECT_SOURCES = \ - storage/storage_backend_iscsi_direct.h \ - storage/storage_backend_iscsi_direct.c \ - $(NULL) - STORAGE_DRIVER_SCSI_SOURCES = \ storage/storage_backend_scsi.h \ storage/storage_backend_scsi.c \ @@ -143,24 +138,6 @@ storage/test_virtstoraged.aug: remote/test_libvirtd.aug.in \ endif WITH_STORAGE -if WITH_STORAGE_ISCSI_DIRECT -libvirt_storage_backend_iscsi_direct_la_SOURCES = \ - $(STORAGE_DRIVER_ISCSI_DIRECT_SOURCES) -libvirt_storage_backend_iscsi_direct_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(LIBISCSI_CFLAGS) \ - $(AM_CFLAGS) \ - $(NULL) - -storagebackend_LTLIBRARIES += libvirt_storage_backend_iscsi-direct.la -libvirt_storage_backend_iscsi_direct_la_LDFLAGS = $(AM_LDFLAGS_MOD) -libvirt_storage_backend_iscsi_direct_la_LIBADD = \ - libvirt.la \ - $(GLIB_LIBS) \ - $(LIBISCSI_LIBS) \ - $(NULL) -endif WITH_STORAGE_ISCSI_DIRECT - if WITH_STORAGE_SCSI libvirt_storage_backend_scsi_la_SOURCES = $(STORAGE_DRIVER_SCSI_SOURCES) libvirt_storage_backend_scsi_la_CFLAGS = \ diff --git a/src/storage/meson.build b/src/storage/meson.build index 0b0f3af3054..05b3131215c 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -20,6 +20,10 @@ storage_backend_iscsi_sources = [ 'storage_backend_iscsi.c', ] +storage_backend_iscsi_direct_sources = [ + 'storage_backend_iscsi_direct.c', +] + storage_lvm_backend_sources = [ 'storage_backend_logical.c', ] @@ -81,6 +85,19 @@ if conf.has('WITH_STORAGE_ISCSI') } endif +if conf.has('WITH_STORAGE_ISCSI_DIRECT') + virt_modules += { + 'name': 'virt_storage_backend_iscsi-direct', + 'sources': [ + files(storage_backend_iscsi_direct_sources), + ], + 'deps': [ + libiscsi_dep + ], + 'install_dir': storage_backend_install_dir, + } +endif + if conf.has('WITH_STORAGE_LVM') virt_modules += { 'name': 'virt_storage_backend_logical', -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/storage/Makefile.inc.am | 20 -------------------- src/storage/meson.build | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index 47843cc5d48..c502f7006b2 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -1,10 +1,5 @@ # vim: filetype=automake -STORAGE_DRIVER_SCSI_SOURCES = \ - storage/storage_backend_scsi.h \ - storage/storage_backend_scsi.c \ - $(NULL) - STORAGE_DRIVER_MPATH_SOURCES = \ storage/storage_backend_mpath.h \ storage/storage_backend_mpath.c \ @@ -138,21 +133,6 @@ storage/test_virtstoraged.aug: remote/test_libvirtd.aug.in \ endif WITH_STORAGE -if WITH_STORAGE_SCSI -libvirt_storage_backend_scsi_la_SOURCES = $(STORAGE_DRIVER_SCSI_SOURCES) -libvirt_storage_backend_scsi_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) - -storagebackend_LTLIBRARIES += libvirt_storage_backend_scsi.la -libvirt_storage_backend_scsi_la_LDFLAGS = $(AM_LDFLAGS_MOD) -libvirt_storage_backend_scsi_la_LIBADD = \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -endif WITH_STORAGE_SCSI - if WITH_STORAGE_MPATH libvirt_storage_backend_mpath_la_SOURCES = $(STORAGE_DRIVER_MPATH_SOURCES) libvirt_storage_backend_mpath_la_LIBADD = \ diff --git a/src/storage/meson.build b/src/storage/meson.build index 05b3131215c..3ae4ab998ba 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -28,6 +28,10 @@ storage_lvm_backend_sources = [ 'storage_backend_logical.c', ] +storage_backend_scsi_sources = [ + 'storage_backend_scsi.c', +] + storage_backend_install_dir = libdir / 'libvirt' / 'storage-backend' storage_file_install_dir = libdir / 'libvirt' / 'storage-file' @@ -107,3 +111,13 @@ if conf.has('WITH_STORAGE_LVM') 'install_dir': storage_backend_install_dir, } endif + +if conf.has('WITH_STORAGE_SCSI') + virt_modules += { + 'name': 'virt_storage_backend_scsi', + 'sources': [ + files(storage_backend_scsi_sources), + ], + 'install_dir': storage_backend_install_dir, + } +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/storage/Makefile.inc.am | 22 ---------------------- src/storage/meson.build | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index c502f7006b2..cc2d1743f83 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -1,10 +1,5 @@ # vim: filetype=automake -STORAGE_DRIVER_MPATH_SOURCES = \ - storage/storage_backend_mpath.h \ - storage/storage_backend_mpath.c \ - $(NULL) - STORAGE_DRIVER_DISK_SOURCES = \ storage/storage_backend_disk.h \ storage/storage_backend_disk.c \ @@ -133,23 +128,6 @@ storage/test_virtstoraged.aug: remote/test_libvirtd.aug.in \ endif WITH_STORAGE -if WITH_STORAGE_MPATH -libvirt_storage_backend_mpath_la_SOURCES = $(STORAGE_DRIVER_MPATH_SOURCES) -libvirt_storage_backend_mpath_la_LIBADD = \ - libvirt.la \ - $(DEVMAPPER_LIBS) \ - $(GLIB_LIBS) \ - $(NULL) -libvirt_storage_backend_mpath_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(DEVMAPPER_CFLAGS) \ - $(AM_CFLAGS) \ - $(NULL) - -storagebackend_LTLIBRARIES += libvirt_storage_backend_mpath.la -libvirt_storage_backend_mpath_la_LDFLAGS = $(AM_LDFLAGS_MOD) -endif WITH_STORAGE_MPATH - if WITH_STORAGE_DISK libvirt_storage_backend_disk_la_SOURCES = $(STORAGE_DRIVER_DISK_SOURCES) libvirt_storage_backend_disk_la_CFLAGS = \ diff --git a/src/storage/meson.build b/src/storage/meson.build index 3ae4ab998ba..67b4fd4281f 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -28,6 +28,10 @@ storage_lvm_backend_sources = [ 'storage_backend_logical.c', ] +storage_backend_mpath_sources = [ + 'storage_backend_mpath.c', +] + storage_backend_scsi_sources = [ 'storage_backend_scsi.c', ] @@ -112,6 +116,19 @@ if conf.has('WITH_STORAGE_LVM') } endif +if conf.has('WITH_STORAGE_MPATH') + virt_modules += { + 'name': 'virt_storage_backend_mpath', + 'sources': [ + files(storage_backend_mpath_sources), + ], + 'deps': [ + devmapper_dep + ], + 'install_dir': storage_backend_install_dir, + } +endif + if conf.has('WITH_STORAGE_SCSI') virt_modules += { 'name': 'virt_storage_backend_scsi', -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/storage/Makefile.inc.am | 20 -------------------- src/storage/meson.build | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index cc2d1743f83..4c60bc7bd2f 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -1,10 +1,5 @@ # vim: filetype=automake -STORAGE_DRIVER_DISK_SOURCES = \ - storage/storage_backend_disk.h \ - storage/storage_backend_disk.c \ - $(NULL) - STORAGE_DRIVER_RBD_SOURCES = \ storage/storage_backend_rbd.h \ storage/storage_backend_rbd.c \ @@ -128,21 +123,6 @@ storage/test_virtstoraged.aug: remote/test_libvirtd.aug.in \ endif WITH_STORAGE -if WITH_STORAGE_DISK -libvirt_storage_backend_disk_la_SOURCES = $(STORAGE_DRIVER_DISK_SOURCES) -libvirt_storage_backend_disk_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) - -storagebackend_LTLIBRARIES += libvirt_storage_backend_disk.la -libvirt_storage_backend_disk_la_LDFLAGS = $(AM_LDFLAGS_MOD) -libvirt_storage_backend_disk_la_LIBADD = \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -endif WITH_STORAGE_DISK - if WITH_STORAGE_RBD libvirt_storage_backend_rbd_la_SOURCES = $(STORAGE_DRIVER_RBD_SOURCES) libvirt_storage_backend_rbd_la_LIBADD = \ diff --git a/src/storage/meson.build b/src/storage/meson.build index 67b4fd4281f..8087bd45648 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -16,6 +16,10 @@ stoarge_file_fs_sources = [ 'storage_file_fs.c', ] +storage_backend_disk_sources = [ + 'storage_backend_disk.c', +] + storage_backend_iscsi_sources = [ 'storage_backend_iscsi.c', ] @@ -83,6 +87,16 @@ if conf.has('WITH_STORAGE') } endif +if conf.has('WITH_STORAGE_DISK') + virt_modules += { + 'name': 'virt_storage_backend_disk', + 'sources': [ + files(storage_backend_disk_sources), + ], + 'install_dir': storage_backend_install_dir, + } +endif + if conf.has('WITH_STORAGE_ISCSI') virt_modules += { 'name': 'virt_storage_backend_iscsi', -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/storage/Makefile.inc.am | 21 --------------------- src/storage/meson.build | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index 4c60bc7bd2f..b52a9e79e63 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -1,10 +1,5 @@ # vim: filetype=automake -STORAGE_DRIVER_RBD_SOURCES = \ - storage/storage_backend_rbd.h \ - storage/storage_backend_rbd.c \ - $(NULL) - STORAGE_DRIVER_SHEEPDOG_SOURCES = \ storage/storage_backend_sheepdog.h \ storage/storage_backend_sheepdog.c \ @@ -123,22 +118,6 @@ storage/test_virtstoraged.aug: remote/test_libvirtd.aug.in \ endif WITH_STORAGE -if WITH_STORAGE_RBD -libvirt_storage_backend_rbd_la_SOURCES = $(STORAGE_DRIVER_RBD_SOURCES) -libvirt_storage_backend_rbd_la_LIBADD = \ - libvirt.la \ - $(LIBRBD_LIBS) \ - $(GLIB_LIBS) \ - $(NULL) -libvirt_storage_backend_rbd_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) - -storagebackend_LTLIBRARIES += libvirt_storage_backend_rbd.la -libvirt_storage_backend_rbd_la_LDFLAGS = $(AM_LDFLAGS_MOD) -endif WITH_STORAGE_RBD - if WITH_STORAGE_SHEEPDOG libvirt_storage_backend_sheepdog_la_SOURCES = \ $(STORAGE_DRIVER_SHEEPDOG_SOURCES) diff --git a/src/storage/meson.build b/src/storage/meson.build index 8087bd45648..3663b530d69 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -36,6 +36,10 @@ storage_backend_mpath_sources = [ 'storage_backend_mpath.c', ] +storage_backend_rbd_sources = [ + 'storage_backend_rbd.c', +] + storage_backend_scsi_sources = [ 'storage_backend_scsi.c', ] @@ -143,6 +147,19 @@ if conf.has('WITH_STORAGE_MPATH') } endif +if conf.has('WITH_STORAGE_RBD') + virt_modules += { + 'name': 'virt_storage_backend_rbd', + 'sources': [ + files(storage_backend_rbd_sources), + ], + 'deps': [ + rbd_dep + ], + 'install_dir': storage_backend_install_dir, + } +endif + if conf.has('WITH_STORAGE_SCSI') virt_modules += { 'name': 'virt_storage_backend_scsi', -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 1 - src/storage/Makefile.inc.am | 30 ------------------------------ src/storage/meson.build | 25 +++++++++++++++++++++++++ 3 files changed, 25 insertions(+), 31 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index e309a96cbb3..ec6da9a6ff5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -23,7 +23,6 @@ nodist_conf_DATA = DRIVER_SOURCE_FILES = STATEFUL_DRIVER_SOURCE_FILES = -noinst_LTLIBRARIES = INSTALL_DATA_DIRS = INSTALL_DATA_LOCAL = UNINSTALL_LOCAL = diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index b52a9e79e63..ebb700eb160 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -1,11 +1,5 @@ # vim: filetype=automake -STORAGE_DRIVER_SHEEPDOG_SOURCES = \ - storage/storage_backend_sheepdog.h \ - storage/storage_backend_sheepdog.c \ - storage/storage_backend_sheepdog_priv.h \ - $(NULL) - STORAGE_DRIVER_GLUSTER_SOURCES = \ storage/storage_backend_gluster.h \ storage/storage_backend_gluster.c \ @@ -118,30 +112,6 @@ storage/test_virtstoraged.aug: remote/test_libvirtd.aug.in \ endif WITH_STORAGE -if WITH_STORAGE_SHEEPDOG -libvirt_storage_backend_sheepdog_la_SOURCES = \ - $(STORAGE_DRIVER_SHEEPDOG_SOURCES) -libvirt_storage_backend_sheepdog_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) - -libvirt_storage_backend_sheepdog_priv_la_SOURCES = \ - $(STORAGE_DRIVER_SHEEPDOG_SOURCES) -libvirt_storage_backend_sheepdog_priv_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) -noinst_LTLIBRARIES += libvirt_storage_backend_sheepdog_priv.la - -storagebackend_LTLIBRARIES += libvirt_storage_backend_sheepdog.la -libvirt_storage_backend_sheepdog_la_LDFLAGS = $(AM_LDFLAGS_MOD) -libvirt_storage_backend_sheepdog_la_LIBADD = \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -endif WITH_STORAGE_SHEEPDOG - if WITH_STORAGE_GLUSTER libvirt_storage_backend_gluster_la_SOURCES = \ $(STORAGE_DRIVER_GLUSTER_SOURCES) diff --git a/src/storage/meson.build b/src/storage/meson.build index 3663b530d69..ae36f3e829e 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -44,6 +44,10 @@ storage_backend_scsi_sources = [ 'storage_backend_scsi.c', ] +storage_backend_sheepdog_sources = [ + 'storage_backend_sheepdog.c', +] + storage_backend_install_dir = libdir / 'libvirt' / 'storage-backend' storage_file_install_dir = libdir / 'libvirt' / 'storage-file' @@ -169,3 +173,24 @@ if conf.has('WITH_STORAGE_SCSI') 'install_dir': storage_backend_install_dir, } endif + +if conf.has('WITH_STORAGE_SHEEPDOG') + storage_backend_sheepdog_priv_lib = static_library( + 'virt_storage_backend_sheepdog_priv', + storage_backend_sheepdog_sources, + dependencies: [ + src_dep, + ], + include_directories: [ + conf_inc_dir, + ], + ) + + virt_modules += { + 'name': 'virt_storage_backend_sheepdog', + 'link_whole': [ + storage_backend_sheepdog_priv_lib, + ], + 'install_dir': storage_backend_install_dir, + } +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/storage/Makefile.inc.am | 47 ------------------------------------- src/storage/meson.build | 32 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 47 deletions(-) diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index ebb700eb160..041a9e12122 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -1,15 +1,5 @@ # vim: filetype=automake -STORAGE_DRIVER_GLUSTER_SOURCES = \ - storage/storage_backend_gluster.h \ - storage/storage_backend_gluster.c \ - $(NULL) - -STORAGE_FILE_GLUSTER_SOURCES = \ - storage/storage_file_gluster.h \ - storage/storage_file_gluster.c \ - $(NULL) - STORAGE_DRIVER_ZFS_SOURCES = \ storage/storage_backend_zfs.h \ storage/storage_backend_zfs.c \ @@ -30,8 +20,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ storagebackend_LTLIBRARIES = -storagefile_LTLIBRARIES = - if WITH_STORAGE sbin_PROGRAMS += virtstoraged @@ -112,41 +100,6 @@ storage/test_virtstoraged.aug: remote/test_libvirtd.aug.in \ endif WITH_STORAGE -if WITH_STORAGE_GLUSTER -libvirt_storage_backend_gluster_la_SOURCES = \ - $(STORAGE_DRIVER_GLUSTER_SOURCES) -libvirt_storage_backend_gluster_la_LIBADD = \ - libvirt.la \ - $(GLUSTERFS_LIBS) \ - $(GLIB_LIBS) \ - $(NULL) -libvirt_storage_backend_gluster_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(GLUSTERFS_CFLAGS) \ - $(AM_CFLAGS) \ - $(NULL) - -storagebackend_LTLIBRARIES += libvirt_storage_backend_gluster.la -libvirt_storage_backend_gluster_la_LDFLAGS = $(AM_LDFLAGS_MOD) - - -libvirt_storage_file_gluster_la_SOURCES = \ - $(STORAGE_FILE_GLUSTER_SOURCES) -libvirt_storage_file_gluster_la_LIBADD = \ - libvirt.la \ - $(GLUSTERFS_LIBS) \ - $(GLIB_LIBS) \ - $(NULL) -libvirt_storage_file_gluster_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(GLUSTERFS_CFLAGS) \ - $(AM_CFLAGS) \ - $(NULL) - -storagefile_LTLIBRARIES += libvirt_storage_file_gluster.la -libvirt_storage_file_gluster_la_LDFLAGS = $(AM_LDFLAGS_MOD) -endif WITH_STORAGE_GLUSTER - if WITH_STORAGE_ZFS libvirt_storage_backend_zfs_la_SOURCES = \ $(STORAGE_DRIVER_ZFS_SOURCES) diff --git a/src/storage/meson.build b/src/storage/meson.build index ae36f3e829e..c97a1b86eff 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -20,6 +20,14 @@ storage_backend_disk_sources = [ 'storage_backend_disk.c', ] +storage_backend_gluster_sources = [ + 'storage_backend_gluster.c', +] + +storage_file_gluster_sources = [ + 'storage_file_gluster.c', +] + storage_backend_iscsi_sources = [ 'storage_backend_iscsi.c', ] @@ -105,6 +113,30 @@ if conf.has('WITH_STORAGE_DISK') } endif +if conf.has('WITH_STORAGE_GLUSTER') + virt_modules += { + 'name': 'virt_storage_backend_gluster', + 'sources': [ + files(storage_backend_gluster_sources), + ], + 'deps': [ + glusterfs_dep, + ], + 'install_dir': storage_backend_install_dir, + } + + virt_modules += { + 'name': 'virt_storage_file_gluster', + 'sources': [ + files(storage_file_gluster_sources), + ], + 'dependenciec': [ + glusterfs_dep, + ], + 'install_dir': storage_file_install_dir, + } +endif + if conf.has('WITH_STORAGE_ISCSI') virt_modules += { 'name': 'virt_storage_backend_iscsi', -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/storage/Makefile.inc.am | 21 --------------------- src/storage/meson.build | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index 041a9e12122..94a471eb0c0 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -1,10 +1,5 @@ # vim: filetype=automake -STORAGE_DRIVER_ZFS_SOURCES = \ - storage/storage_backend_zfs.h \ - storage/storage_backend_zfs.c \ - $(NULL) - STORAGE_DRIVER_VSTORAGE_SOURCES = \ storage/storage_backend_vstorage.h \ storage/storage_backend_vstorage.c \ @@ -100,22 +95,6 @@ storage/test_virtstoraged.aug: remote/test_libvirtd.aug.in \ endif WITH_STORAGE -if WITH_STORAGE_ZFS -libvirt_storage_backend_zfs_la_SOURCES = \ - $(STORAGE_DRIVER_ZFS_SOURCES) -libvirt_storage_backend_zfs_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) - -storagebackend_LTLIBRARIES += libvirt_storage_backend_zfs.la -libvirt_storage_backend_zfs_la_LDFLAGS = $(AM_LDFLAGS_MOD) -libvirt_storage_backend_zfs_la_LIBADD = \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -endif WITH_STORAGE_ZFS - if WITH_STORAGE_VSTORAGE libvirt_storage_backend_vstorage_la_SOURCES = \ $(STORAGE_DRIVER_VSTORAGE_SOURCES) diff --git a/src/storage/meson.build b/src/storage/meson.build index c97a1b86eff..4450f1908f3 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -56,6 +56,10 @@ storage_backend_sheepdog_sources = [ 'storage_backend_sheepdog.c', ] +storage_backend_zfs_sources = [ + 'storage_backend_zfs.c', +] + storage_backend_install_dir = libdir / 'libvirt' / 'storage-backend' storage_file_install_dir = libdir / 'libvirt' / 'storage-file' @@ -226,3 +230,13 @@ if conf.has('WITH_STORAGE_SHEEPDOG') 'install_dir': storage_backend_install_dir, } endif + +if conf.has('WITH_STORAGE_ZFS') + virt_modules += { + 'name': 'virt_storage_backend_zfs', + 'sources': [ + files(storage_backend_zfs_sources), + ], + 'install_dir': storage_backend_install_dir, + } +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/storage/Makefile.inc.am | 23 ----------------------- src/storage/meson.build | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index 94a471eb0c0..45cbe476d22 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -1,10 +1,5 @@ # vim: filetype=automake -STORAGE_DRIVER_VSTORAGE_SOURCES = \ - storage/storage_backend_vstorage.h \ - storage/storage_backend_vstorage.c \ - $(NULL) - STORAGE_HELPER_DISK_SOURCES = \ storage/parthelper.c \ $(NULL) @@ -13,8 +8,6 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(STORAGE_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(STORAGE_DRIVER_SOURCES)) -storagebackend_LTLIBRARIES = - if WITH_STORAGE sbin_PROGRAMS += virtstoraged @@ -95,22 +88,6 @@ storage/test_virtstoraged.aug: remote/test_libvirtd.aug.in \ endif WITH_STORAGE -if WITH_STORAGE_VSTORAGE -libvirt_storage_backend_vstorage_la_SOURCES = \ - $(STORAGE_DRIVER_VSTORAGE_SOURCES) -libvirt_storage_backend_vstorage_la_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) - -storagebackend_LTLIBRARIES += libvirt_storage_backend_vstorage.la -libvirt_storage_backend_vstorage_la_LDFLAGS = $(AM_LDFLAGS_MOD) -libvirt_storage_backend_vstorage_la_LIBADD = \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -endif WITH_STORAGE_VSTORAGE - if WITH_STORAGE_DISK libexec_PROGRAMS += libvirt_parthelper diff --git a/src/storage/meson.build b/src/storage/meson.build index 4450f1908f3..baf5ae5b2fe 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -56,6 +56,10 @@ storage_backend_sheepdog_sources = [ 'storage_backend_sheepdog.c', ] +storage_backend_vstorage_sources = [ + 'storage_backend_vstorage.c', +] + storage_backend_zfs_sources = [ 'storage_backend_zfs.c', ] @@ -231,6 +235,16 @@ if conf.has('WITH_STORAGE_SHEEPDOG') } endif +if conf.has('WITH_STORAGE_VSTORAGE') + virt_modules += { + 'name': 'virt_storage_backend_vstorage', + 'sources': [ + files(storage_backend_vstorage_sources), + ], + 'install_dir': storage_backend_install_dir, + } +endif + if conf.has('WITH_STORAGE_ZFS') virt_modules += { 'name': 'virt_storage_backend_zfs', -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/remote/Makefile.inc.am | 45 -------------------------------------- src/remote/meson.build | 24 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 45 deletions(-) diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 421f7337217..9866903847e 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -1,22 +1,5 @@ # vim: filetype=automake -REMOTE_DAEMON_GENERATED = \ - remote/remote_daemon_dispatch_stubs.h \ - remote/lxc_daemon_dispatch_stubs.h \ - remote/qemu_daemon_dispatch_stubs.h \ - $(NULL) - -REMOTE_DAEMON_SOURCES = \ - remote/remote_daemon.c \ - remote/remote_daemon.h \ - remote/remote_daemon_config.c \ - remote/remote_daemon_config.h \ - remote/remote_daemon_dispatch.c \ - remote/remote_daemon_dispatch.h \ - remote/remote_daemon_stream.c \ - remote/remote_daemon_stream.h \ - $(NULL) - REMOTE_DAEMON_CFLAGS = \ $(AM_CFLAGS) \ $(GNUTLS_CFLAGS) \ @@ -118,15 +101,6 @@ OPENRC_CONF_FILES += \ remote/virtproxyd.confd \ $(NULL) -REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x -LXC_PROTOCOL = $(srcdir)/remote/lxc_protocol.x -QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x -REMOTE_DRIVER_PROTOCOL = \ - $(REMOTE_PROTOCOL) \ - $(QEMU_PROTOCOL) \ - $(LXC_PROTOCOL) \ - $(NULL) - if WITH_LIBVIRTD sbin_PROGRAMS += libvirtd virtproxyd @@ -362,22 +336,3 @@ virtproxy%.socket: remote/libvirt%.socket.in $(top_builddir)/config.status virt-guest-shutdown.target: remote/virt-guest-shutdown.target.in \ $(top_builddir)/config.status $(AM_V_GEN)cp $< $@ - - -remote/remote_daemon_dispatch_stubs.h: $(srcdir)/rpc/gendispatch.pl \ - $(REMOTE_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \ - --mode=server remote REMOTE $(REMOTE_PROTOCOL) \ - > remote/remote_daemon_dispatch_stubs.h - -remote/lxc_daemon_dispatch_stubs.h: $(srcdir)/rpc/gendispatch.pl \ - $(LXC_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \ - --mode=server lxc LXC $(LXC_PROTOCOL) \ - > remote/lxc_daemon_dispatch_stubs.h - -remote/qemu_daemon_dispatch_stubs.h: $(srcdir)/rpc/gendispatch.pl \ - $(QEMU_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \ - --mode=server qemu QEMU $(QEMU_PROTOCOL) \ - > remote/qemu_daemon_dispatch_stubs.h diff --git a/src/remote/meson.build b/src/remote/meson.build index 3de6c5ee1f4..1e3e3479c80 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -39,6 +39,30 @@ foreach name : [ 'remote', 'qemu', 'lxc' ] ) endforeach +remote_daemon_sources = files( + 'remote_daemon.c', + 'remote_daemon_config.c', + 'remote_daemon_dispatch.c', + 'remote_daemon_stream.c', +) + +remote_daemon_generated = [] + +foreach name : [ 'remote', 'qemu', 'lxc' ] + protocol_x = '@0@_protocol.x'.format(name) + dispatch_h = '@0@_daemon_dispatch_stubs.h'.format(name) + + remote_daemon_generated += custom_target( + dispatch_h, + input: protocol_x, + output: dispatch_h, + command: [ + gendispatch_prog, '--mode=server', name, name.to_upper(), '@INPUT@', + ], + capture: true, + ) +endforeach + if conf.has('WITH_REMOTE') remote_driver_lib = static_library( 'virt_remote_driver', -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/meson.build | 51 ++++++++++++++++++++++++++++++++++++++ src/remote/Makefile.inc.am | 41 ------------------------------ 2 files changed, 51 insertions(+), 41 deletions(-) diff --git a/src/meson.build b/src/meson.build index 13f231f4345..3774e2bb4ba 100644 --- a/src/meson.build +++ b/src/meson.build @@ -131,6 +131,14 @@ libvirt_libs = [] # * install_dir - installation directory (optional, default libdir / 'libvirt' / 'connection-driver' virt_modules = [] +# virt_daemons: +# each entry is a dictionary with following items: +# * name - binary name (rquired) +# * sources - binary sources (optional, default remote_daemon_sources) +# * c_args - compile arguments (optional, default []) +# * include = include_directories (optional, default []) +virt_daemons = [] + # list subdirectories @@ -458,3 +466,46 @@ foreach module : virt_modules ) set_variable('@0@_module'.format(module['name'].underscorify()), mod) endforeach + + +# build libvirt daemons + +foreach daemon : virt_daemons + bin = executable( + daemon['name'], + [ + daemon.get('sources', [ remote_daemon_sources, remote_daemon_generated ]), + dtrace_gen_objects, + ], + c_args: [ + daemon.get('c_args', []), + ], + include_directories: [ + conf_inc_dir, + remote_inc_dir, + daemon.get('include', []), + ], + dependencies: [ + access_dep, + dbus_dep, + gnutls_dep, + libnl_dep, + rpc_dep, + src_dep, + sasl_dep, + xdr_dep, + ], + link_with: [ + admin_driver_lib, + libvirt_lib, + libvirt_lxc_lib, + libvirt_qemu_lib, + ], + link_args: [ + libvirt_no_undefined, + ], + install: true, + install_dir: sbindir, + install_rpath: libdir, + ) +endforeach diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 9866903847e..eb281a4c4da 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -1,46 +1,5 @@ # vim: filetype=automake -REMOTE_DAEMON_CFLAGS = \ - $(AM_CFLAGS) \ - $(GNUTLS_CFLAGS) \ - $(SASL_CFLAGS) \ - $(XDR_CFLAGS) \ - $(DBUS_CFLAGS) \ - $(LIBNL_CFLAGS) \ - -I$(srcdir)/access \ - -I$(builddir)/access \ - -I$(srcdir)/conf \ - -I$(srcdir)/rpc \ - -I$(builddir)/rpc \ - -I$(builddir)/remote \ - $(NULL) - -REMOTE_DAEMON_LD_FLAGS = \ - $(AM_LDFLAGS) \ - $(NO_UNDEFINED_LDFLAGS) \ - $(NULL) - -REMOTE_DAEMON_LD_ADD = \ - libvirt_driver_admin.la \ - libvirt-lxc.la \ - libvirt-qemu.la \ - libvirt.la \ - $(LIBXML_LIBS) \ - $(GNUTLS_LIBS) \ - $(SASL_LIBS) \ - $(XDR_LIBS) \ - $(DBUS_LIBS) \ - $(LIBNL_LIBS) \ - $(NULL) - -if WITH_DTRACE_PROBES -REMOTE_DAEMON_LD_ADD += ../src/libvirt_probes.lo -endif WITH_DTRACE_PROBES - -REMOTE_DAEMON_LD_ADD += \ - $(GLIB_LIBS) \ - $(NULL) - LOGROTATE_FILES_IN += \ remote/libvirtd.qemu.logrotate.in \ remote/libvirtd.lxc.logrotate.in \ -- 2.26.2

On Thu, Jul 16, 2020 at 11:57:13 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/meson.build | 51 ++++++++++++++++++++++++++++++++++++++ src/remote/Makefile.inc.am | 41 ------------------------------ 2 files changed, 51 insertions(+), 41 deletions(-)
diff --git a/src/meson.build b/src/meson.build index 13f231f4345..3774e2bb4ba 100644 --- a/src/meson.build +++ b/src/meson.build @@ -131,6 +131,14 @@ libvirt_libs = [] # * install_dir - installation directory (optional, default libdir / 'libvirt' / 'connection-driver' virt_modules = []
+# virt_daemons: +# each entry is a dictionary with following items: +# * name - binary name (rquired)
required
+# * sources - binary sources (optional, default remote_daemon_sources)
I'd go with no default here, but I see it's used in many cases.
+# * c_args - compile arguments (optional, default []) +# * include = include_directories (optional, default []) +virt_daemons = [] +
# list subdirectories

On Fri, Jul 24, 2020 at 08:45:24AM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:57:13 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/meson.build | 51 ++++++++++++++++++++++++++++++++++++++ src/remote/Makefile.inc.am | 41 ------------------------------ 2 files changed, 51 insertions(+), 41 deletions(-)
diff --git a/src/meson.build b/src/meson.build index 13f231f4345..3774e2bb4ba 100644 --- a/src/meson.build +++ b/src/meson.build @@ -131,6 +131,14 @@ libvirt_libs = [] # * install_dir - installation directory (optional, default libdir / 'libvirt' / 'connection-driver' virt_modules = []
+# virt_daemons: +# each entry is a dictionary with following items: +# * name - binary name (rquired)
required
+# * sources - binary sources (optional, default remote_daemon_sources)
I'd go with no default here, but I see it's used in many cases.
The default is used for almost all daemons except for virtlockd and virtlogd where we use different sources. Otherwise the sources would not be required at all. Pavel

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/bhyve/Makefile.inc.am | 12 ------------ src/bhyve/meson.build | 8 ++++++++ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/bhyve/Makefile.inc.am b/src/bhyve/Makefile.inc.am index 40384e1c714..ab681685b2b 100644 --- a/src/bhyve/Makefile.inc.am +++ b/src/bhyve/Makefile.inc.am @@ -4,22 +4,10 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(BHYVE_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(BHYVE_DRIVER_SOURCES)) if WITH_BHYVE -sbin_PROGRAMS += virtbhyved - nodist_conf_DATA += bhyve/virtbhyved.conf augeas_DATA += bhyve/virtbhyved.aug augeastest_DATA += bhyve/test_virtbhyved.aug -virtbhyved_SOURCES = $(REMOTE_DAEMON_SOURCES) -nodist_virtbhyved_SOURCES = $(REMOTE_DAEMON_GENERATED) -virtbhyved_CFLAGS = \ - $(REMOTE_DAEMON_CFLAGS) \ - -DDAEMON_NAME="\"virtbhyved\"" \ - -DMODULE_NAME="\"bhyve\"" \ - $(NULL) -virtbhyved_LDFLAGS = $(REMOTE_DAEMON_LD_FLAGS) -virtbhyved_LDADD = $(REMOTE_DAEMON_LD_ADD) - bhyve/virtbhyved.conf: remote/libvirtd.conf.in $(AM_V_GEN)$(SED) \ -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ diff --git a/src/bhyve/meson.build b/src/bhyve/meson.build index 83d8c366635..5807d67591a 100644 --- a/src/bhyve/meson.build +++ b/src/bhyve/meson.build @@ -35,4 +35,12 @@ if conf.has('WITH_BHYVE') libvirt_no_undefined, ], } + + virt_daemons += { + 'name': 'virtbhyved', + 'c_args': [ + '-DDAEMON_NAME="virtbhyved"', + '-DMODULE_NAME="bhyve"' + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/interface/Makefile.inc.am | 11 ----------- src/interface/meson.build | 8 ++++++++ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/interface/Makefile.inc.am b/src/interface/Makefile.inc.am index 9a56e0b4e0f..7d1d8ed2c4c 100644 --- a/src/interface/Makefile.inc.am +++ b/src/interface/Makefile.inc.am @@ -5,22 +5,11 @@ STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(INTERFACE_DRIVER_SOURCES)) if WITH_INTERFACE -sbin_PROGRAMS += virtinterfaced nodist_conf_DATA += interface/virtinterfaced.conf augeas_DATA += interface/virtinterfaced.aug augeastest_DATA += interface/test_virtinterfaced.aug -virtinterfaced_SOURCES = $(REMOTE_DAEMON_SOURCES) -nodist_virtinterfaced_SOURCES = $(REMOTE_DAEMON_GENERATED) -virtinterfaced_CFLAGS = \ - $(REMOTE_DAEMON_CFLAGS) \ - -DDAEMON_NAME="\"virtinterfaced\"" \ - -DMODULE_NAME="\"interface\"" \ - $(NULL) -virtinterfaced_LDFLAGS = $(REMOTE_DAEMON_LD_FLAGS) -virtinterfaced_LDADD = $(REMOTE_DAEMON_LD_ADD) - SYSCONF_FILES += interface/virtinterfaced.sysconf SYSTEMD_UNIT_FILES += \ diff --git a/src/interface/meson.build b/src/interface/meson.build index bb08706f21c..dbf1d7ff606 100644 --- a/src/interface/meson.build +++ b/src/interface/meson.build @@ -26,4 +26,12 @@ if conf.has('WITH_INTERFACE') libvirt_no_undefined, ], } + + virt_daemons += { + 'name': 'virtinterfaced', + 'c_args': [ + '-DDAEMON_NAME="virtinterfaced"', + '-DMODULE_NAME="interface"', + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/libxl/Makefile.inc.am | 11 ----------- src/libxl/meson.build | 8 ++++++++ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/libxl/Makefile.inc.am b/src/libxl/Makefile.inc.am index 35e6b3bbcd9..051b6c55bd9 100644 --- a/src/libxl/Makefile.inc.am +++ b/src/libxl/Makefile.inc.am @@ -4,22 +4,11 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(LIBXL_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(LIBXL_DRIVER_SOURCES)) if WITH_LIBXL -sbin_PROGRAMS += virtxend nodist_conf_DATA += libxl/virtxend.conf augeas_DATA += libxl/virtxend.aug augeastest_DATA += libxl/test_virtxend.aug -virtxend_SOURCES = $(REMOTE_DAEMON_SOURCES) -nodist_virtxend_SOURCES = $(REMOTE_DAEMON_GENERATED) -virtxend_CFLAGS = \ - $(REMOTE_DAEMON_CFLAGS) \ - -DDAEMON_NAME="\"virtxend\"" \ - -DMODULE_NAME="\"libxl\"" \ - $(NULL) -virtxend_LDFLAGS = $(REMOTE_DAEMON_LD_FLAGS) -virtxend_LDADD = $(REMOTE_DAEMON_LD_ADD) - SYSCONF_FILES += libxl/virtxend.sysconf SYSTEMD_UNIT_FILES += \ diff --git a/src/libxl/meson.build b/src/libxl/meson.build index 484f3805851..fc5864a090c 100644 --- a/src/libxl/meson.build +++ b/src/libxl/meson.build @@ -36,4 +36,12 @@ if conf.has('WITH_LIBXL') libvirt_no_undefined, ], } + + virt_daemons += { + 'name': 'virtxend', + 'c_args': [ + '-DDAEMON_NAME="virtxend"', + '-DMODULE_NAME="libxl"', + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/locking/Makefile.inc.am | 55 ------------------------------------- src/locking/meson.build | 29 +++++++++++++++++++ 2 files changed, 29 insertions(+), 55 deletions(-) diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index 49cf0252162..20974dd0461 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -3,19 +3,6 @@ LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \ locking/sanlock_helper.c -LOCK_DAEMON_GENERATED = \ - locking/lock_daemon_dispatch_stubs.h - $(NULL) - -LOCK_DAEMON_SOURCES = \ - locking/lock_daemon.h \ - locking/lock_daemon.c \ - locking/lock_daemon_config.h \ - locking/lock_daemon_config.c \ - locking/lock_daemon_dispatch.c \ - locking/lock_daemon_dispatch.h \ - $(NULL) - RPC_PROBE_FILES += $(srcdir)/locking/lock_protocol.x SYSCONF_FILES += locking/virtlockd.sysconf @@ -47,42 +34,6 @@ if WITH_LIBXL nodist_conf_DATA += locking/libxl-lockd.conf endif WITH_LIBXL -sbin_PROGRAMS += virtlockd - -virtlockd_SOURCES = \ - $(LOCK_DAEMON_SOURCES) \ - $(NULL) -nodist_virtlockd_SOURCES = \ - $(LOCK_PROTOCOL_GENERATED) \ - $(LOCK_DAEMON_GENERATED) \ - $(NULL) -virtlockd_CFLAGS = \ - -I$(srcdir)/locking \ - -I$(builddir)/locking \ - -I$(builddir)/rpc \ - $(AM_CFLAGS) \ - $(XDR_CFLAGS) \ - $(NULL) -virtlockd_LDFLAGS = \ - $(AM_LDFLAGS) \ - $(XDR_LIBS) \ - $(NO_UNDEFINED_LDFLAGS) \ - $(NULL) -virtlockd_LDADD = \ - libvirt.la \ - libvirt_driver_admin.la \ - $(GLIB_LIBS) \ - $(NULL) -if WITH_DTRACE_PROBES -virtlockd_LDADD += libvirt_probes.lo -endif WITH_DTRACE_PROBES - -if WITH_SASL -virtlockd_CFLAGS += \ - $(SASL_CFLAGS) \ - $(NULL) -endif WITH_SASL - if WITH_SANLOCK augeas_DATA += locking/libvirt_sanlock.aug @@ -169,12 +120,6 @@ locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf cp $< $@ -locking/lock_daemon_dispatch_stubs.h: $(LOCK_PROTOCOL) \ - $(srcdir)/rpc/gendispatch.pl Makefile.am - $(AM_V_GEN)perl -w $(srcdir)/rpc/gendispatch.pl --mode=server \ - virLockSpaceProtocol VIR_LOCK_SPACE_PROTOCOL \ - $(LOCK_PROTOCOL) > locking/lock_daemon_dispatch_stubs.h - virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ diff --git a/src/locking/meson.build b/src/locking/meson.build index 4767ee9c869..cdd558779c2 100644 --- a/src/locking/meson.build +++ b/src/locking/meson.build @@ -30,6 +30,23 @@ lock_protocol_generated += custom_target( ], ) +lock_daemon_sources = files( + 'lock_daemon.c', + 'lock_daemon_config.c', + 'lock_daemon_dispatch.c', +) + +lock_daemon_generated = custom_target( + 'lock_daemon_dispatch_stubs.h', + input: lock_protocol, + output: 'lock_daemon_dispatch_stubs.h', + command: [ + gendispatch_prog, '--mode=server', + 'virLockSpaceProtocol', 'VIR_LOCK_SPACE_PROTOCOL', '@INPUT@', + ], + capture: true, +) + sanlock_sources = [ 'lock_driver_sanlock.c', ] @@ -100,4 +117,16 @@ if conf.has('WITH_LIBVIRTD') 'install_dir': lockdriver_dir, } endif + + virt_daemons += { + 'name': 'virtlockd', + 'sources': [ + lock_daemon_sources, + lock_daemon_generated, + lock_protocol_generated, + ], + 'include': [ + include_directories('.'), + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/logging/Makefile.inc.am | 64 ------------------------------------- src/logging/meson.build | 32 +++++++++++++++++++ 2 files changed, 32 insertions(+), 64 deletions(-) diff --git a/src/logging/Makefile.inc.am b/src/logging/Makefile.inc.am index b88e0c8766e..8adec645d36 100644 --- a/src/logging/Makefile.inc.am +++ b/src/logging/Makefile.inc.am @@ -1,27 +1,5 @@ # vim: filetype=automake -LOG_PROTOCOL_GENERATED = \ - logging/log_protocol.h \ - logging/log_protocol.c \ - $(NULL) - -LOG_DAEMON_GENERATED = \ - logging/log_daemon_dispatch_stubs.h - $(NULL) - -LOG_DAEMON_SOURCES = \ - logging/log_daemon.h \ - logging/log_daemon.c \ - logging/log_daemon_config.h \ - logging/log_daemon_config.c \ - logging/log_daemon_dispatch.c \ - logging/log_daemon_dispatch.h \ - logging/log_handler.c \ - logging/log_handler.h \ - $(NULL) - -LOG_PROTOCOL = $(srcdir)/logging/log_protocol.x - SYSCONF_FILES += logging/virtlogd.sysconf VIRTLOGD_UNIT_FILES_IN = \ @@ -41,42 +19,6 @@ OPENRC_INIT_FILES_IN += \ $(NULL) if WITH_LIBVIRTD -sbin_PROGRAMS += virtlogd - - -virtlogd_SOURCES = \ - $(LOG_DAEMON_SOURCES) \ - $(NULL) -nodist_virtlogd_SOURCES = \ - $(LOG_PROTOCOL_GENERATED) \ - $(LOG_DAEMON_GENERATED) \ - $(NULL) -virtlogd_CFLAGS = \ - -I$(builddir)/logging \ - -I$(builddir)/rpc \ - $(AM_CFLAGS) \ - $(XDR_CFLAGS) \ - $(NULL) -virtlogd_LDFLAGS = \ - $(AM_LDFLAGS) \ - $(XDR_LIBS) \ - $(NO_UNDEFINED_LDFLAGS) \ - $(NULL) -virtlogd_LDADD = \ - libvirt_driver_admin.la \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -if WITH_DTRACE_PROBES -virtlogd_LDADD += libvirt_probes.lo -endif WITH_DTRACE_PROBES - -if WITH_SASL -virtlogd_CFLAGS += \ - $(SASL_CFLAGS) \ - $(NULL) -endif WITH_SASL - conf_DATA += logging/virtlogd.conf augeas_DATA += logging/virtlogd.aug @@ -88,12 +30,6 @@ logging/test_virtlogd.aug: logging/test_virtlogd.aug.in \ endif WITH_LIBVIRTD -logging/log_daemon_dispatch_stubs.h: $(LOG_PROTOCOL) \ - $(srcdir)/rpc/gendispatch.pl Makefile.am - $(AM_V_GEN)perl -w $(srcdir)/rpc/gendispatch.pl --mode=server \ - virLogManagerProtocol VIR_LOG_MANAGER_PROTOCOL \ - $(LOG_PROTOCOL) > logging/log_daemon_dispatch_stubs.h - virtlogd.init: logging/virtlogd.init.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ diff --git a/src/logging/meson.build b/src/logging/meson.build index 5d1f30ac08f..0e58bc9e6bd 100644 --- a/src/logging/meson.build +++ b/src/logging/meson.build @@ -24,6 +24,13 @@ log_protocol_generated += custom_target( ], ) +log_daemon_sources = files( + 'log_daemon.c', + 'log_daemon_config.c', + 'log_daemon_dispatch.c', + 'log_handler.c', +) + log_driver_lib = static_library( 'virt_log_driver', [ @@ -38,3 +45,28 @@ log_driver_lib = static_library( ) libvirt_libs += log_driver_lib + +if conf.has('WITH_LIBVIRTD') + log_daemon_generated = custom_target( + 'log_daemon_dispatch_stubs.h', + input: log_protocol, + output: 'log_daemon_dispatch_stubs.h', + command: [ + gendispatch_prog, '--mode=server', + 'virLogManagerProtocol', 'VIR_LOG_MANAGER_PROTOCOL', '@INPUT@', + ], + capture: true, + ) + + virt_daemons += { + 'name': 'virtlogd', + 'sources': [ + log_daemon_sources, + log_daemon_generated, + log_protocol_generated, + ], + 'include': [ + include_directories('.'), + ], + } +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/lxc/Makefile.inc.am | 12 ------------ src/lxc/meson.build | 8 ++++++++ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am index 3bf8d9dfb05..19546181e51 100644 --- a/src/lxc/Makefile.inc.am +++ b/src/lxc/Makefile.inc.am @@ -47,22 +47,10 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_LXC -sbin_PROGRAMS += virtlxcd - nodist_conf_DATA += lxc/virtlxcd.conf augeas_DATA += lxc/virtlxcd.aug augeastest_DATA += lxc/test_virtlxcd.aug -virtlxcd_SOURCES = $(REMOTE_DAEMON_SOURCES) -nodist_virtlxcd_SOURCES = $(REMOTE_DAEMON_GENERATED) -virtlxcd_CFLAGS = \ - $(REMOTE_DAEMON_CFLAGS) \ - -DDAEMON_NAME="\"virtlxcd\"" \ - -DMODULE_NAME="\"lxc\"" \ - $(NULL) -virtlxcd_LDFLAGS = $(REMOTE_DAEMON_LD_FLAGS) -virtlxcd_LDADD = $(REMOTE_DAEMON_LD_ADD) - SYSCONF_FILES += lxc/virtlxcd.sysconf SYSTEMD_UNIT_FILES += \ diff --git a/src/lxc/meson.build b/src/lxc/meson.build index 5d8a20bd9f7..a90083cdc3d 100644 --- a/src/lxc/meson.build +++ b/src/lxc/meson.build @@ -74,4 +74,12 @@ if conf.has('WITH_LXC') libvirt_no_undefined, ], } + + virt_daemons += { + 'name': 'virtlxcd', + 'c_args': [ + '-DDAEMON_NAME="virtlxcd"', + '-DMODULE_NAME="lxc"', + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/network/Makefile.inc.am | 12 ------------ src/network/meson.build | 8 ++++++++ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am index 523ae453797..c0c8180674d 100644 --- a/src/network/Makefile.inc.am +++ b/src/network/Makefile.inc.am @@ -10,22 +10,10 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_NETWORK -sbin_PROGRAMS += virtnetworkd - nodist_conf_DATA += network/virtnetworkd.conf augeas_DATA += network/virtnetworkd.aug augeastest_DATA += network/test_virtnetworkd.aug -virtnetworkd_SOURCES = $(REMOTE_DAEMON_SOURCES) -nodist_virtnetworkd_SOURCES = $(REMOTE_DAEMON_GENERATED) -virtnetworkd_CFLAGS = \ - $(REMOTE_DAEMON_CFLAGS) \ - -DDAEMON_NAME="\"virtnetworkd\"" \ - -DMODULE_NAME="\"network\"" \ - $(NULL) -virtnetworkd_LDFLAGS = $(REMOTE_DAEMON_LD_FLAGS) -virtnetworkd_LDADD = $(REMOTE_DAEMON_LD_ADD) - SYSCONF_FILES += network/virtnetworkd.sysconf SYSTEMD_UNIT_FILES += \ diff --git a/src/network/meson.build b/src/network/meson.build index 879a5731a6e..d244d2f522b 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -33,4 +33,12 @@ if conf.has('WITH_NETWORK') libvirt_no_undefined, ], } + + virt_daemons += { + 'name': 'virtnetworkd', + 'c_args': [ + '-DDAEMON_NAME="virtnetworkd"', + '-DMODULE_NAME="network"', + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/node_device/Makefile.inc.am | 12 ------------ src/node_device/meson.build | 8 ++++++++ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/node_device/Makefile.inc.am b/src/node_device/Makefile.inc.am index d7d80f61fbb..731d513c980 100644 --- a/src/node_device/Makefile.inc.am +++ b/src/node_device/Makefile.inc.am @@ -12,22 +12,10 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_NODE_DEVICES -sbin_PROGRAMS += virtnodedevd - nodist_conf_DATA += node_device/virtnodedevd.conf augeas_DATA += node_device/virtnodedevd.aug augeastest_DATA += node_device/test_virtnodedevd.aug -virtnodedevd_SOURCES = $(REMOTE_DAEMON_SOURCES) -nodist_virtnodedevd_SOURCES = $(REMOTE_DAEMON_GENERATED) -virtnodedevd_CFLAGS = \ - $(REMOTE_DAEMON_CFLAGS) \ - -DDAEMON_NAME="\"virtnodedevd\"" \ - -DMODULE_NAME="\"nodedev\"" \ - $(NULL) -virtnodedevd_LDFLAGS = $(REMOTE_DAEMON_LD_FLAGS) -virtnodedevd_LDADD = $(REMOTE_DAEMON_LD_ADD) - SYSCONF_FILES += node_device/virtnodedevd.sysconf SYSTEMD_UNIT_FILES += \ diff --git a/src/node_device/meson.build b/src/node_device/meson.build index 00fa7e0ea9c..f85320cf85a 100644 --- a/src/node_device/meson.build +++ b/src/node_device/meson.build @@ -38,4 +38,12 @@ if conf.has('WITH_NODE_DEVICES') libvirt_no_undefined, ], } + + virt_daemons += { + 'name': 'virtnodedevd', + 'c_args': [ + '-DDAEMON_NAME="virtnodedevd"', + '-DMODULE_NAME="nodedev"', + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/nwfilter/Makefile.inc.am | 12 ------------ src/nwfilter/meson.build | 8 ++++++++ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/nwfilter/Makefile.inc.am b/src/nwfilter/Makefile.inc.am index d853282b705..eb5cade5b95 100644 --- a/src/nwfilter/Makefile.inc.am +++ b/src/nwfilter/Makefile.inc.am @@ -11,22 +11,10 @@ if WITH_NWFILTER nwfilterxmldir = $(sysconfdir)/libvirt/nwfilter nwfilterxml_DATA = $(NWFILTER_XML_FILES) -sbin_PROGRAMS += virtnwfilterd - nodist_conf_DATA += nwfilter/virtnwfilterd.conf augeas_DATA += nwfilter/virtnwfilterd.aug augeastest_DATA += nwfilter/test_virtnwfilterd.aug -virtnwfilterd_SOURCES = $(REMOTE_DAEMON_SOURCES) -nodist_virtnwfilterd_SOURCES = $(REMOTE_DAEMON_GENERATED) -virtnwfilterd_CFLAGS = \ - $(REMOTE_DAEMON_CFLAGS) \ - -DDAEMON_NAME="\"virtnwfilterd\"" \ - -DMODULE_NAME="\"nwfilter\"" \ - $(NULL) -virtnwfilterd_LDFLAGS = $(REMOTE_DAEMON_LD_FLAGS) -virtnwfilterd_LDADD = $(REMOTE_DAEMON_LD_ADD) - SYSCONF_FILES += nwfilter/virtnwfilterd.sysconf SYSTEMD_UNIT_FILES += \ diff --git a/src/nwfilter/meson.build b/src/nwfilter/meson.build index 8da853c3ecb..b8f94c726c1 100644 --- a/src/nwfilter/meson.build +++ b/src/nwfilter/meson.build @@ -33,4 +33,12 @@ if conf.has('WITH_NWFILTER') libvirt_no_undefined, ], } + + virt_daemons += { + 'name': 'virtnwfilterd', + 'c_args': [ + '-DDAEMON_NAME="virtnwfilterd"', + '-DMODULE_NAME="nwfilter"', + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/Makefile.inc.am | 12 ------------ src/qemu/meson.build | 8 ++++++++ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am index f2b5e3a77f6..129825121c7 100644 --- a/src/qemu/Makefile.inc.am +++ b/src/qemu/Makefile.inc.am @@ -4,22 +4,10 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES)) if WITH_QEMU -sbin_PROGRAMS += virtqemud - nodist_conf_DATA += qemu/virtqemud.conf augeas_DATA += qemu/virtqemud.aug augeastest_DATA += qemu/test_virtqemud.aug -virtqemud_SOURCES = $(REMOTE_DAEMON_SOURCES) -nodist_virtqemud_SOURCES = $(REMOTE_DAEMON_GENERATED) -virtqemud_CFLAGS = \ - $(REMOTE_DAEMON_CFLAGS) \ - -DDAEMON_NAME="\"virtqemud\"" \ - -DMODULE_NAME="\"qemu\"" \ - $(NULL) -virtqemud_LDFLAGS = $(REMOTE_DAEMON_LD_FLAGS) -virtqemud_LDADD = $(REMOTE_DAEMON_LD_ADD) - SYSCONF_FILES += qemu/virtqemud.sysconf SYSTEMD_UNIT_FILES += \ diff --git a/src/qemu/meson.build b/src/qemu/meson.build index 209cb5f4956..121be3085fa 100644 --- a/src/qemu/meson.build +++ b/src/qemu/meson.build @@ -105,4 +105,12 @@ if conf.has('WITH_QEMU') libvirt_no_undefined, ], } + + virt_daemons += { + 'name': 'virtqemud', + 'c_args': [ + '-DDAEMON_NAME="virtqemud"', + '-DMODULE_NAME="qemu"', + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/remote/Makefile.inc.am | 18 +----------------- src/remote/meson.build | 12 ++++++++++++ 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index eb281a4c4da..f6669bd25f6 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -62,7 +62,7 @@ OPENRC_CONF_FILES += \ if WITH_LIBVIRTD -sbin_PROGRAMS += libvirtd virtproxyd +sbin_PROGRAMS += virtproxyd augeas_DATA += \ remote/libvirtd.aug \ @@ -79,22 +79,6 @@ nodist_conf_DATA += \ remote/virtproxyd.conf \ $(NULL) -libvirtd_SOURCES = $(REMOTE_DAEMON_SOURCES) - -nodist_libvirtd_SOURCES = $(REMOTE_DAEMON_GENERATED) - -libvirtd_CFLAGS = \ - $(REMOTE_DAEMON_CFLAGS) \ - -DSOCK_PREFIX="\"libvirt\"" \ - -DDAEMON_NAME="\"libvirtd\"" \ - -DWITH_IP \ - -DLIBVIRTD \ - $(NULL) - -libvirtd_LDFLAGS = $(REMOTE_DAEMON_LD_FLAGS) - -libvirtd_LDADD = $(REMOTE_DAEMON_LD_ADD) - virtproxyd_SOURCES = $(REMOTE_DAEMON_SOURCES) nodist_virtproxyd_SOURCES = $(REMOTE_DAEMON_GENERATED) virtproxyd_CFLAGS = \ diff --git a/src/remote/meson.build b/src/remote/meson.build index 1e3e3479c80..8cb53b2c782 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -82,6 +82,18 @@ if conf.has('WITH_REMOTE') ) libvirt_libs += remote_driver_lib + + if conf.has('WITH_LIBVIRTD') + virt_daemons += { + 'name': 'libvirtd', + 'c_args': [ + '-DSOCK_PREFIX="libvirt"', + '-DDAEMON_NAME="libvirtd"', + '-DWITH_IP', + '-DLIBVIRTD', + ], + } + endif endif if conf.has('WITH_REMOTE') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/remote/Makefile.inc.am | 14 -------------- src/remote/meson.build | 10 ++++++++++ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index f6669bd25f6..2007bdf8654 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -62,8 +62,6 @@ OPENRC_CONF_FILES += \ if WITH_LIBVIRTD -sbin_PROGRAMS += virtproxyd - augeas_DATA += \ remote/libvirtd.aug \ remote/virtproxyd.aug \ @@ -79,18 +77,6 @@ nodist_conf_DATA += \ remote/virtproxyd.conf \ $(NULL) -virtproxyd_SOURCES = $(REMOTE_DAEMON_SOURCES) -nodist_virtproxyd_SOURCES = $(REMOTE_DAEMON_GENERATED) -virtproxyd_CFLAGS = \ - $(REMOTE_DAEMON_CFLAGS) \ - -DSOCK_PREFIX="\"libvirt\"" \ - -DDAEMON_NAME="\"virtproxyd\"" \ - -DWITH_IP \ - -DVIRTPROXYD \ - $(NULL) -virtproxyd_LDFLAGS = $(REMOTE_DAEMON_LD_FLAGS) -virtproxyd_LDADD = $(REMOTE_DAEMON_LD_ADD) - remote/libvirtd.conf: remote/libvirtd.conf.in $(AM_V_GEN)$(SED) \ -e '/[@]CUT_ENABLE_IP[@]/d' \ diff --git a/src/remote/meson.build b/src/remote/meson.build index 8cb53b2c782..ee38364868e 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -93,6 +93,16 @@ if conf.has('WITH_REMOTE') '-DLIBVIRTD', ], } + + virt_daemons += { + 'name': 'virtproxyd', + 'c_args': [ + '-DSOCK_PREFIX="libvirt"', + '-DDAEMON_NAME="virtproxyd"', + '-DWITH_IP', + '-DVIRTPROXYD', + ], + } endif endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/secret/Makefile.inc.am | 12 ------------ src/secret/meson.build | 8 ++++++++ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/secret/Makefile.inc.am b/src/secret/Makefile.inc.am index e47aa678a6c..7a03f6728ee 100644 --- a/src/secret/Makefile.inc.am +++ b/src/secret/Makefile.inc.am @@ -5,22 +5,10 @@ STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(SECRET_DRIVER_SOURCES)) if WITH_SECRETS -sbin_PROGRAMS += virtsecretd - nodist_conf_DATA += secret/virtsecretd.conf augeas_DATA += secret/virtsecretd.aug augeastest_DATA += secret/test_virtsecretd.aug -virtsecretd_SOURCES = $(REMOTE_DAEMON_SOURCES) -nodist_virtsecretd_SOURCES = $(REMOTE_DAEMON_GENERATED) -virtsecretd_CFLAGS = \ - $(REMOTE_DAEMON_CFLAGS) \ - -DDAEMON_NAME="\"virtsecretd\"" \ - -DMODULE_NAME="\"secret\"" \ - $(NULL) -virtsecretd_LDFLAGS = $(REMOTE_DAEMON_LD_FLAGS) -virtsecretd_LDADD = $(REMOTE_DAEMON_LD_ADD) - SYSCONF_FILES += secret/virtsecretd.sysconf SYSTEMD_UNIT_FILES += \ diff --git a/src/secret/meson.build b/src/secret/meson.build index a6d0a321938..43f1d7342d5 100644 --- a/src/secret/meson.build +++ b/src/secret/meson.build @@ -15,4 +15,12 @@ if conf.has('WITH_SECRETS') libvirt_no_undefined, ], } + + virt_daemons += { + 'name': 'virtsecretd', + 'c_args': [ + '-DDAEMON_NAME="virtsecretd"', + '-DMODULE_NAME="secret"', + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/storage/Makefile.inc.am | 12 ------------ src/storage/meson.build | 8 ++++++++ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index 45cbe476d22..e30f82e14fe 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -9,22 +9,10 @@ STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(STORAGE_DRIVER_SOURCES)) if WITH_STORAGE -sbin_PROGRAMS += virtstoraged - nodist_conf_DATA += storage/virtstoraged.conf augeas_DATA += storage/virtstoraged.aug augeastest_DATA += storage/test_virtstoraged.aug -virtstoraged_SOURCES = $(REMOTE_DAEMON_SOURCES) -nodist_virtstoraged_SOURCES = $(REMOTE_DAEMON_GENERATED) -virtstoraged_CFLAGS = \ - $(REMOTE_DAEMON_CFLAGS) \ - -DDAEMON_NAME="\"virtstoraged\"" \ - -DMODULE_NAME="\"storage\"" \ - $(NULL) -virtstoraged_LDFLAGS = $(REMOTE_DAEMON_LD_FLAGS) -virtstoraged_LDADD = $(REMOTE_DAEMON_LD_ADD) - SYSCONF_FILES += storage/virtstoraged.sysconf SYSTEMD_UNIT_FILES += \ diff --git a/src/storage/meson.build b/src/storage/meson.build index baf5ae5b2fe..a18da013f8c 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -109,6 +109,14 @@ if conf.has('WITH_STORAGE') ], 'install_dir': storage_file_install_dir, } + + virt_daemons += { + 'name': 'virtstoraged', + 'c_args': [ + '-DDAEMON_NAME="virtstoraged"', + '-DMODULE_NAME="storage"', + ], + } endif if conf.has('WITH_STORAGE_DISK') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/vbox/Makefile.inc.am | 12 ------------ src/vbox/meson.build | 8 ++++++++ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/vbox/Makefile.inc.am b/src/vbox/Makefile.inc.am index e61c3df40d6..fc71301e595 100644 --- a/src/vbox/Makefile.inc.am +++ b/src/vbox/Makefile.inc.am @@ -6,22 +6,10 @@ DRIVER_SOURCE_FILES += \ $(NULL) if WITH_VBOX -sbin_PROGRAMS += virtvboxd - nodist_conf_DATA += vbox/virtvboxd.conf augeas_DATA += vbox/virtvboxd.aug augeastest_DATA += vbox/test_virtvboxd.aug -virtvboxd_SOURCES = $(REMOTE_DAEMON_SOURCES) -nodist_virtvboxd_SOURCES = $(REMOTE_DAEMON_GENERATED) -virtvboxd_CFLAGS = \ - $(REMOTE_DAEMON_CFLAGS) \ - -DDAEMON_NAME="\"virtvboxd\"" \ - -DMODULE_NAME="\"vbox\"" \ - $(NULL) -virtvboxd_LDFLAGS = $(REMOTE_DAEMON_LD_FLAGS) -virtvboxd_LDADD = $(REMOTE_DAEMON_LD_ADD) - SYSCONF_FILES += vbox/virtvboxd.sysconf SYSTEMD_UNIT_FILES += \ diff --git a/src/vbox/meson.build b/src/vbox/meson.build index 5af671c00cb..0619834a9c8 100644 --- a/src/vbox/meson.build +++ b/src/vbox/meson.build @@ -38,4 +38,12 @@ if conf.has('WITH_VBOX') libvirt_no_undefined, ], } + + virt_daemons += { + 'name': 'virtvboxd', + 'c_args': [ + '-DDAEMON_NAME="virtvboxd"', + '-DMODULE_NAME="vbox"', + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 1 - src/vz/Makefile.inc.am | 12 ------------ src/vz/meson.build | 8 ++++++++ 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index ec6da9a6ff5..6a8a7ea1791 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -43,7 +43,6 @@ OPENRC_INIT_FILES = OPENRC_INIT_FILES_IN = OPENRC_CONF_FILES = SYSCONF_FILES = -sbin_PROGRAMS = bin_PROGRAMS = COMMON_UNIT_VARS = \ diff --git a/src/vz/Makefile.inc.am b/src/vz/Makefile.inc.am index f55d03d400a..18bb0c40c46 100644 --- a/src/vz/Makefile.inc.am +++ b/src/vz/Makefile.inc.am @@ -5,22 +5,10 @@ STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(VZ_DRIVER_SOURCES)) if WITH_VZ -sbin_PROGRAMS += virtvzd - nodist_conf_DATA += vz/virtvzd.conf augeas_DATA += vz/virtvzd.aug augeastest_DATA += vz/test_virtvzd.aug -virtvzd_SOURCES = $(REMOTE_DAEMON_SOURCES) -nodist_virtvzd_SOURCES = $(REMOTE_DAEMON_GENERATED) -virtvzd_CFLAGS = \ - $(REMOTE_DAEMON_CFLAGS) \ - -DDAEMON_NAME="\"virtvzd\"" \ - -DMODULE_NAME="\"vz\"" \ - $(NULL) -virtvzd_LDFLAGS = $(REMOTE_DAEMON_LD_FLAGS) -virtvzd_LDADD = $(REMOTE_DAEMON_LD_ADD) - SYSCONF_FILES += vz/virtvzd.sysconf SYSTEMD_UNIT_FILES += \ diff --git a/src/vz/meson.build b/src/vz/meson.build index 41cce92de2f..07ad8fc75ae 100644 --- a/src/vz/meson.build +++ b/src/vz/meson.build @@ -30,4 +30,12 @@ if conf.has('WITH_VZ') libvirt_no_undefined, ], } + + virt_daemons += { + 'name': 'virtvzd', + 'c_args': [ + '-DDAEMON_NAME="virtvzd"', + '-DMODULE_NAME="vz"', + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/meson.build | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/meson.build b/src/meson.build index 3774e2bb4ba..bb970f10c61 100644 --- a/src/meson.build +++ b/src/meson.build @@ -139,6 +139,16 @@ virt_modules = [] # * include = include_directories (optional, default []) virt_daemons = [] +# virt_helpers: +# each entry is a dictionary with following items: +# * name - binary name (required) +# * sources - binary sources (required) +# * c_args - compile arguments (optional, default []) +# * include - include_directories (optional, default []) +# * deps - dependencies (optional, default []) +# * install_dir - installation directory (optional, libexecdir) +virt_helpers = [] + # list subdirectories @@ -509,3 +519,31 @@ foreach daemon : virt_daemons install_rpath: libdir, ) endforeach + + +# build libvirt helpers + +foreach helper : virt_helpers + bin = executable( + helper['name'], + [ + helper['sources'], + ], + c_args: [ + helper.get('c_args', []), + ], + include_directories: [ + helper.get('include', []), + ], + dependencies: [ + src_dep, + helper.get('deps', []), + ], + link_with: [ + libvirt_lib, + ], + install: true, + install_dir: helper.get('install_dir', libexecdir), + install_rpath: libdir, + ) +endforeach -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/locking/Makefile.inc.am | 17 ----------------- src/locking/meson.build | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index 20974dd0461..b4fb9387a17 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -1,8 +1,5 @@ # vim: filetype=automake -LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \ - locking/sanlock_helper.c - RPC_PROBE_FILES += $(srcdir)/locking/lock_protocol.x SYSCONF_FILES += locking/virtlockd.sysconf @@ -46,20 +43,6 @@ if WITH_LIBXL nodist_conf_DATA += locking/libxl-sanlock.conf endif WITH_LIBXL -libexec_PROGRAMS += libvirt_sanlock_helper - -libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES) -libvirt_sanlock_helper_CFLAGS = \ - -I$(srcdir)/conf \ - $(AM_CFLAGS) \ - $(NULL) -libvirt_sanlock_helper_LDFLAGS = \ - $(AM_LDFLAGS) \ - $(NULL) -libvirt_sanlock_helper_LDADD = \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) endif WITH_SANLOCK conf_DATA += locking/virtlockd.conf diff --git a/src/locking/meson.build b/src/locking/meson.build index cdd558779c2..0e48c86afc9 100644 --- a/src/locking/meson.build +++ b/src/locking/meson.build @@ -51,6 +51,10 @@ sanlock_sources = [ 'lock_driver_sanlock.c', ] +sanlock_helper_sources = files( + 'sanlock_helper.c', +) + lock_driver_lib = static_library( 'virt_lock_driver', [ @@ -129,4 +133,16 @@ if conf.has('WITH_LIBVIRTD') include_directories('.'), ], } + + if conf.has('WITH_SANLOCK') + virt_helpers += { + 'name': 'libvirt_sanlock_helper', + 'sources': [ + sanlock_helper_sources, + ], + 'include': [ + conf_inc_dir, + ], + } + endif endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/lxc/Makefile.inc.am | 88 ----------------------------------------- src/lxc/meson.build | 46 +++++++++++++++++++++ 2 files changed, 46 insertions(+), 88 deletions(-) diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am index 19546181e51..03f03ba13db 100644 --- a/src/lxc/Makefile.inc.am +++ b/src/lxc/Makefile.inc.am @@ -1,40 +1,5 @@ # vim: filetype=automake -LXC_MONITOR_PROTOCOL_GENERATED = \ - lxc/lxc_monitor_protocol.h \ - lxc/lxc_monitor_protocol.c \ - $(NULL) - -LXC_MONITOR_GENERATED = \ - lxc/lxc_monitor_dispatch.h \ - $(NULL) - -LXC_CONTROLLER_GENERATED = \ - lxc/lxc_controller_dispatch.h \ - $(NULL) - -LXC_GENERATED = \ - $(LXC_MONITOR_PROTOCOL_GENERATED) \ - $(LXC_MONITOR_GENERATED) \ - $(LXC_CONTROLLER_GENERATED) \ - $(NULL) - -LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x - -LXC_CONTROLLER_SOURCES = \ - lxc/lxc_conf.c \ - lxc/lxc_conf.h \ - lxc/lxc_container.c \ - lxc/lxc_container.h \ - lxc/lxc_cgroup.c \ - lxc/lxc_cgroup.h \ - lxc/lxc_domain.c \ - lxc/lxc_domain.h \ - lxc/lxc_fuse.c \ - lxc/lxc_fuse.h \ - lxc/lxc_controller.c \ - $(NULL) - DRIVER_SOURCE_FILES += \ $(LXC_MONITOR_PROTOCOL_GENERATED) \ $(LXC_MONITOR_GENERATED) \ @@ -44,7 +9,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ $(LXC_MONITOR_GENERATED) \ $(addprefix $(srcdir)/,$(LXC_DRIVER_SOURCES)) - if WITH_LXC nodist_conf_DATA += lxc/virtlxcd.conf @@ -109,52 +73,6 @@ lxc/test_virtlxcd.aug: remote/test_libvirtd.aug.in \ -e 's/[@]DAEMON_NAME_UC[@]/Virtlxcd/' \ > $@ || rm -f $@ -libexec_PROGRAMS += libvirt_lxc - -libvirt_lxc_SOURCES = \ - $(LXC_CONTROLLER_SOURCES) \ - $(DATATYPES_SOURCES) \ - $(NULL) -nodist_libvirt_lxc_SOURCES = \ - $(LXC_MONITOR_PROTOCOL_GENERATED) \ - $(LXC_CONTROLLER_GENERATED) \ - $(NULL) -libvirt_lxc_LDFLAGS = \ - $(AM_LDFLAGS) \ - $(CAPNG_LIBS) \ - $(LIBXML_LIBS) \ - $(GLIB_LIBS) \ - $(NULL) -libvirt_lxc_LDADD = \ - libvirt.la \ - $(FUSE_LIBS) \ - $(GLIB_LIBS) \ - $(NULL) -if WITH_DTRACE_PROBES -libvirt_lxc_LDADD += libvirt_probes.lo -endif WITH_DTRACE_PROBES -libvirt_lxc_LDADD += $(SECDRIVER_LIBS) -libvirt_lxc_CFLAGS = \ - -I$(srcdir)/conf \ - -I$(builddir)/lxc \ - -I$(builddir)/rpc \ - -I$(srcdir)/hypervisor \ - $(AM_CFLAGS) \ - $(CAPNG_CFLAGS) \ - $(LIBXML_CFLAGS) \ - $(GLIB_CFLAGS) \ - $(LIBNL_CFLAGS) \ - $(FUSE_CFLAGS) \ - $(DBUS_CFLAGS) \ - $(XDR_CFLAGS) \ - $(NULL) -if WITH_BLKID -libvirt_lxc_CFLAGS += $(BLKID_CFLAGS) -libvirt_lxc_LDADD += $(BLKID_LIBS) -endif WITH_BLKID -libvirt_lxc_CFLAGS += $(SECDRIVER_CFLAGS) - - if WITH_DTRACE_PROBES RPC_PROBE_FILES += $(srcdir)/lxc/lxc_monitor_protocol.x endif @@ -182,12 +100,6 @@ uninstall-data-lxc: endif WITH_LXC -lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \ - $(REMOTE_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \ - virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \ - lxc/lxc_controller_dispatch.h - .PHONY: \ install-data-lxc \ uninstall-data-lxc \ diff --git a/src/lxc/meson.build b/src/lxc/meson.build index a90083cdc3d..cf1f976573a 100644 --- a/src/lxc/meson.build +++ b/src/lxc/meson.build @@ -40,6 +40,26 @@ lxc_monitor_generated = custom_target( capture: true, ) +lxc_controller_sources = files( + 'lxc_conf.c', + 'lxc_container.c', + 'lxc_cgroup.c', + 'lxc_domain.c', + 'lxc_fuse.c', + 'lxc_controller.c', +) + +lxc_controller_generated = custom_target( + 'lxc_controller_dispatch_h', + input: lxc_monitor_protocol, + output: 'lxc_controller_dispatch.h', + command: [ + gendispatch_prog, '--mode=server', + 'virLXCMonitor', 'VIR_LXC_MONITOR', '@INPUT@' + ], + capture: true, +) + if conf.has('WITH_LXC') lxc_driver_impl_lib = static_library( 'virt_driver_lxc_impl', @@ -82,4 +102,30 @@ if conf.has('WITH_LXC') '-DMODULE_NAME="lxc"', ], } + + virt_helpers += { + 'name': 'libvirt_lxc', + 'sources': [ + lxc_controller_sources, + lxc_monitor_protocol_generated, + lxc_controller_generated, + datatypes_sources, + dtrace_gen_objects, + ], + 'include': [ + conf_inc_dir, + hypervisor_inc_dir, + include_directories('.'), + ], + 'deps': [ + blkid_dep, + capng_dep, + dbus_dep, + fuse_dep, + libnl_dep, + rpc_dep, + secdriver_dep, + xdr_dep, + ], + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/network/Makefile.inc.am | 22 ---------------------- src/network/meson.build | 12 ++++++++++++ 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am index c0c8180674d..fe93adc0194 100644 --- a/src/network/Makefile.inc.am +++ b/src/network/Makefile.inc.am @@ -1,14 +1,9 @@ # vim: filetype=automake -NETWORK_LEASES_HELPER_SOURCES = \ - network/leaseshelper.c \ - $(NULL) - DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(NETWORK_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(NETWORK_DRIVER_SOURCES)) - if WITH_NETWORK nodist_conf_DATA += network/virtnetworkd.conf augeas_DATA += network/virtnetworkd.aug @@ -74,23 +69,6 @@ network/test_virtnetworkd.aug: remote/test_libvirtd.aug.in \ -e 's/[@]DAEMON_NAME_UC[@]/Virtnetworkd/' \ > $@ || rm -f $@ -libexec_PROGRAMS += libvirt_leaseshelper -libvirt_leaseshelper_SOURCES = $(NETWORK_LEASES_HELPER_SOURCES) -libvirt_leaseshelper_LDFLAGS = \ - $(AM_LDFLAGS) \ - $(NULL) -libvirt_leaseshelper_LDADD = \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -if WITH_DTRACE_PROBES -libvirt_leaseshelper_LDADD += libvirt_probes.lo -endif WITH_DTRACE_PROBES - -libvirt_leaseshelper_CFLAGS = \ - $(AM_CFLAGS) \ - $(NULL) - INSTALL_DATA_DIRS += network UUID=$(shell uuidgen 2>/dev/null) diff --git a/src/network/meson.build b/src/network/meson.build index d244d2f522b..9b59e442c9d 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -3,6 +3,10 @@ network_driver_sources = [ 'bridge_driver_platform.c', ] +network_leases_helper_sources = files( + 'leaseshelper.c', +) + if conf.has('WITH_NETWORK') network_driver_impl = static_library( 'virt_driver_network_impl', @@ -41,4 +45,12 @@ if conf.has('WITH_NETWORK') '-DMODULE_NAME="network"', ], } + + virt_helpers += { + 'name': 'libvirt_leaseshelper', + 'sources': [ + network_leases_helper_sources, + dtrace_gen_objects, + ], + } endif -- 2.26.2

On Thu, Jul 16, 2020 at 11:57:33 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/network/Makefile.inc.am | 22 ---------------------- src/network/meson.build | 12 ++++++++++++ 2 files changed, 12 insertions(+), 22 deletions(-)
I took this one as a representative sample to compare how it's linked. The only difference I found is that 'libnl-route-3' is not linked with meson any more. That certainly doesn't matter in this case, but it's maybe worth checking whether it's linked in the appropriate place.

On Fri, Jul 24, 2020 at 09:16:40AM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:57:33 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/network/Makefile.inc.am | 22 ---------------------- src/network/meson.build | 12 ++++++++++++ 2 files changed, 12 insertions(+), 22 deletions(-)
I took this one as a representative sample to compare how it's linked. The only difference I found is that 'libnl-route-3' is not linked with meson any more. That certainly doesn't matter in this case, but it's maybe worth checking whether it's linked in the appropriate place.
So I did some digging and the libnl-route-3 library was added by commit <60fb8a22ee63481b6574a04304f740f50a133754> which introduced support for libnl-3. However, it looks like we don't use any symbols from libnl-route-3 library. Meson uses -Wl,--as-needed which tells linker to use libraries that satisfies undefined symbols which confirms that we don't use any symbols from libnl-route-3. I'll add it to my todo list to drop the libnl-route-3 check once we finish this series as it can wait. Nice catch. Pavel

-export-dynamic is provided by src_dep Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 1 - src/qemu/Makefile.inc.am | 14 -------------- src/qemu/meson.build | 12 ++++++++++++ 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 6a8a7ea1791..8760fdf3a22 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -43,7 +43,6 @@ OPENRC_INIT_FILES = OPENRC_INIT_FILES_IN = OPENRC_CONF_FILES = SYSCONF_FILES = -bin_PROGRAMS = COMMON_UNIT_VARS = \ -e 's|[@]runstatedir[@]|$(runstatedir)|g' \ diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am index 129825121c7..80555d79a40 100644 --- a/src/qemu/Makefile.inc.am +++ b/src/qemu/Makefile.inc.am @@ -101,17 +101,3 @@ endif WITH_QEMU install-data-qemu \ uninstall-data-qemu \ $(NULL) - -QEMU_SHIM_SOURCES = qemu/qemu_shim.c - -if WITH_QEMU -bin_PROGRAMS += virt-qemu-run - -virt_qemu_run_SOURCES = $(QEMU_SHIM_SOURCES) - -virt_qemu_run_LDADD = \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -virt_qemu_run_LDFLAGS = -export-dynamic -endif WITH_QEMU diff --git a/src/qemu/meson.build b/src/qemu/meson.build index 121be3085fa..fca7cf1658f 100644 --- a/src/qemu/meson.build +++ b/src/qemu/meson.build @@ -71,6 +71,10 @@ if conf.has('WITH_DTRACE_PROBES') ) endif +qemu_shim_sources = files( + 'qemu_shim.c', +) + if conf.has('WITH_QEMU') qemu_driver_impl = static_library( 'virt_driver_qemu_impl', @@ -113,4 +117,12 @@ if conf.has('WITH_QEMU') '-DMODULE_NAME="qemu"', ], } + + virt_helpers += { + 'name': 'virt-qemu-run', + 'sources': [ + qemu_shim_sources + ], + 'install_dir': bindir, + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/security/Makefile.inc.am | 31 ------------------------------- src/security/meson.build | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 31 deletions(-) diff --git a/src/security/Makefile.inc.am b/src/security/Makefile.inc.am index 12afd7f8db0..50e2706be9f 100644 --- a/src/security/Makefile.inc.am +++ b/src/security/Makefile.inc.am @@ -1,10 +1,5 @@ # vim: filetype=automake -SECURITY_DRIVER_APPARMOR_HELPER_SOURCES = \ - $(DATATYPES_SOURCES) \ - security/virt-aa-helper.c \ - $(NULL) - SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES_IN = \ security/apparmor/usr.lib.libvirt.virt-aa-helper.in \ security/apparmor/usr.sbin.libvirtd.in \ @@ -23,32 +18,6 @@ security/apparmor/%: $(srcdir)/security/apparmor/%.in -e 's|[@]libexecdir[@]|@libexecdir@|' \ $< > $@ -if WITH_SECDRIVER_APPARMOR -if WITH_LIBVIRTD -libexec_PROGRAMS += virt-aa-helper - -virt_aa_helper_SOURCES = $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES) - -virt_aa_helper_LDFLAGS = \ - $(AM_LDFLAGS) \ - $(NULL) -virt_aa_helper_LDADD = \ - libvirt.la \ - libvirt_driver_storage_impl.la \ - $(GLIB_LIBS) \ - $(NULL) -if WITH_DTRACE_PROBES -virt_aa_helper_LDADD += libvirt_probes.lo -endif WITH_DTRACE_PROBES -virt_aa_helper_CFLAGS = \ - -I$(srcdir)/conf \ - -I$(top_srcdir)/src/hypervisor \ - -I$(srcdir)/security \ - $(AM_CFLAGS) \ - $(NULL) -endif WITH_LIBVIRTD -endif WITH_SECDRIVER_APPARMOR - if WITH_APPARMOR_PROFILES apparmordir = $(sysconfdir)/apparmor.d/ apparmor_DATA = \ diff --git a/src/security/meson.build b/src/security/meson.build index 1e85d8dcf5f..4014ddccc45 100644 --- a/src/security/meson.build +++ b/src/security/meson.build @@ -15,6 +15,10 @@ if conf.has('WITH_SECDRIVER_SELINUX') security_driver_sources += 'security_selinux.c' endif +apparmor_helper_sources = files( + 'virt-aa-helper.c', +) + security_driver_lib = static_library( 'virt_security_manager', [ @@ -31,3 +35,19 @@ security_driver_lib = static_library( ) libvirt_libs += security_driver_lib + +if conf.has('WITH_LIBVIRTD') and conf.has('WITH_APPARMOR') + virt_helpers += { + 'name': 'virt-aa-helper', + 'sources': [ + apparmor_helper_sources, + datatypes_sources, + dtrace_gen_objects, + ], + 'include': [ + conf_inc_dir, + hypervisor_inc_dir, + include_directories('.'), + ], + } +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/storage/Makefile.inc.am | 26 -------------------------- src/storage/meson.build | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index e30f82e14fe..ee4377d94ff 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -1,9 +1,5 @@ # vim: filetype=automake -STORAGE_HELPER_DISK_SOURCES = \ - storage/parthelper.c \ - $(NULL) - DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(STORAGE_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(STORAGE_DRIVER_SOURCES)) @@ -75,25 +71,3 @@ storage/test_virtstoraged.aug: remote/test_libvirtd.aug.in \ endif WITH_STORAGE - -if WITH_STORAGE_DISK -libexec_PROGRAMS += libvirt_parthelper - -libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES) -libvirt_parthelper_LDFLAGS = \ - $(AM_LDFLAGS) \ - $(NULL) -libvirt_parthelper_LDADD = \ - $(LIBPARTED_LIBS) \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -if WITH_DTRACE_PROBES -libvirt_parthelper_LDADD += libvirt_probes.lo -endif WITH_DTRACE_PROBES - -libvirt_parthelper_CFLAGS = \ - $(LIBPARTED_CFLAGS) \ - $(AM_CFLAGS) \ - $(NULL) -endif WITH_STORAGE_DISK diff --git a/src/storage/meson.build b/src/storage/meson.build index a18da013f8c..1996cd4c11c 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -20,6 +20,10 @@ storage_backend_disk_sources = [ 'storage_backend_disk.c', ] +storage_helper_disk_sources = [ + 'parthelper.c', +] + storage_backend_gluster_sources = [ 'storage_backend_gluster.c', ] @@ -127,6 +131,17 @@ if conf.has('WITH_STORAGE_DISK') ], 'install_dir': storage_backend_install_dir, } + + virt_helpers += { + 'name': 'libvirt_parthelper', + 'sources': [ + files(storage_helper_disk_sources), + dtrace_gen_objects, + ], + 'deps': [ + libparted_dep, + ], + } endif if conf.has('WITH_STORAGE_GLUSTER') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 24 ------------------------ src/util/Makefile.inc.am | 3 --- src/util/meson.build | 14 ++++++++++++++ 3 files changed, 14 insertions(+), 27 deletions(-) delete mode 100644 src/util/Makefile.inc.am diff --git a/src/Makefile.am b/src/Makefile.am index 8760fdf3a22..99bb71e6a03 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -34,7 +34,6 @@ conf_DATA = if WITH_DTRACE_PROBES tapset_DATA = endif WITH_DTRACE_PROBES -libexec_PROGRAMS = RPC_PROBE_FILES = LOGROTATE_FILES_IN = SYSTEMD_UNIT_FILES = @@ -50,7 +49,6 @@ COMMON_UNIT_VARS = \ -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ $(NULL) -include util/Makefile.inc.am include security/Makefile.inc.am include access/Makefile.inc.am include logging/Makefile.inc.am @@ -336,28 +334,6 @@ endif LIBVIRT_INIT_SCRIPT_OPENRC endif WITH_LIBVIRTD -if WITH_LIBVIRTD -libexec_PROGRAMS += libvirt_iohelper -libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES) -libvirt_iohelper_LDFLAGS = \ - $(AM_LDFLAGS) \ - $(NULL) -libvirt_iohelper_LDADD = \ - libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) -if WITH_DTRACE_PROBES -libvirt_iohelper_LDADD += libvirt_probes.lo -endif WITH_DTRACE_PROBES - -libvirt_iohelper_CFLAGS = \ - $(AM_CFLAGS) \ - $(NULL) - - -endif WITH_LIBVIRTD - - install-data-local: $(INSTALL_DATA_LOCAL) \ $(INSTALL_DATA_DIRS:%=install-data-%) $(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt" diff --git a/src/util/Makefile.inc.am b/src/util/Makefile.inc.am deleted file mode 100644 index 879b3d9e398..00000000000 --- a/src/util/Makefile.inc.am +++ /dev/null @@ -1,3 +0,0 @@ -# vim: filetype=automake - -UTIL_IO_HELPER_SOURCES = util/iohelper.c diff --git a/src/util/meson.build b/src/util/meson.build index 3c728b355ee..af60283cbc7 100644 --- a/src/util/meson.build +++ b/src/util/meson.build @@ -168,6 +168,10 @@ foreach name : keyname_list ) endforeach +io_helper_sources = [ + 'iohelper.c', +] + virt_util_lib = static_library( 'virt_util', [ @@ -195,4 +199,14 @@ virt_util_lib = static_library( libvirt_libs += virt_util_lib +if conf.has('WITH_LIBVIRTD') + virt_helpers += { + 'name': 'libvirt_iohelper', + 'sources': [ + files(io_helper_sources), + dtrace_gen_headers, + ], + } +endif + util_inc_dir = include_directories('.') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 5 -- src/meson.build | 103 +++++++++++++++++++++++++++++++++++++++++ src/remote/meson.build | 26 +++++++++++ 3 files changed, 129 insertions(+), 5 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 99bb71e6a03..471ebae2b79 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -69,13 +69,8 @@ include storage/Makefile.inc.am include remote/Makefile.inc.am -confdir = $(sysconfdir)/libvirt conf_DATA += libvirt.conf -augeasdir = $(datadir)/augeas/lenses - -augeastestdir = $(datadir)/augeas/lenses/tests - # .libs/libvirt.so is built by libtool as a side-effect of the Makefile # rule for libvirt.la. However, checking symbols relies on Linux ELF layout if WITH_LINUX diff --git a/src/meson.build b/src/meson.build index bb970f10c61..3a44cd9d663 100644 --- a/src/meson.build +++ b/src/meson.build @@ -149,6 +149,32 @@ virt_daemons = [] # * install_dir - installation directory (optional, libexecdir) virt_helpers = [] +# virt_conf_files: +# libvirt conf files +virt_conf_files = [] + +# virt_aug_files: +# libvirt aug files +virt_aug_files = [] + +# virt_test_aug_files: +# generate libvirt augeas test files +# * name - augeas test file name (required) +# * aug - augeas test file source (required) +# * conf - conf file (required) +virt_test_aug_files = [] + +# virt_daemon_confs: +# generation libvirt daemon conf files +# each entry is a dictionary with following items: +# * name - daemon name (required) +# * name_uc - daemon name with first letter uppercase (required) +# * with_ip - only for libvirtd and virtproxyd (optional, default false) +virt_daemon_confs = [] + +virt_aug_dir = datadir / 'augeas' / 'lenses' +virt_test_aug_dir = datadir / 'augeas' / 'lenses' / 'tests' + # list subdirectories @@ -547,3 +573,80 @@ foreach helper : virt_helpers install_rpath: libdir, ) endforeach + + +# Generate daemon config, augeas and augeas test files + +install_data(virt_conf_files, install_dir: confdir) +install_data(virt_aug_files, install_dir: virt_aug_dir) + +foreach data : virt_test_aug_files + custom_target( + data['name'], + input: [ data['conf'], data['aug'] ], + output: data['name'], + command: [ meson_python_prog, augeas_gentest_prog, '@INPUT@' ], + capture: true, + install: true, + install_dir: virt_test_aug_dir, + ) +endforeach + +foreach data : virt_daemon_confs + daemon_conf = configuration_data() + daemon_conf.set('runstatedir', runstatedir) + daemon_conf.set('sbindir', sbindir) + daemon_conf.set('sysconfdir', sysconfdir) + daemon_conf.set('DAEMON_NAME', data['name']) + daemon_conf.set('DAEMON_NAME_UC', data['name_uc']) + # to silence meson warning about missing 'CONFIG' in the configuration_data + daemon_conf.set('CONFIG', '@CONFIG@') + + if data.get('with_ip', false) + conf_in = libvirtd_conf_tmp + else + conf_in = virtd_conf_tmp + endif + conf_out = configure_file( + input: conf_in, + output: '@0@.conf'.format(data['name']), + configuration: daemon_conf, + install: true, + install_dir: confdir, + ) + + if data.get('with_ip', false) + aug_in = libvirtd_aug_tmp + else + aug_in = virtd_aug_tmp + endif + configure_file( + input: aug_in, + output: '@0@.aug'.format(data['name']), + configuration: daemon_conf, + install: true, + install_dir: virt_aug_dir, + ) + + if data.get('with_ip', false) + test_aug_in = test_libvirtd_aug_tmp + else + test_aug_in = test_virtd_aug_tmp + endif + test_aug_tmp = configure_file( + input: test_aug_in, + output: 'test_@0@.aug.tmp'.format(data['name']), + configuration: daemon_conf, + ) + + test_aug_out = 'test_@0@.aug'.format(data['name']) + custom_target( + test_aug_out, + input: [ conf_out, test_aug_tmp ], + output: test_aug_out, + command: [ meson_python_prog, augeas_gentest_prog, '@INPUT@' ], + capture: true, + install: true, + install_dir: virt_test_aug_dir, + ) +endforeach diff --git a/src/remote/meson.build b/src/remote/meson.build index ee38364868e..6635bcd4cff 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -63,6 +63,32 @@ foreach name : [ 'remote', 'qemu', 'lxc' ] ) endforeach +libvirt_conf_files = [ + [ 'libvirtd.conf.in', 'libvirtd.conf.tmp', 'virtd.conf.tmp' ], + [ 'libvirtd.aug.in', 'libvirtd.aug.tmp', 'virtd.aug.tmp' ], + [ 'test_libvirtd.aug.in', 'test_libvirtd.aug.tmp', 'test_virtd.aug.tmp' ], +] + +foreach name : libvirt_conf_files + tmp = configure_file( + input: name[0], + output: name[1], + command: [ 'sed', '-e', '/[@]CUT_ENABLE_IP[@]/d', '-e', '/[@]END[@]/d', '@INPUT@' ], + capture: true, + ) + set_variable(name[1].underscorify(), tmp) +endforeach + +foreach name : libvirt_conf_files + tmp = configure_file( + input: name[0], + output: name[2], + command: [ 'sed', '-e', '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d', '@INPUT@' ], + capture: true, + ) + set_variable(name[2].underscorify(), tmp) +endforeach + if conf.has('WITH_REMOTE') remote_driver_lib = static_library( 'virt_remote_driver', -- 2.26.2

On Thu, Jul 16, 2020 at 11:57:38 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 5 -- src/meson.build | 103 +++++++++++++++++++++++++++++++++++++++++ src/remote/meson.build | 26 +++++++++++ 3 files changed, 129 insertions(+), 5 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 99bb71e6a03..471ebae2b79 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -69,13 +69,8 @@ include storage/Makefile.inc.am include remote/Makefile.inc.am
-confdir = $(sysconfdir)/libvirt conf_DATA += libvirt.conf
-augeasdir = $(datadir)/augeas/lenses - -augeastestdir = $(datadir)/augeas/lenses/tests - # .libs/libvirt.so is built by libtool as a side-effect of the Makefile # rule for libvirt.la. However, checking symbols relies on Linux ELF layout if WITH_LINUX diff --git a/src/meson.build b/src/meson.build index bb970f10c61..3a44cd9d663 100644 --- a/src/meson.build +++ b/src/meson.build @@ -149,6 +149,32 @@ virt_daemons = [] # * install_dir - installation directory (optional, libexecdir) virt_helpers = []
+# virt_conf_files: +# libvirt conf files +virt_conf_files = [] + +# virt_aug_files: +# libvirt aug files +virt_aug_files = [] + +# virt_test_aug_files: +# generate libvirt augeas test files +# * name - augeas test file name (required) +# * aug - augeas test file source (required) +# * conf - conf file (required) +virt_test_aug_files = [] + +# virt_daemon_confs: +# generation libvirt daemon conf files +# each entry is a dictionary with following items: +# * name - daemon name (required) +# * name_uc - daemon name with first letter uppercase (required)
I've seen that you called some magic inline python to calculate stuff somewhere else. Can't we do it here too?
+# * with_ip - only for libvirtd and virtproxyd (optional, default false) +virt_daemon_confs = [] + +virt_aug_dir = datadir / 'augeas' / 'lenses' +virt_test_aug_dir = datadir / 'augeas' / 'lenses' / 'tests' +
# list subdirectories
@@ -547,3 +573,80 @@ foreach helper : virt_helpers install_rpath: libdir, ) endforeach + + +# Generate daemon config, augeas and augeas test files + +install_data(virt_conf_files, install_dir: confdir) +install_data(virt_aug_files, install_dir: virt_aug_dir) + +foreach data : virt_test_aug_files + custom_target( + data['name'], + input: [ data['conf'], data['aug'] ], + output: data['name'], + command: [ meson_python_prog, augeas_gentest_prog, '@INPUT@' ], + capture: true, + install: true,
Why do we install test files?
+ install_dir: virt_test_aug_dir, + ) +endforeach +
[...]
diff --git a/src/remote/meson.build b/src/remote/meson.build index ee38364868e..6635bcd4cff 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -63,6 +63,32 @@ foreach name : [ 'remote', 'qemu', 'lxc' ] ) endforeach
+libvirt_conf_files = [ + [ 'libvirtd.conf.in', 'libvirtd.conf.tmp', 'virtd.conf.tmp' ], + [ 'libvirtd.aug.in', 'libvirtd.aug.tmp', 'virtd.aug.tmp' ], + [ 'test_libvirtd.aug.in', 'test_libvirtd.aug.tmp', 'test_virtd.aug.tmp' ], +] + +foreach name : libvirt_conf_files + tmp = configure_file( + input: name[0], + output: name[1],
Please at least document the fields in the above list, but preferably use a dict.
+ command: [ 'sed', '-e', '/[@]CUT_ENABLE_IP[@]/d', '-e', '/[@]END[@]/d', '@INPUT@' ], + capture: true, + ) + set_variable(name[1].underscorify(), tmp) +endforeach

On Mon, Jul 27, 2020 at 04:56:41PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:57:38 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 5 -- src/meson.build | 103 +++++++++++++++++++++++++++++++++++++++++ src/remote/meson.build | 26 +++++++++++ 3 files changed, 129 insertions(+), 5 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 99bb71e6a03..471ebae2b79 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -69,13 +69,8 @@ include storage/Makefile.inc.am include remote/Makefile.inc.am
-confdir = $(sysconfdir)/libvirt conf_DATA += libvirt.conf
-augeasdir = $(datadir)/augeas/lenses - -augeastestdir = $(datadir)/augeas/lenses/tests - # .libs/libvirt.so is built by libtool as a side-effect of the Makefile # rule for libvirt.la. However, checking symbols relies on Linux ELF layout if WITH_LINUX diff --git a/src/meson.build b/src/meson.build index bb970f10c61..3a44cd9d663 100644 --- a/src/meson.build +++ b/src/meson.build @@ -149,6 +149,32 @@ virt_daemons = [] # * install_dir - installation directory (optional, libexecdir) virt_helpers = []
+# virt_conf_files: +# libvirt conf files +virt_conf_files = [] + +# virt_aug_files: +# libvirt aug files +virt_aug_files = [] + +# virt_test_aug_files: +# generate libvirt augeas test files +# * name - augeas test file name (required) +# * aug - augeas test file source (required) +# * conf - conf file (required) +virt_test_aug_files = [] + +# virt_daemon_confs: +# generation libvirt daemon conf files +# each entry is a dictionary with following items: +# * name - daemon name (required) +# * name_uc - daemon name with first letter uppercase (required)
I've seen that you called some magic inline python to calculate stuff somewhere else.
Can't we do it here too?
Sure we can, I was just following what we have with autotools where we have both strings as well. I figured that calling name_uc = run_command(python3_prog, '-c', 'print("{0}".capitalize())'.format(data['name'])).stdout().strip() would a bit overkill for this.
+# * with_ip - only for libvirtd and virtproxyd (optional, default false) +virt_daemon_confs = [] + +virt_aug_dir = datadir / 'augeas' / 'lenses' +virt_test_aug_dir = datadir / 'augeas' / 'lenses' / 'tests' +
# list subdirectories
@@ -547,3 +573,80 @@ foreach helper : virt_helpers install_rpath: libdir, ) endforeach + + +# Generate daemon config, augeas and augeas test files + +install_data(virt_conf_files, install_dir: confdir) +install_data(virt_aug_files, install_dir: virt_aug_dir) + +foreach data : virt_test_aug_files + custom_target( + data['name'], + input: [ data['conf'], data['aug'] ], + output: data['name'], + command: [ meson_python_prog, augeas_gentest_prog, '@INPUT@' ], + capture: true, + install: true,
Why do we install test files?
No idea :) but with autotools we install them as well. If we want to change it I would do it as followup patch once this is merged.
+ install_dir: virt_test_aug_dir, + ) +endforeach +
[...]
diff --git a/src/remote/meson.build b/src/remote/meson.build index ee38364868e..6635bcd4cff 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -63,6 +63,32 @@ foreach name : [ 'remote', 'qemu', 'lxc' ] ) endforeach
+libvirt_conf_files = [ + [ 'libvirtd.conf.in', 'libvirtd.conf.tmp', 'virtd.conf.tmp' ], + [ 'libvirtd.aug.in', 'libvirtd.aug.tmp', 'virtd.aug.tmp' ], + [ 'test_libvirtd.aug.in', 'test_libvirtd.aug.tmp', 'test_virtd.aug.tmp' ], +] + +foreach name : libvirt_conf_files + tmp = configure_file( + input: name[0], + output: name[1],
Please at least document the fields in the above list, but preferably use a dict.
Good point, I'll change it into dictionary. Thanks Pavel

On Tue, Jul 28, 2020 at 09:24:13 +0200, Pavel Hrdina wrote:
On Mon, Jul 27, 2020 at 04:56:41PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:57:38 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 5 -- src/meson.build | 103 +++++++++++++++++++++++++++++++++++++++++ src/remote/meson.build | 26 +++++++++++ 3 files changed, 129 insertions(+), 5 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 99bb71e6a03..471ebae2b79 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -69,13 +69,8 @@ include storage/Makefile.inc.am include remote/Makefile.inc.am
-confdir = $(sysconfdir)/libvirt conf_DATA += libvirt.conf
-augeasdir = $(datadir)/augeas/lenses - -augeastestdir = $(datadir)/augeas/lenses/tests - # .libs/libvirt.so is built by libtool as a side-effect of the Makefile # rule for libvirt.la. However, checking symbols relies on Linux ELF layout if WITH_LINUX diff --git a/src/meson.build b/src/meson.build index bb970f10c61..3a44cd9d663 100644 --- a/src/meson.build +++ b/src/meson.build @@ -149,6 +149,32 @@ virt_daemons = [] # * install_dir - installation directory (optional, libexecdir) virt_helpers = []
+# virt_conf_files: +# libvirt conf files +virt_conf_files = [] + +# virt_aug_files: +# libvirt aug files +virt_aug_files = [] + +# virt_test_aug_files: +# generate libvirt augeas test files +# * name - augeas test file name (required) +# * aug - augeas test file source (required) +# * conf - conf file (required) +virt_test_aug_files = [] + +# virt_daemon_confs: +# generation libvirt daemon conf files +# each entry is a dictionary with following items: +# * name - daemon name (required) +# * name_uc - daemon name with first letter uppercase (required)
I've seen that you called some magic inline python to calculate stuff somewhere else.
Can't we do it here too?
Sure we can, I was just following what we have with autotools where we have both strings as well. I figured that calling
name_uc = run_command(python3_prog, '-c', 'print("{0}".capitalize())'.format(data['name'])).stdout().strip()
would a bit overkill for this.
I think it's _WAY_ better than having another entry in the dictionary just for the name with uppercase first letter. The autoconf thing was probably just because it wasn't possible to automate.
+# * with_ip - only for libvirtd and virtproxyd (optional, default false) +virt_daemon_confs = [] + +virt_aug_dir = datadir / 'augeas' / 'lenses' +virt_test_aug_dir = datadir / 'augeas' / 'lenses' / 'tests' +
# list subdirectories
@@ -547,3 +573,80 @@ foreach helper : virt_helpers install_rpath: libdir, ) endforeach + + +# Generate daemon config, augeas and augeas test files + +install_data(virt_conf_files, install_dir: confdir) +install_data(virt_aug_files, install_dir: virt_aug_dir) + +foreach data : virt_test_aug_files + custom_target( + data['name'], + input: [ data['conf'], data['aug'] ], + output: data['name'], + command: [ meson_python_prog, augeas_gentest_prog, '@INPUT@' ], + capture: true, + install: true,
Why do we install test files?
No idea :) but with autotools we install them as well. If we want to change it I would do it as followup patch once this is merged.
Fair enough. This can be kept as-is.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 2 -- src/admin/Makefile.inc.am | 2 -- src/admin/meson.build | 2 ++ src/bhyve/Makefile.inc.am | 2 -- src/bhyve/meson.build | 3 +++ src/libxl/Makefile.inc.am | 2 -- src/libxl/meson.build | 3 +++ src/locking/Makefile.inc.am | 27 ---------------------- src/locking/meson.build | 45 +++++++++++++++++++++++++++++++++++++ src/logging/Makefile.inc.am | 3 --- src/logging/meson.build | 3 +++ src/lxc/Makefile.inc.am | 3 --- src/lxc/meson.build | 3 +++ src/meson.build | 2 ++ src/qemu/Makefile.inc.am | 3 --- src/qemu/meson.build | 3 +++ 16 files changed, 64 insertions(+), 44 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 471ebae2b79..9693a2e1aea 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -69,8 +69,6 @@ include storage/Makefile.inc.am include remote/Makefile.inc.am -conf_DATA += libvirt.conf - # .libs/libvirt.so is built by libtool as a side-effect of the Makefile # rule for libvirt.la. However, checking symbols relies on Linux ELF layout if WITH_LINUX diff --git a/src/admin/Makefile.inc.am b/src/admin/Makefile.inc.am index bdaed14cd19..ec084299b85 100644 --- a/src/admin/Makefile.inc.am +++ b/src/admin/Makefile.inc.am @@ -2,8 +2,6 @@ ADMIN_SYM_FILES = $(srcdir)/admin/libvirt_admin_private.syms -conf_DATA += admin/libvirt-admin.conf - if WITH_LINUX check-admin-symfile: admin/libvirt_admin.syms libvirt-admin.la $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-symfile.py \ diff --git a/src/admin/meson.build b/src/admin/meson.build index 3522d789a00..c9dff4d92a0 100644 --- a/src/admin/meson.build +++ b/src/admin/meson.build @@ -92,4 +92,6 @@ admin_driver_lib = static_library( libvirt_libs += admin_driver_lib +virt_conf_files += files('libvirt-admin.conf') + admin_inc_dir = include_directories('.') diff --git a/src/bhyve/Makefile.inc.am b/src/bhyve/Makefile.inc.am index ab681685b2b..9583580ab02 100644 --- a/src/bhyve/Makefile.inc.am +++ b/src/bhyve/Makefile.inc.am @@ -31,8 +31,6 @@ bhyve/test_virtbhyved.aug: remote/test_libvirtd.aug.in \ -e 's/[@]DAEMON_NAME_UC[@]/Virtbhyved/' \ > $@ || rm -f $@ -conf_DATA += bhyve/bhyve.conf -augeas_DATA += bhyve/libvirtd_bhyve.aug augeastest_DATA += bhyve/test_libvirtd_bhyve.aug bhyve/test_libvirtd_bhyve.aug: bhyve/test_libvirtd_bhyve.aug.in \ diff --git a/src/bhyve/meson.build b/src/bhyve/meson.build index 5807d67591a..9380ec3313f 100644 --- a/src/bhyve/meson.build +++ b/src/bhyve/meson.build @@ -43,4 +43,7 @@ if conf.has('WITH_BHYVE') '-DMODULE_NAME="bhyve"' ], } + + virt_conf_files += files('bhyve.conf') + virt_aug_files += files('libvirtd_bhyve.aug') endif diff --git a/src/libxl/Makefile.inc.am b/src/libxl/Makefile.inc.am index 051b6c55bd9..021bf4b8d51 100644 --- a/src/libxl/Makefile.inc.am +++ b/src/libxl/Makefile.inc.am @@ -71,8 +71,6 @@ libxl/test_virtxend.aug: remote/test_libvirtd.aug.in \ -e 's/[@]DAEMON_NAME_UC[@]/Virtxend/' \ > $@ || rm -f $@ -conf_DATA += libxl/libxl.conf -augeas_DATA += libxl/libvirtd_libxl.aug augeastest_DATA += libxl/test_libvirtd_libxl.aug libxl/test_libvirtd_libxl.aug: libxl/test_libvirtd_libxl.aug.in \ diff --git a/src/libxl/meson.build b/src/libxl/meson.build index fc5864a090c..0415a0c4a71 100644 --- a/src/libxl/meson.build +++ b/src/libxl/meson.build @@ -44,4 +44,7 @@ if conf.has('WITH_LIBXL') '-DMODULE_NAME="libxl"', ], } + + virt_conf_files += files('libxl.conf') + virt_aug_files += files('libvirtd_libxl.aug') endif diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index b4fb9387a17..0826472cfca 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -20,34 +20,15 @@ OPENRC_INIT_FILES_IN += \ $(NULL) if WITH_LIBVIRTD -augeas_DATA += locking/libvirt_lockd.aug - if WITH_QEMU augeastest_DATA += locking/test_libvirt_lockd.aug -nodist_conf_DATA += locking/qemu-lockd.conf endif WITH_QEMU - -if WITH_LIBXL -nodist_conf_DATA += locking/libxl-lockd.conf -endif WITH_LIBXL - if WITH_SANLOCK -augeas_DATA += locking/libvirt_sanlock.aug - if WITH_QEMU augeastest_DATA += locking/test_libvirt_sanlock.aug -nodist_conf_DATA += locking/qemu-sanlock.conf endif WITH_QEMU - -if WITH_LIBXL -nodist_conf_DATA += locking/libxl-sanlock.conf -endif WITH_LIBXL - endif WITH_SANLOCK -conf_DATA += locking/virtlockd.conf - -augeas_DATA += locking/virtlockd.aug augeastest_DATA += locking/test_virtlockd.aug INSTALL_DATA_DIRS += locking @@ -94,14 +75,6 @@ endif WITH_LIBVIRTD uninstall-data-locking \ $(NULL) -locking/%-lockd.conf: $(srcdir)/locking/lockd.conf - $(AM_V_GEN)$(MKDIR_P) locking ; \ - cp $< $@ - -locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf - $(AM_V_GEN)$(MKDIR_P) locking ; \ - cp $< $@ - virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ diff --git a/src/locking/meson.build b/src/locking/meson.build index 0e48c86afc9..9e09c96f67b 100644 --- a/src/locking/meson.build +++ b/src/locking/meson.build @@ -145,4 +145,49 @@ if conf.has('WITH_LIBVIRTD') ], } endif + + virt_aug_files += files('libvirt_lockd.aug') + + if conf.has('WITH_QEMU') + qemu_lockd_conf = configure_file( + input: 'lockd.conf', + output: 'qemu-lockd.conf', + copy: true, + ) + virt_conf_files += qemu_lockd_conf + endif + + if conf.has('WITH_LIBXL') + libxl_lockd_conf = configure_file( + input: 'lockd.conf', + output: 'libxl-lockd.conf', + copy: true, + ) + virt_conf_files += libxl_lockd_conf + endif + + if conf.has('WITH_SANLOCK') + virt_aug_files += files('libvirt_sanlock.aug') + + if conf.has('WITH_QEMU') + qemu_sanlock_conf = configure_file( + input: 'sanlock.conf', + output: 'qemu-sanlock.conf', + copy: true, + ) + virt_conf_files += qemu_sanlock_conf + endif + + if conf.has('WITH_LIBXL') + libxl_sanlock_conf = configure_file( + input: 'sanlock.conf', + output: 'libxl-sanlock.conf', + copy: true, + ) + virt_conf_files += libxl_sanlock_conf + endif + endif + + virt_conf_files += files('virtlockd.conf') + virt_aug_files += files('virtlockd.aug') endif diff --git a/src/logging/Makefile.inc.am b/src/logging/Makefile.inc.am index 8adec645d36..1ae0078e434 100644 --- a/src/logging/Makefile.inc.am +++ b/src/logging/Makefile.inc.am @@ -19,9 +19,6 @@ OPENRC_INIT_FILES_IN += \ $(NULL) if WITH_LIBVIRTD -conf_DATA += logging/virtlogd.conf - -augeas_DATA += logging/virtlogd.aug augeastest_DATA += logging/test_virtlogd.aug logging/test_virtlogd.aug: logging/test_virtlogd.aug.in \ diff --git a/src/logging/meson.build b/src/logging/meson.build index 0e58bc9e6bd..9594646c81f 100644 --- a/src/logging/meson.build +++ b/src/logging/meson.build @@ -69,4 +69,7 @@ if conf.has('WITH_LIBVIRTD') include_directories('.'), ], } + + virt_conf_files += files('virtlogd.conf') + virt_aug_files += files('virtlogd.aug') endif diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am index 03f03ba13db..aea70f37a87 100644 --- a/src/lxc/Makefile.inc.am +++ b/src/lxc/Makefile.inc.am @@ -77,9 +77,6 @@ if WITH_DTRACE_PROBES RPC_PROBE_FILES += $(srcdir)/lxc/lxc_monitor_protocol.x endif -conf_DATA += lxc/lxc.conf - -augeas_DATA += lxc/libvirtd_lxc.aug augeastest_DATA += lxc/test_libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \ diff --git a/src/lxc/meson.build b/src/lxc/meson.build index cf1f976573a..7295510c62b 100644 --- a/src/lxc/meson.build +++ b/src/lxc/meson.build @@ -128,4 +128,7 @@ if conf.has('WITH_LXC') xdr_dep, ], } + + virt_conf_files += files('lxc.conf') + virt_aug_files += files('libvirtd_lxc.aug') endif diff --git a/src/meson.build b/src/meson.build index 3a44cd9d663..f19870d2c18 100644 --- a/src/meson.build +++ b/src/meson.build @@ -577,6 +577,8 @@ endforeach # Generate daemon config, augeas and augeas test files +virt_conf_files += 'libvirt.conf' + install_data(virt_conf_files, install_dir: confdir) install_data(virt_aug_files, install_dir: virt_aug_dir) diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am index 80555d79a40..5817e1266f3 100644 --- a/src/qemu/Makefile.inc.am +++ b/src/qemu/Makefile.inc.am @@ -66,9 +66,6 @@ qemu/test_virtqemud.aug: remote/test_libvirtd.aug.in \ -e 's/[@]DAEMON_NAME_UC[@]/Virtqemud/' \ > $@ || rm -f $@ -conf_DATA += qemu/qemu.conf - -augeas_DATA += qemu/libvirtd_qemu.aug augeastest_DATA += qemu/test_libvirtd_qemu.aug qemu/test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \ diff --git a/src/qemu/meson.build b/src/qemu/meson.build index fca7cf1658f..680ca2189a6 100644 --- a/src/qemu/meson.build +++ b/src/qemu/meson.build @@ -118,6 +118,9 @@ if conf.has('WITH_QEMU') ], } + virt_conf_files += files('qemu.conf') + virt_aug_files += files('libvirtd_qemu.aug') + virt_helpers += { 'name': 'virt-qemu-run', 'sources': [ -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/bhyve/Makefile.inc.am | 6 ------ src/bhyve/meson.build | 5 +++++ src/libxl/Makefile.inc.am | 6 ------ src/libxl/meson.build | 5 +++++ src/locking/Makefile.inc.am | 32 -------------------------------- src/locking/meson.build | 15 +++++++++++++++ src/logging/Makefile.inc.am | 9 --------- src/logging/meson.build | 5 +++++ src/lxc/Makefile.inc.am | 6 ------ src/lxc/meson.build | 5 +++++ src/qemu/Makefile.inc.am | 6 ------ src/qemu/meson.build | 5 +++++ 12 files changed, 40 insertions(+), 65 deletions(-) diff --git a/src/bhyve/Makefile.inc.am b/src/bhyve/Makefile.inc.am index 9583580ab02..e09c503c384 100644 --- a/src/bhyve/Makefile.inc.am +++ b/src/bhyve/Makefile.inc.am @@ -31,10 +31,4 @@ bhyve/test_virtbhyved.aug: remote/test_libvirtd.aug.in \ -e 's/[@]DAEMON_NAME_UC[@]/Virtbhyved/' \ > $@ || rm -f $@ -augeastest_DATA += bhyve/test_libvirtd_bhyve.aug - -bhyve/test_libvirtd_bhyve.aug: bhyve/test_libvirtd_bhyve.aug.in \ - $(srcdir)/bhyve/bhyve.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/bhyve/bhyve.conf $< > $@ - endif WITH_BHYVE diff --git a/src/bhyve/meson.build b/src/bhyve/meson.build index 9380ec3313f..74caddf030e 100644 --- a/src/bhyve/meson.build +++ b/src/bhyve/meson.build @@ -46,4 +46,9 @@ if conf.has('WITH_BHYVE') virt_conf_files += files('bhyve.conf') virt_aug_files += files('libvirtd_bhyve.aug') + virt_test_aug_files += { + 'name': 'test_libvirtd_bhyve.aug', + 'aug': files('test_libvirtd_bhyve.aug.in'), + 'conf': files('bhyve.conf'), + } endif diff --git a/src/libxl/Makefile.inc.am b/src/libxl/Makefile.inc.am index 021bf4b8d51..9af04c4914a 100644 --- a/src/libxl/Makefile.inc.am +++ b/src/libxl/Makefile.inc.am @@ -71,12 +71,6 @@ libxl/test_virtxend.aug: remote/test_libvirtd.aug.in \ -e 's/[@]DAEMON_NAME_UC[@]/Virtxend/' \ > $@ || rm -f $@ -augeastest_DATA += libxl/test_libvirtd_libxl.aug - -libxl/test_libvirtd_libxl.aug: libxl/test_libvirtd_libxl.aug.in \ - $(srcdir)/libxl/libxl.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/libxl/libxl.conf $< > $@ - INSTALL_DATA_DIRS += libxl install-data-libxl: diff --git a/src/libxl/meson.build b/src/libxl/meson.build index 0415a0c4a71..92916831120 100644 --- a/src/libxl/meson.build +++ b/src/libxl/meson.build @@ -47,4 +47,9 @@ if conf.has('WITH_LIBXL') virt_conf_files += files('libxl.conf') virt_aug_files += files('libvirtd_libxl.aug') + virt_test_aug_files += { + 'name': 'test_libvirtd_libxl.aug', + 'aug': files('test_libvirtd_libxl.aug.in'), + 'conf': files('libxl.conf'), + } endif diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index 0826472cfca..a2a0a4c6250 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -19,18 +19,6 @@ OPENRC_INIT_FILES_IN += \ locking/virtlockd.init.in \ $(NULL) -if WITH_LIBVIRTD -if WITH_QEMU -augeastest_DATA += locking/test_libvirt_lockd.aug -endif WITH_QEMU -if WITH_SANLOCK -if WITH_QEMU -augeastest_DATA += locking/test_libvirt_sanlock.aug -endif WITH_QEMU -endif WITH_SANLOCK - -augeastest_DATA += locking/test_virtlockd.aug - INSTALL_DATA_DIRS += locking install-data-locking: @@ -48,26 +36,6 @@ uninstall-data-locking: if WITH_SANLOCK rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||: endif WITH_SANLOCK - -if WITH_SANLOCK -if WITH_QEMU -locking/test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \ - locking/qemu-sanlock.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< > $@ - -endif WITH_QEMU -endif WITH_SANLOCK - -if WITH_QEMU -locking/test_libvirt_lockd.aug: locking/test_libvirt_lockd.aug.in \ - locking/qemu-lockd.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) locking/qemu-lockd.conf $< > $@ -endif WITH_QEMU - -locking/test_virtlockd.aug: locking/test_virtlockd.aug.in \ - locking/virtlockd.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< > $@ - endif WITH_LIBVIRTD .PHONY: \ diff --git a/src/locking/meson.build b/src/locking/meson.build index 9e09c96f67b..0681e4fbc4d 100644 --- a/src/locking/meson.build +++ b/src/locking/meson.build @@ -155,6 +155,11 @@ if conf.has('WITH_LIBVIRTD') copy: true, ) virt_conf_files += qemu_lockd_conf + virt_test_aug_files += { + 'name': 'test_libvirt_lockd.aug', + 'aug' : files('test_libvirt_lockd.aug.in'), + 'conf': qemu_lockd_conf, + } endif if conf.has('WITH_LIBXL') @@ -176,6 +181,11 @@ if conf.has('WITH_LIBVIRTD') copy: true, ) virt_conf_files += qemu_sanlock_conf + virt_test_aug_files += { + 'name': 'test_libvirt_sanlock.aug', + 'aug' : files('test_libvirt_sanlock.aug.in'), + 'conf': qemu_sanlock_conf, + } endif if conf.has('WITH_LIBXL') @@ -190,4 +200,9 @@ if conf.has('WITH_LIBVIRTD') virt_conf_files += files('virtlockd.conf') virt_aug_files += files('virtlockd.aug') + virt_test_aug_files += { + 'name': 'test_virtlockd.aug', + 'aug': files('test_virtlockd.aug.in'), + 'conf': files('virtlockd.conf'), + } endif diff --git a/src/logging/Makefile.inc.am b/src/logging/Makefile.inc.am index 1ae0078e434..b13f53ffe41 100644 --- a/src/logging/Makefile.inc.am +++ b/src/logging/Makefile.inc.am @@ -18,15 +18,6 @@ OPENRC_INIT_FILES_IN += \ logging/virtlogd.init.in \ $(NULL) -if WITH_LIBVIRTD -augeastest_DATA += logging/test_virtlogd.aug - -logging/test_virtlogd.aug: logging/test_virtlogd.aug.in \ - logging/virtlogd.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/logging/virtlogd.conf $< > $@ - -endif WITH_LIBVIRTD - virtlogd.init: logging/virtlogd.init.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ diff --git a/src/logging/meson.build b/src/logging/meson.build index 9594646c81f..4897cbf1f32 100644 --- a/src/logging/meson.build +++ b/src/logging/meson.build @@ -72,4 +72,9 @@ if conf.has('WITH_LIBVIRTD') virt_conf_files += files('virtlogd.conf') virt_aug_files += files('virtlogd.aug') + virt_test_aug_files += { + 'name': 'test_virtlogd.aug', + 'aug': files('test_virtlogd.aug.in'), + 'conf': files('virtlogd.conf'), + } endif diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am index aea70f37a87..bee6c99b025 100644 --- a/src/lxc/Makefile.inc.am +++ b/src/lxc/Makefile.inc.am @@ -77,12 +77,6 @@ if WITH_DTRACE_PROBES RPC_PROBE_FILES += $(srcdir)/lxc/lxc_monitor_protocol.x endif -augeastest_DATA += lxc/test_libvirtd_lxc.aug - -lxc/test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \ - $(srcdir)/lxc/lxc.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< > $@ - INSTALL_DATA_DIRS += lxc install-data-lxc: diff --git a/src/lxc/meson.build b/src/lxc/meson.build index 7295510c62b..825c280bd10 100644 --- a/src/lxc/meson.build +++ b/src/lxc/meson.build @@ -131,4 +131,9 @@ if conf.has('WITH_LXC') virt_conf_files += files('lxc.conf') virt_aug_files += files('libvirtd_lxc.aug') + virt_test_aug_files += { + 'name': 'test_libvirtd_lxc.aug', + 'aug': files('test_libvirtd_lxc.aug.in'), + 'conf': files('lxc.conf'), + } endif diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am index 5817e1266f3..ff8a3dcbdc6 100644 --- a/src/qemu/Makefile.inc.am +++ b/src/qemu/Makefile.inc.am @@ -66,12 +66,6 @@ qemu/test_virtqemud.aug: remote/test_libvirtd.aug.in \ -e 's/[@]DAEMON_NAME_UC[@]/Virtqemud/' \ > $@ || rm -f $@ -augeastest_DATA += qemu/test_libvirtd_qemu.aug - -qemu/test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \ - $(srcdir)/qemu/qemu.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< > $@ - INSTALL_DATA_DIRS += qemu install-data-qemu: diff --git a/src/qemu/meson.build b/src/qemu/meson.build index 680ca2189a6..4d5cfec7eaa 100644 --- a/src/qemu/meson.build +++ b/src/qemu/meson.build @@ -120,6 +120,11 @@ if conf.has('WITH_QEMU') virt_conf_files += files('qemu.conf') virt_aug_files += files('libvirtd_qemu.aug') + virt_test_aug_files += { + 'name': 'test_libvirtd_qemu.aug', + 'aug': files('test_libvirtd_qemu.aug.in'), + 'conf': files('qemu.conf'), + } virt_helpers += { 'name': 'virt-qemu-run', -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 5 --- src/bhyve/Makefile.inc.am | 30 ------------- src/bhyve/meson.build | 5 +++ src/interface/Makefile.inc.am | 27 ------------ src/interface/meson.build | 5 +++ src/libxl/Makefile.inc.am | 27 ------------ src/libxl/meson.build | 5 +++ src/lxc/Makefile.inc.am | 27 ------------ src/lxc/meson.build | 5 +++ src/network/Makefile.inc.am | 27 ------------ src/network/meson.build | 5 +++ src/node_device/Makefile.inc.am | 28 ------------ src/node_device/meson.build | 5 +++ src/nwfilter/Makefile.inc.am | 28 ------------ src/nwfilter/meson.build | 5 +++ src/qemu/Makefile.inc.am | 27 ------------ src/qemu/meson.build | 5 +++ src/remote/Makefile.inc.am | 77 --------------------------------- src/remote/meson.build | 12 +++++ src/secret/Makefile.inc.am | 27 ------------ src/secret/meson.build | 5 +++ src/storage/Makefile.inc.am | 28 ------------ src/storage/meson.build | 5 +++ src/vbox/Makefile.inc.am | 27 ------------ src/vbox/meson.build | 5 +++ src/vz/Makefile.inc.am | 27 ------------ src/vz/meson.build | 5 +++ 27 files changed, 72 insertions(+), 412 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 9693a2e1aea..82e7212b186 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,7 +20,6 @@ # here. List them against the individual XXX_la_CFLAGS targets # that actually use them. -nodist_conf_DATA = DRIVER_SOURCE_FILES = STATEFUL_DRIVER_SOURCE_FILES = INSTALL_DATA_DIRS = @@ -30,7 +29,6 @@ SYM_FILES = USED_SYM_FILES = augeas_DATA = augeastest_DATA = -conf_DATA = if WITH_DTRACE_PROBES tapset_DATA = endif WITH_DTRACE_PROBES @@ -195,9 +193,6 @@ check-augeas: $(augeas_DATA) $(augeastest_DATA) fi .PHONY: check-augeas -AUG_GENTEST_SCRIPT = $(top_srcdir)/scripts/augeas-gentest.py -AUG_GENTEST = $(RUNUTF8) $(PYTHON) $(AUG_GENTEST_SCRIPT) - if WITH_DTRACE_PROBES tapset_DATA += libvirt_functions.stp diff --git a/src/bhyve/Makefile.inc.am b/src/bhyve/Makefile.inc.am index e09c503c384..65021d785a2 100644 --- a/src/bhyve/Makefile.inc.am +++ b/src/bhyve/Makefile.inc.am @@ -2,33 +2,3 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(BHYVE_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(BHYVE_DRIVER_SOURCES)) - -if WITH_BHYVE -nodist_conf_DATA += bhyve/virtbhyved.conf -augeas_DATA += bhyve/virtbhyved.aug -augeastest_DATA += bhyve/test_virtbhyved.aug - -bhyve/virtbhyved.conf: remote/libvirtd.conf.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtbhyved/' \ - $< > $@ - -bhyve/virtbhyved.aug: remote/libvirtd.aug.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtbhyved/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtbhyved/' \ - $< > $@ - -bhyve/test_virtbhyved.aug: remote/test_libvirtd.aug.in \ - bhyve/virtbhyved.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) bhyve/virtbhyved.conf \ - $(srcdir)/remote/test_libvirtd.aug.in | \ - $(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtbhyved/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtbhyved/' \ - > $@ || rm -f $@ - -endif WITH_BHYVE diff --git a/src/bhyve/meson.build b/src/bhyve/meson.build index 74caddf030e..fd1f6bbad88 100644 --- a/src/bhyve/meson.build +++ b/src/bhyve/meson.build @@ -51,4 +51,9 @@ if conf.has('WITH_BHYVE') 'aug': files('test_libvirtd_bhyve.aug.in'), 'conf': files('bhyve.conf'), } + + virt_daemon_confs += { + 'name': 'virtbhyved', + 'name_uc': 'Virtbhyved', + } endif diff --git a/src/interface/Makefile.inc.am b/src/interface/Makefile.inc.am index 7d1d8ed2c4c..a189105dcac 100644 --- a/src/interface/Makefile.inc.am +++ b/src/interface/Makefile.inc.am @@ -6,10 +6,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_INTERFACE -nodist_conf_DATA += interface/virtinterfaced.conf -augeas_DATA += interface/virtinterfaced.aug -augeastest_DATA += interface/test_virtinterfaced.aug - SYSCONF_FILES += interface/virtinterfaced.sysconf SYSTEMD_UNIT_FILES += \ @@ -48,27 +44,4 @@ virtinterface%.socket: remote/libvirt%.socket.in \ $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(VIRTINTERFACED_UNIT_VARS) $< > $@-t && mv $@-t $@ -interface/virtinterfaced.conf: remote/libvirtd.conf.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtinterfaced/' \ - $< > $@ - -interface/virtinterfaced.aug: remote/libvirtd.aug.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtinterfaced/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtinterfaced/' \ - $< > $@ - -interface/test_virtinterfaced.aug: remote/test_libvirtd.aug.in \ - interface/virtinterfaced.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) interface/virtinterfaced.conf \ - $(srcdir)/remote/test_libvirtd.aug.in | \ - $(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtinterfaced/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtinterfaced/' \ - > $@ || rm -f $@ - endif WITH_INTERFACE diff --git a/src/interface/meson.build b/src/interface/meson.build index dbf1d7ff606..fa9c674c084 100644 --- a/src/interface/meson.build +++ b/src/interface/meson.build @@ -34,4 +34,9 @@ if conf.has('WITH_INTERFACE') '-DMODULE_NAME="interface"', ], } + + virt_daemon_confs += { + 'name': 'virtinterfaced', + 'name_uc': 'Virtinterfaced', + } endif diff --git a/src/libxl/Makefile.inc.am b/src/libxl/Makefile.inc.am index 9af04c4914a..57271db1be8 100644 --- a/src/libxl/Makefile.inc.am +++ b/src/libxl/Makefile.inc.am @@ -5,10 +5,6 @@ STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(LIBXL_DRIVER_SOURCES)) if WITH_LIBXL -nodist_conf_DATA += libxl/virtxend.conf -augeas_DATA += libxl/virtxend.aug -augeastest_DATA += libxl/test_virtxend.aug - SYSCONF_FILES += libxl/virtxend.sysconf SYSTEMD_UNIT_FILES += \ @@ -48,29 +44,6 @@ virtxend.service: libxl/virtxend.service.in $(top_builddir)/config.status virtxen%.socket: remote/libvirt%.socket.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(VIRTXEND_UNIT_VARS) $< > $@-t && mv $@-t $@ -libxl/virtxend.conf: remote/libvirtd.conf.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtxend/' \ - $< > $@ - -libxl/virtxend.aug: remote/libvirtd.aug.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtxend/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtxend/' \ - $< > $@ - -libxl/test_virtxend.aug: remote/test_libvirtd.aug.in \ - libxl/virtxend.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) libxl/virtxend.conf \ - $(srcdir)/remote/test_libvirtd.aug.in | \ - $(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtxend/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtxend/' \ - > $@ || rm -f $@ - INSTALL_DATA_DIRS += libxl install-data-libxl: diff --git a/src/libxl/meson.build b/src/libxl/meson.build index 92916831120..2fc72d92ac2 100644 --- a/src/libxl/meson.build +++ b/src/libxl/meson.build @@ -52,4 +52,9 @@ if conf.has('WITH_LIBXL') 'aug': files('test_libvirtd_libxl.aug.in'), 'conf': files('libxl.conf'), } + + virt_daemon_confs += { + 'name': 'virtxend', + 'name_uc': 'Virtxend', + } endif diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am index bee6c99b025..2692163226c 100644 --- a/src/lxc/Makefile.inc.am +++ b/src/lxc/Makefile.inc.am @@ -11,10 +11,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_LXC -nodist_conf_DATA += lxc/virtlxcd.conf -augeas_DATA += lxc/virtlxcd.aug -augeastest_DATA += lxc/test_virtlxcd.aug - SYSCONF_FILES += lxc/virtlxcd.sysconf SYSTEMD_UNIT_FILES += \ @@ -50,29 +46,6 @@ virtlxcd.service: lxc/virtlxcd.service.in $(top_builddir)/config.status virtlxc%.socket: remote/libvirt%.socket.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(VIRTLXCD_UNIT_VARS) $< > $@-t && mv $@-t $@ -lxc/virtlxcd.conf: remote/libvirtd.conf.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtlxcd/' \ - $< > $@ - -lxc/virtlxcd.aug: remote/libvirtd.aug.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtlxcd/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtlxcd/' \ - $< > $@ - -lxc/test_virtlxcd.aug: remote/test_libvirtd.aug.in \ - lxc/virtlxcd.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) lxc/virtlxcd.conf \ - $(srcdir)/remote/test_libvirtd.aug.in | \ - $(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtlxcd/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtlxcd/' \ - > $@ || rm -f $@ - if WITH_DTRACE_PROBES RPC_PROBE_FILES += $(srcdir)/lxc/lxc_monitor_protocol.x endif diff --git a/src/lxc/meson.build b/src/lxc/meson.build index 825c280bd10..650eaef1d81 100644 --- a/src/lxc/meson.build +++ b/src/lxc/meson.build @@ -136,4 +136,9 @@ if conf.has('WITH_LXC') 'aug': files('test_libvirtd_lxc.aug.in'), 'conf': files('lxc.conf'), } + + virt_daemon_confs += { + 'name': 'virtlxcd', + 'name_uc': 'Virtlxcd', + } endif diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am index fe93adc0194..ee5413e85e1 100644 --- a/src/network/Makefile.inc.am +++ b/src/network/Makefile.inc.am @@ -5,10 +5,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(NETWORK_DRIVER_SOURCES)) if WITH_NETWORK -nodist_conf_DATA += network/virtnetworkd.conf -augeas_DATA += network/virtnetworkd.aug -augeastest_DATA += network/test_virtnetworkd.aug - SYSCONF_FILES += network/virtnetworkd.sysconf SYSTEMD_UNIT_FILES += \ @@ -46,29 +42,6 @@ virtnetwork%.socket: remote/libvirt%.socket.in \ $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(VIRTNETWORKD_UNIT_VARS) $< > $@-t && mv $@-t $@ -network/virtnetworkd.conf: remote/libvirtd.conf.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtnetworkd/' \ - $< > $@ - -network/virtnetworkd.aug: remote/libvirtd.aug.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtnetworkd/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtnetworkd/' \ - $< > $@ - -network/test_virtnetworkd.aug: remote/test_libvirtd.aug.in \ - network/virtnetworkd.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) network/virtnetworkd.conf \ - $(srcdir)/remote/test_libvirtd.aug.in | \ - $(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtnetworkd/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtnetworkd/' \ - > $@ || rm -f $@ - INSTALL_DATA_DIRS += network UUID=$(shell uuidgen 2>/dev/null) diff --git a/src/network/meson.build b/src/network/meson.build index 9b59e442c9d..1e31f8d30cb 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -46,6 +46,11 @@ if conf.has('WITH_NETWORK') ], } + virt_daemon_confs += { + 'name': 'virtnetworkd', + 'name_uc': 'Virtnetworkd', + } + virt_helpers += { 'name': 'libvirt_leaseshelper', 'sources': [ diff --git a/src/node_device/Makefile.inc.am b/src/node_device/Makefile.inc.am index 731d513c980..79491aee577 100644 --- a/src/node_device/Makefile.inc.am +++ b/src/node_device/Makefile.inc.am @@ -12,10 +12,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_NODE_DEVICES -nodist_conf_DATA += node_device/virtnodedevd.conf -augeas_DATA += node_device/virtnodedevd.aug -augeastest_DATA += node_device/test_virtnodedevd.aug - SYSCONF_FILES += node_device/virtnodedevd.sysconf SYSTEMD_UNIT_FILES += \ @@ -53,28 +49,4 @@ virtnodedevd.service: node_device/virtnodedevd.service.in \ virtnodedev%.socket: remote/libvirt%.socket.in \ $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(VIRTNODEDEVD_UNIT_VARS) $< > $@-t && mv $@-t $@ - -node_device/virtnodedevd.conf: remote/libvirtd.conf.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtnodedevd/' \ - $< > $@ - -node_device/virtnodedevd.aug: remote/libvirtd.aug.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtnodedevd/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtnodedevd/' \ - $< > $@ - -node_device/test_virtnodedevd.aug: remote/test_libvirtd.aug.in \ - node_device/virtnodedevd.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) node_device/virtnodedevd.conf \ - $(srcdir)/remote/test_libvirtd.aug.in | \ - $(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtnodedevd/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtnodedevd/' \ - > $@ || rm -f $@ - endif WITH_NODE_DEVICES diff --git a/src/node_device/meson.build b/src/node_device/meson.build index f85320cf85a..e81fe281359 100644 --- a/src/node_device/meson.build +++ b/src/node_device/meson.build @@ -46,4 +46,9 @@ if conf.has('WITH_NODE_DEVICES') '-DMODULE_NAME="nodedev"', ], } + + virt_daemon_confs += { + 'name': 'virtnodedevd', + 'name_uc': 'Virtnodedevd', + } endif diff --git a/src/nwfilter/Makefile.inc.am b/src/nwfilter/Makefile.inc.am index eb5cade5b95..2c0d29454bb 100644 --- a/src/nwfilter/Makefile.inc.am +++ b/src/nwfilter/Makefile.inc.am @@ -11,10 +11,6 @@ if WITH_NWFILTER nwfilterxmldir = $(sysconfdir)/libvirt/nwfilter nwfilterxml_DATA = $(NWFILTER_XML_FILES) -nodist_conf_DATA += nwfilter/virtnwfilterd.conf -augeas_DATA += nwfilter/virtnwfilterd.aug -augeastest_DATA += nwfilter/test_virtnwfilterd.aug - SYSCONF_FILES += nwfilter/virtnwfilterd.sysconf SYSTEMD_UNIT_FILES += \ @@ -52,28 +48,4 @@ virtnwfilterd.service: nwfilter/virtnwfilterd.service.in \ virtnwfilter%.socket: remote/libvirt%.socket.in \ $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(VIRTNWFILTERD_UNIT_VARS) $< > $@-t && mv $@-t $@ - -nwfilter/virtnwfilterd.conf: remote/libvirtd.conf.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtnwfilterd/' \ - $< > $@ - -nwfilter/virtnwfilterd.aug: remote/libvirtd.aug.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtnwfilterd/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtnwfilterd/' \ - $< > $@ - -nwfilter/test_virtnwfilterd.aug: remote/test_libvirtd.aug.in \ - nwfilter/virtnwfilterd.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) nwfilter/virtnwfilterd.conf \ - $(srcdir)/remote/test_libvirtd.aug.in | \ - $(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtnwfilterd/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtnwfilterd/' \ - > $@ || rm -f $@ - endif WITH_NWFILTER diff --git a/src/nwfilter/meson.build b/src/nwfilter/meson.build index b8f94c726c1..0c8641735c8 100644 --- a/src/nwfilter/meson.build +++ b/src/nwfilter/meson.build @@ -41,4 +41,9 @@ if conf.has('WITH_NWFILTER') '-DMODULE_NAME="nwfilter"', ], } + + virt_daemon_confs += { + 'name': 'virtnwfilterd', + 'name_uc': 'Virtnwfilterd', + } endif diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am index ff8a3dcbdc6..46a7d1e9be2 100644 --- a/src/qemu/Makefile.inc.am +++ b/src/qemu/Makefile.inc.am @@ -4,10 +4,6 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES)) if WITH_QEMU -nodist_conf_DATA += qemu/virtqemud.conf -augeas_DATA += qemu/virtqemud.aug -augeastest_DATA += qemu/test_virtqemud.aug - SYSCONF_FILES += qemu/virtqemud.sysconf SYSTEMD_UNIT_FILES += \ @@ -43,29 +39,6 @@ virtqemud.service: qemu/virtqemud.service.in $(top_builddir)/config.status virtqemu%.socket: remote/libvirt%.socket.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(VIRTQEMUD_UNIT_VARS) $< > $@-t && mv $@-t $@ -qemu/virtqemud.conf: remote/libvirtd.conf.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtqemud/' \ - $< > $@ - -qemu/virtqemud.aug: remote/libvirtd.aug.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtqemud/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtqemud/' \ - $< > $@ - -qemu/test_virtqemud.aug: remote/test_libvirtd.aug.in \ - qemu/virtqemud.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) qemu/virtqemud.conf \ - $(srcdir)/remote/test_libvirtd.aug.in | \ - $(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtqemud/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtqemud/' \ - > $@ || rm -f $@ - INSTALL_DATA_DIRS += qemu install-data-qemu: diff --git a/src/qemu/meson.build b/src/qemu/meson.build index 4d5cfec7eaa..35af65cf5f5 100644 --- a/src/qemu/meson.build +++ b/src/qemu/meson.build @@ -133,4 +133,9 @@ if conf.has('WITH_QEMU') ], 'install_dir': bindir, } + + virt_daemon_confs += { + 'name': 'virtqemud', + 'name_uc': 'Virtqemud', + } endif diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 2007bdf8654..dfea32ff21e 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -62,39 +62,6 @@ OPENRC_CONF_FILES += \ if WITH_LIBVIRTD -augeas_DATA += \ - remote/libvirtd.aug \ - remote/virtproxyd.aug \ - $(NULL) - -augeastest_DATA += \ - remote/test_libvirtd.aug \ - remote/test_virtproxyd.aug \ - $(NULL) - -nodist_conf_DATA += \ - remote/libvirtd.conf \ - remote/virtproxyd.conf \ - $(NULL) - -remote/libvirtd.conf: remote/libvirtd.conf.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/d' \ - -e '/[@]END[@]/d' \ - -e 's|[@]sysconfdir[@]|@sysconfdir@|' \ - -e 's|[@]runstatedir[@]|@runstatedir@|' \ - -e 's|[@]DAEMON_NAME[@]|libvirtd|' \ - $< > $@ - -remote/virtproxyd.conf: remote/libvirtd.conf.in - $(AM_V_GEN)sed \ - -e '/[@]CUT_ENABLE_IP[@]/d' \ - -e '/[@]END[@]/d' \ - -e 's|[@]sysconfdir[@]|@sysconfdir@|' \ - -e 's|[@]runstatedir[@]|@runstatedir@|' \ - -e 's/[@]DAEMON_NAME[@]/virtproxyd/' \ - $< > $@ - INSTALL_DATA_DIRS += remote install-data-remote: @@ -103,50 +70,6 @@ install-data-remote: uninstall-data-remote: rmdir "$(DESTDIR)$(localstatedir)/log/libvirt" ||: -remote/libvirtd.aug: remote/libvirtd.aug.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/d' \ - -e '/[@]END[@]/d' \ - -e 's|[@]sysconfdir[@]|@sysconfdir@|' \ - -e 's|[@]DAEMON_NAME[@]|libvirtd|' \ - -e 's|[@]DAEMON_NAME_UC[@]|Libvirtd|' \ - $< > $@ - -remote/virtproxyd.aug: remote/libvirtd.aug.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/d' \ - -e '/[@]END[@]/d' \ - -e 's|[@]sysconfdir[@]|@sysconfdir@|' \ - -e 's/[@]DAEMON_NAME[@]/virtproxyd/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtproxyd/' \ - $< > $@ - -remote/test_libvirtd.aug: remote/test_libvirtd.aug.in \ - remote/libvirtd.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) remote/libvirtd.conf \ - $(srcdir)/remote/test_libvirtd.aug.in | \ - $(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/d' \ - -e '/[@]END[@]/d' \ - -e 's|[@]sysconfdir[@]|@sysconfdir@|' \ - -e 's|[@]runstatedir[@]|@runstatedir@|' \ - -e 's|[@]DAEMON_NAME[@]|libvirtd|' \ - -e 's|[@]DAEMON_NAME_UC[@]|Libvirtd|' \ - > $@ || rm -f $@ - -remote/test_virtproxyd.aug: remote/test_libvirtd.aug.in \ - remote/virtproxyd.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) remote/virtproxyd.conf \ - $(srcdir)/remote/test_libvirtd.aug.in | \ - $(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/d' \ - -e '/[@]END[@]/d' \ - -e 's|[@]sysconfdir[@]|@sysconfdir@|' \ - -e 's|[@]runstatedir[@]|@runstatedir@|' \ - -e 's/[@]DAEMON_NAME[@]/virtproxyd/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtproxyd/' \ - > $@ || rm -f $@ - if WITH_SYSCTL # Use $(prefix)/lib rather than $(libdir), since man sysctl.d insists on # /usr/lib/sysctl.d/ even when libdir is /usr/lib64 diff --git a/src/remote/meson.build b/src/remote/meson.build index 6635bcd4cff..20ccd14b458 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -120,6 +120,12 @@ if conf.has('WITH_REMOTE') ], } + virt_daemon_confs += { + 'name': 'libvirtd', + 'name_uc': 'Libvirtd', + 'with_ip': true, + } + virt_daemons += { 'name': 'virtproxyd', 'c_args': [ @@ -129,6 +135,12 @@ if conf.has('WITH_REMOTE') '-DVIRTPROXYD', ], } + + virt_daemon_confs += { + 'name': 'virtproxyd', + 'name_uc': 'Virtproxyd', + 'with_ip': true, + } endif endif diff --git a/src/secret/Makefile.inc.am b/src/secret/Makefile.inc.am index 7a03f6728ee..648648c260c 100644 --- a/src/secret/Makefile.inc.am +++ b/src/secret/Makefile.inc.am @@ -5,10 +5,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(SECRET_DRIVER_SOURCES)) if WITH_SECRETS -nodist_conf_DATA += secret/virtsecretd.conf -augeas_DATA += secret/virtsecretd.aug -augeastest_DATA += secret/test_virtsecretd.aug - SYSCONF_FILES += secret/virtsecretd.sysconf SYSTEMD_UNIT_FILES += \ @@ -46,27 +42,4 @@ virtsecret%.socket: remote/libvirt%.socket.in \ $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(VIRTSECRETD_UNIT_VARS) $< > $@-t && mv $@-t $@ -secret/virtsecretd.conf: remote/libvirtd.conf.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtsecretd/' \ - $< > $@ - -secret/virtsecretd.aug: remote/libvirtd.aug.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtsecretd/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtsecretd/' \ - $< > $@ - -secret/test_virtsecretd.aug: remote/test_libvirtd.aug.in \ - secret/virtsecretd.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) secret/virtsecretd.conf \ - $(srcdir)/remote/test_libvirtd.aug.in | \ - $(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtsecretd/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtsecretd/' \ - > $@ || rm -f $@ - endif WITH_SECRETS diff --git a/src/secret/meson.build b/src/secret/meson.build index 43f1d7342d5..7b9e253d4a4 100644 --- a/src/secret/meson.build +++ b/src/secret/meson.build @@ -23,4 +23,9 @@ if conf.has('WITH_SECRETS') '-DMODULE_NAME="secret"', ], } + + virt_daemon_confs += { + 'name': 'virtsecretd', + 'name_uc': 'Virtsecretd', + } endif diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index ee4377d94ff..1ac4da02164 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -5,10 +5,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(STORAGE_DRIVER_SOURCES)) if WITH_STORAGE -nodist_conf_DATA += storage/virtstoraged.conf -augeas_DATA += storage/virtstoraged.aug -augeastest_DATA += storage/test_virtstoraged.aug - SYSCONF_FILES += storage/virtstoraged.sysconf SYSTEMD_UNIT_FILES += \ @@ -46,28 +42,4 @@ virtstorage%.socket: remote/libvirt%.socket.in \ $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(VIRTSTORAGED_UNIT_VARS) $< > $@-t && mv $@-t $@ -storage/virtstoraged.conf: remote/libvirtd.conf.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtstoraged/' \ - $< > $@ - -storage/virtstoraged.aug: remote/libvirtd.aug.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtstoraged/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtstoraged/' \ - $< > $@ - -storage/test_virtstoraged.aug: remote/test_libvirtd.aug.in \ - storage/virtstoraged.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) storage/virtstoraged.conf \ - $(srcdir)/remote/test_libvirtd.aug.in | \ - $(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtstoraged/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtstoraged/' \ - > $@ || rm -f $@ - - endif WITH_STORAGE diff --git a/src/storage/meson.build b/src/storage/meson.build index 1996cd4c11c..b23b5823caa 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -121,6 +121,11 @@ if conf.has('WITH_STORAGE') '-DMODULE_NAME="storage"', ], } + + virt_daemon_confs += { + 'name': 'virtstoraged', + 'name_uc': 'Virtstoraged', + } endif if conf.has('WITH_STORAGE_DISK') diff --git a/src/vbox/Makefile.inc.am b/src/vbox/Makefile.inc.am index fc71301e595..62c7dc98a0c 100644 --- a/src/vbox/Makefile.inc.am +++ b/src/vbox/Makefile.inc.am @@ -6,10 +6,6 @@ DRIVER_SOURCE_FILES += \ $(NULL) if WITH_VBOX -nodist_conf_DATA += vbox/virtvboxd.conf -augeas_DATA += vbox/virtvboxd.aug -augeastest_DATA += vbox/test_virtvboxd.aug - SYSCONF_FILES += vbox/virtvboxd.sysconf SYSTEMD_UNIT_FILES += \ @@ -45,27 +41,4 @@ virtvboxd.service: vbox/virtvboxd.service.in $(top_builddir)/config.status virtvbox%.socket: remote/libvirt%.socket.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(VIRTVBOXD_UNIT_VARS) $< > $@-t && mv $@-t $@ -vbox/virtvboxd.conf: remote/libvirtd.conf.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtvboxd/' \ - $< > $@ - -vbox/virtvboxd.aug: remote/libvirtd.aug.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtvboxd/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtvboxd/' \ - $< > $@ - -vbox/test_virtvboxd.aug: remote/test_libvirtd.aug.in \ - vbox/virtvboxd.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) vbox/virtvboxd.conf \ - $(srcdir)/remote/test_libvirtd.aug.in | \ - $(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtvboxd/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtvboxd/' \ - > $@ || rm -f $@ - endif WITH_VBOX diff --git a/src/vbox/meson.build b/src/vbox/meson.build index 0619834a9c8..2c28855e420 100644 --- a/src/vbox/meson.build +++ b/src/vbox/meson.build @@ -46,4 +46,9 @@ if conf.has('WITH_VBOX') '-DMODULE_NAME="vbox"', ], } + + virt_daemon_confs += { + 'name': 'virtvboxd', + 'name_uc': 'Virtvboxd', + } endif diff --git a/src/vz/Makefile.inc.am b/src/vz/Makefile.inc.am index 18bb0c40c46..ffc684d76de 100644 --- a/src/vz/Makefile.inc.am +++ b/src/vz/Makefile.inc.am @@ -5,10 +5,6 @@ STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(VZ_DRIVER_SOURCES)) if WITH_VZ -nodist_conf_DATA += vz/virtvzd.conf -augeas_DATA += vz/virtvzd.aug -augeastest_DATA += vz/test_virtvzd.aug - SYSCONF_FILES += vz/virtvzd.sysconf SYSTEMD_UNIT_FILES += \ @@ -44,27 +40,4 @@ virtvzd.service: vz/virtvzd.service.in $(top_builddir)/config.status virtvz%.socket: remote/libvirt%.socket.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(VIRTVZD_UNIT_VARS) $< > $@-t && mv $@-t $@ -vz/virtvzd.conf: remote/libvirtd.conf.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtvzd/' \ - $< > $@ - -vz/virtvzd.aug: remote/libvirtd.aug.in - $(AM_V_GEN)$(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtvzd/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtvzd/' \ - $< > $@ - -vz/test_virtvzd.aug: remote/test_libvirtd.aug.in \ - vz/virtvzd.conf $(AUG_GENTEST_SCRIPT) - $(AM_V_GEN)$(AUG_GENTEST) vz/virtvzd.conf \ - $(srcdir)/remote/test_libvirtd.aug.in | \ - $(SED) \ - -e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \ - -e 's/[@]DAEMON_NAME[@]/virtvzd/' \ - -e 's/[@]DAEMON_NAME_UC[@]/Virtvzd/' \ - > $@ || rm -f $@ - endif WITH_VZ diff --git a/src/vz/meson.build b/src/vz/meson.build index 07ad8fc75ae..ff901179cdd 100644 --- a/src/vz/meson.build +++ b/src/vz/meson.build @@ -38,4 +38,9 @@ if conf.has('WITH_VZ') '-DMODULE_NAME="vz"', ], } + + virt_daemon_confs += { + 'name': 'virtvzd', + 'name_uc': 'Virtvzd', + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 21 ------ src/interface/Makefile.inc.am | 26 ------- src/interface/meson.build | 9 +++ src/libxl/Makefile.inc.am | 27 ------- src/libxl/meson.build | 10 +++ src/locking/Makefile.inc.am | 19 ----- src/locking/meson.build | 10 +++ src/logging/Makefile.inc.am | 19 ----- src/logging/meson.build | 10 +++ src/lxc/Makefile.inc.am | 23 ------ src/lxc/meson.build | 9 +++ src/meson.build | 67 +++++++++++++++++ src/network/Makefile.inc.am | 25 ------- src/network/meson.build | 9 +++ src/node_device/Makefile.inc.am | 25 ------- src/node_device/meson.build | 9 +++ src/nwfilter/Makefile.inc.am | 25 ------- src/nwfilter/meson.build | 9 +++ src/qemu/Makefile.inc.am | 23 ------ src/qemu/meson.build | 9 +++ src/remote/Makefile.inc.am | 71 ------------------- src/remote/meson.build | 29 ++++++++ ...n.target.in => virt-guest-shutdown.target} | 0 src/secret/Makefile.inc.am | 25 ------- src/secret/meson.build | 9 +++ src/storage/Makefile.inc.am | 25 ------- src/storage/meson.build | 9 +++ src/vbox/Makefile.inc.am | 23 ------ src/vbox/meson.build | 9 +++ src/vz/Makefile.inc.am | 23 ------ src/vz/meson.build | 9 +++ 31 files changed, 216 insertions(+), 400 deletions(-) rename src/remote/{virt-guest-shutdown.target.in => virt-guest-shutdown.target} (100%) diff --git a/src/Makefile.am b/src/Makefile.am index 82e7212b186..bd27e5acc29 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -34,8 +34,6 @@ tapset_DATA = endif WITH_DTRACE_PROBES RPC_PROBE_FILES = LOGROTATE_FILES_IN = -SYSTEMD_UNIT_FILES = -SYSTEMD_UNIT_FILES_IN = OPENRC_INIT_FILES = OPENRC_INIT_FILES_IN = OPENRC_CONF_FILES = @@ -275,25 +273,6 @@ endif WITH_LIBVIRTD if WITH_LIBVIRTD -if LIBVIRT_INIT_SCRIPT_SYSTEMD - -SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system - -install-systemd: $(SYSTEMD_UNIT_FILES) install-sysconfig - $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR) - for f in $(SYSTEMD_UNIT_FILES); \ - do \ - $(INSTALL_DATA) $$f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/ ; \ - done - -uninstall-systemd: uninstall-sysconfig - rm -f $(SYSTEMD_UNIT_FILES:%=$(DESTDIR)$(SYSTEMD_UNIT_DIR)/%) - rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || : - -INSTALL_DATA_LOCAL += install-systemd -UNINSTALL_LOCAL += uninstall-systemd -endif LIBVIRT_INIT_SCRIPT_SYSTEMD - if LIBVIRT_INIT_SCRIPT_OPENRC OPENRC_INIT_DIR = $(sysconfdir)/init.d diff --git a/src/interface/Makefile.inc.am b/src/interface/Makefile.inc.am index a189105dcac..b4bcfb7ecaa 100644 --- a/src/interface/Makefile.inc.am +++ b/src/interface/Makefile.inc.am @@ -8,16 +8,6 @@ if WITH_INTERFACE SYSCONF_FILES += interface/virtinterfaced.sysconf -SYSTEMD_UNIT_FILES += \ - virtinterfaced.service \ - virtinterfaced.socket \ - virtinterfaced-ro.socket \ - virtinterfaced-admin.socket \ - $(NULL) -SYSTEMD_UNIT_FILES_IN += \ - interface/virtinterfaced.service.in \ - $(NULL) - OPENRC_INIT_FILES += \ virtinterfaced.init \ $(NULL) @@ -25,23 +15,7 @@ OPENRC_INIT_FILES_IN += \ interface/virtinterfaced.init.in \ $(NULL) -VIRTINTERFACED_UNIT_VARS = \ - $(VIRTD_UNIT_VARS) \ - -e 's|[@]name[@]|Libvirt interface|g' \ - -e 's|[@]service[@]|virtinterfaced|g' \ - -e 's|[@]sockprefix[@]|virtinterfaced|g' \ - $(NULL) - virtinterfaced.init: interface/virtinterfaced.init.in \ $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ - -virtinterfaced.service: interface/virtinterfaced.service.in \ - $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTINTERFACED_UNIT_VARS) $< > $@-t && mv $@-t $@ - -virtinterface%.socket: remote/libvirt%.socket.in \ - $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTINTERFACED_UNIT_VARS) $< > $@-t && mv $@-t $@ - endif WITH_INTERFACE diff --git a/src/interface/meson.build b/src/interface/meson.build index fa9c674c084..a94b1164aa1 100644 --- a/src/interface/meson.build +++ b/src/interface/meson.build @@ -39,4 +39,13 @@ if conf.has('WITH_INTERFACE') 'name': 'virtinterfaced', 'name_uc': 'Virtinterfaced', } + + virt_daemon_units += { + 'service': 'virtinterfaced', + 'service_in': files('virtinterfaced.service.in'), + 'name': 'Libvirt interface', + 'sockprefix': 'virtinterfaced', + 'sockets': [ 'main', 'ro', 'admin' ], + 'conflicts': true, + } endif diff --git a/src/libxl/Makefile.inc.am b/src/libxl/Makefile.inc.am index 57271db1be8..b29ae98269c 100644 --- a/src/libxl/Makefile.inc.am +++ b/src/libxl/Makefile.inc.am @@ -7,16 +7,6 @@ if WITH_LIBXL SYSCONF_FILES += libxl/virtxend.sysconf -SYSTEMD_UNIT_FILES += \ - virtxend.service \ - virtxend.socket \ - virtxend-ro.socket \ - virtxend-admin.socket \ - $(NULL) -SYSTEMD_UNIT_FILES_IN += \ - libxl/virtxend.service.in \ - $(NULL) - OPENRC_INIT_FILES += \ virtxend.init \ $(NULL) @@ -24,26 +14,9 @@ OPENRC_INIT_FILES_IN += \ libxl/virtxend.init.in \ $(NULL) -LIBXL_UNIT_COND = ConditionPathExists=/proc/xen/capabilities -LIBXL_UNIT_CONFLICT = Conflicts=$(LIBVIRTD_SOCKET_UNIT_FILES) - -VIRTXEND_UNIT_VARS = \ - $(COMMON_UNIT_VARS) \ - -e 's|[@]deps[@]|$(LIBXL_UNIT_CONFLICT)\n$(LIBXL_UNIT_COND)|g' \ - -e 's|[@]name[@]|Libvirt libxl|g' \ - -e 's|[@]service[@]|virtxend|g' \ - -e 's|[@]sockprefix[@]|virtxend|g' \ - $(NULL) - virtxend.init: libxl/virtxend.init.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ -virtxend.service: libxl/virtxend.service.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTXEND_UNIT_VARS) $< > $@-t && mv $@-t $@ - -virtxen%.socket: remote/libvirt%.socket.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTXEND_UNIT_VARS) $< > $@-t && mv $@-t $@ - INSTALL_DATA_DIRS += libxl install-data-libxl: diff --git a/src/libxl/meson.build b/src/libxl/meson.build index 2fc72d92ac2..4a872198702 100644 --- a/src/libxl/meson.build +++ b/src/libxl/meson.build @@ -57,4 +57,14 @@ if conf.has('WITH_LIBXL') 'name': 'virtxend', 'name_uc': 'Virtxend', } + + virt_daemon_units += { + 'service': 'virtxend', + 'service_in': files('virtxend.service.in'), + 'name': 'Libvirt libxl', + 'sockprefix': 'virtxend', + 'sockets': [ 'main', 'ro', 'admin' ], + 'deps': 'ConditionPathExists=/proc/xen/capabilities', + 'conflicts': true, + } endif diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index a2a0a4c6250..8727efdc9a5 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -3,15 +3,6 @@ RPC_PROBE_FILES += $(srcdir)/locking/lock_protocol.x SYSCONF_FILES += locking/virtlockd.sysconf -VIRTLOCKD_UNIT_FILES_IN = \ - locking/virtlockd.service.in \ - locking/virtlockd.socket.in \ - locking/virtlockd-admin.socket.in \ - $(NULL) - -SYSTEMD_UNIT_FILES += $(notdir $(VIRTLOCKD_UNIT_FILES_IN:%.in=%)) -SYSTEMD_UNIT_FILES_IN += $(VIRTLOCKD_UNIT_FILES_IN) - OPENRC_INIT_FILES += \ virtlockd.init \ $(NULL) @@ -46,13 +37,3 @@ endif WITH_LIBVIRTD virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ - -virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status - $(AM_V_GEN)sed $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ - -virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status - $(AM_V_GEN)sed $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ - -virtlockd-admin.socket: locking/virtlockd-admin.socket.in \ - $(top_builddir)/config.status - $(AM_V_GEN)sed $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ diff --git a/src/locking/meson.build b/src/locking/meson.build index 0681e4fbc4d..d35853e799b 100644 --- a/src/locking/meson.build +++ b/src/locking/meson.build @@ -134,6 +134,16 @@ if conf.has('WITH_LIBVIRTD') ], } + virt_daemon_units += { + 'service': 'virtlockd', + 'service_in': files('virtlockd.service.in'), + 'name': '', + 'sockprefix': '', + 'sockets': [ 'main', 'admin' ], + 'socket_in': files('virtlockd.socket.in'), + 'socket_admin_in': files('virtlockd-admin.socket.in'), + } + if conf.has('WITH_SANLOCK') virt_helpers += { 'name': 'libvirt_sanlock_helper', diff --git a/src/logging/Makefile.inc.am b/src/logging/Makefile.inc.am index b13f53ffe41..ad07c7b7f77 100644 --- a/src/logging/Makefile.inc.am +++ b/src/logging/Makefile.inc.am @@ -2,15 +2,6 @@ SYSCONF_FILES += logging/virtlogd.sysconf -VIRTLOGD_UNIT_FILES_IN = \ - logging/virtlogd.service.in \ - logging/virtlogd.socket.in \ - logging/virtlogd-admin.socket.in \ - $(NULL) - -SYSTEMD_UNIT_FILES += $(notdir $(VIRTLOGD_UNIT_FILES_IN:%.in=%)) -SYSTEMD_UNIT_FILES_IN += $(VIRTLOGD_UNIT_FILES_IN) - OPENRC_INIT_FILES += \ virtlogd.init \ $(NULL) @@ -20,13 +11,3 @@ OPENRC_INIT_FILES_IN += \ virtlogd.init: logging/virtlogd.init.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ - -virtlogd.service: logging/virtlogd.service.in $(top_builddir)/config.status - $(AM_V_GEN)sed $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ - -virtlogd.socket: logging/virtlogd.socket.in $(top_builddir)/config.status - $(AM_V_GEN)sed $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ - -virtlogd-admin.socket: logging/virtlogd-admin.socket.in \ - $(top_builddir)/config.status - $(AM_V_GEN)sed $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ diff --git a/src/logging/meson.build b/src/logging/meson.build index 4897cbf1f32..9cfd60019ea 100644 --- a/src/logging/meson.build +++ b/src/logging/meson.build @@ -77,4 +77,14 @@ if conf.has('WITH_LIBVIRTD') 'aug': files('test_virtlogd.aug.in'), 'conf': files('virtlogd.conf'), } + + virt_daemon_units += { + 'service': 'virtlogd', + 'service_in': files('virtlogd.service.in'), + 'name': '', + 'sockprefix': '', + 'sockets': [ 'main', 'admin' ], + 'socket_in': files('virtlogd.socket.in'), + 'socket_admin_in': files('virtlogd-admin.socket.in'), + } endif diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am index 2692163226c..1b3d0a2b4a8 100644 --- a/src/lxc/Makefile.inc.am +++ b/src/lxc/Makefile.inc.am @@ -13,16 +13,6 @@ if WITH_LXC SYSCONF_FILES += lxc/virtlxcd.sysconf -SYSTEMD_UNIT_FILES += \ - virtlxcd.service \ - virtlxcd.socket \ - virtlxcd-ro.socket \ - virtlxcd-admin.socket \ - $(NULL) -SYSTEMD_UNIT_FILES_IN += \ - lxc/virtlxcd.service.in \ - $(NULL) - OPENRC_INIT_FILES += \ virtlxcd.init \ $(NULL) @@ -30,22 +20,9 @@ OPENRC_INIT_FILES_IN += \ lxc/virtlxcd.init.in \ $(NULL) -VIRTLXCD_UNIT_VARS = \ - $(VIRTD_UNIT_VARS) \ - -e 's|[@]name[@]|Libvirt lxc|g' \ - -e 's|[@]service[@]|virtlxcd|g' \ - -e 's|[@]sockprefix[@]|virtlxcd|g' \ - $(NULL) - virtlxcd.init: lxc/virtlxcd.init.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ -virtlxcd.service: lxc/virtlxcd.service.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTLXCD_UNIT_VARS) $< > $@-t && mv $@-t $@ - -virtlxc%.socket: remote/libvirt%.socket.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTLXCD_UNIT_VARS) $< > $@-t && mv $@-t $@ - if WITH_DTRACE_PROBES RPC_PROBE_FILES += $(srcdir)/lxc/lxc_monitor_protocol.x endif diff --git a/src/lxc/meson.build b/src/lxc/meson.build index 650eaef1d81..c539149a8c9 100644 --- a/src/lxc/meson.build +++ b/src/lxc/meson.build @@ -141,4 +141,13 @@ if conf.has('WITH_LXC') 'name': 'virtlxcd', 'name_uc': 'Virtlxcd', } + + virt_daemon_units += { + 'service': 'virtlxcd', + 'service_in': files('virtlxcd.service.in'), + 'name': 'Libvirt lxc', + 'sockprefix': 'virtlxcd', + 'sockets': [ 'main', 'ro', 'admin' ], + 'conflicts': true, + } endif diff --git a/src/meson.build b/src/meson.build index f19870d2c18..b22c950c6d4 100644 --- a/src/meson.build +++ b/src/meson.build @@ -175,6 +175,22 @@ virt_daemon_confs = [] virt_aug_dir = datadir / 'augeas' / 'lenses' virt_test_aug_dir = datadir / 'augeas' / 'lenses' / 'tests' +# guest_unit_files: +# guest unit files to install +guest_unit_files = [] + +# virt_daemon_units: +# generate libvirt daemon systemd unit files +# * service - name of the service (required) +# * service_in - service source file (required) +# * name - socket description (required) +# * sockprefix - socket prefix name (required) +# * sockets - array of additional sockets (optional, default [ 'main', 'ro', 'admin' ]) +# * socket_$name_in - additional socket source files (optional, default remote/libvirtd.socket.in ) +# * deps - socket dependencies (optional, default '') +# * conflicts - if the service conflicts with libvirtd (optional, true) +virt_daemon_units = [] + # list subdirectories @@ -652,3 +668,54 @@ foreach data : virt_daemon_confs install_dir: virt_test_aug_dir, ) endforeach + + +if conf.has('WITH_LIBVIRTD') + # Generate systemd service and socket unit files + if init_script == 'systemd' + systemd_unit_dir = prefix / 'lib' / 'systemd' / 'system' + + install_data( + guest_unit_files, + install_dir: systemd_unit_dir, + ) + + foreach unit : virt_daemon_units + unit_conf = configuration_data() + unit_conf.set('runstatedir', runstatedir) + unit_conf.set('sbindir', sbindir) + unit_conf.set('sysconfdir', sysconfdir) + unit_conf.set('name', unit['name']) + unit_conf.set('service', unit['service']) + unit_conf.set('sockprefix', unit['sockprefix']) + unit_conf.set('deps', unit.get('deps', '')) + + configure_file( + input: unit['service_in'], + output: '@0@.service'.format(unit['service']), + configuration: unit_conf, + install: true, + install_dir: systemd_unit_dir, + ) + + foreach socket : unit.get('sockets', [ 'main', 'ro', 'admin' ]) + if socket == 'main' + socket_in_def = 'remote' / 'libvirtd.socket.in' + socket_in = unit.get('socket_in', socket_in_def) + socket_out = '@0@.socket'.format(unit['service']) + else + socket_in_def = 'remote' / 'libvirtd-@0@.socket.in'.format(socket) + socket_in = unit.get('socket_@0@_in'.format(socket), socket_in_def) + socket_out = '@0@-@1@.socket'.format(unit['service'], socket) + endif + configure_file( + input: socket_in, + output: socket_out, + configuration: unit_conf, + install: true, + install_dir: systemd_unit_dir, + ) + endforeach + endforeach + endif +endif diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am index ee5413e85e1..b84057eeb72 100644 --- a/src/network/Makefile.inc.am +++ b/src/network/Makefile.inc.am @@ -7,16 +7,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_NETWORK SYSCONF_FILES += network/virtnetworkd.sysconf -SYSTEMD_UNIT_FILES += \ - virtnetworkd.service \ - virtnetworkd.socket \ - virtnetworkd-ro.socket \ - virtnetworkd-admin.socket \ - $(NULL) -SYSTEMD_UNIT_FILES_IN += \ - network/virtnetworkd.service.in \ - $(NULL) - OPENRC_INIT_FILES += \ virtnetworkd.init \ $(NULL) @@ -24,24 +14,9 @@ OPENRC_INIT_FILES_IN += \ network/virtnetworkd.init.in \ $(NULL) -VIRTNETWORKD_UNIT_VARS = \ - $(VIRTD_UNIT_VARS) \ - -e 's|[@]name[@]|Libvirt network|g' \ - -e 's|[@]service[@]|virtnetworkd|g' \ - -e 's|[@]sockprefix[@]|virtnetworkd|g' \ - $(NULL) - virtnetworkd.init: network/virtnetworkd.init.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ -virtnetworkd.service: network/virtnetworkd.service.in \ - $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTNETWORKD_UNIT_VARS) $< > $@-t && mv $@-t $@ - -virtnetwork%.socket: remote/libvirt%.socket.in \ - $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTNETWORKD_UNIT_VARS) $< > $@-t && mv $@-t $@ - INSTALL_DATA_DIRS += network UUID=$(shell uuidgen 2>/dev/null) diff --git a/src/network/meson.build b/src/network/meson.build index 1e31f8d30cb..0c643900c15 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -58,4 +58,13 @@ if conf.has('WITH_NETWORK') dtrace_gen_objects, ], } + + virt_daemon_units += { + 'service': 'virtnetworkd', + 'service_in': files('virtnetworkd.service.in'), + 'name': 'Libvirt network', + 'sockprefix': 'virtnetworkd', + 'sockets': [ 'main', 'ro', 'admin' ], + 'conflicts': true, + } endif diff --git a/src/node_device/Makefile.inc.am b/src/node_device/Makefile.inc.am index 79491aee577..beff0d6ed04 100644 --- a/src/node_device/Makefile.inc.am +++ b/src/node_device/Makefile.inc.am @@ -14,16 +14,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_NODE_DEVICES SYSCONF_FILES += node_device/virtnodedevd.sysconf -SYSTEMD_UNIT_FILES += \ - virtnodedevd.service \ - virtnodedevd.socket \ - virtnodedevd-ro.socket \ - virtnodedevd-admin.socket \ - $(NULL) -SYSTEMD_UNIT_FILES_IN += \ - node_device/virtnodedevd.service.in \ - $(NULL) - OPENRC_INIT_FILES += \ virtnodedevd.init \ $(NULL) @@ -31,22 +21,7 @@ OPENRC_INIT_FILES_IN += \ node_device/virtnodedevd.init.in \ $(NULL) -VIRTNODEDEVD_UNIT_VARS = \ - $(VIRTD_UNIT_VARS) \ - -e 's|[@]name[@]|Libvirt nodedev|g' \ - -e 's|[@]service[@]|virtnodedevd|g' \ - -e 's|[@]sockprefix[@]|virtnodedevd|g' \ - $(NULL) - virtnodedevd.init: node_device/virtnodedevd.init.in \ $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ - -virtnodedevd.service: node_device/virtnodedevd.service.in \ - $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTNODEDEVD_UNIT_VARS) $< > $@-t && mv $@-t $@ - -virtnodedev%.socket: remote/libvirt%.socket.in \ - $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTNODEDEVD_UNIT_VARS) $< > $@-t && mv $@-t $@ endif WITH_NODE_DEVICES diff --git a/src/node_device/meson.build b/src/node_device/meson.build index e81fe281359..875e4ec775f 100644 --- a/src/node_device/meson.build +++ b/src/node_device/meson.build @@ -51,4 +51,13 @@ if conf.has('WITH_NODE_DEVICES') 'name': 'virtnodedevd', 'name_uc': 'Virtnodedevd', } + + virt_daemon_units += { + 'service': 'virtnodedevd', + 'service_in': files('virtnodedevd.service.in'), + 'name': 'Libvirt nodedev', + 'sockprefix': 'virtnodedevd', + 'sockets': [ 'main', 'ro', 'admin' ], + 'conflicts': true, + } endif diff --git a/src/nwfilter/Makefile.inc.am b/src/nwfilter/Makefile.inc.am index 2c0d29454bb..2384f053aeb 100644 --- a/src/nwfilter/Makefile.inc.am +++ b/src/nwfilter/Makefile.inc.am @@ -13,16 +13,6 @@ nwfilterxml_DATA = $(NWFILTER_XML_FILES) SYSCONF_FILES += nwfilter/virtnwfilterd.sysconf -SYSTEMD_UNIT_FILES += \ - virtnwfilterd.service \ - virtnwfilterd.socket \ - virtnwfilterd-ro.socket \ - virtnwfilterd-admin.socket \ - $(NULL) -SYSTEMD_UNIT_FILES_IN += \ - nwfilter/virtnwfilterd.service.in \ - $(NULL) - OPENRC_INIT_FILES += \ virtnwfilterd.init \ $(NULL) @@ -30,22 +20,7 @@ OPENRC_INIT_FILES_IN += \ nwfilter/virtnwfilterd.init.in \ $(NULL) -VIRTNWFILTERD_UNIT_VARS = \ - $(VIRTD_UNIT_VARS) \ - -e 's|[@]name[@]|Libvirt nwfilter|g' \ - -e 's|[@]service[@]|virtnwfilterd|g' \ - -e 's|[@]sockprefix[@]|virtnwfilterd|g' \ - $(NULL) - virtnwfilterd.init: nwfilter/virtnwfilterd.init.in \ $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ - -virtnwfilterd.service: nwfilter/virtnwfilterd.service.in \ - $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTNWFILTERD_UNIT_VARS) $< > $@-t && mv $@-t $@ - -virtnwfilter%.socket: remote/libvirt%.socket.in \ - $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTNWFILTERD_UNIT_VARS) $< > $@-t && mv $@-t $@ endif WITH_NWFILTER diff --git a/src/nwfilter/meson.build b/src/nwfilter/meson.build index 0c8641735c8..50ee78933e2 100644 --- a/src/nwfilter/meson.build +++ b/src/nwfilter/meson.build @@ -46,4 +46,13 @@ if conf.has('WITH_NWFILTER') 'name': 'virtnwfilterd', 'name_uc': 'Virtnwfilterd', } + + virt_daemon_units += { + 'service': 'virtnwfilterd', + 'service_in': files('virtnwfilterd.service.in'), + 'name': 'Libvirt nwfilter', + 'sockprefix': 'virtnwfilterd', + 'sockets': [ 'main', 'ro', 'admin' ], + 'conflicts': true, + } endif diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am index 46a7d1e9be2..0ea8905ed57 100644 --- a/src/qemu/Makefile.inc.am +++ b/src/qemu/Makefile.inc.am @@ -6,16 +6,6 @@ STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES)) if WITH_QEMU SYSCONF_FILES += qemu/virtqemud.sysconf -SYSTEMD_UNIT_FILES += \ - virtqemud.service \ - virtqemud.socket \ - virtqemud-ro.socket \ - virtqemud-admin.socket \ - $(NULL) -SYSTEMD_UNIT_FILES_IN += \ - qemu/virtqemud.service.in \ - $(NULL) - OPENRC_INIT_FILES += \ virtqemud.init \ $(NULL) @@ -23,22 +13,9 @@ OPENRC_INIT_FILES_IN += \ qemu/virtqemud.init.in \ $(NULL) -VIRTQEMUD_UNIT_VARS = \ - $(VIRTD_UNIT_VARS) \ - -e 's|[@]name[@]|Libvirt qemu|g' \ - -e 's|[@]service[@]|virtqemud|g' \ - -e 's|[@]sockprefix[@]|virtqemud|g' \ - $(NULL) - virtqemud.init: qemu/virtqemud.init.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ -virtqemud.service: qemu/virtqemud.service.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTQEMUD_UNIT_VARS) $< > $@-t && mv $@-t $@ - -virtqemu%.socket: remote/libvirt%.socket.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTQEMUD_UNIT_VARS) $< > $@-t && mv $@-t $@ - INSTALL_DATA_DIRS += qemu install-data-qemu: diff --git a/src/qemu/meson.build b/src/qemu/meson.build index 35af65cf5f5..479c530ece8 100644 --- a/src/qemu/meson.build +++ b/src/qemu/meson.build @@ -138,4 +138,13 @@ if conf.has('WITH_QEMU') 'name': 'virtqemud', 'name_uc': 'Virtqemud', } + + virt_daemon_units += { + 'service': 'virtqemud', + 'service_in': files('virtqemud.service.in'), + 'name': 'Libvirt qemu', + 'sockprefix': 'virtqemud', + 'sockets': [ 'main', 'ro', 'admin' ], + 'conflicts': true, + } endif diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index dfea32ff21e..159bc5e01be 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -12,41 +12,6 @@ SYSCONF_FILES += \ remote/virtproxyd.sysconf \ $(NULL) -LIBVIRTD_SOCKET_UNIT_FILES_IN = \ - remote/libvirtd.socket.in \ - remote/libvirtd-ro.socket.in \ - remote/libvirtd-admin.socket.in \ - remote/libvirtd-tcp.socket.in \ - remote/libvirtd-tls.socket.in \ - $(NULL) - -LIBVIRTD_SOCKET_UNIT_FILES = $(notdir $(LIBVIRTD_SOCKET_UNIT_FILES_IN:%.in=%)) - -LIBVIRTD_UNIT_FILES_IN = \ - remote/libvirtd.service.in \ - $(LIBVIRTD_SOCKET_UNIT_FILES_IN) \ - $(NULL) - -VIRTPROXYD_UNIT_FILES_IN = \ - remote/virtproxyd.service.in \ - $(NULL) - -GUEST_UNIT_FILES_IN = \ - remote/virt-guest-shutdown.target.in \ - $(NULL) - - -SYSTEMD_UNIT_FILES += \ - $(notdir $(LIBVIRTD_UNIT_FILES_IN:%.in=%)) \ - $(notdir $(LIBVIRTD_UNIT_FILES_IN:remote/libvirtd%.in=remote/virtproxyd%)) \ - $(notdir $(GUEST_UNIT_FILES_IN:%.in=%)) \ - $(NULL) -SYSTEMD_UNIT_FILES_IN += \ - $(LIBVIRTD_UNIT_FILES_IN) \ - $(VIRTPROXYD_UNIT_FILES_IN) \ - $(GUEST_UNIT_FILES_IN) \ - $(NULL) - OPENRC_INIT_FILES += \ libvirtd.init \ virtproxyd.init \ @@ -136,14 +101,6 @@ INSTALL_DATA_LOCAL += install-sasl UNINSTALL_LOCAL += uninstall-sasl endif WITH_SASL -LIBVIRTD_UNIT_VARS = \ - $(COMMON_UNIT_VARS) \ - -e 's|[@]name[@]|Libvirt|g' \ - -e 's|[@]service[@]|libvirtd|g' \ - -e 's|[@]sockprefix[@]|libvirt|g' \ - -e 's|[@]deps[@]||g' \ - $(NULL) - LIBVIRTD_INIT_VARS = \ $(COMMON_UNIT_VARS) @@ -155,36 +112,8 @@ LIBVIRTD_INIT_VARS += \ -e 's|[@]NEED_FIREWALLD[@]||g' endif ! WITH_FIREWALLD -VIRTD_UNIT_VARS = \ - $(COMMON_UNIT_VARS) \ - -e 's|[@]deps[@]|Conflicts=$(LIBVIRTD_SOCKET_UNIT_FILES)|g' \ - $(NULL) - -VIRTPROXYD_UNIT_VARS = \ - $(VIRTD_UNIT_VARS) \ - -e 's|[@]name[@]|Libvirt proxy|g' \ - -e 's|[@]service[@]|virtproxyd|g' \ - -e 's|[@]sockprefix[@]|libvirt|g' \ - $(NULL) - libvirtd.init: remote/libvirtd.init.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ virtproxyd.init: remote/virtproxyd.init.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ - -libvirtd.service: remote/libvirtd.service.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(LIBVIRTD_UNIT_VARS) $< > $@-t && mv $@-t $@ - -libvirt%.socket: remote/libvirt%.socket.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(LIBVIRTD_UNIT_VARS) $< > $@-t && mv $@-t $@ - -virtproxyd.service: remote/virtproxyd.service.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTPROXYD_UNIT_VARS) $< > $@-t && mv $@-t $@ - -virtproxy%.socket: remote/libvirt%.socket.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTPROXYD_UNIT_VARS) $< > $@-t && mv $@-t $@ - -virt-guest-shutdown.target: remote/virt-guest-shutdown.target.in \ - $(top_builddir)/config.status - $(AM_V_GEN)cp $< $@ diff --git a/src/remote/meson.build b/src/remote/meson.build index 20ccd14b458..c0bc6f14b93 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -89,6 +89,16 @@ foreach name : libvirt_conf_files set_variable(name[2].underscorify(), tmp) endforeach +libvirtd_socket_unit_files = [ + 'libvirtd.socket', + 'libvirtd-ro.socket', + 'libvirtd-admin.socket', + 'libvirtd-tcp.socket', + 'libvirtd-tls.socket', +] + +libvirtd_socket_conflicts = ' '.join(libvirtd_socket_unit_files) + if conf.has('WITH_REMOTE') remote_driver_lib = static_library( 'virt_remote_driver', @@ -110,6 +120,8 @@ if conf.has('WITH_REMOTE') libvirt_libs += remote_driver_lib if conf.has('WITH_LIBVIRTD') + guest_unit_files += files('virt-guest-shutdown.target') + virt_daemons += { 'name': 'libvirtd', 'c_args': [ @@ -126,6 +138,14 @@ if conf.has('WITH_REMOTE') 'with_ip': true, } + virt_daemon_units += { + 'service': 'libvirtd', + 'service_in': files('libvirtd.service.in'), + 'name': 'Libvirt', + 'sockprefix': 'libvirtd', + 'sockets': [ 'main', 'ro', 'admin', 'tcp', 'tls' ], + } + virt_daemons += { 'name': 'virtproxyd', 'c_args': [ @@ -141,6 +161,15 @@ if conf.has('WITH_REMOTE') 'name_uc': 'Virtproxyd', 'with_ip': true, } + + virt_daemon_units += { + 'service': 'virtproxyd', + 'service_in': files('virtproxyd.service.in'), + 'name': 'Libvirt proxy', + 'sockprefix': 'libvirtd', + 'sockets': [ 'main', 'ro', 'admin', 'tcp', 'tls' ], + 'deps': libvirtd_socket_conflicts, + } endif endif diff --git a/src/remote/virt-guest-shutdown.target.in b/src/remote/virt-guest-shutdown.target similarity index 100% rename from src/remote/virt-guest-shutdown.target.in rename to src/remote/virt-guest-shutdown.target diff --git a/src/secret/Makefile.inc.am b/src/secret/Makefile.inc.am index 648648c260c..3aafe7a6a5d 100644 --- a/src/secret/Makefile.inc.am +++ b/src/secret/Makefile.inc.am @@ -7,16 +7,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_SECRETS SYSCONF_FILES += secret/virtsecretd.sysconf -SYSTEMD_UNIT_FILES += \ - virtsecretd.service \ - virtsecretd.socket \ - virtsecretd-ro.socket \ - virtsecretd-admin.socket \ - $(NULL) -SYSTEMD_UNIT_FILES_IN += \ - secret/virtsecretd.service.in \ - $(NULL) - OPENRC_INIT_FILES += \ virtsecretd.init \ $(NULL) @@ -24,22 +14,7 @@ OPENRC_INIT_FILES_IN += \ secret/virtsecretd.init.in \ $(NULL) -VIRTSECRETD_UNIT_VARS = \ - $(VIRTD_UNIT_VARS) \ - -e 's|[@]name[@]|Libvirt secret|g' \ - -e 's|[@]service[@]|virtsecretd|g' \ - -e 's|[@]sockprefix[@]|virtsecretd|g' \ - $(NULL) - virtsecretd.init: secret/virtsecretd.init.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ -virtsecretd.service: secret/virtsecretd.service.in \ - $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTSECRETD_UNIT_VARS) $< > $@-t && mv $@-t $@ - -virtsecret%.socket: remote/libvirt%.socket.in \ - $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTSECRETD_UNIT_VARS) $< > $@-t && mv $@-t $@ - endif WITH_SECRETS diff --git a/src/secret/meson.build b/src/secret/meson.build index 7b9e253d4a4..a6b919dfabb 100644 --- a/src/secret/meson.build +++ b/src/secret/meson.build @@ -28,4 +28,13 @@ if conf.has('WITH_SECRETS') 'name': 'virtsecretd', 'name_uc': 'Virtsecretd', } + + virt_daemon_units += { + 'service': 'virtsecretd', + 'service_in': files('virtsecretd.service.in'), + 'name': 'Libvirt secret', + 'sockprefix': 'virtsecretd', + 'sockets': [ 'main', 'ro', 'admin' ], + 'conflicts': true, + } endif diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index 1ac4da02164..3b4a13032aa 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -7,16 +7,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_STORAGE SYSCONF_FILES += storage/virtstoraged.sysconf -SYSTEMD_UNIT_FILES += \ - virtstoraged.service \ - virtstoraged.socket \ - virtstoraged-ro.socket \ - virtstoraged-admin.socket \ - $(NULL) -SYSTEMD_UNIT_FILES_IN += \ - storage/virtstoraged.service.in \ - $(NULL) - OPENRC_INIT_FILES += \ virtstoraged.init \ $(NULL) @@ -24,22 +14,7 @@ OPENRC_INIT_FILES_IN += \ storage/virtstoraged.init.in \ $(NULL) -VIRTSTORAGED_UNIT_VARS = \ - $(VIRTD_UNIT_VARS) \ - -e 's|[@]name[@]|Libvirt storage|g' \ - -e 's|[@]service[@]|virtstoraged|g' \ - -e 's|[@]sockprefix[@]|virtstoraged|g' \ - $(NULL) - virtstoraged.init: storage/virtstoraged.init.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ -virtstoraged.service: storage/virtstoraged.service.in \ - $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTSTORAGED_UNIT_VARS) $< > $@-t && mv $@-t $@ - -virtstorage%.socket: remote/libvirt%.socket.in \ - $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTSTORAGED_UNIT_VARS) $< > $@-t && mv $@-t $@ - endif WITH_STORAGE diff --git a/src/storage/meson.build b/src/storage/meson.build index b23b5823caa..acc9600ba4b 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -126,6 +126,15 @@ if conf.has('WITH_STORAGE') 'name': 'virtstoraged', 'name_uc': 'Virtstoraged', } + + virt_daemon_units += { + 'service': 'virtstoraged', + 'service_in': files('virtstoraged.service.in'), + 'name': 'Libvirt storage', + 'sockprefix': 'virtstoraged', + 'sockets': [ 'main', 'ro', 'admin' ], + 'conflicts': true, + } endif if conf.has('WITH_STORAGE_DISK') diff --git a/src/vbox/Makefile.inc.am b/src/vbox/Makefile.inc.am index 62c7dc98a0c..4968777858c 100644 --- a/src/vbox/Makefile.inc.am +++ b/src/vbox/Makefile.inc.am @@ -8,16 +8,6 @@ DRIVER_SOURCE_FILES += \ if WITH_VBOX SYSCONF_FILES += vbox/virtvboxd.sysconf -SYSTEMD_UNIT_FILES += \ - virtvboxd.service \ - virtvboxd.socket \ - virtvboxd-ro.socket \ - virtvboxd-admin.socket \ - $(NULL) -SYSTEMD_UNIT_FILES_IN += \ - vbox/virtvboxd.service.in \ - $(NULL) - OPENRC_INIT_FILES += \ virtvboxd.init \ $(NULL) @@ -25,20 +15,7 @@ OPENRC_INIT_FILES_IN += \ vbox/virtvboxd.init.in \ $(NULL) -VIRTVBOXD_UNIT_VARS = \ - $(VIRTD_UNIT_VARS) \ - -e 's|[@]name[@]|Libvirt vbox|g' \ - -e 's|[@]service[@]|virtvboxd|g' \ - -e 's|[@]sockprefix[@]|virtvboxd|g' \ - $(NULL) - virtvboxd.init: vbox/virtvboxd.init.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ -virtvboxd.service: vbox/virtvboxd.service.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTVBOXD_UNIT_VARS) $< > $@-t && mv $@-t $@ - -virtvbox%.socket: remote/libvirt%.socket.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTVBOXD_UNIT_VARS) $< > $@-t && mv $@-t $@ - endif WITH_VBOX diff --git a/src/vbox/meson.build b/src/vbox/meson.build index 2c28855e420..1fb88513ba0 100644 --- a/src/vbox/meson.build +++ b/src/vbox/meson.build @@ -51,4 +51,13 @@ if conf.has('WITH_VBOX') 'name': 'virtvboxd', 'name_uc': 'Virtvboxd', } + + virt_daemon_units += { + 'service': 'virtvboxd', + 'service_in': files('virtvboxd.service.in'), + 'name': 'Libvirt vbox', + 'sockprefix': 'virtvboxd', + 'sockets': [ 'main', 'ro', 'admin' ], + 'conflicts': true, + } endif diff --git a/src/vz/Makefile.inc.am b/src/vz/Makefile.inc.am index ffc684d76de..5889d0170a4 100644 --- a/src/vz/Makefile.inc.am +++ b/src/vz/Makefile.inc.am @@ -7,16 +7,6 @@ STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(VZ_DRIVER_SOURCES)) if WITH_VZ SYSCONF_FILES += vz/virtvzd.sysconf -SYSTEMD_UNIT_FILES += \ - virtvzd.service \ - virtvzd.socket \ - virtvzd-ro.socket \ - virtvzd-admin.socket \ - $(NULL) -SYSTEMD_UNIT_FILES_IN += \ - vz/virtvzd.service.in \ - $(NULL) - OPENRC_INIT_FILES += \ virtvzd.init \ $(NULL) @@ -24,20 +14,7 @@ OPENRC_INIT_FILES_IN += \ vz/virtvzd.init.in \ $(NULL) -VIRTVZD_UNIT_VARS = \ - $(VIRTD_UNIT_VARS) \ - -e 's|[@]name[@]|Libvirt vz|g' \ - -e 's|[@]service[@]|virtvzd|g' \ - -e 's|[@]sockprefix[@]|virtvzd|g' \ - $(NULL) - virtvzd.init: vz/virtvzd.init.in $(top_builddir)/config.status $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ -virtvzd.service: vz/virtvzd.service.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTVZD_UNIT_VARS) $< > $@-t && mv $@-t $@ - -virtvz%.socket: remote/libvirt%.socket.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(VIRTVZD_UNIT_VARS) $< > $@-t && mv $@-t $@ - endif WITH_VZ diff --git a/src/vz/meson.build b/src/vz/meson.build index ff901179cdd..dcf8f5037fd 100644 --- a/src/vz/meson.build +++ b/src/vz/meson.build @@ -43,4 +43,13 @@ if conf.has('WITH_VZ') 'name': 'virtvzd', 'name_uc': 'Virtvzd', } + + virt_daemon_units += { + 'service': 'virtvzd', + 'service_in': files('virtvzd.service.in'), + 'name': 'Libvirt vz', + 'sockprefix': 'virtvzd', + 'sockets': [ 'main', 'ro', 'admin' ], + 'conflicts': true, + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 57 --------------------------------- src/interface/Makefile.inc.am | 10 ------ src/interface/meson.build | 5 +++ src/libxl/Makefile.inc.am | 10 ------ src/libxl/meson.build | 5 +++ src/locking/Makefile.inc.am | 11 ------- src/locking/meson.build | 5 +++ src/logging/Makefile.inc.am | 10 ------ src/logging/meson.build | 5 +++ src/lxc/Makefile.inc.am | 10 ------ src/lxc/meson.build | 5 +++ src/meson.build | 41 ++++++++++++++++++++++++ src/network/Makefile.inc.am | 10 ------ src/network/meson.build | 5 +++ src/node_device/Makefile.inc.am | 11 ------- src/node_device/meson.build | 5 +++ src/nwfilter/Makefile.inc.am | 10 ------ src/nwfilter/meson.build | 5 +++ src/qemu/Makefile.inc.am | 10 ------ src/qemu/meson.build | 5 +++ src/remote/Makefile.inc.am | 30 ----------------- src/remote/meson.build | 12 +++++++ src/secret/Makefile.inc.am | 11 ------- src/secret/meson.build | 5 +++ src/storage/Makefile.inc.am | 11 ------- src/storage/meson.build | 5 +++ src/vbox/Makefile.inc.am | 11 ------- src/vbox/meson.build | 5 +++ src/vz/Makefile.inc.am | 11 ------- src/vz/meson.build | 5 +++ 30 files changed, 118 insertions(+), 223 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index bd27e5acc29..0b40c23f980 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -34,17 +34,8 @@ tapset_DATA = endif WITH_DTRACE_PROBES RPC_PROBE_FILES = LOGROTATE_FILES_IN = -OPENRC_INIT_FILES = -OPENRC_INIT_FILES_IN = -OPENRC_CONF_FILES = SYSCONF_FILES = -COMMON_UNIT_VARS = \ - -e 's|[@]runstatedir[@]|$(runstatedir)|g' \ - -e 's|[@]sbindir[@]|$(sbindir)|g' \ - -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ - $(NULL) - include security/Makefile.inc.am include access/Makefile.inc.am include logging/Makefile.inc.am @@ -226,25 +217,6 @@ uninstall-sysconfig: done rmdir $(DESTDIR)$(sysconfdir)/sysconfig || : -OPENRC_CONF_DIR = $(sysconfdir)/conf.d - -install-openrc-conf: - $(MKDIR_P) $(DESTDIR)$(OPENRC_CONF_DIR) - for f in $(OPENRC_CONF_FILES:%.confd=%) ; \ - do \ - tgt=`basename $$f`; \ - $(INSTALL_DATA) $(srcdir)/$$f.confd \ - $(DESTDIR)$(OPENRC_CONF_DIR)/$$tgt; \ - done - -uninstall-openrc-conf: - for f in $(OPENRC_CONF_FILES:%.confd=%) ; \ - do \ - tgt=`basename $$f`; \ - rm -f $(DESTDIR)$(OPENRC_CONF_DIR)/$$tgt; \ - done - rmdir $(DESTDIR)$(OPENRC_CONF_DIR) || : - LOGROTATE_FILES := $(LOGROTATE_FILES_IN:remote/%.in=%) %.logrotate: remote/%.logrotate.in @@ -272,35 +244,6 @@ UNINSTALL_LOCAL += uninstall-logrotate endif WITH_LIBVIRTD -if WITH_LIBVIRTD -if LIBVIRT_INIT_SCRIPT_OPENRC - -OPENRC_INIT_DIR = $(sysconfdir)/init.d - -install-openrc: $(OPENRC_INIT_FILES) install-openrc-conf - $(MKDIR_P) $(DESTDIR)$(OPENRC_INIT_DIR) - for f in $(OPENRC_INIT_FILES:%.init=%) ; \ - do \ - tgt=`basename $$f`; \ - $(INSTALL_SCRIPT) $$f.init \ - $(DESTDIR)$(OPENRC_INIT_DIR)/$$tgt ; \ - done - -uninstall-openrc: uninstall-openrc-conf - for f in $(OPENRC_INIT_FILES:%.init=%) ; \ - do \ - tgt=`basename $$f`; \ - rm -f $(DESTDIR)$(OPENRC_INIT_DIR)/$$tgt ; \ - done - rmdir $(DESTDIR)$(OPENRC_INIT_DIR) || : - -INSTALL_DATA_LOCAL += install-openrc -UNINSTALL_LOCAL += uninstall-openrc -endif LIBVIRT_INIT_SCRIPT_OPENRC - -endif WITH_LIBVIRTD - - install-data-local: $(INSTALL_DATA_LOCAL) \ $(INSTALL_DATA_DIRS:%=install-data-%) $(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt" diff --git a/src/interface/Makefile.inc.am b/src/interface/Makefile.inc.am index b4bcfb7ecaa..f6626c7f491 100644 --- a/src/interface/Makefile.inc.am +++ b/src/interface/Makefile.inc.am @@ -8,14 +8,4 @@ if WITH_INTERFACE SYSCONF_FILES += interface/virtinterfaced.sysconf -OPENRC_INIT_FILES += \ - virtinterfaced.init \ - $(NULL) -OPENRC_INIT_FILES_IN += \ - interface/virtinterfaced.init.in \ - $(NULL) - -virtinterfaced.init: interface/virtinterfaced.init.in \ - $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ endif WITH_INTERFACE diff --git a/src/interface/meson.build b/src/interface/meson.build index a94b1164aa1..a6b3e888358 100644 --- a/src/interface/meson.build +++ b/src/interface/meson.build @@ -48,4 +48,9 @@ if conf.has('WITH_INTERFACE') 'sockets': [ 'main', 'ro', 'admin' ], 'conflicts': true, } + + openrc_init_files += { + 'name': 'virtinterfaced', + 'in_file': files('virtinterfaced.init.in') + } endif diff --git a/src/libxl/Makefile.inc.am b/src/libxl/Makefile.inc.am index b29ae98269c..9a33eb5f06b 100644 --- a/src/libxl/Makefile.inc.am +++ b/src/libxl/Makefile.inc.am @@ -7,16 +7,6 @@ if WITH_LIBXL SYSCONF_FILES += libxl/virtxend.sysconf -OPENRC_INIT_FILES += \ - virtxend.init \ - $(NULL) -OPENRC_INIT_FILES_IN += \ - libxl/virtxend.init.in \ - $(NULL) - -virtxend.init: libxl/virtxend.init.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ - INSTALL_DATA_DIRS += libxl install-data-libxl: diff --git a/src/libxl/meson.build b/src/libxl/meson.build index 4a872198702..5f858dc32fc 100644 --- a/src/libxl/meson.build +++ b/src/libxl/meson.build @@ -67,4 +67,9 @@ if conf.has('WITH_LIBXL') 'deps': 'ConditionPathExists=/proc/xen/capabilities', 'conflicts': true, } + + openrc_init_files += { + 'name': 'virtxend', + 'in_file': files('virtxend.init.in'), + } endif diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index 8727efdc9a5..8a0ecd8d1f2 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -3,13 +3,6 @@ RPC_PROBE_FILES += $(srcdir)/locking/lock_protocol.x SYSCONF_FILES += locking/virtlockd.sysconf -OPENRC_INIT_FILES += \ - virtlockd.init \ - $(NULL) -OPENRC_INIT_FILES_IN += \ - locking/virtlockd.init.in \ - $(NULL) - INSTALL_DATA_DIRS += locking install-data-locking: @@ -33,7 +26,3 @@ endif WITH_LIBVIRTD install-data-locking \ uninstall-data-locking \ $(NULL) - - -virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ diff --git a/src/locking/meson.build b/src/locking/meson.build index d35853e799b..f560c9b44b9 100644 --- a/src/locking/meson.build +++ b/src/locking/meson.build @@ -144,6 +144,11 @@ if conf.has('WITH_LIBVIRTD') 'socket_admin_in': files('virtlockd-admin.socket.in'), } + openrc_init_files += { + 'name': 'virtlockd', + 'in_file': files('virtlockd.init.in'), + } + if conf.has('WITH_SANLOCK') virt_helpers += { 'name': 'libvirt_sanlock_helper', diff --git a/src/logging/Makefile.inc.am b/src/logging/Makefile.inc.am index ad07c7b7f77..48cae3add15 100644 --- a/src/logging/Makefile.inc.am +++ b/src/logging/Makefile.inc.am @@ -1,13 +1,3 @@ # vim: filetype=automake SYSCONF_FILES += logging/virtlogd.sysconf - -OPENRC_INIT_FILES += \ - virtlogd.init \ - $(NULL) -OPENRC_INIT_FILES_IN += \ - logging/virtlogd.init.in \ - $(NULL) - -virtlogd.init: logging/virtlogd.init.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ diff --git a/src/logging/meson.build b/src/logging/meson.build index 9cfd60019ea..40327241e3c 100644 --- a/src/logging/meson.build +++ b/src/logging/meson.build @@ -87,4 +87,9 @@ if conf.has('WITH_LIBVIRTD') 'socket_in': files('virtlogd.socket.in'), 'socket_admin_in': files('virtlogd-admin.socket.in'), } + + openrc_init_files += { + 'name': 'virtlogd', + 'in_file': files('virtlogd.init.in'), + } endif diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am index 1b3d0a2b4a8..3cf6f96ea1d 100644 --- a/src/lxc/Makefile.inc.am +++ b/src/lxc/Makefile.inc.am @@ -13,16 +13,6 @@ if WITH_LXC SYSCONF_FILES += lxc/virtlxcd.sysconf -OPENRC_INIT_FILES += \ - virtlxcd.init \ - $(NULL) -OPENRC_INIT_FILES_IN += \ - lxc/virtlxcd.init.in \ - $(NULL) - -virtlxcd.init: lxc/virtlxcd.init.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ - if WITH_DTRACE_PROBES RPC_PROBE_FILES += $(srcdir)/lxc/lxc_monitor_protocol.x endif diff --git a/src/lxc/meson.build b/src/lxc/meson.build index c539149a8c9..6135f61d4ab 100644 --- a/src/lxc/meson.build +++ b/src/lxc/meson.build @@ -150,4 +150,9 @@ if conf.has('WITH_LXC') 'sockets': [ 'main', 'ro', 'admin' ], 'conflicts': true, } + + openrc_init_files += { + 'name': 'virtlxcd', + 'in_file': files('virtlxcd.init.in'), + } endif diff --git a/src/meson.build b/src/meson.build index b22c950c6d4..602e8176d99 100644 --- a/src/meson.build +++ b/src/meson.build @@ -191,6 +191,12 @@ guest_unit_files = [] # * conflicts - if the service conflicts with libvirtd (optional, true) virt_daemon_units = [] +# openrc_init_files +# generate libvirt daemon openrc init files +# * name - daemon name (required) +# * in_file - source init file (required) +openrc_init_files = [] + # list subdirectories @@ -718,4 +724,39 @@ if conf.has('WITH_LIBVIRTD') endforeach endforeach endif + + # Generate openrc init files + if init_script == 'openrc' + foreach init : openrc_init_files + init_conf = configuration_data() + init_conf.set('sbindir', sbindir) + init_conf.set('runstatedir', runstatedir) + if conf.has('WITH_FIREWALLD') + need_firewalld = 'need firewalld' + else + need_firewalld = '' + endif + init_conf.set('NEED_FIREWALLD', need_firewalld) + + init_file = configure_file( + input: init['in_file'], + output: '@0@.init'.format(init['name']), + configuration: init_conf, + ) + + install_data( + init_file, + install_dir: sysconfdir / 'init.d', + rename: [ init['name'] ], + ) + + if init.has_key('confd') + install_data( + init['confd'], + install_dir: sysconfdir / 'conf.d', + rename: [ init['name'] ], + ) + endif + endforeach + endif endif diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am index b84057eeb72..81971c64ed4 100644 --- a/src/network/Makefile.inc.am +++ b/src/network/Makefile.inc.am @@ -7,16 +7,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_NETWORK SYSCONF_FILES += network/virtnetworkd.sysconf -OPENRC_INIT_FILES += \ - virtnetworkd.init \ - $(NULL) -OPENRC_INIT_FILES_IN += \ - network/virtnetworkd.init.in \ - $(NULL) - -virtnetworkd.init: network/virtnetworkd.init.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ - INSTALL_DATA_DIRS += network UUID=$(shell uuidgen 2>/dev/null) diff --git a/src/network/meson.build b/src/network/meson.build index 0c643900c15..c27578d66b4 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -67,4 +67,9 @@ if conf.has('WITH_NETWORK') 'sockets': [ 'main', 'ro', 'admin' ], 'conflicts': true, } + + openrc_init_files += { + 'name': 'virtnetworkd', + 'in_file': files('virtnetworkd.init.in'), + } endif diff --git a/src/node_device/Makefile.inc.am b/src/node_device/Makefile.inc.am index beff0d6ed04..e6fcbf6c9e5 100644 --- a/src/node_device/Makefile.inc.am +++ b/src/node_device/Makefile.inc.am @@ -13,15 +13,4 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_NODE_DEVICES SYSCONF_FILES += node_device/virtnodedevd.sysconf - -OPENRC_INIT_FILES += \ - virtnodedevd.init \ - $(NULL) -OPENRC_INIT_FILES_IN += \ - node_device/virtnodedevd.init.in \ - $(NULL) - -virtnodedevd.init: node_device/virtnodedevd.init.in \ - $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ endif WITH_NODE_DEVICES diff --git a/src/node_device/meson.build b/src/node_device/meson.build index 875e4ec775f..d73867148ea 100644 --- a/src/node_device/meson.build +++ b/src/node_device/meson.build @@ -60,4 +60,9 @@ if conf.has('WITH_NODE_DEVICES') 'sockets': [ 'main', 'ro', 'admin' ], 'conflicts': true, } + + openrc_init_files += { + 'name': 'virtnodedevd', + 'in_file': files('virtnodedevd.init.in'), + } endif diff --git a/src/nwfilter/Makefile.inc.am b/src/nwfilter/Makefile.inc.am index 2384f053aeb..8fcd63cbbf9 100644 --- a/src/nwfilter/Makefile.inc.am +++ b/src/nwfilter/Makefile.inc.am @@ -13,14 +13,4 @@ nwfilterxml_DATA = $(NWFILTER_XML_FILES) SYSCONF_FILES += nwfilter/virtnwfilterd.sysconf -OPENRC_INIT_FILES += \ - virtnwfilterd.init \ - $(NULL) -OPENRC_INIT_FILES_IN += \ - nwfilter/virtnwfilterd.init.in \ - $(NULL) - -virtnwfilterd.init: nwfilter/virtnwfilterd.init.in \ - $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ endif WITH_NWFILTER diff --git a/src/nwfilter/meson.build b/src/nwfilter/meson.build index 50ee78933e2..744600a73d1 100644 --- a/src/nwfilter/meson.build +++ b/src/nwfilter/meson.build @@ -55,4 +55,9 @@ if conf.has('WITH_NWFILTER') 'sockets': [ 'main', 'ro', 'admin' ], 'conflicts': true, } + + openrc_init_files += { + 'name': 'virtnwfilterd', + 'in_file': files('virtnwfilterd.init.in'), + } endif diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am index 0ea8905ed57..ec3178c373a 100644 --- a/src/qemu/Makefile.inc.am +++ b/src/qemu/Makefile.inc.am @@ -6,16 +6,6 @@ STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES)) if WITH_QEMU SYSCONF_FILES += qemu/virtqemud.sysconf -OPENRC_INIT_FILES += \ - virtqemud.init \ - $(NULL) -OPENRC_INIT_FILES_IN += \ - qemu/virtqemud.init.in \ - $(NULL) - -virtqemud.init: qemu/virtqemud.init.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ - INSTALL_DATA_DIRS += qemu install-data-qemu: diff --git a/src/qemu/meson.build b/src/qemu/meson.build index 479c530ece8..09b72335741 100644 --- a/src/qemu/meson.build +++ b/src/qemu/meson.build @@ -147,4 +147,9 @@ if conf.has('WITH_QEMU') 'sockets': [ 'main', 'ro', 'admin' ], 'conflicts': true, } + + openrc_init_files += { + 'name': 'virtqemud', + 'in_file': files('virtqemud.init.in'), + } endif diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 159bc5e01be..73f7578ee5e 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -12,19 +12,6 @@ SYSCONF_FILES += \ remote/virtproxyd.sysconf \ $(NULL) -OPENRC_INIT_FILES += \ - libvirtd.init \ - virtproxyd.init \ - $(NULL) -OPENRC_INIT_FILES_IN += \ - remote/libvirtd.init.in \ - remote/virtproxyd.init.in \ - $(NULL) -OPENRC_CONF_FILES += \ - remote/libvirtd.confd \ - remote/virtproxyd.confd \ - $(NULL) - if WITH_LIBVIRTD INSTALL_DATA_DIRS += remote @@ -100,20 +87,3 @@ uninstall-sasl: INSTALL_DATA_LOCAL += install-sasl UNINSTALL_LOCAL += uninstall-sasl endif WITH_SASL - -LIBVIRTD_INIT_VARS = \ - $(COMMON_UNIT_VARS) - -if WITH_FIREWALLD -LIBVIRTD_INIT_VARS += \ - -e 's|[@]NEED_FIREWALLD[@]|need firewalld|g' -else ! WITH_FIREWALLD -LIBVIRTD_INIT_VARS += \ - -e 's|[@]NEED_FIREWALLD[@]||g' -endif ! WITH_FIREWALLD - -libvirtd.init: remote/libvirtd.init.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ - -virtproxyd.init: remote/virtproxyd.init.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ diff --git a/src/remote/meson.build b/src/remote/meson.build index c0bc6f14b93..0310ad232aa 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -146,6 +146,12 @@ if conf.has('WITH_REMOTE') 'sockets': [ 'main', 'ro', 'admin', 'tcp', 'tls' ], } + openrc_init_files += { + 'name': 'libvirtd', + 'in_file': files('libvirtd.init.in'), + 'confd': files('libvirtd.confd'), + } + virt_daemons += { 'name': 'virtproxyd', 'c_args': [ @@ -170,6 +176,12 @@ if conf.has('WITH_REMOTE') 'sockets': [ 'main', 'ro', 'admin', 'tcp', 'tls' ], 'deps': libvirtd_socket_conflicts, } + + openrc_init_files += { + 'name': 'virtproxyd', + 'in_file': files('virtproxyd.init.in'), + 'confd': files('virtproxyd.confd'), + } endif endif diff --git a/src/secret/Makefile.inc.am b/src/secret/Makefile.inc.am index 3aafe7a6a5d..dd38e6888cd 100644 --- a/src/secret/Makefile.inc.am +++ b/src/secret/Makefile.inc.am @@ -6,15 +6,4 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_SECRETS SYSCONF_FILES += secret/virtsecretd.sysconf - -OPENRC_INIT_FILES += \ - virtsecretd.init \ - $(NULL) -OPENRC_INIT_FILES_IN += \ - secret/virtsecretd.init.in \ - $(NULL) - -virtsecretd.init: secret/virtsecretd.init.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ - endif WITH_SECRETS diff --git a/src/secret/meson.build b/src/secret/meson.build index a6b919dfabb..3b3f999f758 100644 --- a/src/secret/meson.build +++ b/src/secret/meson.build @@ -37,4 +37,9 @@ if conf.has('WITH_SECRETS') 'sockets': [ 'main', 'ro', 'admin' ], 'conflicts': true, } + + openrc_init_files += { + 'name': 'virtsecretd', + 'in_file': files('virtsecretd.init.in'), + } endif diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index 3b4a13032aa..23576659785 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -6,15 +6,4 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_STORAGE SYSCONF_FILES += storage/virtstoraged.sysconf - -OPENRC_INIT_FILES += \ - virtstoraged.init \ - $(NULL) -OPENRC_INIT_FILES_IN += \ - storage/virtstoraged.init.in \ - $(NULL) - -virtstoraged.init: storage/virtstoraged.init.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ - endif WITH_STORAGE diff --git a/src/storage/meson.build b/src/storage/meson.build index acc9600ba4b..7a1ed9f4b81 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -135,6 +135,11 @@ if conf.has('WITH_STORAGE') 'sockets': [ 'main', 'ro', 'admin' ], 'conflicts': true, } + + openrc_init_files += { + 'name': 'virtstoraged', + 'in_file': files('virtstoraged.init.in'), + } endif if conf.has('WITH_STORAGE_DISK') diff --git a/src/vbox/Makefile.inc.am b/src/vbox/Makefile.inc.am index 4968777858c..28bc3c4a585 100644 --- a/src/vbox/Makefile.inc.am +++ b/src/vbox/Makefile.inc.am @@ -7,15 +7,4 @@ DRIVER_SOURCE_FILES += \ if WITH_VBOX SYSCONF_FILES += vbox/virtvboxd.sysconf - -OPENRC_INIT_FILES += \ - virtvboxd.init \ - $(NULL) -OPENRC_INIT_FILES_IN += \ - vbox/virtvboxd.init.in \ - $(NULL) - -virtvboxd.init: vbox/virtvboxd.init.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ - endif WITH_VBOX diff --git a/src/vbox/meson.build b/src/vbox/meson.build index 1fb88513ba0..f1b8012777f 100644 --- a/src/vbox/meson.build +++ b/src/vbox/meson.build @@ -60,4 +60,9 @@ if conf.has('WITH_VBOX') 'sockets': [ 'main', 'ro', 'admin' ], 'conflicts': true, } + + openrc_init_files += { + 'name': 'virtvboxd', + 'in_file': files('virtvboxd.init.in'), + } endif diff --git a/src/vz/Makefile.inc.am b/src/vz/Makefile.inc.am index 5889d0170a4..7e7d402a7f0 100644 --- a/src/vz/Makefile.inc.am +++ b/src/vz/Makefile.inc.am @@ -6,15 +6,4 @@ STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(VZ_DRIVER_SOURCES)) if WITH_VZ SYSCONF_FILES += vz/virtvzd.sysconf - -OPENRC_INIT_FILES += \ - virtvzd.init \ - $(NULL) -OPENRC_INIT_FILES_IN += \ - vz/virtvzd.init.in \ - $(NULL) - -virtvzd.init: vz/virtvzd.init.in $(top_builddir)/config.status - $(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@ - endif WITH_VZ diff --git a/src/vz/meson.build b/src/vz/meson.build index dcf8f5037fd..fde1e937f35 100644 --- a/src/vz/meson.build +++ b/src/vz/meson.build @@ -52,4 +52,9 @@ if conf.has('WITH_VZ') 'sockets': [ 'main', 'ro', 'admin' ], 'conflicts': true, } + + openrc_init_files += { + 'name': 'virtvzd', + 'in_file': files('virtvzd.init.in'), + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 19 ------------------- src/interface/Makefile.inc.am | 6 ------ src/interface/meson.build | 5 +++++ src/libxl/Makefile.inc.am | 2 -- src/libxl/meson.build | 5 +++++ src/locking/Makefile.inc.am | 1 - src/locking/meson.build | 5 +++++ src/logging/Makefile.inc.am | 3 --- src/logging/meson.build | 5 +++++ src/lxc/Makefile.inc.am | 2 -- src/lxc/meson.build | 5 +++++ src/meson.build | 14 ++++++++++++++ src/network/Makefile.inc.am | 2 -- src/network/meson.build | 5 +++++ src/node_device/Makefile.inc.am | 5 ----- src/node_device/meson.build | 5 +++++ src/nwfilter/Makefile.inc.am | 2 -- src/nwfilter/meson.build | 5 +++++ src/qemu/Makefile.inc.am | 1 - src/qemu/meson.build | 5 +++++ src/remote/Makefile.inc.am | 5 ----- src/remote/meson.build | 10 ++++++++++ src/secret/Makefile.inc.am | 4 ---- src/secret/meson.build | 5 +++++ src/storage/Makefile.inc.am | 4 ---- src/storage/meson.build | 5 +++++ src/vbox/Makefile.inc.am | 4 ---- src/vbox/meson.build | 5 +++++ src/vz/Makefile.inc.am | 5 ----- src/vz/meson.build | 5 +++++ 30 files changed, 89 insertions(+), 65 deletions(-) delete mode 100644 src/logging/Makefile.inc.am diff --git a/src/Makefile.am b/src/Makefile.am index 0b40c23f980..c403a1d6b33 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -34,11 +34,9 @@ tapset_DATA = endif WITH_DTRACE_PROBES RPC_PROBE_FILES = LOGROTATE_FILES_IN = -SYSCONF_FILES = include security/Makefile.inc.am include access/Makefile.inc.am -include logging/Makefile.inc.am include locking/Makefile.inc.am include admin/Makefile.inc.am include vbox/Makefile.inc.am @@ -200,23 +198,6 @@ libvirt_functions.stp: $(RPC_PROBE_FILES) $(top_srcdir)/scripts/gensystemtap.py endif WITH_DTRACE_PROBES -install-sysconfig: - $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig - for f in $(SYSCONF_FILES:%.sysconf=%) ; \ - do \ - tgt=`basename $$f`; \ - $(INSTALL_DATA) $(srcdir)/$$f.sysconf \ - $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \ - done - -uninstall-sysconfig: - for f in $(SYSCONF_FILES:%.sysconf=%) ; \ - do \ - tgt=`basename $$f`; \ - rm -f $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \ - done - rmdir $(DESTDIR)$(sysconfdir)/sysconfig || : - LOGROTATE_FILES := $(LOGROTATE_FILES_IN:remote/%.in=%) %.logrotate: remote/%.logrotate.in diff --git a/src/interface/Makefile.inc.am b/src/interface/Makefile.inc.am index f6626c7f491..06bd8f820b1 100644 --- a/src/interface/Makefile.inc.am +++ b/src/interface/Makefile.inc.am @@ -3,9 +3,3 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(INTERFACE_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(INTERFACE_DRIVER_SOURCES)) - -if WITH_INTERFACE - -SYSCONF_FILES += interface/virtinterfaced.sysconf - -endif WITH_INTERFACE diff --git a/src/interface/meson.build b/src/interface/meson.build index a6b3e888358..8b5347bce43 100644 --- a/src/interface/meson.build +++ b/src/interface/meson.build @@ -53,4 +53,9 @@ if conf.has('WITH_INTERFACE') 'name': 'virtinterfaced', 'in_file': files('virtinterfaced.init.in') } + + sysconf_files += { + 'name': 'virtinterfaced', + 'file': files('virtinterfaced.sysconf'), + } endif diff --git a/src/libxl/Makefile.inc.am b/src/libxl/Makefile.inc.am index 9a33eb5f06b..0031adb2ef3 100644 --- a/src/libxl/Makefile.inc.am +++ b/src/libxl/Makefile.inc.am @@ -5,8 +5,6 @@ STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(LIBXL_DRIVER_SOURCES)) if WITH_LIBXL -SYSCONF_FILES += libxl/virtxend.sysconf - INSTALL_DATA_DIRS += libxl install-data-libxl: diff --git a/src/libxl/meson.build b/src/libxl/meson.build index 5f858dc32fc..722a001e079 100644 --- a/src/libxl/meson.build +++ b/src/libxl/meson.build @@ -72,4 +72,9 @@ if conf.has('WITH_LIBXL') 'name': 'virtxend', 'in_file': files('virtxend.init.in'), } + + sysconf_files += { + 'name': 'virtxend', + 'file': files('virtxend.sysconf'), + } endif diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index 8a0ecd8d1f2..02ce2fa7a77 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -1,7 +1,6 @@ # vim: filetype=automake RPC_PROBE_FILES += $(srcdir)/locking/lock_protocol.x -SYSCONF_FILES += locking/virtlockd.sysconf INSTALL_DATA_DIRS += locking diff --git a/src/locking/meson.build b/src/locking/meson.build index f560c9b44b9..1d42682d608 100644 --- a/src/locking/meson.build +++ b/src/locking/meson.build @@ -149,6 +149,11 @@ if conf.has('WITH_LIBVIRTD') 'in_file': files('virtlockd.init.in'), } + sysconf_files += { + 'name': 'virtlockd', + 'file': files('virtlockd.sysconf'), + } + if conf.has('WITH_SANLOCK') virt_helpers += { 'name': 'libvirt_sanlock_helper', diff --git a/src/logging/Makefile.inc.am b/src/logging/Makefile.inc.am deleted file mode 100644 index 48cae3add15..00000000000 --- a/src/logging/Makefile.inc.am +++ /dev/null @@ -1,3 +0,0 @@ -# vim: filetype=automake - -SYSCONF_FILES += logging/virtlogd.sysconf diff --git a/src/logging/meson.build b/src/logging/meson.build index 40327241e3c..8e913fb352f 100644 --- a/src/logging/meson.build +++ b/src/logging/meson.build @@ -92,4 +92,9 @@ if conf.has('WITH_LIBVIRTD') 'name': 'virtlogd', 'in_file': files('virtlogd.init.in'), } + + sysconf_files += { + 'name': 'virtlogd', + 'file': files('virtlogd.sysconf'), + } endif diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am index 3cf6f96ea1d..f65b1cdf6b9 100644 --- a/src/lxc/Makefile.inc.am +++ b/src/lxc/Makefile.inc.am @@ -11,8 +11,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_LXC -SYSCONF_FILES += lxc/virtlxcd.sysconf - if WITH_DTRACE_PROBES RPC_PROBE_FILES += $(srcdir)/lxc/lxc_monitor_protocol.x endif diff --git a/src/lxc/meson.build b/src/lxc/meson.build index 6135f61d4ab..bcb5798dbc7 100644 --- a/src/lxc/meson.build +++ b/src/lxc/meson.build @@ -155,4 +155,9 @@ if conf.has('WITH_LXC') 'name': 'virtlxcd', 'in_file': files('virtlxcd.init.in'), } + + sysconf_files += { + 'name': 'virtlxcd', + 'file': files('virtlxcd.sysconf'), + } endif diff --git a/src/meson.build b/src/meson.build index 602e8176d99..7d1b9714218 100644 --- a/src/meson.build +++ b/src/meson.build @@ -197,6 +197,12 @@ virt_daemon_units = [] # * in_file - source init file (required) openrc_init_files = [] +# sysconf_files +# install libvirt daemon sysconf files +# * name - daemon name (required) +# * file - source sysconf file (required) +sysconf_files = [] + # list subdirectories @@ -760,3 +766,11 @@ if conf.has('WITH_LIBVIRTD') endforeach endif endif + +foreach sysconf : sysconf_files + install_data( + sysconf['file'], + install_dir: sysconfdir / 'sysconfig', + rename: [ sysconf['name'] ], + ) +endforeach diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am index 81971c64ed4..2202903870f 100644 --- a/src/network/Makefile.inc.am +++ b/src/network/Makefile.inc.am @@ -5,8 +5,6 @@ STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(NETWORK_DRIVER_SOURCES)) if WITH_NETWORK -SYSCONF_FILES += network/virtnetworkd.sysconf - INSTALL_DATA_DIRS += network UUID=$(shell uuidgen 2>/dev/null) diff --git a/src/network/meson.build b/src/network/meson.build index c27578d66b4..35391698d6d 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -72,4 +72,9 @@ if conf.has('WITH_NETWORK') 'name': 'virtnetworkd', 'in_file': files('virtnetworkd.init.in'), } + + sysconf_files += { + 'name': 'virtnetworkd', + 'file': files('virtnetworkd.sysconf'), + } endif diff --git a/src/node_device/Makefile.inc.am b/src/node_device/Makefile.inc.am index e6fcbf6c9e5..63d2548e11f 100644 --- a/src/node_device/Makefile.inc.am +++ b/src/node_device/Makefile.inc.am @@ -9,8 +9,3 @@ DRIVER_SOURCE_FILES += \ STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(NODE_DEVICE_DRIVER_SOURCES)) \ $(NULL) - - -if WITH_NODE_DEVICES -SYSCONF_FILES += node_device/virtnodedevd.sysconf -endif WITH_NODE_DEVICES diff --git a/src/node_device/meson.build b/src/node_device/meson.build index d73867148ea..437924466eb 100644 --- a/src/node_device/meson.build +++ b/src/node_device/meson.build @@ -65,4 +65,9 @@ if conf.has('WITH_NODE_DEVICES') 'name': 'virtnodedevd', 'in_file': files('virtnodedevd.init.in'), } + + sysconf_files += { + 'name': 'virtnodedevd', + 'file': files('virtnodedevd.sysconf'), + } endif diff --git a/src/nwfilter/Makefile.inc.am b/src/nwfilter/Makefile.inc.am index 8fcd63cbbf9..4df4756adf7 100644 --- a/src/nwfilter/Makefile.inc.am +++ b/src/nwfilter/Makefile.inc.am @@ -11,6 +11,4 @@ if WITH_NWFILTER nwfilterxmldir = $(sysconfdir)/libvirt/nwfilter nwfilterxml_DATA = $(NWFILTER_XML_FILES) -SYSCONF_FILES += nwfilter/virtnwfilterd.sysconf - endif WITH_NWFILTER diff --git a/src/nwfilter/meson.build b/src/nwfilter/meson.build index 744600a73d1..a832c2ddaeb 100644 --- a/src/nwfilter/meson.build +++ b/src/nwfilter/meson.build @@ -60,4 +60,9 @@ if conf.has('WITH_NWFILTER') 'name': 'virtnwfilterd', 'in_file': files('virtnwfilterd.init.in'), } + + sysconf_files += { + 'name': 'virtnwfilterd', + 'file': files('virtnwfilterd.sysconf'), + } endif diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am index ec3178c373a..6d1e9e78148 100644 --- a/src/qemu/Makefile.inc.am +++ b/src/qemu/Makefile.inc.am @@ -4,7 +4,6 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES)) if WITH_QEMU -SYSCONF_FILES += qemu/virtqemud.sysconf INSTALL_DATA_DIRS += qemu diff --git a/src/qemu/meson.build b/src/qemu/meson.build index 09b72335741..a7a7b4801ca 100644 --- a/src/qemu/meson.build +++ b/src/qemu/meson.build @@ -152,4 +152,9 @@ if conf.has('WITH_QEMU') 'name': 'virtqemud', 'in_file': files('virtqemud.init.in'), } + + sysconf_files += { + 'name': 'virtqemud', + 'file': files('virtqemud.sysconf'), + } endif diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 73f7578ee5e..14c7a8e4141 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -7,11 +7,6 @@ LOGROTATE_FILES_IN += \ remote/libvirtd.logrotate.in \ $(NULL) -SYSCONF_FILES += \ - remote/libvirtd.sysconf \ - remote/virtproxyd.sysconf \ - $(NULL) - if WITH_LIBVIRTD INSTALL_DATA_DIRS += remote diff --git a/src/remote/meson.build b/src/remote/meson.build index 0310ad232aa..cc5a24d1e68 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -152,6 +152,11 @@ if conf.has('WITH_REMOTE') 'confd': files('libvirtd.confd'), } + sysconf_files += { + 'name': 'libvirtd', + 'file': files('libvirtd.sysconf'), + } + virt_daemons += { 'name': 'virtproxyd', 'c_args': [ @@ -182,6 +187,11 @@ if conf.has('WITH_REMOTE') 'in_file': files('virtproxyd.init.in'), 'confd': files('virtproxyd.confd'), } + + sysconf_files += { + 'name': 'virtproxyd', + 'file': files('virtproxyd.sysconf'), + } endif endif diff --git a/src/secret/Makefile.inc.am b/src/secret/Makefile.inc.am index dd38e6888cd..a60a6b507f4 100644 --- a/src/secret/Makefile.inc.am +++ b/src/secret/Makefile.inc.am @@ -3,7 +3,3 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(SECRET_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(SECRET_DRIVER_SOURCES)) - -if WITH_SECRETS -SYSCONF_FILES += secret/virtsecretd.sysconf -endif WITH_SECRETS diff --git a/src/secret/meson.build b/src/secret/meson.build index 3b3f999f758..2245790f796 100644 --- a/src/secret/meson.build +++ b/src/secret/meson.build @@ -42,4 +42,9 @@ if conf.has('WITH_SECRETS') 'name': 'virtsecretd', 'in_file': files('virtsecretd.init.in'), } + + sysconf_files += { + 'name': 'virtsecretd', + 'file': files('virtsecretd.sysconf'), + } endif diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index 23576659785..d5438e8a71c 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -3,7 +3,3 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(STORAGE_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(STORAGE_DRIVER_SOURCES)) - -if WITH_STORAGE -SYSCONF_FILES += storage/virtstoraged.sysconf -endif WITH_STORAGE diff --git a/src/storage/meson.build b/src/storage/meson.build index 7a1ed9f4b81..59024746322 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -140,6 +140,11 @@ if conf.has('WITH_STORAGE') 'name': 'virtstoraged', 'in_file': files('virtstoraged.init.in'), } + + sysconf_files += { + 'name': 'virtstoraged', + 'file': files('virtstoraged.sysconf'), + } endif if conf.has('WITH_STORAGE_DISK') diff --git a/src/vbox/Makefile.inc.am b/src/vbox/Makefile.inc.am index 28bc3c4a585..6197c3172b5 100644 --- a/src/vbox/Makefile.inc.am +++ b/src/vbox/Makefile.inc.am @@ -4,7 +4,3 @@ DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(VBOX_DRIVER_SOURCES)) \ $(srcdir)/vbox/vbox_tmpl.c \ $(NULL) - -if WITH_VBOX -SYSCONF_FILES += vbox/virtvboxd.sysconf -endif WITH_VBOX diff --git a/src/vbox/meson.build b/src/vbox/meson.build index f1b8012777f..b6dcee279b9 100644 --- a/src/vbox/meson.build +++ b/src/vbox/meson.build @@ -65,4 +65,9 @@ if conf.has('WITH_VBOX') 'name': 'virtvboxd', 'in_file': files('virtvboxd.init.in'), } + + sysconf_files += { + 'name': 'virtvboxd', + 'file': files('virtvboxd.sysconf'), + } endif diff --git a/src/vz/Makefile.inc.am b/src/vz/Makefile.inc.am index 7e7d402a7f0..380d1ffb839 100644 --- a/src/vz/Makefile.inc.am +++ b/src/vz/Makefile.inc.am @@ -2,8 +2,3 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(VZ_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(VZ_DRIVER_SOURCES)) - - -if WITH_VZ -SYSCONF_FILES += vz/virtvzd.sysconf -endif WITH_VZ diff --git a/src/vz/meson.build b/src/vz/meson.build index fde1e937f35..9e8ac3f8cfc 100644 --- a/src/vz/meson.build +++ b/src/vz/meson.build @@ -57,4 +57,9 @@ if conf.has('WITH_VZ') 'name': 'virtvzd', 'in_file': files('virtvzd.init.in'), } + + sysconf_files += { + 'name': 'virtvzd', + 'file': files('virtvzd.sysconf'), + } endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- scripts/install-dirs.sh | 5 +++++ scripts/meson.build | 1 + src/Makefile.am | 9 --------- src/libxl/Makefile.inc.am | 16 ---------------- src/libxl/meson.build | 6 ++++++ src/locking/Makefile.inc.am | 24 ------------------------ src/locking/meson.build | 12 ++++++++++++ src/lxc/Makefile.inc.am | 17 ----------------- src/lxc/meson.build | 6 ++++++ src/meson.build | 16 ++++++++++++++++ src/network/Makefile.inc.am | 5 ----- src/network/meson.build | 6 ++++++ src/qemu/Makefile.inc.am | 29 ----------------------------- src/qemu/meson.build | 10 ++++++++++ src/remote/Makefile.inc.am | 13 ------------- src/remote/meson.build | 4 ++++ 16 files changed, 66 insertions(+), 113 deletions(-) create mode 100644 scripts/install-dirs.sh diff --git a/scripts/install-dirs.sh b/scripts/install-dirs.sh new file mode 100644 index 00000000000..27558d53fe9 --- /dev/null +++ b/scripts/install-dirs.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +for dir in "$@"; do + mkdir -p $DESTDIR/$dir +done diff --git a/scripts/meson.build b/scripts/meson.build index 0d2e48c3a36..8e4f16349e5 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -20,6 +20,7 @@ scripts = [ 'header-ifdef.py', 'hvsupport.py', 'hyperv_wmi_generator.py', + 'install-dirs.sh', 'meson-python.sh', 'mock-noinline.py', 'prohibit-duplicate-header.py', diff --git a/src/Makefile.am b/src/Makefile.am index c403a1d6b33..894ec5162a3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -227,15 +227,6 @@ endif WITH_LIBVIRTD install-data-local: $(INSTALL_DATA_LOCAL) \ $(INSTALL_DATA_DIRS:%=install-data-%) - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" uninstall-local: $(UNINSTALL_LOCAL) \ $(INSTALL_DATA_DIRS:%=uninstall-data-%) - rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||: - rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||: - rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||: - rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||: - rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||: diff --git a/src/libxl/Makefile.inc.am b/src/libxl/Makefile.inc.am index 0031adb2ef3..5af19c83512 100644 --- a/src/libxl/Makefile.inc.am +++ b/src/libxl/Makefile.inc.am @@ -2,19 +2,3 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(LIBXL_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(LIBXL_DRIVER_SOURCES)) - -if WITH_LIBXL - -INSTALL_DATA_DIRS += libxl - -install-data-libxl: - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" - $(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/libxl" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" - -uninstall-data-libxl: - rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||: - rmdir "$(DESTDIR)$(runstatedir)/libvirt/libxl" ||: - rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||: - -endif WITH_LIBXL diff --git a/src/libxl/meson.build b/src/libxl/meson.build index 722a001e079..a5df0011b0b 100644 --- a/src/libxl/meson.build +++ b/src/libxl/meson.build @@ -77,4 +77,10 @@ if conf.has('WITH_LIBXL') 'name': 'virtxend', 'file': files('virtxend.sysconf'), } + + virt_install_dirs += [ + localstatedir / 'lib' / 'libvirt' / 'libxl', + runstatedir / 'libvirt' / 'libxl', + localstatedir / 'log' / 'libvirt' / 'libxl', + ] endif diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index 02ce2fa7a77..285e73a6bf4 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -1,27 +1,3 @@ # vim: filetype=automake RPC_PROBE_FILES += $(srcdir)/locking/lock_protocol.x - -INSTALL_DATA_DIRS += locking - -install-data-locking: - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" - $(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/lockd" -if WITH_SANLOCK - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" -endif WITH_SANLOCK - -uninstall-data-locking: - rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||: - rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||: - rmdir "$(DESTDIR)$(runstatedir)/libvirt/lockd" ||: -if WITH_SANLOCK - rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||: -endif WITH_SANLOCK -endif WITH_LIBVIRTD - -.PHONY: \ - install-data-locking \ - uninstall-data-locking \ - $(NULL) diff --git a/src/locking/meson.build b/src/locking/meson.build index 1d42682d608..dbff78ca1bb 100644 --- a/src/locking/meson.build +++ b/src/locking/meson.build @@ -225,4 +225,16 @@ if conf.has('WITH_LIBVIRTD') 'aug': files('test_virtlockd.aug.in'), 'conf': files('virtlockd.conf'), } + + virt_install_dirs += [ + localstatedir / 'lib' / 'libvirt' / 'lockd', + localstatedir / 'lib' / 'libvirt' / 'lockd' / 'files', + runstatedir / 'libvirt' / 'lockd', + ] + + if conf.has('WITH_SANLOCK') + virt_install_dirs += [ + localstatedir / 'lib' / 'libvirt' / 'sanlock', + ] + endif endif diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am index f65b1cdf6b9..7f312975d6c 100644 --- a/src/lxc/Makefile.inc.am +++ b/src/lxc/Makefile.inc.am @@ -15,21 +15,4 @@ if WITH_DTRACE_PROBES RPC_PROBE_FILES += $(srcdir)/lxc/lxc_monitor_protocol.x endif -INSTALL_DATA_DIRS += lxc - -install-data-lxc: - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" - $(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/lxc" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/lxc" - -uninstall-data-lxc: - rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||: - rmdir "$(DESTDIR)$(runstatedir)/libvirt/lxc" ||: - rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/lxc" ||: - endif WITH_LXC - -.PHONY: \ - install-data-lxc \ - uninstall-data-lxc \ - $(NULL) diff --git a/src/lxc/meson.build b/src/lxc/meson.build index bcb5798dbc7..ccb11ee1d42 100644 --- a/src/lxc/meson.build +++ b/src/lxc/meson.build @@ -160,4 +160,10 @@ if conf.has('WITH_LXC') 'name': 'virtlxcd', 'file': files('virtlxcd.sysconf'), } + + virt_install_dirs += [ + localstatedir / 'lib' / 'libvirt' / 'lxc', + runstatedir / 'libvirt' / 'lxc', + localstatedir / 'log' / 'libvirt' / 'lxc', + ] endif diff --git a/src/meson.build b/src/meson.build index 7d1b9714218..b8e356d8b0e 100644 --- a/src/meson.build +++ b/src/meson.build @@ -203,6 +203,10 @@ openrc_init_files = [] # * file - source sysconf file (required) sysconf_files = [] +# virt_install_dirs: +# list of directories to create during installation +virt_install_dirs = [] + # list subdirectories @@ -774,3 +778,15 @@ foreach sysconf : sysconf_files rename: [ sysconf['name'] ], ) endforeach + + +# Install empty directories + +virt_install_dirs += [ + localstatedir / 'cache' / 'libvirt', + localstatedir / 'lib' / 'libvirt' / 'images', + localstatedir / 'lib' / 'libvirt' / 'filesystems', + localstatedir / 'lib' / 'libvirt' / 'boot', +] + +meson.add_install_script(install_dirs_prog.path(), virt_install_dirs) diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am index 2202903870f..8482f924a15 100644 --- a/src/network/Makefile.inc.am +++ b/src/network/Makefile.inc.am @@ -10,9 +10,6 @@ INSTALL_DATA_DIRS += network UUID=$(shell uuidgen 2>/dev/null) install-data-network: - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq" - $(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/network" $(MKDIR_P) "$(DESTDIR)$(confdir)/qemu/networks/autostart" $(INSTALL_DATA) $(srcdir)/network/default.xml \ $(DESTDIR)$(confdir)/qemu/networks/default.xml @@ -38,8 +35,6 @@ uninstall-data-network: rm -f $(DESTDIR)$(confdir)/qemu/networks/default.xml rmdir "$(DESTDIR)$(confdir)/qemu/networks/autostart" || : rmdir "$(DESTDIR)$(confdir)/qemu/networks" || : - rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||: - rmdir "$(DESTDIR)$(runstatedir)/libvirt/network" ||: if WITH_FIREWALLD_ZONE rm -f $(DESTDIR)$(prefix)/lib/firewalld/zones/libvirt.xml endif WITH_FIREWALLD_ZONE diff --git a/src/network/meson.build b/src/network/meson.build index 35391698d6d..c2085091bce 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -77,4 +77,10 @@ if conf.has('WITH_NETWORK') 'name': 'virtnetworkd', 'file': files('virtnetworkd.sysconf'), } + + virt_install_dirs += [ + localstatedir / 'lib' / 'libvirt' / 'network', + localstatedir / 'lib' / 'libvirt' / 'dnsmasq', + runstatedir / 'libvirt' / 'network', + ] endif diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am index 6d1e9e78148..f665cb1f130 100644 --- a/src/qemu/Makefile.inc.am +++ b/src/qemu/Makefile.inc.am @@ -2,32 +2,3 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES)) - -if WITH_QEMU - -INSTALL_DATA_DIRS += qemu - -install-data-qemu: - $(MKDIR_P) -m 0751 "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu" - $(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/qemu" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/swtpm" - $(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/qemu/swtpm" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/swtpm/libvirt/qemu" - -uninstall-data-qemu: - rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu" ||: - rmdir "$(DESTDIR)$(runstatedir)/libvirt/qemu" ||: - rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu" ||: - rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/qemu" ||: - rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/swtpm" - rmdir "$(DESTDIR)$(runstatedir)/libvirt/qemu/swtpm" ||: - rmdir "$(DESTDIR)$(localstatedir)/log/swtpm/libvirt/qemu" ||: - -endif WITH_QEMU - -.PHONY: \ - install-data-qemu \ - uninstall-data-qemu \ - $(NULL) diff --git a/src/qemu/meson.build b/src/qemu/meson.build index a7a7b4801ca..7bdaf6c19bd 100644 --- a/src/qemu/meson.build +++ b/src/qemu/meson.build @@ -157,4 +157,14 @@ if conf.has('WITH_QEMU') 'name': 'virtqemud', 'file': files('virtqemud.sysconf'), } + + virt_install_dirs += [ + localstatedir / 'lib' / 'libvirt' / 'qemu', + runstatedir / 'libvirt' / 'qemu', + localstatedir / 'cache' / 'libvirt' / 'qemu', + localstatedir / 'log' / 'libvirt' / 'qemu', + localstatedir / 'lib' / 'libvirt' / 'swtpm', + runstatedir / 'libvirt' / 'qemu' / 'swtpm', + localstatedir / 'log' / 'swtpm' / 'libvirt' / 'qemu', + ] endif diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 14c7a8e4141..287dad426cb 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -9,14 +9,6 @@ LOGROTATE_FILES_IN += \ if WITH_LIBVIRTD -INSTALL_DATA_DIRS += remote - -install-data-remote: - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt" - -uninstall-data-remote: - rmdir "$(DESTDIR)$(localstatedir)/log/libvirt" ||: - if WITH_SYSCTL # Use $(prefix)/lib rather than $(libdir), since man sysctl.d insists on # /usr/lib/sysctl.d/ even when libdir is /usr/lib64 @@ -60,11 +52,6 @@ endif WITH_POLKIT endif WITH_LIBVIRTD -.PHONY: \ - install-data-remote \ - uninstall-data-remote \ - $(NULL) - # This is needed for clients too, so can't wrap in # the WITH_LIBVIRTD conditional if WITH_SASL diff --git a/src/remote/meson.build b/src/remote/meson.build index cc5a24d1e68..b18754d02c1 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -192,6 +192,10 @@ if conf.has('WITH_REMOTE') 'name': 'virtproxyd', 'file': files('virtproxyd.sysconf'), } + + virt_install_dirs += [ + localstatedir / 'log' / 'libvirt', + ] endif endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 28 ---------------------------- src/remote/Makefile.inc.am | 7 ------- src/remote/meson.build | 23 +++++++++++++++++++++++ 3 files changed, 23 insertions(+), 35 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 894ec5162a3..07516aa43ae 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -33,7 +33,6 @@ if WITH_DTRACE_PROBES tapset_DATA = endif WITH_DTRACE_PROBES RPC_PROBE_FILES = -LOGROTATE_FILES_IN = include security/Makefile.inc.am include access/Makefile.inc.am @@ -198,33 +197,6 @@ libvirt_functions.stp: $(RPC_PROBE_FILES) $(top_srcdir)/scripts/gensystemtap.py endif WITH_DTRACE_PROBES -LOGROTATE_FILES := $(LOGROTATE_FILES_IN:remote/%.in=%) - -%.logrotate: remote/%.logrotate.in - $(AM_V_GEN)sed \ - -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ - < $< > $@-t && \ - mv $@-t $@ - -if WITH_LIBVIRTD -install-logrotate: $(LOGROTATE_FILES) - $(MKDIR_P) $(DESTDIR)$(sysconfdir)/logrotate.d/ - for f in $(LOGROTATE_FILES) ; \ - do \ - tgt=`echo $$f | sed -e 's/.logrotate//'`; \ - $(INSTALL_DATA) $$f \ - $(DESTDIR)$(sysconfdir)/logrotate.d/$$tgt; \ - done - -uninstall-logrotate: - rm -f $(LOGROTATE_FILES:%.logrotate=$(DESTDIR)$(sysconfdir)/logrotate.d/%) - rmdir $(DESTDIR)$(sysconfdir)/logrotate.d || : - -INSTALL_DATA_LOCAL += install-logrotate -UNINSTALL_LOCAL += uninstall-logrotate -endif WITH_LIBVIRTD - - install-data-local: $(INSTALL_DATA_LOCAL) \ $(INSTALL_DATA_DIRS:%=install-data-%) diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 287dad426cb..8fbe8425b3b 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -1,12 +1,5 @@ # vim: filetype=automake -LOGROTATE_FILES_IN += \ - remote/libvirtd.qemu.logrotate.in \ - remote/libvirtd.lxc.logrotate.in \ - remote/libvirtd.libxl.logrotate.in \ - remote/libvirtd.logrotate.in \ - $(NULL) - if WITH_LIBVIRTD if WITH_SYSCTL diff --git a/src/remote/meson.build b/src/remote/meson.build index b18754d02c1..3b9f6117b62 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -99,6 +99,13 @@ libvirtd_socket_unit_files = [ libvirtd_socket_conflicts = ' '.join(libvirtd_socket_unit_files) +logrotate_files = [ + 'libvirtd.qemu', + 'libvirtd.lxc', + 'libvirtd.libxl', + 'libvirtd', +] + if conf.has('WITH_REMOTE') remote_driver_lib = static_library( 'virt_remote_driver', @@ -196,6 +203,22 @@ if conf.has('WITH_REMOTE') virt_install_dirs += [ localstatedir / 'log' / 'libvirt', ] + + logrotate_conf = configuration_data() + logrotate_conf.set('localstatedir', localstatedir) + + foreach name : logrotate_files + log_file = configure_file( + input: '@0@.logrotate.in'.format(name), + output: '@0@.logrotate'.format(name), + configuration: logrotate_conf, + ) + install_data( + log_file, + install_dir: sysconfdir / 'logrotate.d', + rename: [ name ], + ) + endforeach endif endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/access/Makefile.inc.am | 15 --------------- src/access/meson.build | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/access/Makefile.inc.am b/src/access/Makefile.inc.am index 72c62a0d2cd..d90829632ff 100644 --- a/src/access/Makefile.inc.am +++ b/src/access/Makefile.inc.am @@ -6,21 +6,6 @@ ACCESS_DRIVER_API_FILES = \ libvirt_access_lxc.xml \ $(NULL) -ACCESS_DRIVER_POLKIT_POLICY = access/org.libvirt.api.policy - -$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \ - $(top_srcdir)/scripts/genpolkit.py Makefile.am - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) \ - $(top_srcdir)/scripts/genpolkit.py $< > $@ || rm -f $@ - -if WITH_POLKIT - -polkitactiondir = $(datadir)/polkit-1/actions -if WITH_LIBVIRTD -polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY) -endif WITH_LIBVIRTD -endif ! WITH_POLKIT - libvirt_access.xml: $(srcdir)/rpc/gendispatch.pl \ $(REMOTE_PROTOCOL) Makefile.am $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclapi \ diff --git a/src/access/meson.build b/src/access/meson.build index f3b605f0009..71bc4670091 100644 --- a/src/access/meson.build +++ b/src/access/meson.build @@ -9,6 +9,8 @@ access_polkit_sources = [ 'viraccessdriverpolkit.c', ] +access_perm_h = files('viraccessperm.h') + remote_path = meson.source_root() / 'src' / 'remote' access_gen_headers = [] @@ -58,6 +60,18 @@ endforeach if conf.has('WITH_POLKIT') access_sources += access_polkit_sources + + if conf.has('WITH_LIBVIRTD') + custom_target( + 'org.libvirt.api.policy', + input: access_perm_h, + output: 'org.libvirt.api.policy', + command: [ meson_python_prog, genpolkit_prog, '@INPUT@' ], + capture: true, + install: true, + install_dir: datadir / 'polkit-1' / 'actions', + ) + endif endif virt_access_lib = static_library( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 1 - src/access/Makefile.inc.am | 21 --------------------- src/access/meson.build | 12 ++++++++++++ 3 files changed, 12 insertions(+), 22 deletions(-) delete mode 100644 src/access/Makefile.inc.am diff --git a/src/Makefile.am b/src/Makefile.am index 07516aa43ae..63705b36b6f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -35,7 +35,6 @@ endif WITH_DTRACE_PROBES RPC_PROBE_FILES = include security/Makefile.inc.am -include access/Makefile.inc.am include locking/Makefile.inc.am include admin/Makefile.inc.am include vbox/Makefile.inc.am diff --git a/src/access/Makefile.inc.am b/src/access/Makefile.inc.am deleted file mode 100644 index d90829632ff..00000000000 --- a/src/access/Makefile.inc.am +++ /dev/null @@ -1,21 +0,0 @@ -# vim: filetype=automake - -ACCESS_DRIVER_API_FILES = \ - libvirt_access.xml \ - libvirt_access_qemu.xml \ - libvirt_access_lxc.xml \ - $(NULL) - -libvirt_access.xml: $(srcdir)/rpc/gendispatch.pl \ - $(REMOTE_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclapi \ - remote REMOTE $(REMOTE_PROTOCOL) > $@ -libvirt_access_qemu.xml: $(srcdir)/rpc/gendispatch.pl \ - $(QEMU_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclapi \ - qemu QEMU $(QEMU_PROTOCOL) > $@ -libvirt_access_lxc.xml: $(srcdir)/rpc/gendispatch.pl \ - $(LXC_PROTOCOL) Makefile.am - $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclapi \ - lxc LXC $(LXC_PROTOCOL) > $@ - diff --git a/src/access/meson.build b/src/access/meson.build index 71bc4670091..2d8a2a90716 100644 --- a/src/access/meson.build +++ b/src/access/meson.build @@ -16,16 +16,19 @@ remote_path = meson.source_root() / 'src' / 'remote' access_gen_headers = [] access_gen_sources = [] access_gen_sym = [] +access_gen_xml = [] foreach name : [ 'remote', 'qemu', 'lxc' ] if name == 'remote' header_file = 'viraccessapicheck.h' source_file = 'viraccessapicheck.c' syms_file = 'libvirt_access.syms' + xml_file = 'libvirt_access.xml' else header_file = 'viraccessapicheck@0@.h'.format(name) source_file = 'viraccessapicheck@0@.c'.format(name) syms_file = 'libvirt_access_@0@.syms'.format(name) + xml_file = 'libvirt_access_@0@.xml'.format(name) endif protocol_file = remote_path / '@0@_protocol.x'.format(name) @@ -56,6 +59,15 @@ foreach name : [ 'remote', 'qemu', 'lxc' ] gendispatch_prog, '--mode=aclsym', name, name.to_upper(), protocol_file, ] ) + + access_gen_xml += custom_target( + xml_file, + output: xml_file, + capture: true, + command: [ + gendispatch_prog, '--mode=aclapi', name, name.to_upper(), protocol_file, + ], + ) endforeach if conf.has('WITH_POLKIT') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- scripts/install-symlink.sh | 7 +++++ scripts/meson.build | 1 + src/network/Makefile.inc.am | 20 ------------- src/network/{default.xml => default.xml.in} | 0 src/network/meson.build | 32 +++++++++++++++++++++ 5 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 scripts/install-symlink.sh rename src/network/{default.xml => default.xml.in} (100%) diff --git a/scripts/install-symlink.sh b/scripts/install-symlink.sh new file mode 100644 index 00000000000..bfd1f5ad37d --- /dev/null +++ b/scripts/install-symlink.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +mkdir -p $DESTDIR/$1 + +cd $DESTDIR/$1 + +ln -f -s $2 $3 diff --git a/scripts/meson.build b/scripts/meson.build index 8e4f16349e5..3038dfc8d21 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -21,6 +21,7 @@ scripts = [ 'hvsupport.py', 'hyperv_wmi_generator.py', 'install-dirs.sh', + 'install-symlink.sh', 'meson-python.sh', 'mock-noinline.py', 'prohibit-duplicate-header.py', diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am index 8482f924a15..c19b1f99529 100644 --- a/src/network/Makefile.inc.am +++ b/src/network/Makefile.inc.am @@ -7,23 +7,7 @@ STATEFUL_DRIVER_SOURCE_FILES += \ if WITH_NETWORK INSTALL_DATA_DIRS += network -UUID=$(shell uuidgen 2>/dev/null) - install-data-network: - $(MKDIR_P) "$(DESTDIR)$(confdir)/qemu/networks/autostart" - $(INSTALL_DATA) $(srcdir)/network/default.xml \ - $(DESTDIR)$(confdir)/qemu/networks/default.xml - test -z "$(UUID)" || \ - { sed -e "s,</name>,</name>; <uuid>$(UUID)</uuid>," \ - $(DESTDIR)$(confdir)/qemu/networks/default.xml | \ - tr ";" "\n" > \ - $(DESTDIR)$(confdir)/qemu/networks/default.xml.t && \ - cp $(DESTDIR)$(confdir)/qemu/networks/default.xml.t \ - $(DESTDIR)$(confdir)/qemu/networks/default.xml && \ - rm $(DESTDIR)$(confdir)/qemu/networks/default.xml.t; } - ( cd $(DESTDIR)$(confdir)/qemu/networks/autostart && \ - rm -f default.xml && \ - $(LN_S) ../default.xml default.xml ) if WITH_FIREWALLD_ZONE $(MKDIR_P) "$(DESTDIR)$(prefix)/lib/firewalld/zones" $(INSTALL_DATA) $(srcdir)/network/libvirt.zone \ @@ -31,10 +15,6 @@ if WITH_FIREWALLD_ZONE endif WITH_FIREWALLD_ZONE uninstall-data-network: - rm -f $(DESTDIR)$(confdir)/qemu/networks/autostart/default.xml - rm -f $(DESTDIR)$(confdir)/qemu/networks/default.xml - rmdir "$(DESTDIR)$(confdir)/qemu/networks/autostart" || : - rmdir "$(DESTDIR)$(confdir)/qemu/networks" || : if WITH_FIREWALLD_ZONE rm -f $(DESTDIR)$(prefix)/lib/firewalld/zones/libvirt.xml endif WITH_FIREWALLD_ZONE diff --git a/src/network/default.xml b/src/network/default.xml.in similarity index 100% rename from src/network/default.xml rename to src/network/default.xml.in diff --git a/src/network/meson.build b/src/network/meson.build index c2085091bce..2ca7d268c6e 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -83,4 +83,36 @@ if conf.has('WITH_NETWORK') localstatedir / 'lib' / 'libvirt' / 'dnsmasq', runstatedir / 'libvirt' / 'network', ] + + uuidgen_prog = find_program('uuidgen', required: false) + + if uuidgen_prog.found() + uuid = run_command(uuidgen_prog).stdout().strip() + + configure_file( + input: 'default.xml.in', + output: 'default.xml', + command: [ + 'sed', '-e', 's|</name>|</name>\\n <uuid>@0@</uuid>|'.format(uuid), + '@INPUT@', + ], + capture: true, + install: true, + install_dir: confdir / 'qemu' / 'networks', + ) + else + configure_file( + input: 'default.xml.in', + output: 'default.xml', + copy: true, + install: true, + install_dir: confdir / 'qemu' / 'networks', + ) + endif + + meson.add_install_script( + install_symlink_prog.path(), + confdir / 'qemu' / 'networks' / 'autostart', + '../default.xml', 'default.xml', + ) endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 7 ++----- src/network/Makefile.inc.am | 22 ---------------------- src/network/meson.build | 8 ++++++++ 3 files changed, 10 insertions(+), 27 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 63705b36b6f..7305a069f07 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,7 +22,6 @@ DRIVER_SOURCE_FILES = STATEFUL_DRIVER_SOURCE_FILES = -INSTALL_DATA_DIRS = INSTALL_DATA_LOCAL = UNINSTALL_LOCAL = SYM_FILES = @@ -196,8 +195,6 @@ libvirt_functions.stp: $(RPC_PROBE_FILES) $(top_srcdir)/scripts/gensystemtap.py endif WITH_DTRACE_PROBES -install-data-local: $(INSTALL_DATA_LOCAL) \ - $(INSTALL_DATA_DIRS:%=install-data-%) +install-data-local: $(INSTALL_DATA_LOCAL) -uninstall-local: $(UNINSTALL_LOCAL) \ - $(INSTALL_DATA_DIRS:%=uninstall-data-%) +uninstall-local: $(UNINSTALL_LOCAL) diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am index c19b1f99529..c13a6831cc0 100644 --- a/src/network/Makefile.inc.am +++ b/src/network/Makefile.inc.am @@ -3,25 +3,3 @@ DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(NETWORK_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(NETWORK_DRIVER_SOURCES)) - -if WITH_NETWORK -INSTALL_DATA_DIRS += network - -install-data-network: -if WITH_FIREWALLD_ZONE - $(MKDIR_P) "$(DESTDIR)$(prefix)/lib/firewalld/zones" - $(INSTALL_DATA) $(srcdir)/network/libvirt.zone \ - $(DESTDIR)$(prefix)/lib/firewalld/zones/libvirt.xml -endif WITH_FIREWALLD_ZONE - -uninstall-data-network: -if WITH_FIREWALLD_ZONE - rm -f $(DESTDIR)$(prefix)/lib/firewalld/zones/libvirt.xml -endif WITH_FIREWALLD_ZONE - -endif WITH_NETWORK - -.PHONY: \ - install-data-network \ - uninstall-data-network \ - $(NULL) diff --git a/src/network/meson.build b/src/network/meson.build index 2ca7d268c6e..948dad39432 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -115,4 +115,12 @@ if conf.has('WITH_NETWORK') confdir / 'qemu' / 'networks' / 'autostart', '../default.xml', 'default.xml', ) + + if conf.has('WITH_FIREWALLD_ZONE') + install_data( + 'libvirt.zone', + install_dir: prefix / 'lib' / 'firewalld' / 'zones', + rename: [ 'libvirt.xml' ], + ) + endif endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/nwfilter/Makefile.inc.am | 9 --------- src/nwfilter/meson.build | 2 ++ src/nwfilter/xml/meson.build | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 src/nwfilter/xml/meson.build diff --git a/src/nwfilter/Makefile.inc.am b/src/nwfilter/Makefile.inc.am index 4df4756adf7..4d34d7f3ad1 100644 --- a/src/nwfilter/Makefile.inc.am +++ b/src/nwfilter/Makefile.inc.am @@ -1,14 +1,5 @@ # vim: filetype=automake -NWFILTER_XML_FILES = $(wildcard $(srcdir)/nwfilter/xml/*.xml) - DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(NWFILTER_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(NWFILTER_DRIVER_SOURCES)) - -if WITH_NWFILTER - -nwfilterxmldir = $(sysconfdir)/libvirt/nwfilter -nwfilterxml_DATA = $(NWFILTER_XML_FILES) - -endif WITH_NWFILTER diff --git a/src/nwfilter/meson.build b/src/nwfilter/meson.build index a832c2ddaeb..a05f0ce8fcf 100644 --- a/src/nwfilter/meson.build +++ b/src/nwfilter/meson.build @@ -65,4 +65,6 @@ if conf.has('WITH_NWFILTER') 'name': 'virtnwfilterd', 'file': files('virtnwfilterd.sysconf'), } + + subdir('xml') endif diff --git a/src/nwfilter/xml/meson.build b/src/nwfilter/xml/meson.build new file mode 100644 index 00000000000..95af75bb15e --- /dev/null +++ b/src/nwfilter/xml/meson.build @@ -0,0 +1,22 @@ +nwfilter_xml_files = [ + 'allow-arp.xml', + 'allow-dhcp-server.xml', + 'allow-dhcp.xml', + 'allow-incoming-ipv4.xml', + 'allow-ipv4.xml', + 'clean-traffic-gateway.xml', + 'clean-traffic.xml', + 'no-arp-ip-spoofing.xml', + 'no-arp-mac-spoofing.xml', + 'no-arp-spoofing.xml', + 'no-ip-multicast.xml', + 'no-ip-spoofing.xml', + 'no-mac-broadcast.xml', + 'no-mac-spoofing.xml', + 'no-other-l2-traffic.xml', + 'no-other-rarp-traffic.xml', + 'qemu-announce-self-rarp.xml', + 'qemu-announce-self.xml', +] + +install_data(nwfilter_xml_files, install_dir: sysconfdir / 'libvirt' / 'nwfilter') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/remote/Makefile.inc.am | 18 ------------------ src/remote/meson.build | 10 ++++++++++ 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 8fbe8425b3b..f80f4a06325 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -2,24 +2,6 @@ if WITH_LIBVIRTD -if WITH_SYSCTL -# Use $(prefix)/lib rather than $(libdir), since man sysctl.d insists on -# /usr/lib/sysctl.d/ even when libdir is /usr/lib64 -sysctldir = $(prefix)/lib/sysctl.d - -install-sysctl: - $(MKDIR_P) $(DESTDIR)$(sysctldir) - $(INSTALL_DATA) $(srcdir)/remote/libvirtd.sysctl \ - $(DESTDIR)$(sysctldir)/60-libvirtd.conf - -uninstall-sysctl: - rm -f $(DESTDIR)$(sysctldir)/60-libvirtd.conf - rmdir $(DESTDIR)$(sysctldir) || : - -INSTALL_DATA_LOCAL += install-sysctl -UNINSTALL_LOCAL += uninstall-sysctl -endif WITH_SYSCTL - if WITH_POLKIT polkitdir = $(datadir)/polkit-1 polkitactionsdir = $(polkitdir)/actions diff --git a/src/remote/meson.build b/src/remote/meson.build index 3b9f6117b62..cd6e849c9a8 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -219,6 +219,16 @@ if conf.has('WITH_REMOTE') rename: [ name ], ) endforeach + + if conf.has('WITH_SYSCTL') + # Use $(prefix)/lib rather than $(libdir), since man sysctl.d insists on + # /usr/lib/sysctl.d/ even when libdir is /usr/lib64 + install_data( + 'libvirtd.sysctl', + install_dir: prefix / 'lib' / 'sysctl.d', + rename: [ '60-libvirtd.conf' ], + ) + endif endif endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/remote/Makefile.inc.am | 27 --------------------------- src/remote/meson.build | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 27 deletions(-) diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index f80f4a06325..6a4af4aad31 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -1,32 +1,5 @@ # vim: filetype=automake -if WITH_LIBVIRTD - -if WITH_POLKIT -polkitdir = $(datadir)/polkit-1 -polkitactionsdir = $(polkitdir)/actions -polkitrulesdir = $(polkitdir)/rules.d - -install-polkit: - $(MKDIR_P) $(DESTDIR)$(polkitactionsdir) - $(INSTALL_DATA) $(srcdir)/remote/libvirtd.policy \ - $(DESTDIR)$(polkitactionsdir)/org.libvirt.unix.policy - $(MKDIR_P) $(DESTDIR)$(polkitrulesdir) - $(INSTALL_DATA) $(srcdir)/remote/libvirtd.rules \ - $(DESTDIR)$(polkitrulesdir)/50-libvirt.rules - -uninstall-polkit: - rm -f $(DESTDIR)$(polkitactionsdir)/org.libvirt.unix.policy - rmdir $(DESTDIR)$(polkitactionsdir) || : - rm -f $(DESTDIR)$(polkitrulesdir)/50-libvirt.rules - rmdir $(DESTDIR)$(polkitrulesdir) || : - -INSTALL_DATA_LOCAL += install-polkit -UNINSTALL_LOCAL += uninstall-polkit -endif WITH_POLKIT - -endif WITH_LIBVIRTD - # This is needed for clients too, so can't wrap in # the WITH_LIBVIRTD conditional if WITH_SASL diff --git a/src/remote/meson.build b/src/remote/meson.build index cd6e849c9a8..1169403722f 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -229,6 +229,20 @@ if conf.has('WITH_REMOTE') rename: [ '60-libvirtd.conf' ], ) endif + + if conf.has('WITH_POLKIT') + polkitdir = datadir / 'polkit-1' + install_data( + 'libvirtd.policy', + install_dir: polkitdir / 'actions', + rename: [ 'org.libvirt.unix.policy' ], + ) + install_data( + 'libvirtd.rules', + install_dir: polkitdir / 'rules.d', + rename: [ '50-libvirt.rules' ], + ) + endif endif endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 1 - src/remote/Makefile.inc.am | 19 ------------------- src/remote/meson.build | 10 ++++++++++ 3 files changed, 10 insertions(+), 20 deletions(-) delete mode 100644 src/remote/Makefile.inc.am diff --git a/src/Makefile.am b/src/Makefile.am index 7305a069f07..acdbe30e0e0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -48,7 +48,6 @@ include nwfilter/Makefile.inc.am include node_device/Makefile.inc.am include secret/Makefile.inc.am include storage/Makefile.inc.am -include remote/Makefile.inc.am # .libs/libvirt.so is built by libtool as a side-effect of the Makefile diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am deleted file mode 100644 index 6a4af4aad31..00000000000 --- a/src/remote/Makefile.inc.am +++ /dev/null @@ -1,19 +0,0 @@ -# vim: filetype=automake - -# This is needed for clients too, so can't wrap in -# the WITH_LIBVIRTD conditional -if WITH_SASL -sasldir = $(sysconfdir)/sasl2 - -install-sasl: - $(MKDIR_P) $(DESTDIR)$(sasldir) - $(INSTALL_DATA) $(srcdir)/remote/libvirtd.sasl \ - $(DESTDIR)$(sasldir)/libvirt.conf - -uninstall-sasl: - rm -f $(DESTDIR)$(sasldir)/libvirt.conf - rmdir $(DESTDIR)$(sasldir) || : - -INSTALL_DATA_LOCAL += install-sasl -UNINSTALL_LOCAL += uninstall-sasl -endif WITH_SASL diff --git a/src/remote/meson.build b/src/remote/meson.build index 1169403722f..055857ae360 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -252,4 +252,14 @@ else sym_files += 'libvirt_remote.syms' endif +# This is needed for clients too, so can't wrap in +# the WITH_LIBVIRTD conditional +if conf.has('WITH_SASL') + install_data( + 'libvirtd.sasl', + install_dir: sysconfdir / 'sasl2', + rename: [ 'libvirt.conf' ], + ) +endif + remote_inc_dir = include_directories('.') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 7 --- src/security/Makefile.inc.am | 52 ------------------- src/security/apparmor/meson.build | 38 ++++++++++++++ .../usr.lib.libvirt.virt-aa-helper.local | 1 + src/security/meson.build | 4 ++ 5 files changed, 43 insertions(+), 59 deletions(-) delete mode 100644 src/security/Makefile.inc.am create mode 100644 src/security/apparmor/meson.build create mode 100644 src/security/apparmor/usr.lib.libvirt.virt-aa-helper.local diff --git a/src/Makefile.am b/src/Makefile.am index acdbe30e0e0..18cc33185a0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,8 +22,6 @@ DRIVER_SOURCE_FILES = STATEFUL_DRIVER_SOURCE_FILES = -INSTALL_DATA_LOCAL = -UNINSTALL_LOCAL = SYM_FILES = USED_SYM_FILES = augeas_DATA = @@ -33,7 +31,6 @@ tapset_DATA = endif WITH_DTRACE_PROBES RPC_PROBE_FILES = -include security/Makefile.inc.am include locking/Makefile.inc.am include admin/Makefile.inc.am include vbox/Makefile.inc.am @@ -193,7 +190,3 @@ libvirt_functions.stp: $(RPC_PROBE_FILES) $(top_srcdir)/scripts/gensystemtap.py $(RPC_PROBE_FILES) > $@ endif WITH_DTRACE_PROBES - -install-data-local: $(INSTALL_DATA_LOCAL) - -uninstall-local: $(UNINSTALL_LOCAL) diff --git a/src/security/Makefile.inc.am b/src/security/Makefile.inc.am deleted file mode 100644 index 50e2706be9f..00000000000 --- a/src/security/Makefile.inc.am +++ /dev/null @@ -1,52 +0,0 @@ -# vim: filetype=automake - -SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES_IN = \ - security/apparmor/usr.lib.libvirt.virt-aa-helper.in \ - security/apparmor/usr.sbin.libvirtd.in \ - $(NULL) - -SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES = \ - $(SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES_IN:%.in=%) - $(NULL) - -security/apparmor/%: $(srcdir)/security/apparmor/%.in - $(AM_V_GEN)$(MKDIR_P) `dirname $@` && \ - $(SED) \ - -e 's|[@]sysconfdir[@]|@sysconfdir@|' \ - -e 's|[@]sbindir[@]|@sbindir@|' \ - -e 's|[@]runstatedir[@]|@runstatedir@|' \ - -e 's|[@]libexecdir[@]|@libexecdir@|' \ - $< > $@ - -if WITH_APPARMOR_PROFILES -apparmordir = $(sysconfdir)/apparmor.d/ -apparmor_DATA = \ - $(SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES) - $(NULL) - -abstractionsdir = $(apparmordir)/abstractions -abstractions_DATA = \ - security/apparmor/libvirt-qemu \ - security/apparmor/libvirt-lxc \ - $(NULL) - -templatesdir = $(apparmordir)/libvirt -templates_DATA = \ - security/apparmor/TEMPLATE.qemu \ - security/apparmor/TEMPLATE.lxc \ - $(NULL) - -APPARMOR_LOCAL_DIR = "$(DESTDIR)$(apparmordir)/local" -install-apparmor-local: $(SECURITY_DRIVER_APPARMOR_GENERATED_PROFILES) - $(MKDIR_P) "$(APPARMOR_LOCAL_DIR)" - echo "# Site-specific additions and overrides for \ - 'usr.lib.libvirt.virt-aa-helper'" \ - >"$(APPARMOR_LOCAL_DIR)/usr.lib.libvirt.virt-aa-helper" - -uninstall-apparmor-local: - rm -f "$(APPARMOR_LOCAL_DIR)/usr.lib.libvirt.virt-aa-helper" - rmdir "$(APPARMOR_LOCAL_DIR)" || : - -INSTALL_DATA_LOCAL += install-apparmor-local -UNINSTALL_LOCAL += uninstall-apparmor-local -endif WITH_APPARMOR_PROFILES diff --git a/src/security/apparmor/meson.build b/src/security/apparmor/meson.build new file mode 100644 index 00000000000..af437802112 --- /dev/null +++ b/src/security/apparmor/meson.build @@ -0,0 +1,38 @@ +apparmor_gen_profiles = [ + 'usr.lib.libvirt.virt-aa-helper', + 'usr.sbin.libvirtd', +] + +apparmor_gen_profiles_conf = configuration_data() +apparmor_gen_profiles_conf.set('sysconfdir', sysconfdir) +apparmor_gen_profiles_conf.set('sbindir', sbindir) +apparmor_gen_profiles_conf.set('runstatedir', runstatedir) +apparmor_gen_profiles_conf.set('libexecdir', libexecdir) + +apparmor_dir = sysconfdir / 'apparmor.d' + +foreach name : apparmor_gen_profiles + configure_file( + input: '@0@.in'.format(name), + output: name, + configuration: apparmor_gen_profiles_conf, + install: true, + install_dir: apparmor_dir, + ) +endforeach + +install_data( + [ 'libvirt-qemu', 'libvirt-lxc' ], + install_dir: apparmor_dir / 'abstractions', +) + +install_data( + [ 'TEMPLATE.qemu', 'TEMPLATE.lxc' ], + install_dir: apparmor_dir / 'libvirt', +) + +install_data( + 'usr.lib.libvirt.virt-aa-helper.local', + install_dir: apparmor_dir / 'local', + rename: 'usr.lib.libvirt.virt-aa-helper', +) diff --git a/src/security/apparmor/usr.lib.libvirt.virt-aa-helper.local b/src/security/apparmor/usr.lib.libvirt.virt-aa-helper.local new file mode 100644 index 00000000000..c0990e51d0b --- /dev/null +++ b/src/security/apparmor/usr.lib.libvirt.virt-aa-helper.local @@ -0,0 +1 @@ +# Site-specific additions and overrides for 'usr.lib.libvirt.virt-aa-helper' diff --git a/src/security/meson.build b/src/security/meson.build index 4014ddccc45..4f876c03c2d 100644 --- a/src/security/meson.build +++ b/src/security/meson.build @@ -51,3 +51,7 @@ if conf.has('WITH_LIBVIRTD') and conf.has('WITH_APPARMOR') ], } endif + +if conf.has('WITH_APPARMOR_PROFILES') + subdir('apparmor') +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 11 +---------- src/meson.build | 12 ++++++++++++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 18cc33185a0..0e0fc621e53 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -47,15 +47,6 @@ include secret/Makefile.inc.am include storage/Makefile.inc.am -# .libs/libvirt.so is built by libtool as a side-effect of the Makefile -# rule for libvirt.la. However, checking symbols relies on Linux ELF layout -if WITH_LINUX -check-symfile: libvirt.syms libvirt.la - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-symfile.py \ - libvirt.syms .libs/libvirt.so -else ! WITH_LINUX -check-symfile: -endif ! WITH_LINUX check-symsorting: $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-symsorting.py \ $(srcdir) $(SYM_FILES) @@ -147,7 +138,7 @@ check-aclperms: $(srcdir)/access/viraccessperm.h \ $(srcdir)/access/viraccessperm.c -check-local: check-protocol check-symfile check-symsorting \ +check-local: check-protocol check-symsorting \ check-drivername check-driverimpls check-aclrules \ check-aclperms check-admin .PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct) diff --git a/src/meson.build b/src/meson.build index b8e356d8b0e..0c94483965d 100644 --- a/src/meson.build +++ b/src/meson.build @@ -790,3 +790,15 @@ virt_install_dirs += [ ] meson.add_install_script(install_dirs_prog.path(), virt_install_dirs) + + +# Check driver files + +if host_machine.system() == 'linux' + test( + 'check-symfile', + python3_prog, + args: [ check_symfile_prog.path(), libvirt_syms, libvirt_lib ], + env: runutf8, + ) +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 13 +------------ src/meson.build | 11 +++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 0e0fc621e53..11fb9122631 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,8 +22,6 @@ DRIVER_SOURCE_FILES = STATEFUL_DRIVER_SOURCE_FILES = -SYM_FILES = -USED_SYM_FILES = augeas_DATA = augeastest_DATA = if WITH_DTRACE_PROBES @@ -47,10 +45,6 @@ include secret/Makefile.inc.am include storage/Makefile.inc.am -check-symsorting: - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-symsorting.py \ - $(srcdir) $(SYM_FILES) - # Keep this list synced with RPC_PROBE_FILES PROTOCOL_STRUCTS = \ $(srcdir)/remote_protocol-structs \ @@ -138,17 +132,12 @@ check-aclperms: $(srcdir)/access/viraccessperm.h \ $(srcdir)/access/viraccessperm.c -check-local: check-protocol check-symsorting \ +check-local: check-protocol \ check-drivername check-driverimpls check-aclrules \ check-aclperms check-admin .PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct) -# All .syms files should be placed in exactly one of these three lists, -# depending on whether they are stored in git and/or used in the build. -SYM_FILES += $(USED_SYM_FILES) - - check-local: check-augeas check-augeas: $(augeas_DATA) $(augeastest_DATA) diff --git a/src/meson.build b/src/meson.build index 0c94483965d..21d4b9aa412 100644 --- a/src/meson.build +++ b/src/meson.build @@ -802,3 +802,14 @@ if host_machine.system() == 'linux' env: runutf8, ) endif + +test( + 'check-symsorting', + python3_prog, + args: [ + check_symsorting_prog.path(), + meson.current_source_dir(), + files(sym_files, used_sym_files), + ], + env: runutf8, +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 21 +-------------------- src/meson.build | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 11fb9122631..e5d338409dc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -99,25 +99,6 @@ else !WITH_REMOTE check-protocol: endif !WITH_REMOTE -DRIVERS = \ - $(srcdir)/driver-hypervisor.h \ - $(srcdir)/driver-interface.h \ - $(srcdir)/driver-network.h \ - $(srcdir)/driver-nodedev.h \ - $(srcdir)/driver-nwfilter.h \ - $(srcdir)/driver-secret.h \ - $(srcdir)/driver-state.h \ - $(srcdir)/driver-storage.h \ - $(srcdir)/driver-stream.h \ - $(NULL) - -check-drivername: - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-drivername.py \ - $(DRIVERS) \ - $(srcdir)/libvirt_public.syms \ - $(srcdir)/libvirt_qemu.syms \ - $(srcdir)/libvirt_lxc.syms - check-driverimpls: $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-driverimpls.py \ $(DRIVER_SOURCE_FILES) @@ -133,7 +114,7 @@ check-aclperms: $(srcdir)/access/viraccessperm.c check-local: check-protocol \ - check-drivername check-driverimpls check-aclrules \ + check-driverimpls check-aclrules \ check-aclperms check-admin .PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct) diff --git a/src/meson.build b/src/meson.build index 21d4b9aa412..5fb90f61687 100644 --- a/src/meson.build +++ b/src/meson.build @@ -269,6 +269,18 @@ driver_sources = [ 'libvirt-stream.c', ] +driver_headers = [ + 'driver-hypervisor.h', + 'driver-interface.h', + 'driver-network.h', + 'driver-nodedev.h', + 'driver-nwfilter.h', + 'driver-secret.h', + 'driver-state.h', + 'driver-storage.h', + 'driver-stream.h', +] + driver_lib = static_library( 'virt_driver', [ @@ -813,3 +825,13 @@ test( ], env: runutf8, ) + +test( + 'check-drivername', + python3_prog, + args: [ + check_drivername_prog.path(), files(driver_headers), + files('libvirt_public.syms'), libvirt_qemu_syms, libvirt_lxc_syms, + ], + env: runutf8, +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 8 +------- src/bhyve/Makefile.inc.am | 1 - src/bhyve/meson.build | 2 ++ src/interface/Makefile.inc.am | 1 - src/interface/meson.build | 2 ++ src/libxl/Makefile.inc.am | 1 - src/libxl/meson.build | 2 ++ src/lxc/Makefile.inc.am | 4 ---- src/lxc/meson.build | 6 ++++++ src/meson.build | 11 +++++++++++ src/network/Makefile.inc.am | 1 - src/network/meson.build | 2 ++ src/node_device/Makefile.inc.am | 6 ------ src/node_device/meson.build | 2 ++ src/nwfilter/Makefile.inc.am | 1 - src/nwfilter/meson.build | 2 ++ src/qemu/Makefile.inc.am | 1 - src/qemu/meson.build | 2 ++ src/secret/Makefile.inc.am | 1 - src/secret/meson.build | 2 ++ src/storage/Makefile.inc.am | 1 - src/storage/meson.build | 2 ++ src/vbox/Makefile.inc.am | 6 ------ src/vbox/meson.build | 5 +++++ src/vz/Makefile.inc.am | 1 - src/vz/meson.build | 2 ++ 26 files changed, 43 insertions(+), 32 deletions(-) delete mode 100644 src/vbox/Makefile.inc.am diff --git a/src/Makefile.am b/src/Makefile.am index e5d338409dc..54e3ed42974 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,7 +20,6 @@ # here. List them against the individual XXX_la_CFLAGS targets # that actually use them. -DRIVER_SOURCE_FILES = STATEFUL_DRIVER_SOURCE_FILES = augeas_DATA = augeastest_DATA = @@ -31,7 +30,6 @@ RPC_PROBE_FILES = include locking/Makefile.inc.am include admin/Makefile.inc.am -include vbox/Makefile.inc.am include qemu/Makefile.inc.am include bhyve/Makefile.inc.am include libxl/Makefile.inc.am @@ -99,10 +97,6 @@ else !WITH_REMOTE check-protocol: endif !WITH_REMOTE -check-driverimpls: - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-driverimpls.py \ - $(DRIVER_SOURCE_FILES) - check-aclrules: $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-aclrules.py \ $(REMOTE_PROTOCOL) \ @@ -114,7 +108,7 @@ check-aclperms: $(srcdir)/access/viraccessperm.c check-local: check-protocol \ - check-driverimpls check-aclrules \ + check-aclrules \ check-aclperms check-admin .PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct) diff --git a/src/bhyve/Makefile.inc.am b/src/bhyve/Makefile.inc.am index 65021d785a2..7a9c6a87242 100644 --- a/src/bhyve/Makefile.inc.am +++ b/src/bhyve/Makefile.inc.am @@ -1,4 +1,3 @@ # vim: filetype=automake -DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(BHYVE_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(BHYVE_DRIVER_SOURCES)) diff --git a/src/bhyve/meson.build b/src/bhyve/meson.build index fd1f6bbad88..12b933b0b44 100644 --- a/src/bhyve/meson.build +++ b/src/bhyve/meson.build @@ -10,6 +10,8 @@ bhyve_sources = files( 'bhyve_process.c', ) +driver_source_files += bhyve_sources + if conf.has('WITH_BHYVE') bhyve_driver_impl = static_library( 'virt_driver_bhyve_impl', diff --git a/src/interface/Makefile.inc.am b/src/interface/Makefile.inc.am index 06bd8f820b1..6cd6dff3b90 100644 --- a/src/interface/Makefile.inc.am +++ b/src/interface/Makefile.inc.am @@ -1,5 +1,4 @@ # vim: filetype=automake -DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(INTERFACE_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(INTERFACE_DRIVER_SOURCES)) diff --git a/src/interface/meson.build b/src/interface/meson.build index 8b5347bce43..bd04a7f350f 100644 --- a/src/interface/meson.build +++ b/src/interface/meson.build @@ -10,6 +10,8 @@ if conf.has('WITH_UDEV') interface_driver_sources += 'interface_backend_udev.c' endif +driver_source_files += files(interface_driver_sources) + if conf.has('WITH_INTERFACE') virt_modules += { 'name': 'virt_driver_interface', diff --git a/src/libxl/Makefile.inc.am b/src/libxl/Makefile.inc.am index 5af19c83512..d713f4e75aa 100644 --- a/src/libxl/Makefile.inc.am +++ b/src/libxl/Makefile.inc.am @@ -1,4 +1,3 @@ # vim: filetype=automake -DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(LIBXL_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(LIBXL_DRIVER_SOURCES)) diff --git a/src/libxl/meson.build b/src/libxl/meson.build index a5df0011b0b..6720d826435 100644 --- a/src/libxl/meson.build +++ b/src/libxl/meson.build @@ -10,6 +10,8 @@ libxl_driver_sources = [ 'xen_xm.c', ] +driver_source_files += files(libxl_driver_sources) + if conf.has('WITH_LIBXL') libxl_driver_imp = static_library( 'virt_driver_libxl_impl', diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am index 7f312975d6c..6abd08e333e 100644 --- a/src/lxc/Makefile.inc.am +++ b/src/lxc/Makefile.inc.am @@ -1,9 +1,5 @@ # vim: filetype=automake -DRIVER_SOURCE_FILES += \ - $(LXC_MONITOR_PROTOCOL_GENERATED) \ - $(LXC_MONITOR_GENERATED) \ - $(addprefix $(srcdir)/,$(LXC_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(LXC_MONITOR_PROTOCOL_GENERATED) \ $(LXC_MONITOR_GENERATED) \ diff --git a/src/lxc/meson.build b/src/lxc/meson.build index ccb11ee1d42..65dff6a7c4b 100644 --- a/src/lxc/meson.build +++ b/src/lxc/meson.build @@ -40,6 +40,12 @@ lxc_monitor_generated = custom_target( capture: true, ) +driver_source_files += [ + files(lxc_driver_sources), + lxc_monitor_protocol_generated, + lxc_monitor_generated, +] + lxc_controller_sources = files( 'lxc_conf.c', 'lxc_container.c', diff --git a/src/meson.build b/src/meson.build index 5fb90f61687..e30bf7e90b6 100644 --- a/src/meson.build +++ b/src/meson.build @@ -207,6 +207,10 @@ sysconf_files = [] # list of directories to create during installation virt_install_dirs = [] +# driver_source_files: +# driver source files to check +driver_source_files = [] + # list subdirectories @@ -835,3 +839,10 @@ test( ], env: runutf8, ) + +test( + 'check-driverimpls', + python3_prog, + args: [ check_driverimpls_prog.path(), driver_source_files ], + env: runutf8, +) diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am index c13a6831cc0..cf5cff4ea88 100644 --- a/src/network/Makefile.inc.am +++ b/src/network/Makefile.inc.am @@ -1,5 +1,4 @@ # vim: filetype=automake -DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(NETWORK_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(NETWORK_DRIVER_SOURCES)) diff --git a/src/network/meson.build b/src/network/meson.build index 948dad39432..c33404dfd96 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -3,6 +3,8 @@ network_driver_sources = [ 'bridge_driver_platform.c', ] +driver_source_files += files(network_driver_sources) + network_leases_helper_sources = files( 'leaseshelper.c', ) diff --git a/src/node_device/Makefile.inc.am b/src/node_device/Makefile.inc.am index 63d2548e11f..ddd906fa782 100644 --- a/src/node_device/Makefile.inc.am +++ b/src/node_device/Makefile.inc.am @@ -1,11 +1,5 @@ # vim: filetype=automake -DRIVER_SOURCE_FILES += \ - $(addprefix $(srcdir)/,$(NODE_DEVICE_DRIVER_SOURCES)) \ - $(addprefix $(srcdir)/,$(NODE_DEVICE_DRIVER_HAL_SOURCES)) \ - $(addprefix $(srcdir)/,$(NODE_DEVICE_DRIVER_UDEV_SOURCES)) \ - $(NULL) - STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(NODE_DEVICE_DRIVER_SOURCES)) \ $(NULL) diff --git a/src/node_device/meson.build b/src/node_device/meson.build index 437924466eb..0ac2aecf4f1 100644 --- a/src/node_device/meson.build +++ b/src/node_device/meson.build @@ -10,6 +10,8 @@ if conf.has('WITH_UDEV') node_device_driver_sources += 'node_device_udev.c' endif +driver_source_files += files(node_device_driver_sources) + if conf.has('WITH_NODE_DEVICES') node_device_driver_impl = static_library( 'virt_driver_nodedev_impl', diff --git a/src/nwfilter/Makefile.inc.am b/src/nwfilter/Makefile.inc.am index 4d34d7f3ad1..68bc42c2edf 100644 --- a/src/nwfilter/Makefile.inc.am +++ b/src/nwfilter/Makefile.inc.am @@ -1,5 +1,4 @@ # vim: filetype=automake -DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(NWFILTER_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(NWFILTER_DRIVER_SOURCES)) diff --git a/src/nwfilter/meson.build b/src/nwfilter/meson.build index a05f0ce8fcf..c2c186903d8 100644 --- a/src/nwfilter/meson.build +++ b/src/nwfilter/meson.build @@ -6,6 +6,8 @@ nwfilter_driver_sources = [ 'nwfilter_learnipaddr.c', ] +driver_source_files += files(nwfilter_driver_sources) + if conf.has('WITH_NWFILTER') nwfilter_driver_impl = static_library( 'virt_driver_nwfilter_impl', diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am index f665cb1f130..96265d2893b 100644 --- a/src/qemu/Makefile.inc.am +++ b/src/qemu/Makefile.inc.am @@ -1,4 +1,3 @@ # vim: filetype=automake -DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES)) diff --git a/src/qemu/meson.build b/src/qemu/meson.build index 7bdaf6c19bd..c74acf9d14b 100644 --- a/src/qemu/meson.build +++ b/src/qemu/meson.build @@ -37,6 +37,8 @@ qemu_driver_sources = [ 'qemu_virtiofs.c', ] +driver_source_files += files(qemu_driver_sources) + qemu_dtrace_gen_headers = [] qemu_dtrace_gen_objects = [] diff --git a/src/secret/Makefile.inc.am b/src/secret/Makefile.inc.am index a60a6b507f4..361305283a5 100644 --- a/src/secret/Makefile.inc.am +++ b/src/secret/Makefile.inc.am @@ -1,5 +1,4 @@ # vim: filetype=automake -DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(SECRET_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(SECRET_DRIVER_SOURCES)) diff --git a/src/secret/meson.build b/src/secret/meson.build index 2245790f796..bbcd74ce309 100644 --- a/src/secret/meson.build +++ b/src/secret/meson.build @@ -2,6 +2,8 @@ secret_driver_sources = [ 'secret_driver.c', ] +driver_source_files += files(secret_driver_sources) + if conf.has('WITH_SECRETS') virt_modules += { 'name': 'virt_driver_secret', diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am index d5438e8a71c..0834ac43a64 100644 --- a/src/storage/Makefile.inc.am +++ b/src/storage/Makefile.inc.am @@ -1,5 +1,4 @@ # vim: filetype=automake -DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(STORAGE_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += \ $(addprefix $(srcdir)/,$(STORAGE_DRIVER_SOURCES)) diff --git a/src/storage/meson.build b/src/storage/meson.build index 59024746322..b14dcf969d9 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -8,6 +8,8 @@ storage_driver_sources = [ storage_driver_backend_sources, ] +driver_source_files += files(storage_driver_sources) + storage_backend_fs_sources = [ 'storage_backend_fs.c', ] diff --git a/src/vbox/Makefile.inc.am b/src/vbox/Makefile.inc.am deleted file mode 100644 index 6197c3172b5..00000000000 --- a/src/vbox/Makefile.inc.am +++ /dev/null @@ -1,6 +0,0 @@ -# vim: filetype=automake - -DRIVER_SOURCE_FILES += \ - $(addprefix $(srcdir)/,$(VBOX_DRIVER_SOURCES)) \ - $(srcdir)/vbox/vbox_tmpl.c \ - $(NULL) diff --git a/src/vbox/meson.build b/src/vbox/meson.build index b6dcee279b9..8451e3018be 100644 --- a/src/vbox/meson.build +++ b/src/vbox/meson.build @@ -10,6 +10,11 @@ vbox_driver_sources = [ 'vbox_XPCOMCGlue.c', ] +driver_source_files += files( + vbox_driver_sources, + 'vbox_tmpl.c', +) + if conf.has('WITH_VBOX') vbox_driver_impl = static_library( 'virt_driver_vbox_impl', diff --git a/src/vz/Makefile.inc.am b/src/vz/Makefile.inc.am index 380d1ffb839..eb6721fb135 100644 --- a/src/vz/Makefile.inc.am +++ b/src/vz/Makefile.inc.am @@ -1,4 +1,3 @@ # vim: filetype=automake -DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(VZ_DRIVER_SOURCES)) STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(VZ_DRIVER_SOURCES)) diff --git a/src/vz/meson.build b/src/vz/meson.build index 9e8ac3f8cfc..903e1f1359f 100644 --- a/src/vz/meson.build +++ b/src/vz/meson.build @@ -4,6 +4,8 @@ vz_driver_sources = [ 'vz_sdk.c', ] +driver_source_files += files(vz_driver_sources) + if conf.has('WITH_VZ') vz_driver_impl = static_library( 'virt_driver_vz_impl', -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 17 ----------------- src/bhyve/Makefile.inc.am | 3 --- src/bhyve/meson.build | 1 + src/interface/Makefile.inc.am | 4 ---- src/interface/meson.build | 1 + src/libxl/Makefile.inc.am | 3 --- src/libxl/meson.build | 1 + src/lxc/Makefile.inc.am | 5 ----- src/lxc/meson.build | 6 ++++++ src/meson.build | 11 +++++++++++ src/network/Makefile.inc.am | 4 ---- src/network/meson.build | 1 + src/node_device/Makefile.inc.am | 5 ----- src/node_device/meson.build | 2 ++ src/nwfilter/Makefile.inc.am | 4 ---- src/nwfilter/meson.build | 1 + src/qemu/Makefile.inc.am | 3 --- src/qemu/meson.build | 1 + src/secret/Makefile.inc.am | 4 ---- src/secret/meson.build | 1 + src/storage/Makefile.inc.am | 4 ---- src/storage/meson.build | 1 + src/vz/Makefile.inc.am | 3 --- src/vz/meson.build | 1 + 24 files changed, 28 insertions(+), 59 deletions(-) delete mode 100644 src/bhyve/Makefile.inc.am delete mode 100644 src/interface/Makefile.inc.am delete mode 100644 src/libxl/Makefile.inc.am delete mode 100644 src/network/Makefile.inc.am delete mode 100644 src/node_device/Makefile.inc.am delete mode 100644 src/nwfilter/Makefile.inc.am delete mode 100644 src/qemu/Makefile.inc.am delete mode 100644 src/secret/Makefile.inc.am delete mode 100644 src/storage/Makefile.inc.am delete mode 100644 src/vz/Makefile.inc.am diff --git a/src/Makefile.am b/src/Makefile.am index 54e3ed42974..3b5195f2266 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,7 +20,6 @@ # here. List them against the individual XXX_la_CFLAGS targets # that actually use them. -STATEFUL_DRIVER_SOURCE_FILES = augeas_DATA = augeastest_DATA = if WITH_DTRACE_PROBES @@ -30,17 +29,7 @@ RPC_PROBE_FILES = include locking/Makefile.inc.am include admin/Makefile.inc.am -include qemu/Makefile.inc.am -include bhyve/Makefile.inc.am -include libxl/Makefile.inc.am -include vz/Makefile.inc.am include lxc/Makefile.inc.am -include interface/Makefile.inc.am -include network/Makefile.inc.am -include nwfilter/Makefile.inc.am -include node_device/Makefile.inc.am -include secret/Makefile.inc.am -include storage/Makefile.inc.am # Keep this list synced with RPC_PROBE_FILES @@ -97,18 +86,12 @@ else !WITH_REMOTE check-protocol: endif !WITH_REMOTE -check-aclrules: - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-aclrules.py \ - $(REMOTE_PROTOCOL) \ - $(STATEFUL_DRIVER_SOURCE_FILES) - check-aclperms: $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-aclperms.py \ $(srcdir)/access/viraccessperm.h \ $(srcdir)/access/viraccessperm.c check-local: check-protocol \ - check-aclrules \ check-aclperms check-admin .PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct) diff --git a/src/bhyve/Makefile.inc.am b/src/bhyve/Makefile.inc.am deleted file mode 100644 index 7a9c6a87242..00000000000 --- a/src/bhyve/Makefile.inc.am +++ /dev/null @@ -1,3 +0,0 @@ -# vim: filetype=automake - -STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(BHYVE_DRIVER_SOURCES)) diff --git a/src/bhyve/meson.build b/src/bhyve/meson.build index 12b933b0b44..6dc8b7d29ff 100644 --- a/src/bhyve/meson.build +++ b/src/bhyve/meson.build @@ -11,6 +11,7 @@ bhyve_sources = files( ) driver_source_files += bhyve_sources +stateful_driver_source_files += bhyve_sources if conf.has('WITH_BHYVE') bhyve_driver_impl = static_library( diff --git a/src/interface/Makefile.inc.am b/src/interface/Makefile.inc.am deleted file mode 100644 index 6cd6dff3b90..00000000000 --- a/src/interface/Makefile.inc.am +++ /dev/null @@ -1,4 +0,0 @@ -# vim: filetype=automake - -STATEFUL_DRIVER_SOURCE_FILES += \ - $(addprefix $(srcdir)/,$(INTERFACE_DRIVER_SOURCES)) diff --git a/src/interface/meson.build b/src/interface/meson.build index bd04a7f350f..bf9d649282e 100644 --- a/src/interface/meson.build +++ b/src/interface/meson.build @@ -11,6 +11,7 @@ if conf.has('WITH_UDEV') endif driver_source_files += files(interface_driver_sources) +stateful_driver_source_files += files(interface_driver_sources) if conf.has('WITH_INTERFACE') virt_modules += { diff --git a/src/libxl/Makefile.inc.am b/src/libxl/Makefile.inc.am deleted file mode 100644 index d713f4e75aa..00000000000 --- a/src/libxl/Makefile.inc.am +++ /dev/null @@ -1,3 +0,0 @@ -# vim: filetype=automake - -STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(LIBXL_DRIVER_SOURCES)) diff --git a/src/libxl/meson.build b/src/libxl/meson.build index 6720d826435..b2e9ca07d4a 100644 --- a/src/libxl/meson.build +++ b/src/libxl/meson.build @@ -11,6 +11,7 @@ libxl_driver_sources = [ ] driver_source_files += files(libxl_driver_sources) +stateful_driver_source_files += files(libxl_driver_sources) if conf.has('WITH_LIBXL') libxl_driver_imp = static_library( diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am index 6abd08e333e..564b3519bcb 100644 --- a/src/lxc/Makefile.inc.am +++ b/src/lxc/Makefile.inc.am @@ -1,10 +1,5 @@ # vim: filetype=automake -STATEFUL_DRIVER_SOURCE_FILES += \ - $(LXC_MONITOR_PROTOCOL_GENERATED) \ - $(LXC_MONITOR_GENERATED) \ - $(addprefix $(srcdir)/,$(LXC_DRIVER_SOURCES)) - if WITH_LXC if WITH_DTRACE_PROBES diff --git a/src/lxc/meson.build b/src/lxc/meson.build index 65dff6a7c4b..8b51093a387 100644 --- a/src/lxc/meson.build +++ b/src/lxc/meson.build @@ -46,6 +46,12 @@ driver_source_files += [ lxc_monitor_generated, ] +stateful_driver_source_files += [ + files(lxc_driver_sources), + lxc_monitor_protocol_generated, + lxc_monitor_generated, +] + lxc_controller_sources = files( 'lxc_conf.c', 'lxc_container.c', diff --git a/src/meson.build b/src/meson.build index e30bf7e90b6..6747f11a3f3 100644 --- a/src/meson.build +++ b/src/meson.build @@ -211,6 +211,10 @@ virt_install_dirs = [] # driver source files to check driver_source_files = [] +# stateful_driver_source_files: +# stateful driver source files to check +stateful_driver_source_files = [] + # list subdirectories @@ -846,3 +850,10 @@ test( args: [ check_driverimpls_prog.path(), driver_source_files ], env: runutf8, ) + +test( + 'check-aclrules', + python3_prog, + args: [ check_aclrules_prog.path(), files('remote/remote_protocol.x'), stateful_driver_source_files ], + env: runutf8, +) diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am deleted file mode 100644 index cf5cff4ea88..00000000000 --- a/src/network/Makefile.inc.am +++ /dev/null @@ -1,4 +0,0 @@ -# vim: filetype=automake - -STATEFUL_DRIVER_SOURCE_FILES += \ - $(addprefix $(srcdir)/,$(NETWORK_DRIVER_SOURCES)) diff --git a/src/network/meson.build b/src/network/meson.build index c33404dfd96..a3836bb12be 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -4,6 +4,7 @@ network_driver_sources = [ ] driver_source_files += files(network_driver_sources) +stateful_driver_source_files += files(network_driver_sources) network_leases_helper_sources = files( 'leaseshelper.c', diff --git a/src/node_device/Makefile.inc.am b/src/node_device/Makefile.inc.am deleted file mode 100644 index ddd906fa782..00000000000 --- a/src/node_device/Makefile.inc.am +++ /dev/null @@ -1,5 +0,0 @@ -# vim: filetype=automake - -STATEFUL_DRIVER_SOURCE_FILES += \ - $(addprefix $(srcdir)/,$(NODE_DEVICE_DRIVER_SOURCES)) \ - $(NULL) diff --git a/src/node_device/meson.build b/src/node_device/meson.build index 0ac2aecf4f1..d833b329da4 100644 --- a/src/node_device/meson.build +++ b/src/node_device/meson.build @@ -2,6 +2,8 @@ node_device_driver_sources = [ 'node_device_driver.c', ] +stateful_driver_source_files += files(node_device_driver_sources) + if conf.has('WITH_HAL') node_device_driver_sources += 'node_device_hal.c' endif diff --git a/src/nwfilter/Makefile.inc.am b/src/nwfilter/Makefile.inc.am deleted file mode 100644 index 68bc42c2edf..00000000000 --- a/src/nwfilter/Makefile.inc.am +++ /dev/null @@ -1,4 +0,0 @@ -# vim: filetype=automake - -STATEFUL_DRIVER_SOURCE_FILES += \ - $(addprefix $(srcdir)/,$(NWFILTER_DRIVER_SOURCES)) diff --git a/src/nwfilter/meson.build b/src/nwfilter/meson.build index c2c186903d8..6e9734e6a26 100644 --- a/src/nwfilter/meson.build +++ b/src/nwfilter/meson.build @@ -7,6 +7,7 @@ nwfilter_driver_sources = [ ] driver_source_files += files(nwfilter_driver_sources) +stateful_driver_source_files += files(nwfilter_driver_sources) if conf.has('WITH_NWFILTER') nwfilter_driver_impl = static_library( diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am deleted file mode 100644 index 96265d2893b..00000000000 --- a/src/qemu/Makefile.inc.am +++ /dev/null @@ -1,3 +0,0 @@ -# vim: filetype=automake - -STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(QEMU_DRIVER_SOURCES)) diff --git a/src/qemu/meson.build b/src/qemu/meson.build index c74acf9d14b..640ef273ca8 100644 --- a/src/qemu/meson.build +++ b/src/qemu/meson.build @@ -38,6 +38,7 @@ qemu_driver_sources = [ ] driver_source_files += files(qemu_driver_sources) +stateful_driver_source_files += files(qemu_driver_sources) qemu_dtrace_gen_headers = [] qemu_dtrace_gen_objects = [] diff --git a/src/secret/Makefile.inc.am b/src/secret/Makefile.inc.am deleted file mode 100644 index 361305283a5..00000000000 --- a/src/secret/Makefile.inc.am +++ /dev/null @@ -1,4 +0,0 @@ -# vim: filetype=automake - -STATEFUL_DRIVER_SOURCE_FILES += \ - $(addprefix $(srcdir)/,$(SECRET_DRIVER_SOURCES)) diff --git a/src/secret/meson.build b/src/secret/meson.build index bbcd74ce309..1605729f49b 100644 --- a/src/secret/meson.build +++ b/src/secret/meson.build @@ -3,6 +3,7 @@ secret_driver_sources = [ ] driver_source_files += files(secret_driver_sources) +stateful_driver_source_files += files(secret_driver_sources) if conf.has('WITH_SECRETS') virt_modules += { diff --git a/src/storage/Makefile.inc.am b/src/storage/Makefile.inc.am deleted file mode 100644 index 0834ac43a64..00000000000 --- a/src/storage/Makefile.inc.am +++ /dev/null @@ -1,4 +0,0 @@ -# vim: filetype=automake - -STATEFUL_DRIVER_SOURCE_FILES += \ - $(addprefix $(srcdir)/,$(STORAGE_DRIVER_SOURCES)) diff --git a/src/storage/meson.build b/src/storage/meson.build index b14dcf969d9..86abfedbdde 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -9,6 +9,7 @@ storage_driver_sources = [ ] driver_source_files += files(storage_driver_sources) +stateful_driver_source_files += files(storage_driver_sources) storage_backend_fs_sources = [ 'storage_backend_fs.c', diff --git a/src/vz/Makefile.inc.am b/src/vz/Makefile.inc.am deleted file mode 100644 index eb6721fb135..00000000000 --- a/src/vz/Makefile.inc.am +++ /dev/null @@ -1,3 +0,0 @@ -# vim: filetype=automake - -STATEFUL_DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(VZ_DRIVER_SOURCES)) diff --git a/src/vz/meson.build b/src/vz/meson.build index 903e1f1359f..0ab83731071 100644 --- a/src/vz/meson.build +++ b/src/vz/meson.build @@ -5,6 +5,7 @@ vz_driver_sources = [ ] driver_source_files += files(vz_driver_sources) +stateful_driver_source_files += files(vz_driver_sources) if conf.has('WITH_VZ') vz_driver_impl = static_library( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 7 +------ src/access/meson.build | 7 +++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 3b5195f2266..d697114d7e8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -86,13 +86,8 @@ else !WITH_REMOTE check-protocol: endif !WITH_REMOTE -check-aclperms: - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-aclperms.py \ - $(srcdir)/access/viraccessperm.h \ - $(srcdir)/access/viraccessperm.c - check-local: check-protocol \ - check-aclperms check-admin + check-admin .PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct) diff --git a/src/access/meson.build b/src/access/meson.build index 2d8a2a90716..beb61eddaf5 100644 --- a/src/access/meson.build +++ b/src/access/meson.build @@ -112,3 +112,10 @@ access_dep = declare_dependency( ) generated_sym_files += access_gen_sym + +test( + 'check-aclperms', + python3_prog, + args: [ check_aclperms_prog.path(), access_perm_h, files('viraccessperm.c') ], + env: runutf8, +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- scripts/check-augeas.sh | 12 ++++++++++++ scripts/meson.build | 1 + src/Makefile.am | 17 ----------------- src/meson.build | 18 +++++++++++++++++- 4 files changed, 30 insertions(+), 18 deletions(-) create mode 100644 scripts/check-augeas.sh diff --git a/scripts/check-augeas.sh b/scripts/check-augeas.sh new file mode 100644 index 00000000000..68609d555a7 --- /dev/null +++ b/scripts/check-augeas.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +AUGPARSE=$1 +srcdir=$2 +builddir=$3 +augeastest=$4 + +set -vx + +for f in $augeastest; do + ${AUGPARSE} -I "$srcdir" -I "$builddir" $f +done diff --git a/scripts/meson.build b/scripts/meson.build index 3038dfc8d21..05bf6ff7231 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -3,6 +3,7 @@ scripts = [ 'augeas-gentest.py', 'check-aclperms.py', 'check-aclrules.py', + 'check-augeas.sh', 'check-driverimpls.py', 'check-drivername.py', 'check-file-access.py', diff --git a/src/Makefile.am b/src/Makefile.am index d697114d7e8..88e44fab2b9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,8 +20,6 @@ # here. List them against the individual XXX_la_CFLAGS targets # that actually use them. -augeas_DATA = -augeastest_DATA = if WITH_DTRACE_PROBES tapset_DATA = endif WITH_DTRACE_PROBES @@ -91,21 +89,6 @@ check-local: check-protocol \ .PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct) -check-local: check-augeas - -check-augeas: $(augeas_DATA) $(augeastest_DATA) - $(AM_V_GEN) \ - if test -x "$(AUGPARSE)"; then \ - for f in $(augeastest_DATA); do \ - DIR=$$(dirname "$$f"); \ - FILE=$$(basename "$$f"); \ - "$(AUGPARSE)" \ - -I "$(srcdir)/$$DIR" -I "$(builddir)/$$DIR" \ - "$$DIR/$$FILE" || exit 1; \ - done; \ - fi -.PHONY: check-augeas - if WITH_DTRACE_PROBES tapset_DATA += libvirt_functions.stp diff --git a/src/meson.build b/src/meson.build index 6747f11a3f3..9b4c26e32ea 100644 --- a/src/meson.build +++ b/src/meson.build @@ -646,6 +646,8 @@ foreach data : virt_test_aug_files ) endforeach +augeas_test_data = [] + foreach data : virt_daemon_confs daemon_conf = configuration_data() daemon_conf.set('runstatedir', runstatedir) @@ -694,7 +696,7 @@ foreach data : virt_daemon_confs ) test_aug_out = 'test_@0@.aug'.format(data['name']) - custom_target( + augeas_test_file = custom_target( test_aug_out, input: [ conf_out, test_aug_tmp ], output: test_aug_out, @@ -703,6 +705,7 @@ foreach data : virt_daemon_confs install: true, install_dir: virt_test_aug_dir, ) + augeas_test_data += augeas_test_file endforeach @@ -857,3 +860,16 @@ test( args: [ check_aclrules_prog.path(), files('remote/remote_protocol.x'), stateful_driver_source_files ], env: runutf8, ) + +if augparse_prog.found() + test( + 'check-augeas', + check_augeas_prog, + args: [ + augparse_prog.path(), + meson.current_source_dir(), + meson.current_build_dir(), + augeas_test_data, + ], + ) +endif -- 2.26.2

On Thu, Jul 16, 2020 at 11:58:02 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- scripts/check-augeas.sh | 12 ++++++++++++ scripts/meson.build | 1 + src/Makefile.am | 17 ----------------- src/meson.build | 18 +++++++++++++++++- 4 files changed, 30 insertions(+), 18 deletions(-) create mode 100644 scripts/check-augeas.sh
[...]
@@ -857,3 +860,16 @@ test( args: [ check_aclrules_prog.path(), files('remote/remote_protocol.x'), stateful_driver_source_files ], env: runutf8, ) + +if augparse_prog.found()
Can't we use foreach on augeas_test_data and invoke the test individually for each file rather than adding a script which does the same?
+ test( + 'check-augeas', + check_augeas_prog, + args: [ + augparse_prog.path(), + meson.current_source_dir(), + meson.current_build_dir(), + augeas_test_data, + ], + ) +endif -- 2.26.2

On Tue, Jul 28, 2020 at 09:51:40AM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:58:02 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- scripts/check-augeas.sh | 12 ++++++++++++ scripts/meson.build | 1 + src/Makefile.am | 17 ----------------- src/meson.build | 18 +++++++++++++++++- 4 files changed, 30 insertions(+), 18 deletions(-) create mode 100644 scripts/check-augeas.sh
[...]
@@ -857,3 +860,16 @@ test( args: [ check_aclrules_prog.path(), files('remote/remote_protocol.x'), stateful_driver_source_files ], env: runutf8, ) + +if augparse_prog.found()
Can't we use foreach on augeas_test_data and invoke the test individually for each file rather than adding a script which does the same?
Sure we can, I wanted to stay as close as to autotools where check-augeas is a single target. Using foreach would result into having separate target for each file. In general it is most likely better but I was trying to avoid any changes like this with the rewrite and do them as a followup patches to cleanup the build system. Pavel
+ test( + 'check-augeas', + check_augeas_prog, + args: [ + augparse_prog.path(), + meson.current_source_dir(), + meson.current_build_dir(), + augeas_test_data, + ], + ) +endif -- 2.26.2

On Tue, Jul 28, 2020 at 10:09:11 +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 09:51:40AM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:58:02 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- scripts/check-augeas.sh | 12 ++++++++++++ scripts/meson.build | 1 + src/Makefile.am | 17 ----------------- src/meson.build | 18 +++++++++++++++++- 4 files changed, 30 insertions(+), 18 deletions(-) create mode 100644 scripts/check-augeas.sh
[...]
@@ -857,3 +860,16 @@ test( args: [ check_aclrules_prog.path(), files('remote/remote_protocol.x'), stateful_driver_source_files ], env: runutf8, ) + +if augparse_prog.found()
Can't we use foreach on augeas_test_data and invoke the test individually for each file rather than adding a script which does the same?
Sure we can, I wanted to stay as close as to autotools where check-augeas is a single target. Using foreach would result into having separate target for each file. In general it is most likely better but I was trying to avoid any changes like this with the rewrite and do them as a followup patches to cleanup the build system.
In autotools the loop is in the automake file (yes, still shell), while here you put it into a separate script file. I'd argue that putting the loop into the meson file (regardless of how many test targets it creates) is more equivalent to the original source than this way. Given that you are now changing all the shell helpers to python I'd rather see this done in pure meson, than having a python file looper intermediate helper.

On Tue, Jul 28, 2020 at 10:22:27AM +0200, Peter Krempa wrote:
On Tue, Jul 28, 2020 at 10:09:11 +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 09:51:40AM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:58:02 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- scripts/check-augeas.sh | 12 ++++++++++++ scripts/meson.build | 1 + src/Makefile.am | 17 ----------------- src/meson.build | 18 +++++++++++++++++- 4 files changed, 30 insertions(+), 18 deletions(-) create mode 100644 scripts/check-augeas.sh
[...]
@@ -857,3 +860,16 @@ test( args: [ check_aclrules_prog.path(), files('remote/remote_protocol.x'), stateful_driver_source_files ], env: runutf8, ) + +if augparse_prog.found()
Can't we use foreach on augeas_test_data and invoke the test individually for each file rather than adding a script which does the same?
Sure we can, I wanted to stay as close as to autotools where check-augeas is a single target. Using foreach would result into having separate target for each file. In general it is most likely better but I was trying to avoid any changes like this with the rewrite and do them as a followup patches to cleanup the build system.
In autotools the loop is in the automake file (yes, still shell), while here you put it into a separate script file. I'd argue that putting the loop into the meson file (regardless of how many test targets it creates) is more equivalent to the original source than this way.
Given that you are now changing all the shell helpers to python I'd rather see this done in pure meson, than having a python file looper intermediate helper.
The change to python is already done. But I don't care so I can redo it. Pavel

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/Makefile.am | 24 ------------------------ src/admin/meson.build | 2 ++ src/locking/Makefile.inc.am | 3 --- src/locking/meson.build | 2 ++ src/lxc/Makefile.inc.am | 9 --------- src/lxc/meson.build | 2 ++ src/meson.build | 14 ++++++++++++++ src/remote/meson.build | 2 ++ src/rpc/meson.build | 2 ++ 9 files changed, 24 insertions(+), 36 deletions(-) delete mode 100644 src/locking/Makefile.inc.am delete mode 100644 src/lxc/Makefile.inc.am diff --git a/src/Makefile.am b/src/Makefile.am index 88e44fab2b9..7289f247362 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,14 +20,9 @@ # here. List them against the individual XXX_la_CFLAGS targets # that actually use them. -if WITH_DTRACE_PROBES -tapset_DATA = -endif WITH_DTRACE_PROBES RPC_PROBE_FILES = -include locking/Makefile.inc.am include admin/Makefile.inc.am -include lxc/Makefile.inc.am # Keep this list synced with RPC_PROBE_FILES @@ -87,22 +82,3 @@ endif !WITH_REMOTE check-local: check-protocol \ check-admin .PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct) - - -if WITH_DTRACE_PROBES - -tapset_DATA += libvirt_functions.stp - -# Keep this list synced with PROTOCOL_STRUCTS -RPC_PROBE_FILES += $(srcdir)/rpc/virnetprotocol.x \ - $(srcdir)/rpc/virkeepaliveprotocol.x \ - $(srcdir)/remote/remote_protocol.x \ - $(srcdir)/remote/lxc_protocol.x \ - $(srcdir)/remote/qemu_protocol.x \ - $(srcdir)/admin/admin_protocol.x - -libvirt_functions.stp: $(RPC_PROBE_FILES) $(top_srcdir)/scripts/gensystemtap.py - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/gensystemtap.py \ - $(RPC_PROBE_FILES) > $@ - -endif WITH_DTRACE_PROBES diff --git a/src/admin/meson.build b/src/admin/meson.build index c9dff4d92a0..330fe2f98d1 100644 --- a/src/admin/meson.build +++ b/src/admin/meson.build @@ -5,6 +5,8 @@ admin_driver_sources = [ admin_driver_protocol = files('admin_protocol.x') +rpc_probe_files += admin_driver_protocol + admin_driver_generated = [] admin_driver_generated += custom_target( diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am deleted file mode 100644 index 285e73a6bf4..00000000000 --- a/src/locking/Makefile.inc.am +++ /dev/null @@ -1,3 +0,0 @@ -# vim: filetype=automake - -RPC_PROBE_FILES += $(srcdir)/locking/lock_protocol.x diff --git a/src/locking/meson.build b/src/locking/meson.build index dbff78ca1bb..5c49bc641f8 100644 --- a/src/locking/meson.build +++ b/src/locking/meson.build @@ -1,5 +1,7 @@ lock_protocol = 'lock_protocol.x' +rpc_probe_files += files(lock_protocol) + lock_driver_sources = [ 'lock_manager.c', 'lock_driver_nop.c', diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am deleted file mode 100644 index 564b3519bcb..00000000000 --- a/src/lxc/Makefile.inc.am +++ /dev/null @@ -1,9 +0,0 @@ -# vim: filetype=automake - -if WITH_LXC - -if WITH_DTRACE_PROBES -RPC_PROBE_FILES += $(srcdir)/lxc/lxc_monitor_protocol.x -endif - -endif WITH_LXC diff --git a/src/lxc/meson.build b/src/lxc/meson.build index 8b51093a387..0999e1c96b8 100644 --- a/src/lxc/meson.build +++ b/src/lxc/meson.build @@ -13,6 +13,8 @@ lxc_driver_sources = [ lxc_monitor_protocol = files('lxc_monitor_protocol.x') +rpc_probe_files += lxc_monitor_protocol + lxc_monitor_protocol_generated = [] lxc_monitor_protocol_generated += custom_target( diff --git a/src/meson.build b/src/meson.build index 9b4c26e32ea..7965c5fb18a 100644 --- a/src/meson.build +++ b/src/meson.build @@ -75,6 +75,8 @@ if conf.has('WITH_DTRACE_PROBES') ) endif +rpc_probe_files = [] + # symbol files @@ -802,6 +804,18 @@ foreach sysconf : sysconf_files ) endforeach +if conf.has('WITH_DTRACE_PROBES') + custom_target( + 'libvirt_functions.stp', + input: rpc_probe_files, + output: 'libvirt_functions.stp', + command: [ meson_python_prog, gensystemtap_prog, '@INPUT@' ], + capture: true, + install: true, + install_dir: systemtap_dir, + ) +endif + # Install empty directories diff --git a/src/remote/meson.build b/src/remote/meson.build index 055857ae360..fa7ce7ce5be 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -37,6 +37,8 @@ foreach name : [ 'remote', 'qemu', 'lxc' ] genprotocol_prog, rpcgen_prog, '-c', '@INPUT@', '@OUTPUT@', ], ) + + rpc_probe_files += files(protocol_x) endforeach remote_daemon_sources = files( diff --git a/src/rpc/meson.build b/src/rpc/meson.build index 8f4372bb3e2..d759fa21aec 100644 --- a/src/rpc/meson.build +++ b/src/rpc/meson.build @@ -45,6 +45,8 @@ foreach name : [ 'virnet', 'virkeepalive' ] genprotocol_prog, rpcgen_prog, '-c', '@INPUT@', '@OUTPUT@', ], ) + + rpc_probe_files += protocol_file endforeach rpc_server_sources = [ -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- meson.build | 1 + scripts/check-remote-protocol.py | 75 +++++++++++--------------------- src/Makefile.am | 61 -------------------------- src/admin/meson.build | 7 +++ src/locking/meson.build | 7 +++ src/lxc/meson.build | 7 +++ src/meson.build | 23 ++++++++++ src/remote/meson.build | 21 +++++++++ src/rpc/meson.build | 14 ++++++ 9 files changed, 106 insertions(+), 110 deletions(-) diff --git a/meson.build b/meson.build index 457d752ffb5..eb659c64aa0 100644 --- a/meson.build +++ b/meson.build @@ -920,6 +920,7 @@ optional_programs = [ 'mm-ctl', 'modprobe', 'ovs-vsctl', + 'pdwtags', 'radvd', 'rmmod', 'scrub', diff --git a/scripts/check-remote-protocol.py b/scripts/check-remote-protocol.py index e28fb80cdd1..00b8570f9bb 100644 --- a/scripts/check-remote-protocol.py +++ b/scripts/check-remote-protocol.py @@ -31,55 +31,32 @@ import re import subprocess import sys -cc = sys.argv[1] -proto_lo = sys.argv[2] -expected = sys.argv[3] - -proto_lo = proto_lo.replace("/", "/.libs/") - -ccargv = cc.split(" ") -ccargv.append("-v") -ccproc = subprocess.Popen(ccargv, stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) -out, err = ccproc.communicate() -out = out.decode("utf-8") -if out.find("clang") != -1: - print("WARNING: skipping pdwtags test with Clang", file=sys.stderr) - sys.exit(0) - - -def which(program): - def is_exe(fpath): - return (os.path.isfile(fpath) and - os.access(fpath, os.X_OK)) - - fpath, fname = os.path.split(program) - if fpath: - if is_exe(program): - return program - else: - for path in os.environ["PATH"].split(os.pathsep): - exe_file = os.path.join(path, program) - if is_exe(exe_file): - return exe_file - - return None - - -pdwtags = which("pdwtags") -if pdwtags is None: - print("WARNING: you lack pdwtags; skipping the protocol test", - file=sys.stderr) - print("WARNING: install the dwarves package to get pdwtags", - file=sys.stderr) - sys.exit(0) - -proto_o = proto_lo.replace(".lo", ".o") - -if not os.path.exists(proto_o): - raise Exception("Missing %s", proto_o) - -pdwtagsproc = subprocess.Popen(["pdwtags", "--verbose", proto_o], +name = sys.argv[1] +libname = sys.argv[2] +builddir = sys.argv[3] +pdwtags = sys.argv[4] +expected = sys.argv[5] + + +def get_subdir(dirname, subdir): + objectdir = "" + reg = re.compile(subdir) + for d in os.listdir(path=dirname): + if reg.match(d): + objectdir = d + break + + if objectdir == "": + raise Exception("Failed to find '{0}' in '{1}'".format(subdir, dirname)) + + return os.path.join(dirname, objectdir) + + +objectdir = get_subdir(builddir, r'.*@{0}@.*'.format(libname)) + +proto_o = get_subdir(objectdir, r'.*{0}\.c\.o'.format(name)) + +pdwtagsproc = subprocess.Popen([pdwtags, "--verbose", proto_o], stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = pdwtagsproc.communicate() out = out.decode("utf-8") diff --git a/src/Makefile.am b/src/Makefile.am index 7289f247362..33e32506525 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,65 +20,4 @@ # here. List them against the individual XXX_la_CFLAGS targets # that actually use them. -RPC_PROBE_FILES = - include admin/Makefile.inc.am - - -# Keep this list synced with RPC_PROBE_FILES -PROTOCOL_STRUCTS = \ - $(srcdir)/remote_protocol-structs \ - $(srcdir)/lxc_protocol-structs \ - $(srcdir)/qemu_protocol-structs \ - $(srcdir)/virnetprotocol-structs \ - $(srcdir)/virkeepaliveprotocol-structs \ - $(srcdir)/lxc_monitor_protocol-structs \ - $(srcdir)/lock_protocol-structs \ - $(srcdir)/admin_protocol-structs \ - $(NULL) - -if WITH_REMOTE -check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct) - -# Ensure that we don't change the struct or member names or member ordering -# in remote_protocol.x The check-remote-protocol.py script post-processes -# output to extract the bits we want. - -CHECK_REMOTE_PROTOCOL = $(top_srcdir)/scripts/check-remote-protocol.py - -# The .o file that pdwtags parses is created as a side effect of running -# libtool; but from make's perspective we depend on the .lo file. -$(srcdir)/remote_protocol-struct \ - $(srcdir)/qemu_protocol-struct \ - $(srcdir)/lxc_protocol-struct: \ - $(srcdir)/%-struct: remote/libvirt_driver_remote_la-%.lo - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(CHECK_REMOTE_PROTOCOL) \ - "$(CC)" $< $(@)s -$(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \ - $(srcdir)/%-struct: rpc/libvirt_net_rpc_la-%.lo - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(CHECK_REMOTE_PROTOCOL) \ - "$(CC)" $< $(@)s -if WITH_LXC -$(srcdir)/lxc_monitor_protocol-struct: \ - $(srcdir)/%-struct: lxc/libvirt_driver_lxc_impl_la-%.lo - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(CHECK_REMOTE_PROTOCOL) \ - "$(CC)" $< $(@)s -endif WITH_LXC -$(srcdir)/lock_protocol-struct: \ - $(srcdir)/%-struct: locking/lockd_la-%.lo - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(CHECK_REMOTE_PROTOCOL) \ - "$(CC)" $< $(@)s -$(srcdir)/admin_protocol-struct: \ - $(srcdir)/%-struct: admin/libvirt_admin_la-%.lo - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(CHECK_REMOTE_PROTOCOL) \ - "$(CC)" $< $(@)s - -else !WITH_REMOTE -# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be -# re-generated when configured --without-remote. -check-protocol: -endif !WITH_REMOTE - -check-local: check-protocol \ - check-admin -.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct) diff --git a/src/admin/meson.build b/src/admin/meson.build index 330fe2f98d1..5652a58e0fb 100644 --- a/src/admin/meson.build +++ b/src/admin/meson.build @@ -94,6 +94,13 @@ admin_driver_lib = static_library( libvirt_libs += admin_driver_lib +check_protocols += { + 'name': 'admin_protocol', + 'libname': 'virt_admin_driver', + 'builddir': meson.current_build_dir(), + 'depends': admin_driver_lib, +} + virt_conf_files += files('libvirt-admin.conf') admin_inc_dir = include_directories('.') diff --git a/src/locking/meson.build b/src/locking/meson.build index 5c49bc641f8..4c30acb2eb9 100644 --- a/src/locking/meson.build +++ b/src/locking/meson.build @@ -90,6 +90,13 @@ if conf.has('WITH_LIBVIRTD') ], ) + check_protocols += { + 'name': 'lock_protocol', + 'libname': 'lockd_impl', + 'builddir': meson.current_build_dir(), + 'depends': lockd_lib_impl, + } + lockdriver_dir = libdir / 'libvirt' / 'lock-driver' virt_modules += { diff --git a/src/lxc/meson.build b/src/lxc/meson.build index 0999e1c96b8..093ad809029 100644 --- a/src/lxc/meson.build +++ b/src/lxc/meson.build @@ -99,6 +99,13 @@ if conf.has('WITH_LXC') ], ) + check_protocols += { + 'name': 'lxc_monitor_protocol', + 'libname': 'virt_driver_lxc_impl', + 'builddir': meson.current_build_dir(), + 'depends': lxc_driver_impl_lib, + } + virt_modules += { 'name': 'virt_driver_lxc', 'link_whole': [ diff --git a/src/meson.build b/src/meson.build index 7965c5fb18a..3f1c456245a 100644 --- a/src/meson.build +++ b/src/meson.build @@ -217,6 +217,14 @@ driver_source_files = [] # stateful driver source files to check stateful_driver_source_files = [] +# check_protocols: +# check if $name.x is in sync with $name-structs +# name - name of the protocol (required) +# libname - name of the meson library (required) +# builddir - build directory for the library (required) +# depends - library that this test depends on (required) +check_protocols = [] + # list subdirectories @@ -887,3 +895,18 @@ if augparse_prog.found() ], ) endif + +if pdwtags_prog.found() + foreach proto : check_protocols + test( + 'check-@0@'.format(proto['name']), + python3_prog, + args: [ + check_remote_protocol_prog.path(), proto['name'], proto['libname'], + proto['builddir'], pdwtags_prog.path(), files('@0@-structs'.format(proto['name'])), + ], + env: runutf8, + depends: proto['depends'], + ) + endforeach +endif diff --git a/src/remote/meson.build b/src/remote/meson.build index fa7ce7ce5be..130d246fcec 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -126,6 +126,27 @@ if conf.has('WITH_REMOTE') ], ) + check_protocols += { + 'name': 'remote_protocol', + 'libname': 'virt_remote_driver', + 'builddir': meson.current_build_dir(), + 'depends': remote_driver_lib, + } + + check_protocols += { + 'name': 'qemu_protocol', + 'libname': 'virt_remote_driver', + 'builddir': meson.current_build_dir(), + 'depends': remote_driver_lib, + } + + check_protocols += { + 'name': 'lxc_protocol', + 'libname': 'virt_remote_driver', + 'builddir': meson.current_build_dir(), + 'depends': remote_driver_lib, + } + libvirt_libs += remote_driver_lib if conf.has('WITH_LIBVIRTD') diff --git a/src/rpc/meson.build b/src/rpc/meson.build index d759fa21aec..18ea0602602 100644 --- a/src/rpc/meson.build +++ b/src/rpc/meson.build @@ -81,6 +81,20 @@ virt_rpc_lib = static_library( ], ) +check_protocols += { + 'name': 'virnetprotocol', + 'libname': 'virt_net_rpc', + 'builddir': meson.current_build_dir(), + 'depends': virt_rpc_lib, +} + +check_protocols += { + 'name': 'virkeepaliveprotocol', + 'libname': 'virt_net_rpc', + 'builddir': meson.current_build_dir(), + 'depends': virt_rpc_lib, +} + virt_rpc_server_lib = static_library( 'virt_net_rpc_server', [ -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/admin/Makefile.inc.am | 10 +--------- src/meson.build | 7 +++++++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/admin/Makefile.inc.am b/src/admin/Makefile.inc.am index ec084299b85..a2af10a158d 100644 --- a/src/admin/Makefile.inc.am +++ b/src/admin/Makefile.inc.am @@ -2,14 +2,6 @@ ADMIN_SYM_FILES = $(srcdir)/admin/libvirt_admin_private.syms -if WITH_LINUX -check-admin-symfile: admin/libvirt_admin.syms libvirt-admin.la - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-symfile.py \ - admin/libvirt_admin.syms .libs/libvirt-admin.so -else ! WITH_LINUX -check-admin-symfile: -endif ! WITH_LINUX - check-admin-symsorting: $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-symsorting.py \ $(srcdir) $(ADMIN_SYM_FILES) @@ -18,4 +10,4 @@ check-admin-drivername: $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-drivername.py \ $(srcdir)/admin/libvirt_admin_public.syms -check-admin: check-admin-symfile check-admin-symsorting check-admin-drivername +check-admin: check-admin-symsorting check-admin-drivername diff --git a/src/meson.build b/src/meson.build index 3f1c456245a..9a2a152f316 100644 --- a/src/meson.build +++ b/src/meson.build @@ -846,6 +846,13 @@ if host_machine.system() == 'linux' args: [ check_symfile_prog.path(), libvirt_syms, libvirt_lib ], env: runutf8, ) + + test( + 'check-admin-symfile', + python3_prog, + args: [ check_symfile_prog.path(), libvirt_admin_syms, libvirt_admin_lib ], + env: runutf8, + ) endif test( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/admin/Makefile.inc.am | 8 +------- src/admin/meson.build | 6 +++++- src/meson.build | 11 +++++++++++ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/admin/Makefile.inc.am b/src/admin/Makefile.inc.am index a2af10a158d..9d6f3c4cca4 100644 --- a/src/admin/Makefile.inc.am +++ b/src/admin/Makefile.inc.am @@ -1,13 +1,7 @@ # vim: filetype=automake -ADMIN_SYM_FILES = $(srcdir)/admin/libvirt_admin_private.syms - -check-admin-symsorting: - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-symsorting.py \ - $(srcdir) $(ADMIN_SYM_FILES) - check-admin-drivername: $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-drivername.py \ $(srcdir)/admin/libvirt_admin_public.syms -check-admin: check-admin-symsorting check-admin-drivername +check-admin: check-admin-drivername diff --git a/src/admin/meson.build b/src/admin/meson.build index 5652a58e0fb..ed675270845 100644 --- a/src/admin/meson.build +++ b/src/admin/meson.build @@ -51,11 +51,15 @@ admin_client_generated = custom_target( capture: true, ) +libvirt_admin_private_syms = files( + 'libvirt_admin_private.syms', +) + libvirt_admin_syms = custom_target( 'libvirt_admin.syms', input: [ 'libvirt_admin_public.syms', - 'libvirt_admin_private.syms', + libvirt_admin_private_syms, ], output: 'libvirt_admin.syms', command: [ gen_sym_files_prog, 'LIBVIRT_ADMIN_PRIVATE_' + meson.project_version(), '@INPUT@' ], diff --git a/src/meson.build b/src/meson.build index 9a2a152f316..24c54241a68 100644 --- a/src/meson.build +++ b/src/meson.build @@ -866,6 +866,17 @@ test( env: runutf8, ) +test( + 'check-admin-symsorting', + python3_prog, + args: [ + check_symsorting_prog.path(), + meson.current_source_dir(), + libvirt_admin_private_syms, + ], + env: runutf8, +) + test( 'check-drivername', python3_prog, -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 2 +- configure.ac | 2 +- src/Makefile.am | 23 ----------------------- src/admin/Makefile.inc.am | 7 ------- src/admin/meson.build | 6 +++++- src/meson.build | 9 +++++++++ 6 files changed, 16 insertions(+), 33 deletions(-) delete mode 100644 src/Makefile.am delete mode 100644 src/admin/Makefile.inc.am diff --git a/Makefile.am b/Makefile.am index 6df2176364a..c5809204e6b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,7 +20,7 @@ # so force it explicitly DISTCHECK_CONFIGURE_FLAGS = --enable-werror -SUBDIRS = . src tools docs \ +SUBDIRS = . tools docs \ tests po examples XZ_OPT ?= -v -T0 diff --git a/configure.ac b/configure.ac index af52f957cb2..c26076fd79b 100644 --- a/configure.ac +++ b/configure.ac @@ -111,7 +111,7 @@ m4_if(m4_version_compare([2.61a.100], AC_CONFIG_FILES([run], [chmod +x,-w run]) AC_CONFIG_FILES([\ - Makefile src/Makefile docs/Makefile \ + Makefile docs/Makefile \ .color_coded \ .ycm_extra_conf.py \ libvirt.pc \ diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index 33e32506525..00000000000 --- a/src/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -## Process this file with automake to produce Makefile.in - -## Copyright (C) 2005-2018 Red Hat, Inc. -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library. If not, see -## <http://www.gnu.org/licenses/>. - -# No libraries with the exception of LIBXML should be listed -# here. List them against the individual XXX_la_CFLAGS targets -# that actually use them. - -include admin/Makefile.inc.am diff --git a/src/admin/Makefile.inc.am b/src/admin/Makefile.inc.am deleted file mode 100644 index 9d6f3c4cca4..00000000000 --- a/src/admin/Makefile.inc.am +++ /dev/null @@ -1,7 +0,0 @@ -# vim: filetype=automake - -check-admin-drivername: - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-drivername.py \ - $(srcdir)/admin/libvirt_admin_public.syms - -check-admin: check-admin-drivername diff --git a/src/admin/meson.build b/src/admin/meson.build index ed675270845..394ac2b04ad 100644 --- a/src/admin/meson.build +++ b/src/admin/meson.build @@ -51,6 +51,10 @@ admin_client_generated = custom_target( capture: true, ) +libvirt_admin_public_syms = files( + 'libvirt_admin_public.syms', +) + libvirt_admin_private_syms = files( 'libvirt_admin_private.syms', ) @@ -58,7 +62,7 @@ libvirt_admin_private_syms = files( libvirt_admin_syms = custom_target( 'libvirt_admin.syms', input: [ - 'libvirt_admin_public.syms', + libvirt_admin_public_syms, libvirt_admin_private_syms, ], output: 'libvirt_admin.syms', diff --git a/src/meson.build b/src/meson.build index 24c54241a68..08892b536e2 100644 --- a/src/meson.build +++ b/src/meson.build @@ -887,6 +887,15 @@ test( env: runutf8, ) +test( + 'check-admin-drivername', + python3_prog, + args: [ + check_drivername_prog.path(), libvirt_admin_public_syms, + ], + env: runutf8, +) + test( 'check-driverimpls', python3_prog, -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 3 --- src/meson.build | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index c26076fd79b..dc1a27ae94b 100644 --- a/configure.ac +++ b/configure.ac @@ -118,9 +118,6 @@ AC_CONFIG_FILES([\ libvirt-qemu.pc \ libvirt-lxc.pc \ libvirt-admin.pc \ - src/libvirt.pc \ - src/libvirt-qemu.pc \ - src/libvirt-lxc.pc \ libvirt.spec mingw-libvirt.spec \ po/Makefile \ examples/Makefile \ diff --git a/src/meson.build b/src/meson.build index 08892b536e2..946c124079a 100644 --- a/src/meson.build +++ b/src/meson.build @@ -937,3 +937,23 @@ if pdwtags_prog.found() ) endforeach endif + +# configure pkg-config files for run script +run_pkg_config_files = [ + 'libvirt-lxc.pc.in', + 'libvirt-qemu.pc.in', + 'libvirt.pc.in', +] + +run_pkg_config_conf = configuration_data() +run_pkg_config_conf.set('VERSION', meson.project_version()) +run_pkg_config_conf.set('abs_top_builddir', meson.build_root()) +run_pkg_config_conf.set('abs_top_srcdir', meson.source_root()) + +foreach file : run_pkg_config_files + configure_file( + input: file, + output: '@BASENAME@', + configuration: run_pkg_config_conf, + ) +endforeach -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- meson.build | 2 ++ tools/Makefile.am | 20 -------------------- tools/meson.build | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 20 deletions(-) create mode 100644 tools/meson.build diff --git a/meson.build b/meson.build index eb659c64aa0..69145512519 100644 --- a/meson.build +++ b/meson.build @@ -2203,6 +2203,8 @@ subdir('include') subdir('src') +subdir('tools') + # generate meson-config.h file configure_file(output: 'meson-config.h', configuration: conf) diff --git a/tools/Makefile.am b/tools/Makefile.am index 19c3b88777c..f266d3e72e7 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -15,32 +15,12 @@ ## License along with this library. If not, see ## <http://www.gnu.org/licenses/>. -AM_CPPFLAGS = \ - -I$(top_builddir)/include -I$(top_srcdir)/include \ - -I$(top_builddir)/src -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/util \ - -I$(top_srcdir) \ - $(NULL) - # We do not want to accidentally include stuff from src/ # dir or public API dir. Specific files can # still be included via their path relative to the root if # needed STANDALONE_CPPFLAGS = -I$(top_srcdir) -AM_CFLAGS = \ - $(WARN_CFLAGS) \ - $(COVERAGE_CFLAGS) \ - $(LIBXML_CFLAGS) \ - $(GLIB_CFLAGS) \ - $(NULL) - -AM_LDFLAGS = \ - $(RELRO_LDFLAGS) \ - $(NO_INDIRECT_LDFLAGS) \ - $(NO_UNDEFINED_LDFLAGS) \ - $(NULL) - ICON_FILES = \ libvirt_win_icon_16x16.ico \ libvirt_win_icon_32x32.ico \ diff --git a/tools/meson.build b/tools/meson.build new file mode 100644 index 00000000000..49214e5706f --- /dev/null +++ b/tools/meson.build @@ -0,0 +1,16 @@ +tools_inc_dir = include_directories('.') + +tools_dep = declare_dependency( + compile_args: coverage_flags, + dependencies: [ + libxml_dep, + glib_dep, + ], + include_directories: [ + libvirt_inc, + src_inc_dir, + util_inc_dir, + top_inc_dir, + ], + link_args: libvirt_relro + libvirt_no_indirect + libvirt_no_undefined, +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 19 +------------------ tools/meson.build | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index f266d3e72e7..01c24bec02d 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -64,24 +64,7 @@ virt-sanlock-cleanup: virt-sanlock-cleanup.in Makefile -e 's|[@]localstatedir@|$(localstatedir)|' < $< > $@ \ || (rm $@ && exit 1) && chmod +x $@ -noinst_LTLIBRARIES = libvirt_shell.la -libvirt_shell_la_CFLAGS = \ - $(AM_CFLAGS) \ - $(READLINE_CFLAGS) \ - $(NULL) -libvirt_shell_la_LDFLAGS = \ - $(AM_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ - $(NULL) -libvirt_shell_la_LIBADD = \ - ../src/libvirt.la \ - $(LIBXML_LIBS) \ - $(READLINE_LIBS) \ - $(GLIB_LIBS) \ - $(NULL) -libvirt_shell_la_SOURCES = \ - vsh.c vsh.h \ - vsh-table.c vsh-table.h +noinst_LTLIBRARIES = virt_host_validate_SOURCES = \ virt-host-validate.c \ diff --git a/tools/meson.build b/tools/meson.build index 49214e5706f..3a4bd760688 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -14,3 +14,21 @@ tools_dep = declare_dependency( ], link_args: libvirt_relro + libvirt_no_indirect + libvirt_no_undefined, ) + +libvirt_shell_lib = static_library( + 'virt_shell', + [ + 'vsh.c', + 'vsh-table.c', + ], + dependencies: [ + tools_dep, + readline_dep, + ], + link_with: [ + libvirt_lib, + ], + link_args: [ + coverage_flags, + ], +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 43 ------------------------------------------- tools/meson.build | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 43 deletions(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index 01c24bec02d..d285146622f 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -45,10 +45,6 @@ bin_PROGRAMS += virt-login-shell libexec_PROGRAMS = virt-login-shell-helper endif WITH_LOGIN_SHELL -if WITH_HOST_VALIDATE -bin_PROGRAMS += virt-host-validate -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' \ @@ -66,45 +62,6 @@ virt-sanlock-cleanup: virt-sanlock-cleanup.in Makefile noinst_LTLIBRARIES = -virt_host_validate_SOURCES = \ - virt-host-validate.c \ - virt-host-validate-common.c virt-host-validate-common.h - -VIRT_HOST_VALIDATE_QEMU = \ - virt-host-validate-qemu.c \ - virt-host-validate-qemu.h -VIRT_HOST_VALIDATE_LXC = \ - virt-host-validate-lxc.c \ - virt-host-validate-lxc.h -VIRT_HOST_VALIDATE_BHYVE = \ - virt-host-validate-bhyve.c \ - virt-host-validate-bhyve.h -if WITH_QEMU -virt_host_validate_SOURCES += $(VIRT_HOST_VALIDATE_QEMU) -endif ! WITH_QEMU - -if WITH_LXC -virt_host_validate_SOURCES += $(VIRT_HOST_VALIDATE_LXC) -endif ! WITH_LXC - -if WITH_BHYVE -virt_host_validate_SOURCES += $(VIRT_HOST_VALIDATE_BHYVE) -endif ! WITH_BHYVE - -virt_host_validate_LDFLAGS = \ - $(AM_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ - $(NULL) - -virt_host_validate_LDADD = \ - ../src/libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) - -virt_host_validate_CFLAGS = \ - $(AM_CFLAGS) \ - $(NULL) - # virt-login-shell will be setuid, and must not link to anything # except glibc. It wil scrub the environment and then invoke the # real virt-login-shell-helper binary. diff --git a/tools/meson.build b/tools/meson.build index 3a4bd760688..8c7d3ec64ab 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -32,3 +32,45 @@ libvirt_shell_lib = static_library( coverage_flags, ], ) + +if conf.has('WITH_HOST_VALIDATE') + virt_host_validate_sources = [ + 'virt-host-validate.c', + 'virt-host-validate-common.c', + ] + + if conf.has('WITH_QEMU') + virt_host_validate_sources += [ + 'virt-host-validate-qemu.c', + ] + endif + if conf.has('WITH_LXC') + virt_host_validate_sources += [ + 'virt-host-validate-lxc.c', + ] + endif + if conf.has('WITH_BHYVE') + virt_host_validate_sources += [ + 'virt-host-validate-bhyve.c', + ] + endif + + executable( + 'virt-host-validate', + [ + virt_host_validate_sources, + ], + dependencies: [ + tools_dep, + ], + link_args: [ + coverage_flags, + ], + link_with: [ + libvirt_lib, + ], + install: true, + install_dir: bindir, + install_rpath: libdir, + ) +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 9 --------- tools/meson.build | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index d285146622f..50acdeab22e 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -41,7 +41,6 @@ endif WITH_SANLOCK if WITH_LOGIN_SHELL conf_DATA += virt-login-shell.conf -bin_PROGRAMS += virt-login-shell libexec_PROGRAMS = virt-login-shell-helper endif WITH_LOGIN_SHELL @@ -62,14 +61,6 @@ virt-sanlock-cleanup: virt-sanlock-cleanup.in Makefile noinst_LTLIBRARIES = -# virt-login-shell will be setuid, and must not link to anything -# except glibc. It wil scrub the environment and then invoke the -# real virt-login-shell-helper binary. -virt_login_shell_SOURCES = \ - virt-login-shell.c - -virt_login_shell_CPPFLAGS = $(STANDALONE_CPPFLAGS) - virt_login_shell_helper_SOURCES = \ virt-login-shell-helper.c diff --git a/tools/meson.build b/tools/meson.build index 8c7d3ec64ab..59c5f3c56ff 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -74,3 +74,20 @@ if conf.has('WITH_HOST_VALIDATE') install_rpath: libdir, ) endif + +if conf.has('WITH_LOGIN_SHELL') + # virt-login-shell will be setuid, and must not link to anything + # except glibc. It wil scrub the environment and then invoke the + # real virt-login-shell-helper binary. + executable( + 'virt-login-shell', + [ + 'virt-login-shell.c', + ], + include_directories: [ + top_inc_dir, + ], + install: true, + install_dir: bindir, + ) +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 18 ------------------ tools/meson.build | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index 50acdeab22e..de1edbd54a0 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -41,7 +41,6 @@ endif WITH_SANLOCK if WITH_LOGIN_SHELL conf_DATA += virt-login-shell.conf -libexec_PROGRAMS = virt-login-shell-helper endif WITH_LOGIN_SHELL virt-xml-validate: virt-xml-validate.in Makefile @@ -61,23 +60,6 @@ virt-sanlock-cleanup: virt-sanlock-cleanup.in Makefile noinst_LTLIBRARIES = -virt_login_shell_helper_SOURCES = \ - virt-login-shell-helper.c - -virt_login_shell_helper_LDFLAGS = \ - $(AM_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ - $(NULL) -virt_login_shell_helper_LDADD = \ - ../src/libvirt.la \ - ../src/libvirt-lxc.la \ - $(GLIB_LIBS) \ - $(NULL) - -virt_login_shell_helper_CFLAGS = \ - $(AM_CFLAGS) \ - $(NULL) - virsh_SOURCES = \ virsh.c virsh.h \ virsh-backup.c virsh-backup.h \ diff --git a/tools/meson.build b/tools/meson.build index 59c5f3c56ff..53bc1af7bc4 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -90,4 +90,24 @@ if conf.has('WITH_LOGIN_SHELL') install: true, install_dir: bindir, ) + + executable( + 'virt-login-shell-helper', + [ + 'virt-login-shell-helper.c', + ], + dependencies: [ + tools_dep, + ], + link_args: [ + coverage_flags, + ], + link_with: [ + libvirt_lib, + libvirt_lxc_lib, + ], + install: true, + install_dir: libexecdir, + install_rpath: libdir, + ) endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 2 -- configure.ac | 14 -------------- m4/virt-win-windres.m4 | 36 ------------------------------------ meson.build | 1 + tools/Makefile.am | 29 ----------------------------- tools/meson.build | 31 +++++++++++++++++++++++++++++++ 6 files changed, 32 insertions(+), 81 deletions(-) delete mode 100644 m4/virt-win-windres.m4 diff --git a/Makefile.am b/Makefile.am index c5809204e6b..0b62d15eef5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,8 +26,6 @@ SUBDIRS = . tools docs \ XZ_OPT ?= -v -T0 export XZ_OPT -ACLOCAL_AMFLAGS = -I m4 - pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libvirt.pc libvirt-qemu.pc libvirt-lxc.pc libvirt-admin.pc diff --git a/configure.ac b/configure.ac index dc1a27ae94b..24724e3755a 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,6 @@ dnl License along with this library. If not, see dnl <http://www.gnu.org/licenses/>. AC_CONFIG_AUX_DIR([build-aux]) -AC_CONFIG_MACRO_DIR([m4]) dnl Make automake keep quiet about wildcards & other GNUmake-isms AM_INIT_AUTOMAKE([ foreign @@ -90,10 +89,6 @@ dnl Need to test if pkg-config exists PKG_PROG_PKG_CONFIG -dnl MinGW checks -LIBVIRT_WIN_CHECK_WINDRES - - # Set LV_LIBTOOL_OBJDIR to "." or $lt_cv_objdir, depending on whether # we're building shared libraries. This is the name of the directory # in which .o files will be created. @@ -124,12 +119,3 @@ AC_CONFIG_FILES([\ tests/Makefile \ tools/Makefile]) AC_OUTPUT - -AC_MSG_NOTICE([]) -AC_MSG_NOTICE([Configuration summary]) -AC_MSG_NOTICE([=====================]) -AC_MSG_NOTICE([]) -AC_MSG_NOTICE([Windows]) -AC_MSG_NOTICE([]) -LIBVIRT_WIN_RESULT_WINDRES -AC_MSG_NOTICE([]) diff --git a/m4/virt-win-windres.m4 b/m4/virt-win-windres.m4 deleted file mode 100644 index e913eb48b8e..00000000000 --- a/m4/virt-win-windres.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl The MinGW windres checks -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 <http://www.gnu.org/licenses/>. -dnl - -AC_DEFUN([LIBVIRT_WIN_CHECK_WINDRES], [ - dnl Look for windres to build a Windows icon resource. - with_windres=no - case "$host" in - *-*-mingw* ) - AC_CHECK_TOOL([WINDRES], [windres], []) - if test "x$WINDRES" != "x"; then - with_windres=yes - fi - ;; - esac - AM_CONDITIONAL([WITH_WIN_ICON], [test "$with_windres" = "yes"]) -]) - -AC_DEFUN([LIBVIRT_WIN_RESULT_WINDRES], [ - LIBVIRT_RESULT([windres], [$with_windres], [$WINDRES]) -]) diff --git a/meson.build b/meson.build index 69145512519..b623ddbf4fd 100644 --- a/meson.build +++ b/meson.build @@ -2307,6 +2307,7 @@ summary(libs_summary, section: 'Libraries', bool_yn: true) win_summary = { 'MinGW': host_machine.system() == 'windows', + 'windres': host_machine.system() == 'windows', } summary(win_summary, section: 'Windows', bool_yn: true) diff --git a/tools/Makefile.am b/tools/Makefile.am index de1edbd54a0..4f4adf94382 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -21,13 +21,6 @@ # needed STANDALONE_CPPFLAGS = -I$(top_srcdir) -ICON_FILES = \ - libvirt_win_icon_16x16.ico \ - libvirt_win_icon_32x32.ico \ - libvirt_win_icon_48x48.ico \ - libvirt_win_icon_64x64.ico \ - virsh_win_icon.rc - confdir = $(sysconfdir)/libvirt conf_DATA = @@ -125,28 +118,6 @@ virt_admin_CFLAGS = \ if WITH_WIN_ICON virsh_LDADD += virsh_win_icon.$(OBJEXT) - -# Before you edit virsh_win_icon.rc, please note the following -# limitations of the resource file format: -# -# (1) '..' is not permitted in the icon filename field. -# (2) '-' is not permitted in the icon filename field. -# (3) Comments are not permitted in the file. -# -# Windows appears to choose the first <= 32x32 icon it finds -# in the resource file. Therefore you should list the available -# icons from largest to smallest, and make sure that the 32x32 -# icon is the most legible. -# -# Windows .ICO is a special MS-only format. GIMP and other -# tools can write it. However there are several variations, -# and Windows seems to do its own colour quantization. More -# information is needed in this area. - -virsh_win_icon.$(OBJEXT): virsh_win_icon.rc - $(AM_V_GEN)$(WINDRES) \ - --input-format rc --input $< \ - --output-format coff --output $@ endif WITH_WIN_ICON install-data-local: install-systemd install-nss \ diff --git a/tools/meson.build b/tools/meson.build index 53bc1af7bc4..c110cfcf177 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -111,3 +111,34 @@ if conf.has('WITH_LOGIN_SHELL') install_rpath: libdir, ) endif + +if host_machine.system() == 'windows' + # Before you edit virsh_win_icon.rc, please note the following + # limitations of the resource file format: + # + # (1) '..' is not permitted in the icon filename field. + # (2) '-' is not permitted in the icon filename field. + # (3) Comments are not permitted in the file. + # + # Windows appears to choose the first <= 32x32 icon it finds + # in the resource file. Therefore you should list the available + # icons from largest to smallest, and make sure that the 32x32 + # icon is the most legible. + # + # Windows .ICO is a special MS-only format. GIMP and other + # tools can write it. However there are several variations, + # and Windows seems to do its own colour quantization. More + # information is needed in this area. + windres = import('windows') + virsh_icon_res = windres.compile_resources( + 'virsh_win_icon.rc', + depend_files: [ + 'libvirt_win_icon_16x16.ico', + 'libvirt_win_icon_32x32.ico', + 'libvirt_win_icon_48x48.ico', + 'libvirt_win_icon_64x64.ico', + ], + ) +else + virsh_icon_res = [] +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 50 +--------------------------------------------- tools/meson.build | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 49 deletions(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index 4f4adf94382..2cf165dffdf 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -25,7 +25,7 @@ confdir = $(sysconfdir)/libvirt conf_DATA = bin_SCRIPTS = virt-xml-validate virt-pki-validate -bin_PROGRAMS = virsh virt-admin +bin_PROGRAMS = virt-admin libexec_SCRIPTS = libvirt-guests.sh if WITH_SANLOCK @@ -53,50 +53,6 @@ virt-sanlock-cleanup: virt-sanlock-cleanup.in Makefile noinst_LTLIBRARIES = -virsh_SOURCES = \ - virsh.c virsh.h \ - virsh-backup.c virsh-backup.h \ - virsh-checkpoint.c virsh-checkpoint.h \ - virsh-completer.c virsh-completer.h \ - virsh-completer-domain.c virsh-completer-domain.h \ - virsh-completer-checkpoint.c virsh-completer-checkpoint.h \ - virsh-completer-host.c virsh-completer-host.h \ - virsh-completer-interface.c virsh-completer-interface.h \ - virsh-completer-network.c virsh-completer-network.h \ - virsh-completer-nodedev.c virsh-completer-nodedev.h \ - virsh-completer-nwfilter.c virsh-completer-nwfilter.h \ - virsh-completer-pool.c virsh-completer-pool.h \ - virsh-completer-secret.c virsh-completer-secret.h \ - virsh-completer-snapshot.c virsh-completer-snapshot.h \ - virsh-completer-volume.c virsh-completer-volume.h \ - virsh-console.c virsh-console.h \ - virsh-domain.c virsh-domain.h \ - virsh-domain-monitor.c virsh-domain-monitor.h \ - virsh-host.c virsh-host.h \ - virsh-interface.c virsh-interface.h \ - virsh-network.c virsh-network.h \ - virsh-nodedev.c virsh-nodedev.h \ - virsh-nwfilter.c virsh-nwfilter.h \ - virsh-pool.c virsh-pool.h \ - virsh-secret.c virsh-secret.h \ - virsh-snapshot.c virsh-snapshot.h \ - virsh-util.c virsh-util.h \ - virsh-volume.c virsh-volume.h \ - $(NULL) - -virsh_LDFLAGS = \ - $(AM_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ - $(NULL) -virsh_LDADD = \ - $(STATIC_BINARIES) \ - ../src/libvirt-lxc.la \ - ../src/libvirt-qemu.la \ - libvirt_shell.la -virsh_CFLAGS = \ - $(AM_CFLAGS) \ - $(READLINE_CFLAGS) - virt_admin_SOURCES = \ virt-admin.c virt-admin.h \ virt-admin-completer.c virt-admin-completer.h \ @@ -116,10 +72,6 @@ virt_admin_CFLAGS = \ $(AM_CFLAGS) \ $(READLINE_CFLAGS) -if WITH_WIN_ICON -virsh_LDADD += virsh_win_icon.$(OBJEXT) -endif WITH_WIN_ICON - install-data-local: install-systemd install-nss \ install-bash-completion diff --git a/tools/meson.build b/tools/meson.build index c110cfcf177..20523b400bd 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -142,3 +142,54 @@ if host_machine.system() == 'windows' else virsh_icon_res = [] endif + +executable( + 'virsh', + [ + 'virsh.c', + 'virsh-backup.c', + 'virsh-checkpoint.c', + 'virsh-completer.c', + 'virsh-completer-domain.c', + 'virsh-completer-checkpoint.c', + 'virsh-completer-host.c', + 'virsh-completer-interface.c', + 'virsh-completer-network.c', + 'virsh-completer-nodedev.c', + 'virsh-completer-nwfilter.c', + 'virsh-completer-pool.c', + 'virsh-completer-secret.c', + 'virsh-completer-snapshot.c', + 'virsh-completer-volume.c', + 'virsh-console.c', + 'virsh-domain.c', + 'virsh-domain-monitor.c', + 'virsh-host.c', + 'virsh-interface.c', + 'virsh-network.c', + 'virsh-nodedev.c', + 'virsh-nwfilter.c', + 'virsh-pool.c', + 'virsh-secret.c', + 'virsh-snapshot.c', + 'virsh-util.c', + 'virsh-volume.c', + virsh_icon_res, + ], + dependencies: [ + tools_dep, + readline_dep, + thread_dep, + ], + link_args: [ + coverage_flags, + ], + link_with: [ + libvirt_lxc_lib, + libvirt_qemu_lib, + libvirt_shell_lib, + ], + install: true, + install_dir: bindir, + install_rpath: libdir, +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 20 -------------------- tools/meson.build | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index 2cf165dffdf..5a0614756f9 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -25,7 +25,6 @@ confdir = $(sysconfdir)/libvirt conf_DATA = bin_SCRIPTS = virt-xml-validate virt-pki-validate -bin_PROGRAMS = virt-admin libexec_SCRIPTS = libvirt-guests.sh if WITH_SANLOCK @@ -53,25 +52,6 @@ virt-sanlock-cleanup: virt-sanlock-cleanup.in Makefile noinst_LTLIBRARIES = -virt_admin_SOURCES = \ - virt-admin.c virt-admin.h \ - virt-admin-completer.c virt-admin-completer.h \ - $(NULL) - -virt_admin_LDFLAGS = \ - $(AM_LDFLAGS) \ - $(COVERAGE_LDFLAGS) \ - $(STATIC_BINARIES) \ - $(NULL) -virt_admin_LDADD = \ - ../src/libvirt-admin.la \ - libvirt_shell.la \ - $(LIBXML_LIBS) \ - $(NULL) -virt_admin_CFLAGS = \ - $(AM_CFLAGS) \ - $(READLINE_CFLAGS) - install-data-local: install-systemd install-nss \ install-bash-completion diff --git a/tools/meson.build b/tools/meson.build index 20523b400bd..d2d82903f1c 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -193,3 +193,25 @@ executable( install_dir: bindir, install_rpath: libdir, ) + +executable( + 'virt-admin', + [ + 'virt-admin.c', + 'virt-admin-completer.c', + ], + dependencies: [ + tools_dep, + readline_dep, + ], + link_args: [ + coverage_flags, + ], + link_with: [ + libvirt_admin_lib, + libvirt_shell_lib, + ], + install: true, + install_dir: bindir, + install_rpath: libdir, +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 7 +------ tools/meson.build | 12 ++++++++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index 5a0614756f9..6040e7e74ad 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -24,7 +24,7 @@ STANDALONE_CPPFLAGS = -I$(top_srcdir) confdir = $(sysconfdir)/libvirt conf_DATA = -bin_SCRIPTS = virt-xml-validate virt-pki-validate +bin_SCRIPTS = virt-pki-validate libexec_SCRIPTS = libvirt-guests.sh if WITH_SANLOCK @@ -35,11 +35,6 @@ if WITH_LOGIN_SHELL conf_DATA += virt-login-shell.conf endif WITH_LOGIN_SHELL -virt-xml-validate: virt-xml-validate.in Makefile - $(AM_V_GEN)sed -e 's|[@]schemadir@|$(pkgdatadir)/schemas|g' \ - -e 's|[@]VERSION@|$(VERSION)|g' \ - < $< > $@ || (rm $@ && exit 1) && chmod +x $@ - virt-pki-validate: virt-pki-validate.in Makefile $(AM_V_GEN)sed -e 's|[@]sysconfdir@|$(sysconfdir)|g' \ -e 's|[@]VERSION@|$(VERSION)|g' \ diff --git a/tools/meson.build b/tools/meson.build index d2d82903f1c..5e985cff593 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -215,3 +215,15 @@ executable( install_dir: bindir, install_rpath: libdir, ) + +tools_conf = configuration_data() +tools_conf.set('VERSION', meson.project_version()) +tools_conf.set('schemadir', pkgdatadir / 'schemas') + +configure_file( + input: 'virt-xml-validate.in', + output: 'virt-xml-validate', + configuration: tools_conf, + install: true, + install_dir: bindir, +) -- 2.26.2

On Thu, Jul 16, 2020 at 11:58:17 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 7 +------ tools/meson.build | 12 ++++++++++++ 2 files changed, 13 insertions(+), 6 deletions(-)
[...]
diff --git a/tools/meson.build b/tools/meson.build index d2d82903f1c..5e985cff593 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -215,3 +215,15 @@ executable( install_dir: bindir, install_rpath: libdir, ) + +tools_conf = configuration_data() +tools_conf.set('VERSION', meson.project_version()) +tools_conf.set('schemadir', pkgdatadir / 'schemas') + +configure_file( + input: 'virt-xml-validate.in', + output: 'virt-xml-validate', + configuration: tools_conf, + install: true, + install_dir: bindir, +)
Does this preserve the executable bit? I think I've reported some files having wrong exec permissions and it might have been this.

On Tue, Jul 28, 2020 at 10:30:21AM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:58:17 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 7 +------ tools/meson.build | 12 ++++++++++++ 2 files changed, 13 insertions(+), 6 deletions(-)
[...]
diff --git a/tools/meson.build b/tools/meson.build index d2d82903f1c..5e985cff593 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -215,3 +215,15 @@ executable( install_dir: bindir, install_rpath: libdir, ) + +tools_conf = configuration_data() +tools_conf.set('VERSION', meson.project_version()) +tools_conf.set('schemadir', pkgdatadir / 'schemas') + +configure_file( + input: 'virt-xml-validate.in', + output: 'virt-xml-validate', + configuration: tools_conf, + install: true, + install_dir: bindir, +)
Does this preserve the executable bit? I think I've reported some files having wrong exec permissions and it might have been this.
Already fixed in gitlab as I replied to the mail that reported it last week.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 6 ------ tools/meson.build | 9 +++++++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index 6040e7e74ad..ee7f8b5b1ab 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -24,7 +24,6 @@ STANDALONE_CPPFLAGS = -I$(top_srcdir) confdir = $(sysconfdir)/libvirt conf_DATA = -bin_SCRIPTS = virt-pki-validate libexec_SCRIPTS = libvirt-guests.sh if WITH_SANLOCK @@ -35,11 +34,6 @@ if WITH_LOGIN_SHELL conf_DATA += virt-login-shell.conf endif WITH_LOGIN_SHELL -virt-pki-validate: virt-pki-validate.in Makefile - $(AM_V_GEN)sed -e 's|[@]sysconfdir@|$(sysconfdir)|g' \ - -e 's|[@]VERSION@|$(VERSION)|g' \ - < $< > $@ || (rm $@ && exit 1) && chmod +x $@ - virt-sanlock-cleanup: virt-sanlock-cleanup.in Makefile $(AM_V_GEN)sed -e 's|[@]sysconfdir@|$(sysconfdir)|' \ -e 's|[@]localstatedir@|$(localstatedir)|' < $< > $@ \ diff --git a/tools/meson.build b/tools/meson.build index 5e985cff593..50a7267f911 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -219,6 +219,7 @@ executable( tools_conf = configuration_data() tools_conf.set('VERSION', meson.project_version()) tools_conf.set('schemadir', pkgdatadir / 'schemas') +tools_conf.set('sysconfdir', sysconfdir) configure_file( input: 'virt-xml-validate.in', @@ -227,3 +228,11 @@ configure_file( install: true, install_dir: bindir, ) + +configure_file( + input: 'virt-pki-validate.in', + output: 'virt-pki-validate', + configuration: tools_conf, + install: true, + install_dir: bindir, +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 9 --------- tools/meson.build | 11 +++++++++++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index ee7f8b5b1ab..94ea385354e 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -26,19 +26,10 @@ conf_DATA = libexec_SCRIPTS = libvirt-guests.sh -if WITH_SANLOCK -sbin_SCRIPTS = virt-sanlock-cleanup -endif WITH_SANLOCK - if WITH_LOGIN_SHELL conf_DATA += virt-login-shell.conf endif WITH_LOGIN_SHELL -virt-sanlock-cleanup: virt-sanlock-cleanup.in Makefile - $(AM_V_GEN)sed -e 's|[@]sysconfdir@|$(sysconfdir)|' \ - -e 's|[@]localstatedir@|$(localstatedir)|' < $< > $@ \ - || (rm $@ && exit 1) && chmod +x $@ - noinst_LTLIBRARIES = install-data-local: install-systemd install-nss \ diff --git a/tools/meson.build b/tools/meson.build index 50a7267f911..d114c109ea6 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -218,6 +218,7 @@ executable( tools_conf = configuration_data() tools_conf.set('VERSION', meson.project_version()) +tools_conf.set('localstatedir', localstatedir) tools_conf.set('schemadir', pkgdatadir / 'schemas') tools_conf.set('sysconfdir', sysconfdir) @@ -236,3 +237,13 @@ configure_file( install: true, install_dir: bindir, ) + +if conf.has('WITH_SANLOCK') + configure_file( + input: 'virt-sanlock-cleanup.in', + output: 'virt-sanlock-cleanup', + configuration: tools_conf, + install: true, + install_dir: sbindir, + ) +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 14 -------------- tools/meson.build | 12 ++++++++++++ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index 94ea385354e..39bc7349a88 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -24,8 +24,6 @@ STANDALONE_CPPFLAGS = -I$(top_srcdir) confdir = $(sysconfdir)/libvirt conf_DATA = -libexec_SCRIPTS = libvirt-guests.sh - if WITH_LOGIN_SHELL conf_DATA += virt-login-shell.conf endif WITH_LOGIN_SHELL @@ -47,18 +45,6 @@ uninstall-sysconfig: rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests rmdir $(DESTDIR)$(sysconfdir)/sysconfig ||: -libvirt-guests.sh: libvirt-guests.sh.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e 's|[@]PACKAGE[@]|$(PACKAGE)|g' \ - -e 's|[@]bindir[@]|$(bindir)|g' \ - -e 's|[@]localedir[@]|$(localedir)|g' \ - -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ - -e 's|[@]sbindir[@]|$(sbindir)|g' \ - -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ - < $< > $@-t && \ - chmod a+x $@-t && \ - mv $@-t $@ - SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system if LIBVIRT_INIT_SCRIPT_SYSTEMD diff --git a/tools/meson.build b/tools/meson.build index d114c109ea6..ad83dd9508b 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -217,8 +217,12 @@ executable( ) tools_conf = configuration_data() +tools_conf.set('PACKAGE', meson.project_name()) tools_conf.set('VERSION', meson.project_version()) +tools_conf.set('bindir', bindir) +tools_conf.set('localedir', localedir) tools_conf.set('localstatedir', localstatedir) +tools_conf.set('sbindir', sbindir) tools_conf.set('schemadir', pkgdatadir / 'schemas') tools_conf.set('sysconfdir', sysconfdir) @@ -247,3 +251,11 @@ if conf.has('WITH_SANLOCK') install_dir: sbindir, ) endif + +configure_file( + input: 'libvirt-guests.sh.in', + output: 'libvirt-guests.sh', + configuration: tools_conf, + install: true, + install_dir: libexecdir, +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 7 ------- tools/meson.build | 2 ++ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index 39bc7349a88..655e22d95ea 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -21,13 +21,6 @@ # needed STANDALONE_CPPFLAGS = -I$(top_srcdir) -confdir = $(sysconfdir)/libvirt -conf_DATA = - -if WITH_LOGIN_SHELL -conf_DATA += virt-login-shell.conf -endif WITH_LOGIN_SHELL - noinst_LTLIBRARIES = install-data-local: install-systemd install-nss \ diff --git a/tools/meson.build b/tools/meson.build index ad83dd9508b..446831557e1 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -110,6 +110,8 @@ if conf.has('WITH_LOGIN_SHELL') install_dir: libexecdir, install_rpath: libdir, ) + + install_data('virt-login-shell.conf', install_dir: sysconfdir / 'libvirt') endif if host_machine.system() == 'windows' -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 13 ++----------- tools/meson.build | 8 ++++++++ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index 655e22d95ea..9c6c6b3d3c9 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -29,24 +29,15 @@ install-data-local: install-systemd install-nss \ uninstall-local: uninstall-systemd uninstall-nss \ uninstall-bash-completion -install-sysconfig: - $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig - $(INSTALL_DATA) $(srcdir)/libvirt-guests.sysconf \ - $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests - -uninstall-sysconfig: - rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests - rmdir $(DESTDIR)$(sysconfdir)/sysconfig ||: - SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system if LIBVIRT_INIT_SCRIPT_SYSTEMD -install-systemd: libvirt-guests.service install-sysconfig libvirt-guests.sh +install-systemd: libvirt-guests.service libvirt-guests.sh $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR) $(INSTALL_DATA) libvirt-guests.service \ $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service -uninstall-systemd: uninstall-sysconfig +uninstall-systemd: rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) ||: diff --git a/tools/meson.build b/tools/meson.build index 446831557e1..b95ced3728b 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -261,3 +261,11 @@ configure_file( install: true, install_dir: libexecdir, ) + +if init_script == 'systemd' + install_data( + 'libvirt-guests.sysconf', + install_dir: sysconfdir / 'sysconfig', + rename: 'libvirt-guests', + ) +endif -- 2.26.2

On Thu, Jul 16, 2020 at 11:58:22 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 13 ++----------- tools/meson.build | 8 ++++++++ 2 files changed, 10 insertions(+), 11 deletions(-)
[...]
diff --git a/tools/meson.build b/tools/meson.build index 446831557e1..b95ced3728b 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -261,3 +261,11 @@ configure_file( install: true, install_dir: libexecdir, ) + +if init_script == 'systemd' + install_data( + 'libvirt-guests.sysconf', + install_dir: sysconfdir / 'sysconfig', + rename: 'libvirt-guests', + ) +endif
Arguably it's data at this point as it doesn't need to be modified, but shouldn't we use the config_file directive for any config file?

On Tue, Jul 28, 2020 at 10:32:20AM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:58:22 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 13 ++----------- tools/meson.build | 8 ++++++++ 2 files changed, 10 insertions(+), 11 deletions(-)
[...]
diff --git a/tools/meson.build b/tools/meson.build index 446831557e1..b95ced3728b 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -261,3 +261,11 @@ configure_file( install: true, install_dir: libexecdir, ) + +if init_script == 'systemd' + install_data( + 'libvirt-guests.sysconf', + install_dir: sysconfdir / 'sysconfig', + rename: 'libvirt-guests', + ) +endif
Arguably it's data at this point as it doesn't need to be modified, but shouldn't we use the config_file directive for any config file?
If by 'config_file' you mean 'configure_file' I don't think so. There is no need to copy it into build directory, it just needs to be installed. Pavel

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 34 ++-------------------------------- tools/meson.build | 9 +++++++++ 2 files changed, 11 insertions(+), 32 deletions(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index 9c6c6b3d3c9..ba3b0bbc120 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -23,42 +23,12 @@ STANDALONE_CPPFLAGS = -I$(top_srcdir) noinst_LTLIBRARIES = -install-data-local: install-systemd install-nss \ +install-data-local: install-nss \ install-bash-completion -uninstall-local: uninstall-systemd uninstall-nss \ +uninstall-local: uninstall-nss \ uninstall-bash-completion -SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system - -if LIBVIRT_INIT_SCRIPT_SYSTEMD -install-systemd: libvirt-guests.service libvirt-guests.sh - $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR) - $(INSTALL_DATA) libvirt-guests.service \ - $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service - -uninstall-systemd: - rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service - rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) ||: - -else ! LIBVIRT_INIT_SCRIPT_SYSTEMD -install-systemd: -uninstall-systemd: -endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD - -libvirt-guests.service: libvirt-guests.service.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e 's|[@]PACKAGE[@]|$(PACKAGE)|g' \ - -e 's|[@]bindir[@]|$(bindir)|g' \ - -e 's|[@]localedir[@]|$(localedir)|g' \ - -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ - -e 's|[@]sbindir[@]|$(sbindir)|g' \ - -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ - -e 's|[@]libexecdir[@]|$(libexecdir)|g' \ - < $< > $@-t && \ - mv $@-t $@ - - if WITH_BASH_COMPLETION install-bash-completion: $(MKDIR_P) "$(DESTDIR)$(BASH_COMPLETIONS_DIR)" diff --git a/tools/meson.build b/tools/meson.build index b95ced3728b..ce8f2bdd1e3 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -222,6 +222,7 @@ tools_conf = configuration_data() tools_conf.set('PACKAGE', meson.project_name()) tools_conf.set('VERSION', meson.project_version()) tools_conf.set('bindir', bindir) +tools_conf.set('libexecdir', libexecdir) tools_conf.set('localedir', localedir) tools_conf.set('localstatedir', localstatedir) tools_conf.set('sbindir', sbindir) @@ -268,4 +269,12 @@ if init_script == 'systemd' install_dir: sysconfdir / 'sysconfig', rename: 'libvirt-guests', ) + + configure_file( + input: 'libvirt-guests.service.in', + output: 'libvirt-guests.service', + configuration: tools_conf, + install: true, + install_dir: prefix / 'lib' / 'systemd' / 'system', + ) endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 27 ++------------------------- tools/bash-completion/meson.build | 13 +++++++++++++ tools/meson.build | 4 ++++ 3 files changed, 19 insertions(+), 25 deletions(-) create mode 100644 tools/bash-completion/meson.build diff --git a/tools/Makefile.am b/tools/Makefile.am index ba3b0bbc120..9c91cac9ccf 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -23,32 +23,9 @@ STANDALONE_CPPFLAGS = -I$(top_srcdir) noinst_LTLIBRARIES = -install-data-local: install-nss \ - install-bash-completion - -uninstall-local: uninstall-nss \ - uninstall-bash-completion - -if WITH_BASH_COMPLETION -install-bash-completion: - $(MKDIR_P) "$(DESTDIR)$(BASH_COMPLETIONS_DIR)" - $(INSTALL_DATA) $(srcdir)/bash-completion/vsh \ - "$(DESTDIR)$(BASH_COMPLETIONS_DIR)/vsh" - ( cd $(DESTDIR)$(BASH_COMPLETIONS_DIR) && \ - rm -f virsh virt-admin && \ - $(LN_S) vsh virsh && \ - $(LN_S) vsh virt-admin ) - -uninstall-bash-completion: - rm -f $(DESTDIR)$(BASH_COMPLETIONS_DIR)/vsh \ - $(DESTDIR)$(BASH_COMPLETIONS_DIR)/virsh \ - $(DESTDIR)$(BASH_COMPLETIONS_DIR)/virt-admin - rmdir $(DESTDIR)$(BASH_COMPLETIONS_DIR) ||: -else ! WITH_BASH_COMPLETION -install-bash-completion: -uninstall-bash-completion: -endif ! WITH_BASH_COMPLETION +install-data-local: install-nss +uninstall-local: uninstall-nss if WITH_WIRESHARK_DISSECTOR diff --git a/tools/bash-completion/meson.build b/tools/bash-completion/meson.build new file mode 100644 index 00000000000..4cc0892accf --- /dev/null +++ b/tools/bash-completion/meson.build @@ -0,0 +1,13 @@ +install_data('vsh', install_dir: bash_completion_dir) + +meson.add_install_script( + install_symlink_prog.path(), + bash_completion_dir, + 'vsh', 'virsh', +) + +meson.add_install_script( + install_symlink_prog.path(), + bash_completion_dir, + 'vsh', 'virt-admin', +) diff --git a/tools/meson.build b/tools/meson.build index ce8f2bdd1e3..36c05d43d9c 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -278,3 +278,7 @@ if init_script == 'systemd' install_dir: prefix / 'lib' / 'systemd' / 'system', ) endif + +if bash_completion_dep.found() + subdir('bash-completion') +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 33 --------------------------------- tools/meson.build | 4 ++++ tools/nss/meson.build | 11 +++++++++++ 3 files changed, 15 insertions(+), 33 deletions(-) create mode 100644 tools/nss/meson.build diff --git a/tools/Makefile.am b/tools/Makefile.am index 9c91cac9ccf..3d9d042d2f3 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -23,10 +23,6 @@ STANDALONE_CPPFLAGS = -I$(top_srcdir) noinst_LTLIBRARIES = -install-data-local: install-nss - -uninstall-local: uninstall-nss - if WITH_WIRESHARK_DISSECTOR ws_plugin_LTLIBRARIES = wireshark/src/libvirt.la @@ -57,35 +53,6 @@ wireshark/src/libvirt/protocol.h: wireshark/util/genxdrstub.pl \ endif WITH_WIRESHARK_DISSECTOR -if WITH_BSD_NSS -LIBVIRT_NSS_SYMBOL_FILE = \ - $(srcdir)/nss/libvirt_nss_bsd.syms -LIBVIRT_GUEST_NSS_SYMBOL_FILE = \ - $(LIBVIRT_NSS_SYMBOL_FILE) -NSS_SO_VER = 1 - -install-nss: - ( cd $(DESTDIR)$(libdir) && \ - rm -f nss_libvirt.so.$(NSS_SO_VER) && \ - $(LN_S) libnss_libvirt.so.$(NSS_SO_VER) nss_libvirt.so.$(NSS_SO_VER) && \ - rm -f nss_libvirt_guest.so.$(NSS_SO_VER) && \ - $(LN_S) libnss_libvirt_guest.so.$(NSS_SO_VER) \ - nss_libvirt_guest.so.$(NSS_SO_VER)) - -uninstall-nss: - -rm -f $(DESTDIR)$(libdir)/nss_libvirt.so.$(NSS_SO_VER) - -rm -f $(DESTDIR)$(libdir)/nss_libvirt_guest.so.$(NSS_SO_VER) -else ! WITH_BSD_NSS -LIBVIRT_NSS_SYMBOL_FILE = \ - $(srcdir)/nss/libvirt_nss.syms -LIBVIRT_GUEST_NSS_SYMBOL_FILE = \ - $(srcdir)/nss/libvirt_guest_nss.syms -NSS_SO_VER = 2 - -install-nss: -uninstall-nss: -endif ! WITH_BSD_NSS - LIBVIRT_NSS_SOURCES = \ nss/libvirt_nss.c \ nss/libvirt_nss.h \ diff --git a/tools/meson.build b/tools/meson.build index 36c05d43d9c..52d997d2e73 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -282,3 +282,7 @@ endif if bash_completion_dep.found() subdir('bash-completion') endif + +if conf.has('WITH_NSS') + subdir('nss') +endif diff --git a/tools/nss/meson.build b/tools/nss/meson.build new file mode 100644 index 00000000000..b83a63c9c34 --- /dev/null +++ b/tools/nss/meson.build @@ -0,0 +1,11 @@ +if conf.has('WITH_BSD_NSS') + nss_sym_file = 'libvirt_nss_bsd.syms' + nss_guest_sym_file = nss_sym_file + nss_so_ver = '1' + nss_prefix = '' +else + nss_sym_file = 'libvirt_nss.syms' + nss_guest_sym_file = 'libvirt_guest_nss.syms' + nss_so_ver = '2' + nss_prefix = 'lib' +endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 22 ---------------------- tools/nss/meson.build | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index 3d9d042d2f3..d6a0ccdab2c 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -53,29 +53,7 @@ wireshark/src/libvirt/protocol.h: wireshark/util/genxdrstub.pl \ endif WITH_WIRESHARK_DISSECTOR -LIBVIRT_NSS_SOURCES = \ - nss/libvirt_nss.c \ - nss/libvirt_nss.h \ - nss/libvirt_nss_leases.c \ - nss/libvirt_nss_leases.h \ - $(NULL) - if WITH_NSS -noinst_LTLIBRARIES += nss/libnss_libvirt_impl.la -nss_libnss_libvirt_impl_la_SOURCES = \ - $(LIBVIRT_NSS_SOURCES) - -nss_libnss_libvirt_impl_la_CPPFLAGS = $(STANDALONE_CPPFLAGS) -nss_libnss_libvirt_impl_la_CFLAGS = \ - -DLIBVIRT_NSS \ - $(YAJL_CFLAGS) \ - $(AM_CFLAGS) \ - $(NULL) - -nss_libnss_libvirt_impl_la_LIBADD = \ - $(YAJL_LIBS) \ - $(NULL) - nss_libnss_libvirt_la_SOURCES = nss_libnss_libvirt_la_LDFLAGS = \ $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_NSS_SYMBOL_FILE) \ diff --git a/tools/nss/meson.build b/tools/nss/meson.build index b83a63c9c34..9bccdafd19b 100644 --- a/tools/nss/meson.build +++ b/tools/nss/meson.build @@ -9,3 +9,22 @@ else nss_so_ver = '2' nss_prefix = 'lib' endif + +nss_sources = [ + 'libvirt_nss.c', + 'libvirt_nss_leases.c', +] + +nss_libvirt_impl = static_library( + 'nss_libvirt_impl', + [ + nss_sources, + ], + c_args: [ + '-DLIBVIRT_NSS' + ], + dependencies: [ + tools_dep, + yajl_dep, + ], +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 23 ----------------------- tools/nss/meson.build | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index d6a0ccdab2c..b1388280fef 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -19,10 +19,6 @@ # dir or public API dir. Specific files can # still be included via their path relative to the root if # needed -STANDALONE_CPPFLAGS = -I$(top_srcdir) - -noinst_LTLIBRARIES = - if WITH_WIRESHARK_DISSECTOR ws_plugin_LTLIBRARIES = wireshark/src/libvirt.la @@ -71,25 +67,6 @@ nss_libnss_libvirt_la_DEPENDENCIES = \ $(nss_libnss_libvirt_la_LIBADD) \ $(LIBVIRT_NSS_SYMBOL_FILE) -noinst_LTLIBRARIES += nss/libnss_libvirt_guest_impl.la -nss_libnss_libvirt_guest_impl_la_SOURCES = \ - $(LIBVIRT_NSS_SOURCES) \ - nss/libvirt_nss_macs.h \ - nss/libvirt_nss_macs.c \ - $(NULL) - -nss_libnss_libvirt_guest_impl_la_CPPFLAGS = $(STANDALONE_CPPFLAGS) -nss_libnss_libvirt_guest_impl_la_CFLAGS = \ - -DLIBVIRT_NSS \ - -DLIBVIRT_NSS_GUEST \ - $(YAJL_CFLAGS) \ - $(AM_CFLAGS) \ - $(NULL) - -nss_libnss_libvirt_guest_impl_la_LIBADD = \ - $(YAJL_LIBS) \ - $(NULL) - nss_libnss_libvirt_guest_la_SOURCES = nss_libnss_libvirt_guest_la_LDFLAGS = \ $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_GUEST_NSS_SYMBOL_FILE) \ diff --git a/tools/nss/meson.build b/tools/nss/meson.build index 9bccdafd19b..ef75ffe0010 100644 --- a/tools/nss/meson.build +++ b/tools/nss/meson.build @@ -15,6 +15,10 @@ nss_sources = [ 'libvirt_nss_leases.c', ] +nss_guest_sources = [ + 'libvirt_nss_macs.c', +] + nss_libvirt_impl = static_library( 'nss_libvirt_impl', [ @@ -28,3 +32,19 @@ nss_libvirt_impl = static_library( yajl_dep, ], ) + +nss_libvirt_guest_impl = static_library( + 'nss_libvirt_guest_impl', + [ + nss_sources, + nss_guest_sources, + ], + c_args: [ + '-DLIBVIRT_NSS', + '-DLIBVIRT_NSS_GUEST', + ], + dependencies: [ + tools_dep, + yajl_dep, + ], +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 18 ------------------ tools/nss/meson.build | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index b1388280fef..d33e5a20885 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -50,23 +50,6 @@ wireshark/src/libvirt/protocol.h: wireshark/util/genxdrstub.pl \ endif WITH_WIRESHARK_DISSECTOR if WITH_NSS -nss_libnss_libvirt_la_SOURCES = -nss_libnss_libvirt_la_LDFLAGS = \ - $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_NSS_SYMBOL_FILE) \ - $(AM_LDFLAGS) \ - -module \ - -export-dynamic \ - -avoid-version \ - -shared \ - -shrext .so.$(NSS_SO_VER) - -nss_libnss_libvirt_la_LIBADD = \ - nss/libnss_libvirt_impl.la - -nss_libnss_libvirt_la_DEPENDENCIES = \ - $(nss_libnss_libvirt_la_LIBADD) \ - $(LIBVIRT_NSS_SYMBOL_FILE) - nss_libnss_libvirt_guest_la_SOURCES = nss_libnss_libvirt_guest_la_LDFLAGS = \ $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_GUEST_NSS_SYMBOL_FILE) \ @@ -85,7 +68,6 @@ nss_libnss_libvirt_guest_la_DEPENDENCIES = \ $(LIBVIRT_GUEST_NSS_SYMBOL_FILE) lib_LTLIBRARIES = \ - nss/libnss_libvirt.la \ nss/libnss_libvirt_guest.la endif WITH_NSS diff --git a/tools/nss/meson.build b/tools/nss/meson.build index ef75ffe0010..cfdcc1fe774 100644 --- a/tools/nss/meson.build +++ b/tools/nss/meson.build @@ -48,3 +48,23 @@ nss_libvirt_guest_impl = static_library( yajl_dep, ], ) + +nss_libvirt_syms = '@0@@1@'.format( + version_script_flags, + meson.current_source_dir() / nss_sym_file, +) + +nss_libvirt_lib = shared_module( + 'nss_libvirt', + name_prefix: nss_prefix, + name_suffix: 'so.@0@'.format(nss_so_ver), + link_args: [ + nss_libvirt_syms, + libvirt_export_dynamic, + ], + link_whole: [ + nss_libvirt_impl, + ], + install: true, + install_dir: libdir, +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 23 ----------------------- tools/nss/meson.build | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index d33e5a20885..4cb0a07afb8 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -48,26 +48,3 @@ wireshark/src/libvirt/protocol.h: wireshark/util/genxdrstub.pl \ $(WS_DISSECTOR_PROTO_FILES) endif WITH_WIRESHARK_DISSECTOR - -if WITH_NSS -nss_libnss_libvirt_guest_la_SOURCES = -nss_libnss_libvirt_guest_la_LDFLAGS = \ - $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_GUEST_NSS_SYMBOL_FILE) \ - $(AM_LDFLAGS) \ - -module \ - -export-dynamic \ - -avoid-version \ - -shared \ - -shrext .so.$(NSS_SO_VER) - -nss_libnss_libvirt_guest_la_LIBADD = \ - nss/libnss_libvirt_guest_impl.la - -nss_libnss_libvirt_guest_la_DEPENDENCIES = \ - $(nss_libnss_libvirt_guest_la_LIBADD) \ - $(LIBVIRT_GUEST_NSS_SYMBOL_FILE) - -lib_LTLIBRARIES = \ - nss/libnss_libvirt_guest.la - -endif WITH_NSS diff --git a/tools/nss/meson.build b/tools/nss/meson.build index cfdcc1fe774..b07bfa4be8b 100644 --- a/tools/nss/meson.build +++ b/tools/nss/meson.build @@ -54,6 +54,11 @@ nss_libvirt_syms = '@0@@1@'.format( meson.current_source_dir() / nss_sym_file, ) +nss_libvirt_guest_syms = '@0@@1@'.format( + version_script_flags, + meson.current_source_dir() / nss_guest_sym_file, +) + nss_libvirt_lib = shared_module( 'nss_libvirt', name_prefix: nss_prefix, @@ -68,3 +73,18 @@ nss_libvirt_lib = shared_module( install: true, install_dir: libdir, ) + +nss_libvirt_guest_lib = shared_library( + 'nss_libvirt_guest', + name_prefix: nss_prefix, + name_suffix: 'so.@0@'.format(nss_so_ver), + link_args: [ + nss_libvirt_guest_syms, + libvirt_export_dynamic, + ], + link_whole: [ + nss_libvirt_guest_impl, + ], + install: true, + install_dir: libdir, +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/meson.build | 4 ++++ tools/wireshark/meson.build | 1 + 2 files changed, 5 insertions(+) create mode 100644 tools/wireshark/meson.build diff --git a/tools/meson.build b/tools/meson.build index 52d997d2e73..f2c2af764b7 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -286,3 +286,7 @@ endif if conf.has('WITH_NSS') subdir('nss') endif + +if wireshark_dep.found() + subdir('wireshark') +endif diff --git a/tools/wireshark/meson.build b/tools/wireshark/meson.build new file mode 100644 index 00000000000..a71bc04eb37 --- /dev/null +++ b/tools/wireshark/meson.build @@ -0,0 +1 @@ +genxdrstup_prog = find_program('util/genxdrstub.pl') -- 2.26.2

Instead of using environment variables pass the values to the script as arguments. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/wireshark/util/genxdrstub.pl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/wireshark/util/genxdrstub.pl b/tools/wireshark/util/genxdrstub.pl index cae64b2f49c..8adbebdbab1 100755 --- a/tools/wireshark/util/genxdrstub.pl +++ b/tools/wireshark/util/genxdrstub.pl @@ -30,7 +30,10 @@ use File::Spec; my $DEBUG = 0; # Enable if you want to see debug output sub dbg { print STDERR @_ if $DEBUG } -die "ERROR: No arguments" unless @ARGV; +die "ERROR: No arguments" unless @ARGV >= 3; + +my $libvirt_version = shift; +my $builddir = shift; # Context object referenced from entire this script my $c = Context->new; @@ -559,7 +562,7 @@ sub add_header_file { local $self->{header_contents} = []; $self->print("/* *DO NOT MODIFY* this file directly.\n"); - $self->print(" * This file was generated by $0 from libvirt version $ENV{LIBVIRT_VERSION} */\n"); + $self->print(" * This file was generated by $0 from libvirt version $libvirt_version */\n"); my $ucname = uc $name; $self->print("#ifndef _$ucname\_H_\n"); $self->print("#define _$ucname\_H_\n"); @@ -576,7 +579,7 @@ sub finalize { for my $header (@{ $self->{headers} || [] }) { my ($name, $contents) = @$header; - my $file = File::Spec->catfile($ENV{PWD}, 'libvirt', "$name.h"); + my $file = File::Spec->catfile($builddir, "$name.h"); open my $fh, '>', $file or die "Cannot open file $file: $!"; CORE::print $fh map { ref($_) ? ($_->{refcnt} ? $_->{body} : ()) : $_ } @$contents; -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tools/Makefile.am | 13 ------------- tools/wireshark/meson.build | 2 ++ tools/wireshark/src/libvirt/meson.build | 20 ++++++++++++++++++++ tools/wireshark/src/meson.build | 1 + 4 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 tools/wireshark/src/libvirt/meson.build create mode 100644 tools/wireshark/src/meson.build diff --git a/tools/Makefile.am b/tools/Makefile.am index 4cb0a07afb8..b42bcf29c53 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -33,18 +33,5 @@ wireshark_src_libvirt_la_SOURCES = \ wireshark/src/packet-libvirt.c: wireshark/src/packet-libvirt.h \ wireshark/src/libvirt/protocol.h -WS_DISSECTOR_PROTO_FILES = \ - $(abs_top_srcdir)/src/remote/remote_protocol.x \ - $(abs_top_srcdir)/src/remote/qemu_protocol.x \ - $(abs_top_srcdir)/src/remote/lxc_protocol.x \ - $(abs_top_srcdir)/src/rpc/virkeepaliveprotocol.x - -wireshark/src/libvirt/protocol.h: wireshark/util/genxdrstub.pl \ - $(WS_DISSECTOR_PROTO_FILES) - $(AM_V_GEN)$(MKDIR_P) wireshark/src/libvirt && \ - cd wireshark/src && \ - LIBVIRT_VERSION=$(LIBVIRT_VERSION) \ - $(PERL) $(abs_top_srcdir)/tools/wireshark/util/genxdrstub.pl \ - $(WS_DISSECTOR_PROTO_FILES) endif WITH_WIRESHARK_DISSECTOR diff --git a/tools/wireshark/meson.build b/tools/wireshark/meson.build index a71bc04eb37..cb43a0640d9 100644 --- a/tools/wireshark/meson.build +++ b/tools/wireshark/meson.build @@ -1 +1,3 @@ genxdrstup_prog = find_program('util/genxdrstub.pl') + +subdir('src') diff --git a/tools/wireshark/src/libvirt/meson.build b/tools/wireshark/src/libvirt/meson.build new file mode 100644 index 00000000000..9d54f827d37 --- /dev/null +++ b/tools/wireshark/src/libvirt/meson.build @@ -0,0 +1,20 @@ +wireshark_protocol = custom_target( + 'protocol.h', + input: [ + meson.source_root() / 'src' / 'remote' / 'remote_protocol.x', + meson.source_root() / 'src' / 'remote' / 'qemu_protocol.x', + meson.source_root() / 'src' / 'remote' / 'lxc_protocol.x', + meson.source_root() / 'src' / 'rpc' / 'virkeepaliveprotocol.x', + ], + output: [ + 'protocol.h', + 'remote.h', + 'qemu.h', + 'lxc.h', + 'keepalive.h', + ], + command: [ + genxdrstup_prog, meson.project_version(), + meson.current_build_dir(), '@INPUT@', + ], +) diff --git a/tools/wireshark/src/meson.build b/tools/wireshark/src/meson.build new file mode 100644 index 00000000000..f41189ba8df --- /dev/null +++ b/tools/wireshark/src/meson.build @@ -0,0 +1 @@ +subdir('libvirt') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 2 +- configure.ac | 3 +-- tools/Makefile.am | 37 --------------------------------- tools/wireshark/src/meson.build | 16 ++++++++++++++ 4 files changed, 18 insertions(+), 40 deletions(-) delete mode 100644 tools/Makefile.am diff --git a/Makefile.am b/Makefile.am index 0b62d15eef5..363c5cf66fd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,7 +20,7 @@ # so force it explicitly DISTCHECK_CONFIGURE_FLAGS = --enable-werror -SUBDIRS = . tools docs \ +SUBDIRS = . docs \ tests po examples XZ_OPT ?= -v -T0 diff --git a/configure.ac b/configure.ac index 24724e3755a..20926ee9f19 100644 --- a/configure.ac +++ b/configure.ac @@ -116,6 +116,5 @@ AC_CONFIG_FILES([\ libvirt.spec mingw-libvirt.spec \ po/Makefile \ examples/Makefile \ - tests/Makefile \ - tools/Makefile]) + tests/Makefile]) AC_OUTPUT diff --git a/tools/Makefile.am b/tools/Makefile.am deleted file mode 100644 index b42bcf29c53..00000000000 --- a/tools/Makefile.am +++ /dev/null @@ -1,37 +0,0 @@ -## Copyright (C) 2005-2016 Red Hat, Inc. -## Copyright (C) 2013 Yuto KAWAMURA(kawamuray) <kawamuray.dadada@gmail.com> -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library. If not, see -## <http://www.gnu.org/licenses/>. - -# We do not want to accidentally include stuff from src/ -# dir or public API dir. Specific files can -# still be included via their path relative to the root if -# needed -if WITH_WIRESHARK_DISSECTOR - -ws_plugin_LTLIBRARIES = wireshark/src/libvirt.la -wireshark_src_libvirt_la_CFLAGS = \ - -I wireshark/src $(WIRESHARK_DISSECTOR_CFLAGS) $(XDR_CFLAGS) $(AM_CFLAGS) -wireshark_src_libvirt_la_LDFLAGS = -avoid-version -module -wireshark_src_libvirt_la_SOURCES = \ - wireshark/src/packet-libvirt.h \ - wireshark/src/packet-libvirt.c \ - wireshark/src/plugin.c - -wireshark/src/packet-libvirt.c: wireshark/src/packet-libvirt.h \ - wireshark/src/libvirt/protocol.h - - -endif WITH_WIRESHARK_DISSECTOR diff --git a/tools/wireshark/src/meson.build b/tools/wireshark/src/meson.build index f41189ba8df..49ccc9bb86e 100644 --- a/tools/wireshark/src/meson.build +++ b/tools/wireshark/src/meson.build @@ -1 +1,17 @@ subdir('libvirt') + +shared_library( + 'virt', + [ + 'packet-libvirt.c', + 'plugin.c', + wireshark_protocol, + ], + dependencies: [ + wireshark_dep, + xdr_dep, + tools_dep, + ], + install: true, + install_dir: wireshark_plugindir, +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- meson.build | 2 ++ tests/Makefile.am | 32 -------------------------------- tests/meson.build | 30 ++++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 32 deletions(-) create mode 100644 tests/meson.build diff --git a/meson.build b/meson.build index b623ddbf4fd..2e894df1ab2 100644 --- a/meson.build +++ b/meson.build @@ -2205,6 +2205,8 @@ subdir('src') subdir('tools') +subdir('tests') + # generate meson-config.h file configure_file(output: 'meson-config.h', configuration: conf) diff --git a/tests/Makefile.am b/tests/Makefile.am index 1b384f3d0c2..79fc271ac64 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,38 +16,6 @@ ## License along with this library. If not, see ## <http://www.gnu.org/licenses/>. -AM_CPPFLAGS = \ - -I$(top_builddir) -I$(top_srcdir) \ - -I$(top_builddir)/include -I$(top_srcdir)/include \ - -I$(top_builddir)/src -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/util \ - -I$(top_srcdir)/src/conf \ - -I$(top_srcdir)/src/hypervisor \ - -I$(top_builddir)/src/rpc \ - $(NULL) - -WARN_CFLAGS += $(RELAXED_FRAME_LIMIT_CFLAGS) - -AM_CFLAGS = \ - -Dabs_builddir="\"$(abs_builddir)\"" \ - -Dabs_top_builddir="\"$(abs_top_builddir)\"" \ - -Dabs_srcdir="\"$(abs_srcdir)\"" \ - -Dabs_top_srcdir="\"$(abs_top_srcdir)\"" \ - $(LIBXML_CFLAGS) \ - $(GLIB_CFLAGS) \ - $(LIBNL_CFLAGS) \ - $(GNUTLS_CFLAGS) \ - $(SASL_CFLAGS) \ - $(SELINUX_CFLAGS) \ - $(APPARMOR_CFLAGS) \ - $(YAJL_CFLAGS) \ - $(COVERAGE_CFLAGS) \ - $(XDR_CFLAGS) \ - $(WARN_CFLAGS) - -AM_LDFLAGS = \ - -export-dynamic - MOCKLIBS_LDFLAGS = -avoid-version \ -rpath /evil/libtool/hack/to/force/shared/lib/creation \ $(MINGW_EXTRA_LDFLAGS) diff --git a/tests/meson.build b/tests/meson.build new file mode 100644 index 00000000000..ab4acbbea9d --- /dev/null +++ b/tests/meson.build @@ -0,0 +1,30 @@ +tests_dep = declare_dependency( + compile_args: [ + '-Dabs_builddir="@0@"'.format(meson.current_build_dir()), + '-Dabs_top_builddir="@0@"'.format(meson.build_root()), + '-Dabs_srcdir="@0@"'.format(meson.current_source_dir()), + '-Dabs_top_srcdir="@0@"'.format(meson.source_root()), + ] + coverage_flags + cc_flags_relaxed_frame_limit, + dependencies: [ + apparmor_dep, + dlopen_dep, + glib_dep, + gnutls_dep, + libnl_dep, + libxml_dep, + rpc_dep, + sasl_dep, + selinux_dep, + xdr_dep, + yajl_dep, + ], + include_directories: [ + conf_inc_dir, + hypervisor_inc_dir, + libvirt_inc, + src_inc_dir, + top_inc_dir, + util_inc_dir, + ], + link_args: libvirt_export_dynamic, +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 201 +--------------------------------------------- tests/meson.build | 89 ++++++++++++++++++++ 2 files changed, 90 insertions(+), 200 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 79fc271ac64..3cdeedb2308 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,10 +16,6 @@ ## License along with this library. If not, see ## <http://www.gnu.org/licenses/>. -MOCKLIBS_LDFLAGS = -avoid-version \ - -rpath /evil/libtool/hack/to/force/shared/lib/creation \ - $(MINGW_EXTRA_LDFLAGS) - DRIVERLIB_LDFLAGS = \ -avoid-version \ -rpath /evil/libtool/hack/to/force/shared/lib/creation \ @@ -39,9 +35,6 @@ LDADDS = \ $(GLIB_LIBS) \ $(NULL) -MOCKLIBS_LIBS = \ - ../src/libvirt.la - test_helpers = commandhelper ssh test_programs = virshtest sockettest \ virhostcputest virbuftest \ @@ -79,22 +72,6 @@ test_programs = virshtest sockettest \ virerrortest \ $(NULL) -test_libraries = libshunload.la \ - libvirportallocatormock.la \ - libvirnetdaemonmock.la \ - libvirnetserverclientmock.la \ - libvircgroupmock.la \ - libvirhostdevmock.la \ - libvirpcimock.la \ - libvirnetdevmock.la \ - libvirrandommock.la \ - libvirprocessmock.la \ - libvirhostcpumock.la \ - libdomaincapsmock.la \ - libvirfilecachemock.la \ - libqemuhotplugmock.la \ - $(NULL) - if WITH_REMOTE test_programs += \ virnetmessagetest \ @@ -111,12 +88,6 @@ test_programs += fchosttest test_programs += scsihosttest test_programs += vircaps2xmltest test_programs += virresctrltest -test_libraries += libvirusbmock.la \ - libvirnetdevbandwidthmock.la \ - libvirnumamock.la \ - libvirtestmock.la \ - libvirfilemock.la \ - $(NULL) endif WITH_LINUX if WITH_LIBVIRTD @@ -127,7 +98,6 @@ if WITH_DBUS test_programs += virdbustest \ virsystemdtest \ $(NULL) -test_libraries += libvirdbusmock.la if WITH_POLKIT test_programs += virpolkittest endif WITH_POLKIT @@ -150,7 +120,7 @@ ssh_LDADD = $(COVERAGE_LDFLAGS) if WITH_LIBXL test_programs += xlconfigtest \ xmconfigtest libxlxml2domconfigtest -test_libraries += libxltestdriver.la libxlmock.la +test_libraries += libxltestdriver.la endif WITH_LIBXL if WITH_QEMU @@ -169,10 +139,6 @@ test_programs += qemuxml2argvtest qemuxml2xmltest \ test_helpers += qemucapsprobe test_libraries += libqemumonitortestutils.la \ libqemutestdriver.la \ - libqemuxml2argvmock.la \ - libqemucaps2xmlmock.la \ - libqemucapsprobemock.la \ - libqemucpumock.la \ $(NULL) endif WITH_QEMU @@ -202,7 +168,6 @@ endif WITH_VMWARE if WITH_BHYVE test_programs += bhyvexml2argvtest bhyvexml2xmltest bhyveargv2xmltest -test_libraries += libbhyvexml2argvmock.la libbhyveargv2xmlmock.la endif WITH_BHYVE if WITH_YAJL @@ -253,7 +218,6 @@ endif WITH_LINUX if WITH_NSS test_helpers += nsslinktest nssguestlinktest test_programs += nsstest nssguesttest -test_libraries += libnssmock.la endif WITH_NSS test_programs += storagevolxml2xmltest @@ -391,12 +355,6 @@ libxlxml2domconfigtest_SOURCES = \ testutils.c testutils.h libxlxml2domconfigtest_LDADD = libxltestdriver.la \ $(libxl_LDADDS) $(LIBXML_LIBS) - -libxlmock_la_SOURCES = \ - libxlmock.c -libxlmock_la_CFLAGS = $(LIBXL_CFLAGS) $(LIBXML_CFLAGS) $(GLIB_CFLAGS) -libxlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libxlmock_la_LIBADD = $(MOCKLIBS_LIBS) endif ! WITH_LIBXL QEMUMONITORTESTUTILS_SOURCES = \ @@ -419,16 +377,6 @@ libqemutestdriver_la_SOURCES = libqemutestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS) libqemutestdriver_la_LIBADD = $(qemu_LDADDS) -libqemucpumock_la_SOURCES = \ - qemucpumock.c testutilshostcpus.h -libqemucpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libqemucpumock_la_LIBADD = $(MOCKLIBS_LIBS) - -libqemuhotplugmock_la_SOURCES = \ - qemuhotplugmock.c -libqemuhotplugmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libqemuhotplugmock_la_LIBADD = $(MOCKLIBS_LIBS) - qemuxml2argvtest_SOURCES = \ qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \ testutils.c testutils.h \ @@ -437,11 +385,6 @@ qemuxml2argvtest_SOURCES = \ qemuxml2argvtest_LDADD = libqemutestdriver.la libqemumonitortestutils.la \ $(LDADDS) $(LIBXML_LIBS) -libqemuxml2argvmock_la_SOURCES = \ - qemuxml2argvmock.c -libqemuxml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libqemuxml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS) - qemuxml2xmltest_SOURCES = \ qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \ testutils.c testutils.h \ @@ -469,11 +412,6 @@ qemucapsprobe_SOURCES = \ qemucapsprobe_LDADD = \ libqemutestdriver.la $(LDADDS) -libqemucapsprobemock_la_SOURCES = \ - qemucapsprobemock.c -libqemucapsprobemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libqemucapsprobemock_la_LIBADD = $(MOCKLIBS_LIBS) - qemucommandutiltest_SOURCES = \ qemucommandutiltest.c \ testutils.c testutils.h \ @@ -489,11 +427,6 @@ qemucaps2xmltest_SOURCES = \ $(NULL) qemucaps2xmltest_LDADD = $(qemu_LDADDS) -libqemucaps2xmlmock_la_SOURCES = \ - qemucaps2xmlmock.c -libqemucaps2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libqemucaps2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS) - qemuagenttest_SOURCES = \ qemuagenttest.c \ testutils.c testutils.h \ @@ -633,16 +566,6 @@ vmwarevertest_LDADD = $(LDADDS) endif ! WITH_VMWARE if WITH_BHYVE -libbhyvexml2argvmock_la_SOURCES = \ - bhyvexml2argvmock.c -libbhyvexml2argvmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libbhyvexml2argvmock_la_LIBADD = $(MOCKLIBS_LIBS) - -libbhyveargv2xmlmock_la_SOURCES = \ - bhyveargv2xmlmock.c -libbhyveargv2xmlmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libbhyveargv2xmlmock_la_LIBADD = $(MOCKLIBS_LIBS) - bhyve_LDADDS = \ ../src/libvirt_driver_bhyve_impl.la \ $(LDADDS) \ @@ -880,10 +803,6 @@ vircapstest_LDADD += ../src/libvirt_driver_lxc_impl.la endif WITH_LXC vircapstest_LDADD += $(LDADDS) -libdomaincapsmock_la_SOURCES = domaincapsmock.c -libdomaincapsmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libdomaincapsmock_la_LIBADD = $(MOCKLIBS_LIBS) - domaincapstest_SOURCES = \ domaincapstest.c testutils.h testutils.c \ virfilewrapper.c virfilewrapper.h \ @@ -917,21 +836,11 @@ virnetdaemontest_SOURCES = \ testutils.h testutils.c virnetdaemontest_LDADD = $(LDADDS) -libvirnetdaemonmock_la_SOURCES = \ - virnetdaemonmock.c -libvirnetdaemonmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libvirnetdaemonmock_la_LIBADD = $(MOCKLIBS_LIBS) - virnetserverclienttest_SOURCES = \ virnetserverclienttest.c \ testutils.h testutils.c virnetserverclienttest_LDADD = $(LDADDS) -libvirnetserverclientmock_la_SOURCES = \ - virnetserverclientmock.c -libvirnetserverclientmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libvirnetserverclientmock_la_LIBADD = $(MOCKLIBS_LIBS) - virnettlscontexttest_SOURCES = \ virnettlscontexttest.c \ virnettlshelpers.h virnettlshelpers.c \ @@ -997,20 +906,10 @@ virportallocatortest_SOURCES = \ virportallocatortest.c testutils.h testutils.c virportallocatortest_LDADD = $(LDADDS) -libvirportallocatormock_la_SOURCES = \ - virportallocatormock.c -libvirportallocatormock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libvirportallocatormock_la_LIBADD = $(MOCKLIBS_LIBS) - vircgrouptest_SOURCES = \ vircgrouptest.c testutils.h testutils.c vircgrouptest_LDADD = $(LDADDS) -libvircgroupmock_la_SOURCES = \ - vircgroupmock.c -libvircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libvircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS) - vircryptotest_SOURCES = \ vircryptotest.c testutils.h testutils.c vircryptotest_LDADD = $(LDADDS) @@ -1023,56 +922,14 @@ virpcitest_SOURCES = \ virpcitest.c testutils.h testutils.c virpcitest_LDADD = $(LDADDS) -libvirpcimock_la_SOURCES = \ - virpcimock.c -libvirpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libvirpcimock_la_LIBADD = $(MOCKLIBS_LIBS) - -libvirrandommock_la_SOURCES = \ - virrandommock.c -libvirrandommock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libvirrandommock_la_LIBADD = $(MOCKLIBS_LIBS) - -libvirprocessmock_la_SOURCES = \ - virprocessmock.c -libvirprocessmock_la_CFLAGS = $(AM_CFLAGS) -libvirprocessmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libvirprocessmock_la_LIBADD = $(MOCKLIBS_LIBS) - -libvirhostcpumock_la_SOURCES = \ - virhostcpumock.c -libvirhostcpumock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libvirhostcpumock_la_LIBADD = $(MOCKLIBS_LIBS) - -libvirfilecachemock_la_SOURCES = \ - virfilecachemock.c -libvirfilecachemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libvirfilecachemock_la_LIBADD = $(MOCKLIBS_LIBS) - -libvirhostdevmock_la_SOURCES = \ - virhostdevmock.c \ - $(NULL) -libvirhostdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libvirhostdevmock_la_LIBADD = $(MOCKLIBS_LIBS) - if WITH_LINUX vircaps2xmltest_SOURCES = \ vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c vircaps2xmltest_LDADD = $(LDADDS) -libvirnumamock_la_SOURCES = \ - virnumamock.c -libvirnumamock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libvirnumamock_la_LIBADD = $(MOCKLIBS_LIBS) - virresctrltest_SOURCES = \ virresctrltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c virresctrltest_LDADD = $(LDADDS) - -libvirfilemock_la_SOURCES = \ - virfilemock.c -libvirfilemock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libvirfilemock_la_LIBADD = $(MOCKLIBS_LIBS) endif ! WITH_LINUX if WITH_NSS @@ -1095,11 +952,6 @@ nssguesttest_LDADD = \ $(LDADDS) \ ../tools/nss/libnss_libvirt_guest_impl.la -libnssmock_la_SOURCES = \ - nssmock.c -libnssmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libnssmock_la_LIBADD = $(MOCKLIBS_LIBS) - ## Intentionaly not linking with anything else. ## See the test source for more detailed explanation. nsslinktest_SOURCES = nsslinktest.c @@ -1118,13 +970,6 @@ nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la nssguestlinktest_LDFLAGS = $(NULL) endif ! WITH_NSS -libvirdeterministichashmock_la_SOURCES = \ - virdeterministichashmock.c -libvirdeterministichashmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libvirdeterministichashmock_la_LIBADD = $(MOCKLIBS_LIBS) - -test_libraries += libvirdeterministichashmock.la - if WITH_YAJL virmacmaptest_SOURCES = \ virmacmaptest.c testutils.h testutils.c @@ -1144,12 +989,6 @@ virnetdevtest_SOURCES = \ virnetdevtest_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS) virnetdevtest_LDADD = $(LDADDS) -libvirnetdevmock_la_SOURCES = \ - virnetdevmock.c -libvirnetdevmock_la_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS) -libvirnetdevmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libvirnetdevmock_la_LIBADD = $(MOCKLIBS_LIBS) - virrotatingfiletest_SOURCES = \ virrotatingfiletest.c testutils.h testutils.c virrotatingfiletest_LDADD = $(LDADDS) @@ -1162,25 +1001,6 @@ virusbtest_LDADD = $(LDADDS) virnetdevbandwidthtest_SOURCES = \ virnetdevbandwidthtest.c testutils.h testutils.c virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS) - -libvirusbmock_la_SOURCES = virusbmock.c -libvirusbmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libvirusbmock_la_LIBADD = $(MOCKLIBS_LIBS) \ - $(PROBES_O) \ - ../src/libvirt_util.la - -libvirnetdevbandwidthmock_la_SOURCES = \ - virnetdevbandwidthmock.c -libvirnetdevbandwidthmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libvirnetdevbandwidthmock_la_LIBADD = $(MOCKLIBS_LIBS) - -libvirtestmock_la_SOURCES = \ - virtestmock.c -libvirtestmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libvirtestmock_la_LIBADD = \ - $(MOCKLIBS_LIBS) \ - $(PROBES_O) \ - ../src/libvirt_util.la endif ! WITH_LINUX if WITH_DBUS @@ -1189,12 +1009,6 @@ virdbustest_SOURCES = \ virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS) virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS) -libvirdbusmock_la_SOURCES = \ - virdbusmock.c -libvirdbusmock_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS) -libvirdbusmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) -libvirdbusmock_la_LIBADD = $(MOCKLIBS_LIBS) - virpolkittest_SOURCES = \ virpolkittest.c testutils.h testutils.c virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS) @@ -1224,15 +1038,6 @@ seclabeltest_LDADD = $(LDADDS) if WITH_SECDRIVER_SELINUX if WITH_ATTR -if WITH_TESTS -noinst_LTLIBRARIES += libsecurityselinuxhelper.la -else ! WITH_TESTS -check_LTLIBRARIES += libsecurityselinuxhelper.la -endif ! WITH_TESTS - -libsecurityselinuxhelper_la_SOURCES = \ - securityselinuxhelper.c -libsecurityselinuxhelper_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) securityselinuxtest_SOURCES = \ securityselinuxtest.c testutils.h testutils.c @@ -1304,10 +1109,6 @@ eventtest_SOURCES = \ eventtest_LDADD = $(LDADDS) endif WITH_LIBVIRTD -libshunload_la_SOURCES = shunloadhelper.c -libshunload_la_LIBADD = ../src/libvirt.la -libshunload_la_LDFLAGS = $(MOCKLIBS_LDFLAGS) - shunloadtest_SOURCES = \ shunloadtest.c shunloadtest_LDADD = $(THREAD_LIBS) $(DLOPEN_LIBS) diff --git a/tests/meson.build b/tests/meson.build index ab4acbbea9d..ca6e5b5f74d 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -28,3 +28,92 @@ tests_dep = declare_dependency( ], link_args: libvirt_export_dynamic, ) + + +# mock_libs: +# each entry is a dictionary with following items: +# * name - mock library name which is also used as default source file name (required) +# * sources - override default sources based on name (optional, default []) +# * deps - additional dependencies (optional, default []) + +mock_libs = [ + { 'name': 'domaincapsmock' }, + { 'name': 'shunload', 'sources': [ 'shunloadhelper.c' ] }, + { 'name': 'vircgroupmock' }, + { 'name': 'virdeterministichashmock' }, + { 'name': 'virfilecachemock' }, + { 'name': 'virhostcpumock' }, + { 'name': 'virhostdevmock' }, + { 'name': 'virnetdaemonmock' }, + { 'name': 'virnetdevmock' }, + { 'name': 'virnetserverclientmock' }, + { 'name': 'virpcimock' }, + { 'name': 'virportallocatormock' }, + { 'name': 'virprocessmock' }, + { 'name': 'virrandommock' }, +] + +if host_machine.system() == 'linux' + mock_libs += [ + { 'name': 'virfilemock' }, + { 'name': 'virnetdevbandwidthmock' }, + { 'name': 'virnumamock' }, + { 'name': 'virtestmock' }, + { 'name': 'virusbmock' }, + ] +endif + +if conf.has('WITH_BHYVE') + mock_libs += [ + { 'name': 'bhyveargv2xmlmock' }, + { 'name': 'bhyvexml2argvmock' }, + ] +endif + +if conf.has('WITH_DBUS') + mock_libs += [ + { 'name': 'virdbusmock', 'deps': [ dbus_dep ] }, + ] +endif + +if conf.has('WITH_LIBXL') + mock_libs += [ + { 'name': 'xlmock', 'sources': [ 'libxlmock.c' ], 'deps': [ libxl_dep ] }, + ] +endif + +if conf.has('WITH_NSS') + mock_libs += [ + { 'name': 'nssmock' }, + ] +endif + +if conf.has('WITH_QEMU') + mock_libs += [ + { 'name': 'qemucaps2xmlmock' }, + { 'name': 'qemucapsprobemock' }, + { 'name': 'qemucpumock' }, + { 'name': 'qemuhotplugmock' }, + { 'name': 'qemuxml2argvmock' }, + ] +endif + +if conf.has('WITH_SECDRIVER_SELINUX') + mock_libs += [ + { 'name': 'securityselinuxhelper' }, + ] +endif + +foreach mock : mock_libs + shared_module( + mock['name'], + mock.get('sources', [ '@0@.c'.format(mock['name']) ]), + dependencies: [ + tests_dep, + mock.get('deps', []), + ], + link_with: [ + libvirt_lib, + ], + ) +endforeach -- 2.26.2

With the old build system we just list the source files directly for each test, but this would not work as expected with Meson. For every binary there is a separate directory with its object files which would mean all the utils sources would be compiled repeatedly for every test using them. Having static libraries ensures that the utils sources are compiled only once. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 10 +-------- tests/meson.build | 53 +++++++++++++++++++++++++++++++++++++++++++++++ tests/testutils.c | 2 +- 3 files changed, 55 insertions(+), 10 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 3cdeedb2308..3bc1a791a16 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -137,7 +137,7 @@ test_programs += qemuxml2argvtest qemuxml2xmltest \ qemuvhostusertest \ $(NULL) test_helpers += qemucapsprobe -test_libraries += libqemumonitortestutils.la \ +test_libraries += \ libqemutestdriver.la \ $(NULL) endif WITH_QEMU @@ -357,16 +357,8 @@ libxlxml2domconfigtest_LDADD = libxltestdriver.la \ $(libxl_LDADDS) $(LIBXML_LIBS) endif ! WITH_LIBXL -QEMUMONITORTESTUTILS_SOURCES = \ - qemumonitortestutils.c \ - qemumonitortestutils.h \ - testutilsqemuschema.h testutilsqemuschema.c \ - $(NULL) - if WITH_QEMU -libqemumonitortestutils_la_SOURCES = $(QEMUMONITORTESTUTILS_SOURCES) - qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la if WITH_DTRACE_PROBES qemu_LDADDS += ../src/libvirt_qemu_probes.lo diff --git a/tests/meson.build b/tests/meson.build index ca6e5b5f74d..5cbd3cd2077 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -117,3 +117,56 @@ foreach mock : mock_libs ], ) endforeach + + +# build libraries used by tests + +test_utils_lib = static_library( + 'test_utils', + [ 'testutils.c' ], + dependencies: [ tests_dep ], +) + +if conf.has('WITH_LIBXL') + test_utils_xen_lib = static_library( + 'test_utils_xen', + [ 'testutilsxen.c' ], + dependencies: [ tests_dep ], + ) + +else + test_utils_xen_lib = [] +endif + +if conf.has('WITH_LXC') + test_utils_lxc_lib = static_library( + 'test_utils_lxc', + [ 'testutilslxc.c' ], + dependencies: [ tests_dep ], + ) +else + test_utils_lxc_lib = [] +endif + +if conf.has('WITH_QEMU') + test_utils_qemu_lib = static_library( + 'test_utils_qemu', + [ 'testutilsqemu.c' ], + dependencies: [ tests_dep ], + ) + + test_utils_qemu_monitor_lib = static_library( + 'test_utils_qemu_monitor', + [ 'qemumonitortestutils.c', 'testutilsqemuschema.c' ], + dependencies: [ tests_dep ], + ) +else + test_utils_qemu_lib = [] + test_utils_qemu_monitor_lib = [] +endif + +test_file_wrapper_lib = static_library( + 'test_file_wrapper', + [ 'virfilewrapper.c' ], + dependencies: [ tests_dep ], +) diff --git a/tests/testutils.c b/tests/testutils.c index a1cd093e4e2..3f53f635fc2 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -340,7 +340,7 @@ virTestRewrapFile(const char *filename) script = g_strdup_printf("%s/scripts/test-wrap-argv.py", abs_top_srcdir); - cmd = virCommandNewArgList(PYTHON, script, "--in-place", filename, NULL); + cmd = virCommandNewArgList(PYTHON3, script, "--in-place", filename, NULL); if (virCommandRun(cmd, NULL) < 0) return -1; -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 14 +------------- tests/meson.build | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 3bc1a791a16..eaaae0c0568 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -35,7 +35,7 @@ LDADDS = \ $(GLIB_LIBS) \ $(NULL) -test_helpers = commandhelper ssh +test_helpers = ssh test_programs = virshtest sockettest \ virhostcputest virbuftest \ commandtest seclabeltest \ @@ -759,18 +759,6 @@ commandtest_SOURCES = \ commandtest.c testutils.h testutils.c commandtest_LDADD = $(LDADDS) -# Must not link to any libvirt modules - libc only -# otherwise external libraries might unexpectedly leak -# file descriptors into commandhelper invalidating the -# test logic assumptions -commandhelper_SOURCES = \ - commandhelper.c -commandhelper_LDADD = \ - $(NO_INDIRECT_LDFLAGS) - -commandhelper_LDFLAGS = -static - - virkmodtest_SOURCES = \ virkmodtest.c testutils.h testutils.c virkmodtest_LDADD = $(LDADDS) diff --git a/tests/meson.build b/tests/meson.build index 5cbd3cd2077..fa116a0e249 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -170,3 +170,20 @@ test_file_wrapper_lib = static_library( [ 'virfilewrapper.c' ], dependencies: [ tests_dep ], ) + + +# build helpers used by tests + +# Must not link to any libvirt modules - libc only otherwise external +# libraries might unexpectedly leak file descriptors into commandhelper +# invalidating the test logic assumptions. +executable( + 'commandhelper', + [ 'commandhelper.c' ], + dependencies: [ + tests_dep, + ], + link_args: [ + libvirt_no_indirect, + ], +) -- 2.26.2

On Thu, Jul 16, 2020 at 11:58:37 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 14 +------------- tests/meson.build | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 13 deletions(-)
[...]
diff --git a/tests/meson.build b/tests/meson.build index 5cbd3cd2077..fa116a0e249 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -170,3 +170,20 @@ test_file_wrapper_lib = static_library( [ 'virfilewrapper.c' ], dependencies: [ tests_dep ], ) + + +# build helpers used by tests + +# Must not link to any libvirt modules - libc only otherwise external +# libraries might unexpectedly leak file descriptors into commandhelper +# invalidating the test logic assumptions.
This didn't work out: $ ldd commandtest linux-vdso.so.1 (0x00007ffd24939000) libvirt.so.0 => /home/pipo/build/libvirt/gcc/tests/./../src/libvirt.so.0 (0x00007feeabbf3000) libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007feeabaa8000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007feeaba8d000) libc.so.6 => /lib64/libc.so.6 (0x00007feeab8c3000) libutil.so.1 => /lib64/libutil.so.1 (0x00007feeab8be000) libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x00007feeab865000) libgio-2.0.so.0 => /lib64/libgio-2.0.so.0 (0x00007feeab67f000) libxml2.so.2 => /lib64/libxml2.so.2 (0x00007feeab50f000) libacl.so.1 => /lib64/libacl.so.1 (0x00007feeab504000) libaudit.so.1 => /lib64/libaudit.so.1 (0x00007feeab4d8000) libcap-ng.so.0 => /lib64/libcap-ng.so.0 (0x00007feeab4d0000) libdbus-1.so.3 => /lib64/libdbus-1.so.3 (0x00007feeab479000) libgnutls.so.30 => /lib64/libgnutls.so.30 (0x00007feeab28b000) libnl-3.so.200 => /lib64/libnl-3.so.200 (0x00007feeab267000) libnuma.so.1 => /lib64/libnuma.so.1 (0x00007feeab259000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007feeab22c000) libyajl.so.2 => /lib64/libyajl.so.2 (0x00007feeab220000) libssh2.so.1 => /lib64/libssh2.so.1 (0x00007feeab1de000) libssh.so.4 => /lib64/libssh.so.4 (0x00007feeab16a000) libsasl2.so.3 => /lib64/libsasl2.so.3 (0x00007feeab14a000) libtirpc.so.3 => /lib64/libtirpc.so.3 (0x00007feeab119000) libcurl.so.4 => /lib64/libcurl.so.4 (0x00007feeab085000) libwsman.so.1 => /lib64/libwsman.so.1 (0x00007feeab04b000) libwsman_client.so.4 => /lib64/libwsman_client.so.4 (0x00007feeab03d000) libwsman_curl_client_transport.so.1 => /lib64/libwsman_curl_client_transport.so.1 (0x00007feeab032000) libdl.so.2 => /lib64/libdl.so.2 (0x00007feeab02b000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007feeab009000) /lib64/ld-linux-x86-64.so.2 (0x00007feeac0b2000) libpcre.so.1 => /lib64/libpcre.so.1 (0x00007feeaaf90000) libffi.so.6 => /lib64/libffi.so.6 (0x00007feeaaf85000) libgmodule-2.0.so.0 => /lib64/libgmodule-2.0.so.0 (0x00007feeaaf7d000) libz.so.1 => /lib64/libz.so.1 (0x00007feeaaf63000) libmount.so.1 => /lib64/libmount.so.1 (0x00007feeaaf03000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007feeaaee9000) liblzma.so.5 => /lib64/liblzma.so.5 (0x00007feeaaebf000) libm.so.6 => /lib64/libm.so.6 (0x00007feeaad79000) libattr.so.1 => /lib64/libattr.so.1 (0x00007feeaad6f000) libsystemd.so.0 => /lib64/libsystemd.so.0 (0x00007feeaacb8000) libp11-kit.so.0 => /lib64/libp11-kit.so.0 (0x00007feeaab88000) libidn2.so.0 => /lib64/libidn2.so.0 (0x00007feeaab66000) libunistring.so.2 => /lib64/libunistring.so.2 (0x00007feeaa9e1000) libtasn1.so.6 => /lib64/libtasn1.so.6 (0x00007feeaa9cb000) libnettle.so.7 => /lib64/libnettle.so.7 (0x00007feeaa98c000) libhogweed.so.5 => /lib64/libhogweed.so.5 (0x00007feeaa95a000) libgmp.so.10 => /lib64/libgmp.so.10 (0x00007feeaa8c3000) libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007feeaa82a000) libssl.so.1.1 => /lib64/libssl.so.1.1 (0x00007feeaa793000) libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x00007feeaa4a6000) libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007feeaa44d000) libcrypt.so.2 => /lib64/libcrypt.so.2 (0x00007feeaa412000) libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007feeaa327000) libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007feeaa30e000) libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007feeaa307000) libnghttp2.so.14 => /lib64/libnghttp2.so.14 (0x00007feeaa2db000) libpsl.so.5 => /lib64/libpsl.so.5 (0x00007feeaa2c6000) libldap-2.4.so.2 => /lib64/libldap-2.4.so.2 (0x00007feeaa274000) liblber-2.4.so.2 => /lib64/liblber-2.4.so.2 (0x00007feeaa263000) libbrotlidec.so.1 => /lib64/libbrotlidec.so.1 (0x00007feeaa254000) libblkid.so.1 => /lib64/libblkid.so.1 (0x00007feeaa201000) librt.so.1 => /lib64/librt.so.1 (0x00007feeaa1f4000) liblz4.so.1 => /lib64/liblz4.so.1 (0x00007feeaa1d3000) libgcrypt.so.20 => /lib64/libgcrypt.so.20 (0x00007feeaa0b2000) libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007feeaa0a0000) libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007feeaa099000) libbrotlicommon.so.1 => /lib64/libbrotlicommon.so.1 (0x00007feeaa074000) libgpg-error.so.0 => /lib64/libgpg-error.so.0 (0x00007feeaa050000) Pre-meson: $ ldd commandhelper linux-vdso.so.1 (0x00007ffc6719f000) libutil.so.1 => /lib64/libutil.so.1 (0x00007fae36bbd000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fae36b9b000) libdl.so.2 => /lib64/libdl.so.2 (0x00007fae36b94000) libc.so.6 => /lib64/libc.so.6 (0x00007fae369ca000) /lib64/ld-linux-x86-64.so.2 (0x00007fae36be4000)

On Tue, Jul 28, 2020 at 12:49:03PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:58:37 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 14 +------------- tests/meson.build | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 13 deletions(-)
[...]
diff --git a/tests/meson.build b/tests/meson.build index 5cbd3cd2077..fa116a0e249 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -170,3 +170,20 @@ test_file_wrapper_lib = static_library( [ 'virfilewrapper.c' ], dependencies: [ tests_dep ], ) + + +# build helpers used by tests + +# Must not link to any libvirt modules - libc only otherwise external +# libraries might unexpectedly leak file descriptors into commandhelper +# invalidating the test logic assumptions.
This didn't work out:
$ ldd commandtest linux-vdso.so.1 (0x00007ffd24939000) libvirt.so.0 => /home/pipo/build/libvirt/gcc/tests/./../src/libvirt.so.0 (0x00007feeabbf3000) libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007feeabaa8000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007feeaba8d000) libc.so.6 => /lib64/libc.so.6 (0x00007feeab8c3000) libutil.so.1 => /lib64/libutil.so.1 (0x00007feeab8be000) libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x00007feeab865000) libgio-2.0.so.0 => /lib64/libgio-2.0.so.0 (0x00007feeab67f000) libxml2.so.2 => /lib64/libxml2.so.2 (0x00007feeab50f000) libacl.so.1 => /lib64/libacl.so.1 (0x00007feeab504000) libaudit.so.1 => /lib64/libaudit.so.1 (0x00007feeab4d8000) libcap-ng.so.0 => /lib64/libcap-ng.so.0 (0x00007feeab4d0000) libdbus-1.so.3 => /lib64/libdbus-1.so.3 (0x00007feeab479000) libgnutls.so.30 => /lib64/libgnutls.so.30 (0x00007feeab28b000) libnl-3.so.200 => /lib64/libnl-3.so.200 (0x00007feeab267000) libnuma.so.1 => /lib64/libnuma.so.1 (0x00007feeab259000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007feeab22c000) libyajl.so.2 => /lib64/libyajl.so.2 (0x00007feeab220000) libssh2.so.1 => /lib64/libssh2.so.1 (0x00007feeab1de000) libssh.so.4 => /lib64/libssh.so.4 (0x00007feeab16a000) libsasl2.so.3 => /lib64/libsasl2.so.3 (0x00007feeab14a000) libtirpc.so.3 => /lib64/libtirpc.so.3 (0x00007feeab119000) libcurl.so.4 => /lib64/libcurl.so.4 (0x00007feeab085000) libwsman.so.1 => /lib64/libwsman.so.1 (0x00007feeab04b000) libwsman_client.so.4 => /lib64/libwsman_client.so.4 (0x00007feeab03d000) libwsman_curl_client_transport.so.1 => /lib64/libwsman_curl_client_transport.so.1 (0x00007feeab032000) libdl.so.2 => /lib64/libdl.so.2 (0x00007feeab02b000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007feeab009000) /lib64/ld-linux-x86-64.so.2 (0x00007feeac0b2000) libpcre.so.1 => /lib64/libpcre.so.1 (0x00007feeaaf90000) libffi.so.6 => /lib64/libffi.so.6 (0x00007feeaaf85000) libgmodule-2.0.so.0 => /lib64/libgmodule-2.0.so.0 (0x00007feeaaf7d000) libz.so.1 => /lib64/libz.so.1 (0x00007feeaaf63000) libmount.so.1 => /lib64/libmount.so.1 (0x00007feeaaf03000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007feeaaee9000) liblzma.so.5 => /lib64/liblzma.so.5 (0x00007feeaaebf000) libm.so.6 => /lib64/libm.so.6 (0x00007feeaad79000) libattr.so.1 => /lib64/libattr.so.1 (0x00007feeaad6f000) libsystemd.so.0 => /lib64/libsystemd.so.0 (0x00007feeaacb8000) libp11-kit.so.0 => /lib64/libp11-kit.so.0 (0x00007feeaab88000) libidn2.so.0 => /lib64/libidn2.so.0 (0x00007feeaab66000) libunistring.so.2 => /lib64/libunistring.so.2 (0x00007feeaa9e1000) libtasn1.so.6 => /lib64/libtasn1.so.6 (0x00007feeaa9cb000) libnettle.so.7 => /lib64/libnettle.so.7 (0x00007feeaa98c000) libhogweed.so.5 => /lib64/libhogweed.so.5 (0x00007feeaa95a000) libgmp.so.10 => /lib64/libgmp.so.10 (0x00007feeaa8c3000) libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007feeaa82a000) libssl.so.1.1 => /lib64/libssl.so.1.1 (0x00007feeaa793000) libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x00007feeaa4a6000) libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007feeaa44d000) libcrypt.so.2 => /lib64/libcrypt.so.2 (0x00007feeaa412000) libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007feeaa327000) libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007feeaa30e000) libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007feeaa307000) libnghttp2.so.14 => /lib64/libnghttp2.so.14 (0x00007feeaa2db000) libpsl.so.5 => /lib64/libpsl.so.5 (0x00007feeaa2c6000) libldap-2.4.so.2 => /lib64/libldap-2.4.so.2 (0x00007feeaa274000) liblber-2.4.so.2 => /lib64/liblber-2.4.so.2 (0x00007feeaa263000) libbrotlidec.so.1 => /lib64/libbrotlidec.so.1 (0x00007feeaa254000) libblkid.so.1 => /lib64/libblkid.so.1 (0x00007feeaa201000) librt.so.1 => /lib64/librt.so.1 (0x00007feeaa1f4000) liblz4.so.1 => /lib64/liblz4.so.1 (0x00007feeaa1d3000) libgcrypt.so.20 => /lib64/libgcrypt.so.20 (0x00007feeaa0b2000) libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007feeaa0a0000) libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007feeaa099000) libbrotlicommon.so.1 => /lib64/libbrotlicommon.so.1 (0x00007feeaa074000) libgpg-error.so.0 => /lib64/libgpg-error.so.0 (0x00007feeaa050000)
Pre-meson:
$ ldd commandhelper linux-vdso.so.1 (0x00007ffc6719f000) libutil.so.1 => /lib64/libutil.so.1 (0x00007fae36bbd000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fae36b9b000) libdl.so.2 => /lib64/libdl.so.2 (0x00007fae36b94000) libc.so.6 => /lib64/libc.so.6 (0x00007fae369ca000) /lib64/ld-linux-x86-64.so.2 (0x00007fae36be4000)
Nice catch, I'll fix that. It's because of using src_dep in dependencies which contains libvirt_lib. I guess during on of the rebases I added that into src_dep. Thanks Pavel

On Tue, Jul 28, 2020 at 01:28:20PM +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 12:49:03PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:58:37 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 14 +------------- tests/meson.build | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 13 deletions(-)
[...]
diff --git a/tests/meson.build b/tests/meson.build index 5cbd3cd2077..fa116a0e249 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -170,3 +170,20 @@ test_file_wrapper_lib = static_library( [ 'virfilewrapper.c' ], dependencies: [ tests_dep ], ) + + +# build helpers used by tests + +# Must not link to any libvirt modules - libc only otherwise external +# libraries might unexpectedly leak file descriptors into commandhelper +# invalidating the test logic assumptions.
This didn't work out:
$ ldd commandtest linux-vdso.so.1 (0x00007ffd24939000) libvirt.so.0 => /home/pipo/build/libvirt/gcc/tests/./../src/libvirt.so.0 (0x00007feeabbf3000) libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007feeabaa8000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007feeaba8d000) libc.so.6 => /lib64/libc.so.6 (0x00007feeab8c3000) libutil.so.1 => /lib64/libutil.so.1 (0x00007feeab8be000) libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x00007feeab865000) libgio-2.0.so.0 => /lib64/libgio-2.0.so.0 (0x00007feeab67f000) libxml2.so.2 => /lib64/libxml2.so.2 (0x00007feeab50f000) libacl.so.1 => /lib64/libacl.so.1 (0x00007feeab504000) libaudit.so.1 => /lib64/libaudit.so.1 (0x00007feeab4d8000) libcap-ng.so.0 => /lib64/libcap-ng.so.0 (0x00007feeab4d0000) libdbus-1.so.3 => /lib64/libdbus-1.so.3 (0x00007feeab479000) libgnutls.so.30 => /lib64/libgnutls.so.30 (0x00007feeab28b000) libnl-3.so.200 => /lib64/libnl-3.so.200 (0x00007feeab267000) libnuma.so.1 => /lib64/libnuma.so.1 (0x00007feeab259000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007feeab22c000) libyajl.so.2 => /lib64/libyajl.so.2 (0x00007feeab220000) libssh2.so.1 => /lib64/libssh2.so.1 (0x00007feeab1de000) libssh.so.4 => /lib64/libssh.so.4 (0x00007feeab16a000) libsasl2.so.3 => /lib64/libsasl2.so.3 (0x00007feeab14a000) libtirpc.so.3 => /lib64/libtirpc.so.3 (0x00007feeab119000) libcurl.so.4 => /lib64/libcurl.so.4 (0x00007feeab085000) libwsman.so.1 => /lib64/libwsman.so.1 (0x00007feeab04b000) libwsman_client.so.4 => /lib64/libwsman_client.so.4 (0x00007feeab03d000) libwsman_curl_client_transport.so.1 => /lib64/libwsman_curl_client_transport.so.1 (0x00007feeab032000) libdl.so.2 => /lib64/libdl.so.2 (0x00007feeab02b000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007feeab009000) /lib64/ld-linux-x86-64.so.2 (0x00007feeac0b2000) libpcre.so.1 => /lib64/libpcre.so.1 (0x00007feeaaf90000) libffi.so.6 => /lib64/libffi.so.6 (0x00007feeaaf85000) libgmodule-2.0.so.0 => /lib64/libgmodule-2.0.so.0 (0x00007feeaaf7d000) libz.so.1 => /lib64/libz.so.1 (0x00007feeaaf63000) libmount.so.1 => /lib64/libmount.so.1 (0x00007feeaaf03000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007feeaaee9000) liblzma.so.5 => /lib64/liblzma.so.5 (0x00007feeaaebf000) libm.so.6 => /lib64/libm.so.6 (0x00007feeaad79000) libattr.so.1 => /lib64/libattr.so.1 (0x00007feeaad6f000) libsystemd.so.0 => /lib64/libsystemd.so.0 (0x00007feeaacb8000) libp11-kit.so.0 => /lib64/libp11-kit.so.0 (0x00007feeaab88000) libidn2.so.0 => /lib64/libidn2.so.0 (0x00007feeaab66000) libunistring.so.2 => /lib64/libunistring.so.2 (0x00007feeaa9e1000) libtasn1.so.6 => /lib64/libtasn1.so.6 (0x00007feeaa9cb000) libnettle.so.7 => /lib64/libnettle.so.7 (0x00007feeaa98c000) libhogweed.so.5 => /lib64/libhogweed.so.5 (0x00007feeaa95a000) libgmp.so.10 => /lib64/libgmp.so.10 (0x00007feeaa8c3000) libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007feeaa82a000) libssl.so.1.1 => /lib64/libssl.so.1.1 (0x00007feeaa793000) libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x00007feeaa4a6000) libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007feeaa44d000) libcrypt.so.2 => /lib64/libcrypt.so.2 (0x00007feeaa412000) libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007feeaa327000) libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007feeaa30e000) libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007feeaa307000) libnghttp2.so.14 => /lib64/libnghttp2.so.14 (0x00007feeaa2db000) libpsl.so.5 => /lib64/libpsl.so.5 (0x00007feeaa2c6000) libldap-2.4.so.2 => /lib64/libldap-2.4.so.2 (0x00007feeaa274000) liblber-2.4.so.2 => /lib64/liblber-2.4.so.2 (0x00007feeaa263000) libbrotlidec.so.1 => /lib64/libbrotlidec.so.1 (0x00007feeaa254000) libblkid.so.1 => /lib64/libblkid.so.1 (0x00007feeaa201000) librt.so.1 => /lib64/librt.so.1 (0x00007feeaa1f4000) liblz4.so.1 => /lib64/liblz4.so.1 (0x00007feeaa1d3000) libgcrypt.so.20 => /lib64/libgcrypt.so.20 (0x00007feeaa0b2000) libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007feeaa0a0000) libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007feeaa099000) libbrotlicommon.so.1 => /lib64/libbrotlicommon.so.1 (0x00007feeaa074000) libgpg-error.so.0 => /lib64/libgpg-error.so.0 (0x00007feeaa050000)
Pre-meson:
$ ldd commandhelper linux-vdso.so.1 (0x00007ffc6719f000) libutil.so.1 => /lib64/libutil.so.1 (0x00007fae36bbd000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fae36b9b000) libdl.so.2 => /lib64/libdl.so.2 (0x00007fae36b94000) libc.so.6 => /lib64/libc.so.6 (0x00007fae369ca000) /lib64/ld-linux-x86-64.so.2 (0x00007fae36be4000)
Nice catch, I'll fix that. It's because of using src_dep in dependencies which contains libvirt_lib. I guess during on of the rebases I added that into src_dep.
So I looked into this and you made a small mistake, for the meson you used ldd commandtest but for autotools you used ldd commandhelper. Whith meson output of ldd commandhelper is: linux-vdso.so.1 (0x00007ffbfb7cd000) libc.so.6 => /lib64/libc.so.6 (0x00007ffbfb5d0000) /lib64/ld-linux-x86-64.so.2 (0x00007ffbfb7cf000) Pavel

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 5 ----- tests/meson.build | 12 ++++++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index eaaae0c0568..5591c999f11 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -35,7 +35,6 @@ LDADDS = \ $(GLIB_LIBS) \ $(NULL) -test_helpers = ssh test_programs = virshtest sockettest \ virhostcputest virbuftest \ commandtest seclabeltest \ @@ -113,10 +112,6 @@ endif WITH_QEMU endif WITH_ATTR endif WITH_SECDRIVER_SELINUX -# This is a fake SSH we use from virnetsockettest -ssh_SOURCES = ssh.c -ssh_LDADD = $(COVERAGE_LDFLAGS) - if WITH_LIBXL test_programs += xlconfigtest \ xmconfigtest libxlxml2domconfigtest diff --git a/tests/meson.build b/tests/meson.build index fa116a0e249..d825526dc78 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -187,3 +187,15 @@ executable( libvirt_no_indirect, ], ) + +# This is a fake SSH we use from virnetsockettest +executable( + 'ssh', + [ 'ssh.c' ], + dependencies: [ + tests_dep, + ], + link_args: [ + coverage_flags, + ], +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 12 ------------ tests/meson.build | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 5591c999f11..fc48527792b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -300,18 +300,6 @@ endif ! WITH_TESTS TESTS = $(test_programs) \ $(test_scripts) -VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT) -TESTS_ENVIRONMENT = \ - abs_top_builddir="$(abs_top_builddir)" \ - abs_top_srcdir="$(abs_top_srcdir)" \ - abs_builddir="$(abs_builddir)" \ - abs_srcdir="$(abs_srcdir)" \ - LIBVIRT_AUTOSTART=0 \ - LC_ALL=C \ - VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE) \ - $(VG) - - VALGRIND = valgrind --quiet --leak-check=full --trace-children=yes \ --trace-children-skip="*/tools/virsh","*/tests/commandhelper","/usr/bin/*" \ --suppressions=$(abs_srcdir)/.valgrind.supp diff --git a/tests/meson.build b/tests/meson.build index d825526dc78..cc83159934f 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -29,6 +29,21 @@ tests_dep = declare_dependency( link_args: libvirt_export_dynamic, ) +tests_env = [ + 'abs_builddir=@0@'.format(meson.current_build_dir()), + 'abs_srcdir=@0@'.format(meson.current_source_dir()), + 'abs_top_builddir=@0@'.format(meson.build_root()), + 'abs_top_srcdir=@0@'.format(meson.source_root()), + 'LC_ALL=C', + 'LIBVIRT_AUTOSTART=0', +] + +if use_expensive_tests + tests_env += 'VIR_TEST_EXPENSIVE=1' +else + tests_env += 'VIR_TEST_EXPENSIVE=0' +endif + # mock_libs: # each entry is a dictionary with following items: -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 21 --------------------- tests/meson.build | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index fc48527792b..856ae8dad15 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,13 +16,6 @@ ## License along with this library. If not, see ## <http://www.gnu.org/licenses/>. -DRIVERLIB_LDFLAGS = \ - -avoid-version \ - -rpath /evil/libtool/hack/to/force/shared/lib/creation \ - $(MINGW_EXTRA_LDFLAGS) \ - $(FLAT_NAMESPACE_FLAGS) \ - $(NULL) - PROBES_O = if WITH_DTRACE_PROBES PROBES_O += ../src/libvirt_probes.lo @@ -115,7 +108,6 @@ endif WITH_SECDRIVER_SELINUX if WITH_LIBXL test_programs += xlconfigtest \ xmconfigtest libxlxml2domconfigtest -test_libraries += libxltestdriver.la endif WITH_LIBXL if WITH_QEMU @@ -132,9 +124,6 @@ test_programs += qemuxml2argvtest qemuxml2xmltest \ qemuvhostusertest \ $(NULL) test_helpers += qemucapsprobe -test_libraries += \ - libqemutestdriver.la \ - $(NULL) endif WITH_QEMU if WITH_LXC @@ -291,10 +280,8 @@ endif WITH_LINUX if WITH_TESTS noinst_PROGRAMS = $(test_programs) $(test_helpers) -noinst_LTLIBRARIES = $(test_libraries) else ! WITH_TESTS check_PROGRAMS = $(test_programs) $(test_helpers) -check_LTLIBRARIES = $(test_libraries) endif ! WITH_TESTS TESTS = $(test_programs) \ @@ -317,10 +304,6 @@ libxl_LDADDS = \ $(LDADDS) \ $(NULL) -libxltestdriver_la_SOURCES = -libxltestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS) -libxltestdriver_la_LIBADD = $(libxl_LDADDS) - xlconfigtest_SOURCES = \ xlconfigtest.c testutilsxen.c testutilsxen.h \ testutils.c testutils.h @@ -348,10 +331,6 @@ qemu_LDADDS += ../src/libvirt_qemu_probes.lo endif WITH_DTRACE_PROBES qemu_LDADDS += $(LDADDS) -libqemutestdriver_la_SOURCES = -libqemutestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS) -libqemutestdriver_la_LIBADD = $(qemu_LDADDS) - qemuxml2argvtest_SOURCES = \ qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \ testutils.c testutils.h \ diff --git a/tests/meson.build b/tests/meson.build index cc83159934f..cdcb87453fc 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -149,8 +149,14 @@ if conf.has('WITH_LIBXL') dependencies: [ tests_dep ], ) + test_xen_driver_lib = shared_library( + 'test_xen_driver', + link_whole: [ libxl_driver_imp ], + link_with: [ libvirt_lib ], + ) else test_utils_xen_lib = [] + test_xen_driver_lib = [] endif if conf.has('WITH_LXC') @@ -175,7 +181,15 @@ if conf.has('WITH_QEMU') [ 'qemumonitortestutils.c', 'testutilsqemuschema.c' ], dependencies: [ tests_dep ], ) + + test_qemu_driver_lib = shared_library( + 'test_qemu_driver', + [ qemu_dtrace_gen_objects ], + link_whole: [ qemu_driver_impl ], + link_with: [ libvirt_lib ], + ) else + test_qemu_driver_lib = [] test_utils_qemu_lib = [] test_utils_qemu_monitor_lib = [] endif -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 12 ------------ tests/meson.build | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 12 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 856ae8dad15..45740b3e08a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,18 +16,6 @@ ## License along with this library. If not, see ## <http://www.gnu.org/licenses/>. -PROBES_O = -if WITH_DTRACE_PROBES -PROBES_O += ../src/libvirt_probes.lo -endif WITH_DTRACE_PROBES - -LDADDS = \ - $(NO_INDIRECT_LDFLAGS) \ - $(PROBES_O) \ - ../src/libvirt.la \ - $(GLIB_LIBS) \ - $(NULL) - test_programs = virshtest sockettest \ virhostcputest virbuftest \ commandtest seclabeltest \ diff --git a/tests/meson.build b/tests/meson.build index cdcb87453fc..1fb332e7973 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -228,3 +228,48 @@ executable( coverage_flags, ], ) + + +# build and define libvirt tests + +# tests: +# each entry is a dictionary with following items: +# * name - name of the test which is also used as default source file name (required) +# * sources - override default sources based on name (optional, default [ '$name.c' ]) +# * c_args - args used by test (optional, default []) +# * deps - additional dependencies (optional, default []) +# * include - include_directories (optional, default []) +# * link_with - compiled libraries to link with (optional, default []) + +tests = [] + +foreach data : tests + test_sources = '@0@.c'.format(data['name']) + test_bin = executable( + data['name'], + [ + data.get('sources', test_sources), + dtrace_gen_objects, + ], + c_args: [ + data.get('c_args', []), + ], + dependencies: [ + tests_dep, + data.get('deps', []), + ], + include_directories: [ + data.get('include', []), + ], + link_args: [ + libvirt_no_indirect, + ], + link_with: [ + libvirt_lib, + test_utils_lib, + data.get('link_with', []), + ], + export_dynamic: true, + ) + test(data['name'], test_bin, env: tests_env) +endforeach -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 329 ---------------------------------------------- tests/meson.build | 82 +++++++++++- 2 files changed, 81 insertions(+), 330 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 45740b3e08a..a7f7fd88a44 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,42 +16,6 @@ ## License along with this library. If not, see ## <http://www.gnu.org/licenses/>. -test_programs = virshtest sockettest \ - virhostcputest virbuftest \ - commandtest seclabeltest \ - virhashtest virconftest \ - utiltest shunloadtest \ - virtimetest viruritest \ - viralloctest \ - virauthconfigtest \ - virbitmaptest \ - vircgrouptest \ - vircryptotest \ - virpcitest \ - virendiantest \ - virfiletest \ - virfilecachetest \ - virfirewalltest \ - viriscsitest \ - virkeycodetest \ - virlockspacetest \ - virlogtest \ - virrotatingfiletest \ - virschematest \ - virstringtest \ - virportallocatortest \ - sysinfotest \ - virkmodtest \ - vircapstest \ - domaincapstest \ - domainconftest \ - virhostdevtest \ - virnetdevtest \ - virtypedparamtest \ - vshtabletest \ - virerrortest \ - $(NULL) - if WITH_REMOTE test_programs += \ virnetmessagetest \ @@ -146,11 +110,6 @@ if WITH_YAJL test_programs += virjsontest endif WITH_YAJL -test_programs += \ - networkxml2xmlupdatetest \ - virnetworkportxml2xmltest \ - $(NULL) - if WITH_NETWORK test_programs += \ networkxml2xmltest \ @@ -163,9 +122,6 @@ if WITH_STORAGE_SHEEPDOG test_programs += storagebackendsheepdogtest endif WITH_STORAGE_SHEEPDOG -test_programs += nwfilterxml2xmltest -test_programs += virnwfilterbindingxml2xmltest - if WITH_NWFILTER test_programs += nwfilterebiptablestest test_programs += nwfilterxml2firewalltest @@ -192,24 +148,10 @@ test_helpers += nsslinktest nssguestlinktest test_programs += nsstest nssguesttest endif WITH_NSS -test_programs += storagevolxml2xmltest - -test_programs += nodedevxml2xmltest - if WITH_NODE_DEVICES test_programs += nodedevmdevctltest endif WITH_NODE_DEVICES -test_programs += interfacexml2xmltest - -test_programs += cputest - -test_programs += metadatatest - -test_programs += secretxml2xmltest - -test_programs += genericxml2xmltest - if WITH_LINUX test_programs += virusbtest \ virnetdevbandwidthtest \ @@ -247,8 +189,6 @@ test_programs += \ virdriverconnvalidatetest endif ! WITH_LIBVIRTD -test_programs += objecteventtest - if WITH_SECDRIVER_APPARMOR if WITH_LIBVIRTD test_scripts += virt-aa-helper-test @@ -281,11 +221,6 @@ VALGRIND = valgrind --quiet --leak-check=full --trace-children=yes \ valgrind: $(MAKE) check VG="$(LIBTOOL) --mode=execute $(VALGRIND)" -sockettest_SOURCES = \ - sockettest.c \ - testutils.c testutils.h -sockettest_LDADD = $(LDADDS) - if WITH_LIBXL libxl_LDADDS = \ ../src/libvirt_driver_libxl_impl.la \ @@ -528,16 +463,6 @@ bhyveargv2xmltest_SOURCES = \ bhyveargv2xmltest_LDADD = $(bhyve_LDADDS) endif ! WITH_BHYVE -networkxml2xmlupdatetest_SOURCES = \ - networkxml2xmlupdatetest.c \ - testutils.c testutils.h -networkxml2xmlupdatetest_LDADD = $(LDADDS) - -virnetworkportxml2xmltest_SOURCES = \ - virnetworkportxml2xmltest.c \ - testutils.c testutils.h -virnetworkportxml2xmltest_LDADD = $(LDADDS) - if WITH_NETWORK networkxml2xmltest_SOURCES = \ networkxml2xmltest.c \ @@ -565,16 +490,6 @@ storagebackendsheepdogtest_LDADD = \ $(LDADDS) endif ! WITH_STORAGE_SHEEPDOG -nwfilterxml2xmltest_SOURCES = \ - nwfilterxml2xmltest.c \ - testutils.c testutils.h -nwfilterxml2xmltest_LDADD = $(LDADDS) - -virnwfilterbindingxml2xmltest_SOURCES = \ - virnwfilterbindingxml2xmltest.c \ - testutils.c testutils.h -virnwfilterbindingxml2xmltest_LDADD = $(LDADDS) - if WITH_NWFILTER nwfilterebiptablestest_SOURCES = \ nwfilterebiptablestest.c \ @@ -588,17 +503,6 @@ nwfilterxml2firewalltest_LDADD = \ ../src/libvirt_driver_nwfilter_impl.la $(LDADDS) endif WITH_NWFILTER -secretxml2xmltest_SOURCES = \ - secretxml2xmltest.c \ - testutils.c testutils.h -secretxml2xmltest_LDADD = $(LDADDS) - -genericxml2xmltest_SOURCES = \ - genericxml2xmltest.c \ - testutils.c testutils.h -genericxml2xmltest_LDADD = $(LDADDS) - - if WITH_STORAGE virstorageutiltest_SOURCES = \ virstorageutiltest.c \ @@ -639,16 +543,6 @@ storagepoolcapstest_SOURCES = \ storagepoolcapstest_LDADD = $(LDADDS) endif ! WITH_STORAGE -storagevolxml2xmltest_SOURCES = \ - storagevolxml2xmltest.c \ - testutils.c testutils.h -storagevolxml2xmltest_LDADD = $(LDADDS) - -nodedevxml2xmltest_SOURCES = \ - nodedevxml2xmltest.c \ - testutils.c testutils.h -nodedevxml2xmltest_LDADD = $(LDADDS) - if WITH_NODE_DEVICES nodedevmdevctltest_SOURCES = \ nodedevmdevctltest.c \ @@ -659,100 +553,6 @@ nodedevmdevctltest_LDADD = \ $(LDADDS) endif WITH_NODE_DEVICES -interfacexml2xmltest_SOURCES = \ - interfacexml2xmltest.c \ - testutils.c testutils.h -interfacexml2xmltest_LDADD = $(LDADDS) - -cputest_SOURCES = \ - cputest.c \ - testutils.c testutils.h -cputest_LDADD = $(LIBXML_LIBS) -if WITH_QEMU -cputest_SOURCES += testutilsqemu.c testutilsqemu.h -cputest_LDADD += libqemumonitortestutils.la $(qemu_LDADDS) -else ! WITH_QEMU -cputest_LDADD += $(LDADDS) -endif ! WITH_QEMU - -metadatatest_SOURCES = \ - metadatatest.c \ - testutils.c testutils.h -metadatatest_LDADD = $(LDADDS) $(LIBXML_LIBS) - -virerrortest_SOURCES = \ - virerrortest.c \ - testutils.c testutils.h -virerrortest_LDADD = $(LDADDS) - -vshtabletest_SOURCES = \ - vshtabletest.c \ - testutils.c testutils.h -vshtabletest_LDADD = \ - $(LDADDS) \ - ../tools/libvirt_shell.la - -virshtest_SOURCES = \ - virshtest.c \ - testutils.c testutils.h -virshtest_LDADD = $(LDADDS) - -virconftest_SOURCES = \ - virconftest.c testutils.h testutils.c -virconftest_LDADD = $(LDADDS) - -virhostcputest_SOURCES = \ - virhostcputest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c -virhostcputest_LDADD = $(LDADDS) - -commandtest_SOURCES = \ - commandtest.c testutils.h testutils.c -commandtest_LDADD = $(LDADDS) - -virkmodtest_SOURCES = \ - virkmodtest.c testutils.h testutils.c -virkmodtest_LDADD = $(LDADDS) - -vircapstest_SOURCES = \ - vircapstest.c testutils.h testutils.c -if WITH_LXC -vircapstest_SOURCES += testutilslxc.c testutilslxc.h -endif WITH_LXC -if WITH_QEMU -vircapstest_SOURCES += testutilsqemu.c testutilsqemu.h -endif WITH_QEMU -vircapstest_LDADD = -if WITH_QEMU -vircapstest_LDADD += ../src/libvirt_driver_qemu_impl.la -if WITH_DTRACE_PROBES -vircapstest_LDADD += ../src/libvirt_qemu_probes.lo -endif WITH_DTRACE_PROBES -endif WITH_QEMU -if WITH_LXC -vircapstest_LDADD += ../src/libvirt_driver_lxc_impl.la -endif WITH_LXC -vircapstest_LDADD += $(LDADDS) - -domaincapstest_SOURCES = \ - domaincapstest.c testutils.h testutils.c \ - virfilewrapper.c virfilewrapper.h \ - $(NULL) -domaincapstest_LDADD = $(LDADDS) - -if WITH_QEMU -domaincapstest_SOURCES += testutilsqemu.c testutilsqemu.h -domaincapstest_LDADD += libqemutestdriver.la -endif WITH_QEMU - -if WITH_LIBXL -domaincapstest_SOURCES += testutilsxen.c testutilsxen.h -domaincapstest_LDADD += libxltestdriver.la -endif WITH_LIBXL - -if WITH_BHYVE -domaincapstest_LDADD += ../src/libvirt_driver_bhyve_impl.la -endif WITH_BHYVE - virnetmessagetest_SOURCES = \ virnetmessagetest.c testutils.h testutils.c virnetmessagetest_LDADD = $(LDADDS) @@ -788,18 +588,6 @@ virnettlssessiontest_SOURCES += pkix_asn1_tab.c virnettlssessiontest_LDADD += -ltasn1 endif ! HAVE_LIBTASN1 -virtimetest_SOURCES = \ - virtimetest.c testutils.h testutils.c -virtimetest_LDADD = $(LDADDS) - -virschematest_SOURCES = \ - virschematest.c testutils.h testutils.c -virschematest_LDADD = $(LDADDS) $(LIBXML_LIBS) - -virstringtest_SOURCES = \ - virstringtest.c testutils.h testutils.c -virstringtest_LDADD = $(LDADDS) - virstoragetest_SOURCES = \ virstoragetest.c testutils.h testutils.c virstoragetest_LDADD = $(LDADDS) \ @@ -816,42 +604,6 @@ viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \ ../src/libvirt.la endif WITH_SELINUX -viriscsitest_SOURCES = \ - viriscsitest.c testutils.h testutils.c -viriscsitest_LDADD = $(LDADDS) - -virkeycodetest_SOURCES = \ - virkeycodetest.c testutils.h testutils.c -virkeycodetest_LDADD = $(LDADDS) - -virlockspacetest_SOURCES = \ - virlockspacetest.c testutils.h testutils.c -virlockspacetest_LDADD = $(LDADDS) - -virlogtest_SOURCES = \ - virlogtest.c testutils.h testutils.c -virlogtest_LDADD = $(LDADDS) - -virportallocatortest_SOURCES = \ - virportallocatortest.c testutils.h testutils.c -virportallocatortest_LDADD = $(LDADDS) - -vircgrouptest_SOURCES = \ - vircgrouptest.c testutils.h testutils.c -vircgrouptest_LDADD = $(LDADDS) - -vircryptotest_SOURCES = \ - vircryptotest.c testutils.h testutils.c -vircryptotest_LDADD = $(LDADDS) - -virhostdevtest_SOURCES = \ - virhostdevtest.c testutils.h testutils.c -virhostdevtest_LDADD = $(LDADDS) - -virpcitest_SOURCES = \ - virpcitest.c testutils.h testutils.c -virpcitest_LDADD = $(LDADDS) - if WITH_LINUX vircaps2xmltest_SOURCES = \ vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c @@ -914,15 +666,6 @@ test_programs += \ virnetdevopenvswitchtest endif ! WITH_YAJL -virnetdevtest_SOURCES = \ - virnetdevtest.c testutils.h testutils.c -virnetdevtest_CFLAGS = $(AM_CFLAGS) $(LIBNL_CFLAGS) -virnetdevtest_LDADD = $(LDADDS) - -virrotatingfiletest_SOURCES = \ - virrotatingfiletest.c testutils.h testutils.c -virrotatingfiletest_LDADD = $(LDADDS) - if WITH_LINUX virusbtest_SOURCES = \ virusbtest.c testutils.h testutils.c @@ -950,22 +693,6 @@ virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS) virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS) endif ! WITH_DBUS -viruritest_SOURCES = \ - viruritest.c testutils.h testutils.c -viruritest_LDADD = $(LDADDS) - -viralloctest_SOURCES = \ - viralloctest.c testutils.h testutils.c -viralloctest_LDADD = $(LDADDS) - -virauthconfigtest_SOURCES = \ - virauthconfigtest.c testutils.h testutils.c -virauthconfigtest_LDADD = $(LDADDS) - -seclabeltest_SOURCES = \ - seclabeltest.c testutils.h testutils.c -seclabeltest_LDADD = $(LDADDS) - if WITH_SECDRIVER_SELINUX if WITH_ATTR @@ -986,43 +713,10 @@ endif WITH_QEMU endif WITH_ATTR endif WITH_SECDRIVER_SELINUX -virbuftest_SOURCES = \ - virbuftest.c testutils.h testutils.c -virbuftest_LDADD = $(LDADDS) - -virhashtest_SOURCES = \ - virhashtest.c virhashdata.h testutils.h testutils.c -virhashtest_LDADD = $(LDADDS) - -virbitmaptest_SOURCES = \ - virbitmaptest.c testutils.h testutils.c -virbitmaptest_LDADD = $(LDADDS) - -virendiantest_SOURCES = \ - virendiantest.c testutils.h testutils.c -virendiantest_LDADD = $(LDADDS) - -virfiletest_SOURCES = \ - virfiletest.c testutils.h testutils.c -virfiletest_LDADD = $(LDADDS) - -virfilecachetest_SOURCES = \ - virfilecachetest.c testutils.h testutils.c -virfilecachetest_LDADD = $(LDADDS) - -virfirewalltest_SOURCES = \ - virfirewalltest.c testutils.h testutils.c -virfirewalltest_LDADD = $(LDADDS) $(DBUS_LIBS) -virfirewalltest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS) - virjsontest_SOURCES = \ virjsontest.c testutils.h testutils.c virjsontest_LDADD = $(LDADDS) -utiltest_SOURCES = \ - utiltest.c testutils.h testutils.c -utiltest_LDADD = $(LDADDS) - if WITH_LIBVIRTD virdrivermoduletest_SOURCES = \ virdrivermoduletest.c testutils.h testutils.c @@ -1039,33 +733,10 @@ eventtest_SOURCES = \ eventtest_LDADD = $(LDADDS) endif WITH_LIBVIRTD -shunloadtest_SOURCES = \ - shunloadtest.c -shunloadtest_LDADD = $(THREAD_LIBS) $(DLOPEN_LIBS) -shunloadtest_DEPENDENCIES = libshunload.la - -sysinfotest_SOURCES = \ - sysinfotest.c testutils.h testutils.c -sysinfotest_LDADD = $(LDADDS) - -domainconftest_SOURCES = \ - domainconftest.c testutils.h testutils.c -domainconftest_LDADD = $(LDADDS) - fdstreamtest_SOURCES = \ fdstreamtest.c testutils.h testutils.c fdstreamtest_LDADD = $(LDADDS) -objecteventtest_SOURCES = \ - objecteventtest.c \ - testutils.c testutils.h -objecteventtest_LDADD = $(LDADDS) - -virtypedparamtest_SOURCES = \ - virtypedparamtest.c testutils.h testutils.c -virtypedparamtest_LDADD = $(LDADDS) - - if WITH_LINUX fchosttest_SOURCES = \ fchosttest.c testutils.h testutils.c diff --git a/tests/meson.build b/tests/meson.build index 1fb332e7973..143b3126c43 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -240,9 +240,89 @@ executable( # * deps - additional dependencies (optional, default []) # * include - include_directories (optional, default []) # * link_with - compiled libraries to link with (optional, default []) - tests = [] +cputest_link_with = [] +if conf.has('WITH_QEMU') + cputest_link_with += [ test_utils_qemu_lib, test_utils_qemu_monitor_lib, test_qemu_driver_lib ] +endif + +domaincapstest_link_with = [ test_file_wrapper_lib ] +if conf.has('WITH_BHYVE') + domaincapstest_link_with += [ bhyve_driver_impl ] +endif +if conf.has('WITH_LIBXL') + domaincapstest_link_with += [ test_utils_xen_lib, test_xen_driver_lib ] +endif +if conf.has('WITH_QEMU') + domaincapstest_link_with += [ test_utils_qemu_lib, test_qemu_driver_lib ] +endif + +vircapstest_link_with = [] +vircapstest_sources = [ 'vircapstest.c' ] +if conf.has('WITH_LXC') + vircapstest_link_with += [ test_utils_lxc_lib, lxc_driver_impl_lib ] +endif +if conf.has('WITH_QEMU') + vircapstest_link_with += [ test_utils_qemu_lib, qemu_driver_impl ] + vircapstest_sources += [ qemu_dtrace_gen_objects ] +endif + +tests += [ + { 'name': 'commandtest' }, + { 'name': 'cputest', 'link_with': cputest_link_with }, + { 'name': 'domaincapstest', 'link_with': domaincapstest_link_with }, + { 'name': 'domainconftest' }, + { 'name': 'genericxml2xmltest' }, + { 'name': 'interfacexml2xmltest' }, + { 'name': 'metadatatest' }, + { 'name': 'networkxml2xmlupdatetest' }, + { 'name': 'nodedevxml2xmltest' }, + { 'name': 'nwfilterxml2xmltest' }, + { 'name': 'objecteventtest' }, + { 'name': 'seclabeltest' }, + { 'name': 'secretxml2xmltest' }, + { 'name': 'shunloadtest', 'deps': [ thread_dep ] }, + { 'name': 'sockettest' }, + { 'name': 'storagevolxml2xmltest' }, + { 'name': 'sysinfotest' }, + { 'name': 'utiltest' }, + { 'name': 'viralloctest' }, + { 'name': 'virauthconfigtest' }, + { 'name': 'virbitmaptest' }, + { 'name': 'virbuftest' }, + { 'name': 'vircapstest', 'sources': vircapstest_sources, 'link_with': vircapstest_link_with }, + { 'name': 'vircgrouptest' }, + { 'name': 'virconftest' }, + { 'name': 'vircryptotest' }, + { 'name': 'virendiantest' }, + { 'name': 'virerrortest' }, + { 'name': 'virfilecachetest' }, + { 'name': 'virfiletest' }, + { 'name': 'virfirewalltest', 'deps': [ dbus_dep ] }, + { 'name': 'virhashtest' }, + { 'name': 'virhostcputest', 'link_with': [ test_file_wrapper_lib ] }, + { 'name': 'virhostdevtest' }, + { 'name': 'viriscsitest' }, + { 'name': 'virkeycodetest' }, + { 'name': 'virkmodtest' }, + { 'name': 'virlockspacetest' }, + { 'name': 'virlogtest' }, + { 'name': 'virnetdevtest' }, + { 'name': 'virnetworkportxml2xmltest' }, + { 'name': 'virnwfilterbindingxml2xmltest' }, + { 'name': 'virpcitest' }, + { 'name': 'virportallocatortest' }, + { 'name': 'virrotatingfiletest' }, + { 'name': 'virschematest' }, + { 'name': 'virshtest' }, + { 'name': 'virstringtest' }, + { 'name': 'virtimetest' }, + { 'name': 'virtypedparamtest' }, + { 'name': 'viruritest' }, + { 'name': 'vshtabletest', 'link_with': [ libvirt_shell_lib ] }, +] + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 53 ----------------------------------------------- tests/meson.build | 12 +++++++++++ 2 files changed, 12 insertions(+), 53 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index a7f7fd88a44..c3d77d16a07 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -27,13 +27,6 @@ test_programs += \ $(NULL) endif WITH_REMOTE -if WITH_LINUX -test_programs += fchosttest -test_programs += scsihosttest -test_programs += vircaps2xmltest -test_programs += virresctrltest -endif WITH_LINUX - if WITH_LIBVIRTD test_programs += fdstreamtest endif WITH_LIBVIRTD @@ -139,10 +132,6 @@ if WITH_STORAGE_FS test_programs += virstoragetest endif WITH_STORAGE_FS -if WITH_LINUX -test_programs += virscsitest -endif WITH_LINUX - if WITH_NSS test_helpers += nsslinktest nssguestlinktest test_programs += nsstest nssguesttest @@ -152,12 +141,6 @@ if WITH_NODE_DEVICES test_programs += nodedevmdevctltest endif WITH_NODE_DEVICES -if WITH_LINUX -test_programs += virusbtest \ - virnetdevbandwidthtest \ - $(NULL) -endif WITH_LINUX - test_scripts = libvirtd_test_scripts = \ libvirtd-fail \ @@ -604,16 +587,6 @@ viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \ ../src/libvirt.la endif WITH_SELINUX -if WITH_LINUX -vircaps2xmltest_SOURCES = \ - vircaps2xmltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c -vircaps2xmltest_LDADD = $(LDADDS) - -virresctrltest_SOURCES = \ - virresctrltest.c testutils.h testutils.c virfilewrapper.h virfilewrapper.c -virresctrltest_LDADD = $(LDADDS) -endif ! WITH_LINUX - if WITH_NSS nsstest_SOURCES = \ nsstest.c testutils.h testutils.c @@ -666,16 +639,6 @@ test_programs += \ virnetdevopenvswitchtest endif ! WITH_YAJL -if WITH_LINUX -virusbtest_SOURCES = \ - virusbtest.c testutils.h testutils.c -virusbtest_LDADD = $(LDADDS) - -virnetdevbandwidthtest_SOURCES = \ - virnetdevbandwidthtest.c testutils.h testutils.c -virnetdevbandwidthtest_LDADD = $(LDADDS) $(LIBXML_LIBS) -endif ! WITH_LINUX - if WITH_DBUS virdbustest_SOURCES = \ virdbustest.c testutils.h testutils.c @@ -736,19 +699,3 @@ endif WITH_LIBVIRTD fdstreamtest_SOURCES = \ fdstreamtest.c testutils.h testutils.c fdstreamtest_LDADD = $(LDADDS) - -if WITH_LINUX -fchosttest_SOURCES = \ - fchosttest.c testutils.h testutils.c -fchosttest_LDADD = $(LDADDS) - -scsihosttest_SOURCES = \ - scsihosttest.c testutils.h testutils.c -scsihosttest_LDADD = $(LDADDS) -endif ! WITH_LINUX - -if WITH_LINUX -virscsitest_SOURCES = \ - virscsitest.c testutils.h testutils.c -virscsitest_LDADD = $(LDADDS) -endif ! WITH_LINUX diff --git a/tests/meson.build b/tests/meson.build index 143b3126c43..ed0731ecc42 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -323,6 +323,18 @@ tests += [ { 'name': 'vshtabletest', 'link_with': [ libvirt_shell_lib ] }, ] +if host_machine.system() == 'linux' + tests += [ + { 'name': 'fchosttest' }, + { 'name': 'scsihosttest' }, + { 'name': 'vircaps2xmltest', 'link_with': [ test_file_wrapper_lib ] }, + { 'name': 'virnetdevbandwidthtest' }, + { 'name': 'virresctrltest', 'link_with': [ test_file_wrapper_lib ] }, + { 'name': 'virscsitest' }, + { 'name': 'virusbtest' }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 25 ------------------------- tests/meson.build | 8 ++++++++ 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index c3d77d16a07..a436f9e0645 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -95,10 +95,6 @@ if WITH_VMWARE test_programs += vmwarevertest endif WITH_VMWARE -if WITH_BHYVE -test_programs += bhyvexml2argvtest bhyvexml2xmltest bhyveargv2xmltest -endif WITH_BHYVE - if WITH_YAJL test_programs += virjsontest endif WITH_YAJL @@ -425,27 +421,6 @@ vmwarevertest_SOURCES = \ vmwarevertest_LDADD = $(LDADDS) endif ! WITH_VMWARE -if WITH_BHYVE -bhyve_LDADDS = \ - ../src/libvirt_driver_bhyve_impl.la \ - $(LDADDS) \ - $(NULL) -bhyvexml2argvtest_SOURCES = \ - bhyvexml2argvtest.c \ - testutils.c testutils.h -bhyvexml2argvtest_LDADD = $(bhyve_LDADDS) - -bhyvexml2xmltest_SOURCES = \ - bhyvexml2xmltest.c \ - testutils.c testutils.h -bhyvexml2xmltest_LDADD = $(bhyve_LDADDS) - -bhyveargv2xmltest_SOURCES = \ - bhyveargv2xmltest.c \ - testutils.c testutils.h -bhyveargv2xmltest_LDADD = $(bhyve_LDADDS) -endif ! WITH_BHYVE - if WITH_NETWORK networkxml2xmltest_SOURCES = \ networkxml2xmltest.c \ diff --git a/tests/meson.build b/tests/meson.build index ed0731ecc42..fe4d252c640 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -335,6 +335,14 @@ if host_machine.system() == 'linux' ] endif +if conf.has('WITH_BHYVE') + tests += [ + { 'name': 'bhyveargv2xmltest', 'link_with': [ bhyve_driver_impl ] }, + { 'name': 'bhyvexml2argvtest', 'link_with': [ bhyve_driver_impl ] }, + { 'name': 'bhyvexml2xmltest', 'link_with': [ bhyve_driver_impl ] }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 26 -------------------------- tests/meson.build | 13 +++++++++++++ 2 files changed, 13 insertions(+), 26 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index a436f9e0645..b721b135cfd 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -31,15 +31,6 @@ if WITH_LIBVIRTD test_programs += fdstreamtest endif WITH_LIBVIRTD -if WITH_DBUS -test_programs += virdbustest \ - virsystemdtest \ - $(NULL) -if WITH_POLKIT -test_programs += virpolkittest -endif WITH_POLKIT -endif WITH_DBUS - if WITH_SECDRIVER_SELINUX if WITH_ATTR test_programs += securityselinuxtest \ @@ -614,23 +605,6 @@ test_programs += \ virnetdevopenvswitchtest endif ! WITH_YAJL -if WITH_DBUS -virdbustest_SOURCES = \ - virdbustest.c testutils.h testutils.c -virdbustest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS) -virdbustest_LDADD = $(LDADDS) $(DBUS_LIBS) - -virpolkittest_SOURCES = \ - virpolkittest.c testutils.h testutils.c -virpolkittest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS) -virpolkittest_LDADD = $(LDADDS) $(DBUS_LIBS) - -virsystemdtest_SOURCES = \ - virsystemdtest.c testutils.h testutils.c -virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS) -virsystemdtest_LDADD = $(LDADDS) $(DBUS_LIBS) -endif ! WITH_DBUS - if WITH_SECDRIVER_SELINUX if WITH_ATTR diff --git a/tests/meson.build b/tests/meson.build index fe4d252c640..86f12a58f7b 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -343,6 +343,19 @@ if conf.has('WITH_BHYVE') ] endif +if conf.has('WITH_DBUS') + tests += [ + { 'name': 'virdbustest', 'deps': [ dbus_dep ] }, + { 'name': 'virsystemdtest', 'deps': [ dbus_dep ] }, + ] + + if conf.has('WITH_POLKIT') + tests += [ + { 'name': 'virpolkittest', 'deps': [ dbus_dep ] }, + ] + endif +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/esx/meson.build | 2 ++ tests/Makefile.am | 14 -------------- tests/meson.build | 6 ++++++ 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/esx/meson.build b/src/esx/meson.build index 1718411d759..469c2044c63 100644 --- a/src/esx/meson.build +++ b/src/esx/meson.build @@ -63,3 +63,5 @@ if conf.has('WITH_ESX') else sym_files += 'libvirt_esx.syms' endif + +esx_inc_dir = include_directories('.') diff --git a/tests/Makefile.am b/tests/Makefile.am index b721b135cfd..55369717cd9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -70,10 +70,6 @@ if WITH_OPENVZ test_programs += openvzutilstest endif WITH_OPENVZ -if WITH_ESX -test_programs += esxutilstest -endif WITH_ESX - if WITH_VBOX test_programs += vboxsnapshotxmltest endif WITH_VBOX @@ -375,16 +371,6 @@ openvzutilstest_LDADD = $(LDADDS) \ ../src/libvirt_driver_openvz.la endif ! WITH_OPENVZ -if WITH_ESX -esxutilstest_SOURCES = \ - esxutilstest.c \ - testutils.c testutils.h -esxutilstest_LDADD = $(LDADDS) -esxutilstest_CFLAGS = \ - -I$(top_builddir)/src/esx \ - $(AM_CFLAGS) -endif ! WITH_ESX - if WITH_VBOX vboxsnapshotxmltest_SOURCES = \ vboxsnapshotxmltest.c \ diff --git a/tests/meson.build b/tests/meson.build index 86f12a58f7b..1eded8454f1 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -356,6 +356,12 @@ if conf.has('WITH_DBUS') endif endif +if conf.has('WITH_ESX') + tests += [ + { 'name': 'esxutilstest', 'include': [ esx_inc_dir ], 'deps': [ dbus_dep ] }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

On Thu, Jul 16, 2020 at 11:58:46 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/esx/meson.build | 2 ++ tests/Makefile.am | 14 -------------- tests/meson.build | 6 ++++++ 3 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/src/esx/meson.build b/src/esx/meson.build index 1718411d759..469c2044c63 100644 --- a/src/esx/meson.build +++ b/src/esx/meson.build @@ -63,3 +63,5 @@ if conf.has('WITH_ESX') else sym_files += 'libvirt_esx.syms' endif + +esx_inc_dir = include_directories('.') diff --git a/tests/Makefile.am b/tests/Makefile.am index b721b135cfd..55369717cd9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -70,10 +70,6 @@ if WITH_OPENVZ test_programs += openvzutilstest endif WITH_OPENVZ
-if WITH_ESX -test_programs += esxutilstest -endif WITH_ESX - if WITH_VBOX test_programs += vboxsnapshotxmltest endif WITH_VBOX @@ -375,16 +371,6 @@ openvzutilstest_LDADD = $(LDADDS) \ ../src/libvirt_driver_openvz.la endif ! WITH_OPENVZ
-if WITH_ESX -esxutilstest_SOURCES = \ - esxutilstest.c \ - testutils.c testutils.h -esxutilstest_LDADD = $(LDADDS) -esxutilstest_CFLAGS = \ - -I$(top_builddir)/src/esx \ - $(AM_CFLAGS) -endif ! WITH_ESX - if WITH_VBOX vboxsnapshotxmltest_SOURCES = \ vboxsnapshotxmltest.c \ diff --git a/tests/meson.build b/tests/meson.build index 86f12a58f7b..1eded8454f1 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -356,6 +356,12 @@ if conf.has('WITH_DBUS') endif endif
+if conf.has('WITH_ESX') + tests += [ + { 'name': 'esxutilstest', 'include': [ esx_inc_dir ], 'deps': [ dbus_dep ] },
dbus? that doesn't seem right.
+ ]

On Tue, Jul 28, 2020 at 02:06:08PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:58:46 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/esx/meson.build | 2 ++ tests/Makefile.am | 14 -------------- tests/meson.build | 6 ++++++ 3 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/src/esx/meson.build b/src/esx/meson.build index 1718411d759..469c2044c63 100644 --- a/src/esx/meson.build +++ b/src/esx/meson.build @@ -63,3 +63,5 @@ if conf.has('WITH_ESX') else sym_files += 'libvirt_esx.syms' endif + +esx_inc_dir = include_directories('.') diff --git a/tests/Makefile.am b/tests/Makefile.am index b721b135cfd..55369717cd9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -70,10 +70,6 @@ if WITH_OPENVZ test_programs += openvzutilstest endif WITH_OPENVZ
-if WITH_ESX -test_programs += esxutilstest -endif WITH_ESX - if WITH_VBOX test_programs += vboxsnapshotxmltest endif WITH_VBOX @@ -375,16 +371,6 @@ openvzutilstest_LDADD = $(LDADDS) \ ../src/libvirt_driver_openvz.la endif ! WITH_OPENVZ
-if WITH_ESX -esxutilstest_SOURCES = \ - esxutilstest.c \ - testutils.c testutils.h -esxutilstest_LDADD = $(LDADDS) -esxutilstest_CFLAGS = \ - -I$(top_builddir)/src/esx \ - $(AM_CFLAGS) -endif ! WITH_ESX - if WITH_VBOX vboxsnapshotxmltest_SOURCES = \ vboxsnapshotxmltest.c \ diff --git a/tests/meson.build b/tests/meson.build index 86f12a58f7b..1eded8454f1 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -356,6 +356,12 @@ if conf.has('WITH_DBUS') endif endif
+if conf.has('WITH_ESX') + tests += [ + { 'name': 'esxutilstest', 'include': [ esx_inc_dir ], 'deps': [ dbus_dep ] },
dbus? that doesn't seem right.
No idea how it got here, it's not correct. I'll fix it. Thanks Pavel

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 29 ----------------------------- tests/meson.build | 9 +++++++++ 2 files changed, 9 insertions(+), 29 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 55369717cd9..a927c0cb2fd 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -27,10 +27,6 @@ test_programs += \ $(NULL) endif WITH_REMOTE -if WITH_LIBVIRTD -test_programs += fdstreamtest -endif WITH_LIBVIRTD - if WITH_SECDRIVER_SELINUX if WITH_ATTR test_programs += securityselinuxtest \ @@ -148,11 +144,6 @@ libvirtd_test_scripts = \ if WITH_LIBVIRTD test_scripts += $(libvirtd_test_scripts) - -test_programs += \ - eventtest \ - virdrivermoduletest \ - virdriverconnvalidatetest endif ! WITH_LIBVIRTD if WITH_SECDRIVER_APPARMOR @@ -614,23 +605,3 @@ endif WITH_SECDRIVER_SELINUX virjsontest_SOURCES = \ virjsontest.c testutils.h testutils.c virjsontest_LDADD = $(LDADDS) - -if WITH_LIBVIRTD -virdrivermoduletest_SOURCES = \ - virdrivermoduletest.c testutils.h testutils.c -virdrivermoduletest_LDADD = $(LDADDS) - -virdriverconnvalidatetest_SOURCES = \ - virdriverconnvalidatetest.c testutils.h testutils.c -virdriverconnvalidatetest_LDADD = $(LDADDS) -endif WITH_LIBVIRTD - -if WITH_LIBVIRTD -eventtest_SOURCES = \ - eventtest.c testutils.h testutils.c -eventtest_LDADD = $(LDADDS) -endif WITH_LIBVIRTD - -fdstreamtest_SOURCES = \ - fdstreamtest.c testutils.h testutils.c -fdstreamtest_LDADD = $(LDADDS) diff --git a/tests/meson.build b/tests/meson.build index 1eded8454f1..cc1b830d72b 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -362,6 +362,15 @@ if conf.has('WITH_ESX') ] endif +if conf.has('WITH_LIBVIRTD') + tests += [ + { 'name': 'eventtest', 'deps': [ thread_dep ] }, + { 'name': 'fdstreamtest' }, + { 'name': 'virdriverconnvalidatetest' }, + { 'name': 'virdrivermoduletest' }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 30 ------------------------------ tests/meson.build | 8 ++++++++ 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index a927c0cb2fd..ec57dd5543b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -37,11 +37,6 @@ endif WITH_QEMU endif WITH_ATTR endif WITH_SECDRIVER_SELINUX -if WITH_LIBXL -test_programs += xlconfigtest \ - xmconfigtest libxlxml2domconfigtest -endif WITH_LIBXL - if WITH_QEMU test_programs += qemuxml2argvtest qemuxml2xmltest \ qemudomaincheckpointxml2xmltest qemudomainsnapshotxml2xmltest \ @@ -178,31 +173,6 @@ VALGRIND = valgrind --quiet --leak-check=full --trace-children=yes \ valgrind: $(MAKE) check VG="$(LIBTOOL) --mode=execute $(VALGRIND)" -if WITH_LIBXL -libxl_LDADDS = \ - ../src/libvirt_driver_libxl_impl.la \ - $(LDADDS) \ - $(NULL) - -xlconfigtest_SOURCES = \ - xlconfigtest.c testutilsxen.c testutilsxen.h \ - testutils.c testutils.h -xlconfigtest_LDADD = libxltestdriver.la \ - $(libxl_LDADDS) - -xmconfigtest_SOURCES = \ - xmconfigtest.c testutilsxen.c testutilsxen.h \ - testutils.c testutils.h -xmconfigtest_LDADD = libxltestdriver.la \ - $(libxl_LDADDS) - -libxlxml2domconfigtest_SOURCES = \ - libxlxml2domconfigtest.c testutilsxen.c testutilsxen.h \ - testutils.c testutils.h -libxlxml2domconfigtest_LDADD = libxltestdriver.la \ - $(libxl_LDADDS) $(LIBXML_LIBS) -endif ! WITH_LIBXL - if WITH_QEMU qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la diff --git a/tests/meson.build b/tests/meson.build index cc1b830d72b..3b5938abfc4 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -371,6 +371,14 @@ if conf.has('WITH_LIBVIRTD') ] endif +if conf.has('WITH_LIBXL') + tests += [ + { 'name': 'libxlxml2domconfigtest', 'link_with': [ test_utils_xen_lib, test_xen_driver_lib ], 'deps': [ libxl_dep ] }, + { 'name': 'xlconfigtest', 'link_with': [ test_utils_xen_lib, test_xen_driver_lib ] }, + { 'name': 'xmconfigtest', 'link_with': [ test_utils_xen_lib, test_xen_driver_lib ] }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 22 ---------------------- tests/meson.build | 7 +++++++ 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index ec57dd5543b..44f02da7af6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -53,10 +53,6 @@ test_programs += qemuxml2argvtest qemuxml2xmltest \ test_helpers += qemucapsprobe endif WITH_QEMU -if WITH_LXC -test_programs += lxcxml2xmltest lxcconf2xmltest -endif WITH_LXC - if WITH_OPENVZ test_programs += openvzutilstest endif WITH_OPENVZ @@ -306,24 +302,6 @@ qemuvhostusertest_SOURCES = \ qemuvhostusertest_LDADD = $(qemu_LDADDS) endif ! WITH_QEMU -if WITH_LXC - -lxc_LDADDS = \ - ../src/libvirt_driver_lxc_impl.la \ - $(LDADDS) \ - $(NULL) - -lxcxml2xmltest_SOURCES = \ - lxcxml2xmltest.c testutilslxc.c testutilslxc.h \ - testutils.c testutils.h -lxcxml2xmltest_LDADD = $(lxc_LDADDS) - -lxcconf2xmltest_SOURCES = \ - lxcconf2xmltest.c testutilslxc.c testutilslxc.h \ - testutils.c testutils.h -lxcconf2xmltest_LDADD = $(lxc_LDADDS) -endif ! WITH_LXC - if WITH_OPENVZ openvzutilstest_SOURCES = \ openvzutilstest.c \ diff --git a/tests/meson.build b/tests/meson.build index 3b5938abfc4..439d95401ef 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -379,6 +379,13 @@ if conf.has('WITH_LIBXL') ] endif +if conf.has('WITH_LXC') + tests += [ + { 'name': 'lxcconf2xmltest', 'link_with': [ test_utils_lxc_lib, lxc_driver_impl_lib ] }, + { 'name': 'lxcxml2xmltest', 'link_with': [ test_utils_lxc_lib, lxc_driver_impl_lib ] }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 25 ------------------------- tests/meson.build | 8 ++++++++ 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 44f02da7af6..ad8bc21fd8d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -73,14 +73,6 @@ if WITH_YAJL test_programs += virjsontest endif WITH_YAJL -if WITH_NETWORK -test_programs += \ - networkxml2xmltest \ - networkxml2conftest \ - networkxml2firewalltest \ - $(NULL) -endif WITH_NETWORK - if WITH_STORAGE_SHEEPDOG test_programs += storagebackendsheepdogtest endif WITH_STORAGE_SHEEPDOG @@ -337,23 +329,6 @@ vmwarevertest_SOURCES = \ vmwarevertest_LDADD = $(LDADDS) endif ! WITH_VMWARE -if WITH_NETWORK -networkxml2xmltest_SOURCES = \ - networkxml2xmltest.c \ - testutils.c testutils.h -networkxml2xmltest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS) - -networkxml2conftest_SOURCES = \ - networkxml2conftest.c \ - testutils.c testutils.h -networkxml2conftest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS) - -networkxml2firewalltest_SOURCES = \ - networkxml2firewalltest.c \ - testutils.c testutils.h -networkxml2firewalltest_LDADD = ../src/libvirt_driver_network_impl.la $(LDADDS) -endif ! WITH_NETWORK - if WITH_STORAGE_SHEEPDOG storagebackendsheepdogtest_SOURCES = \ storagebackendsheepdogtest.c \ diff --git a/tests/meson.build b/tests/meson.build index 439d95401ef..4fc8c170c0a 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -386,6 +386,14 @@ if conf.has('WITH_LXC') ] endif +if conf.has('WITH_NETWORK') + tests += [ + { 'name': 'networkxml2conftest', 'link_with': [ network_driver_impl ] }, + { 'name': 'networkxml2firewalltest', 'link_with': [ network_driver_impl ] }, + { 'name': 'networkxml2xmltest', 'link_with': [ network_driver_impl ] }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 14 -------------- tests/meson.build | 6 ++++++ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index ad8bc21fd8d..a8a3996bab1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -99,10 +99,6 @@ test_helpers += nsslinktest nssguestlinktest test_programs += nsstest nssguesttest endif WITH_NSS -if WITH_NODE_DEVICES -test_programs += nodedevmdevctltest -endif WITH_NODE_DEVICES - test_scripts = libvirtd_test_scripts = \ libvirtd-fail \ @@ -392,16 +388,6 @@ storagepoolcapstest_SOURCES = \ storagepoolcapstest_LDADD = $(LDADDS) endif ! WITH_STORAGE -if WITH_NODE_DEVICES -nodedevmdevctltest_SOURCES = \ - nodedevmdevctltest.c \ - testutils.c testutils.h - -nodedevmdevctltest_LDADD = \ - ../src/libvirt_driver_nodedev_impl.la \ - $(LDADDS) -endif WITH_NODE_DEVICES - virnetmessagetest_SOURCES = \ virnetmessagetest.c testutils.h testutils.c virnetmessagetest_LDADD = $(LDADDS) diff --git a/tests/meson.build b/tests/meson.build index 4fc8c170c0a..e8154810b05 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -394,6 +394,12 @@ if conf.has('WITH_NETWORK') ] endif +if conf.has('WITH_NODE_DEVICES') + tests += [ + { 'name': 'nodedevmdevctltest', 'link_with': [ node_device_driver_impl ] }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 20 -------------------- tests/meson.build | 17 +++++++++++++++++ tools/nss/meson.build | 2 ++ 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index a8a3996bab1..816d7ec8a64 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -96,7 +96,6 @@ endif WITH_STORAGE_FS if WITH_NSS test_helpers += nsslinktest nssguestlinktest -test_programs += nsstest nssguesttest endif WITH_NSS test_scripts = @@ -440,25 +439,6 @@ viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \ endif WITH_SELINUX if WITH_NSS -nsstest_SOURCES = \ - nsstest.c testutils.h testutils.c -nsstest_CFLAGS = \ - $(AM_CFLAGS) \ - -I$(top_srcdir)/tools/nss -nsstest_LDADD = \ - $(LDADDS) \ - ../tools/nss/libnss_libvirt_impl.la - -nssguesttest_SOURCES = \ - nsstest.c testutils.h testutils.c -nssguesttest_CFLAGS = \ - -DLIBVIRT_NSS_GUEST \ - $(AM_CFLAGS) \ - -I$(top_srcdir)/tools/nss -nssguesttest_LDADD = \ - $(LDADDS) \ - ../tools/nss/libnss_libvirt_guest_impl.la - ## Intentionaly not linking with anything else. ## See the test source for more detailed explanation. nsslinktest_SOURCES = nsslinktest.c diff --git a/tests/meson.build b/tests/meson.build index e8154810b05..0b503bca720 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -400,6 +400,23 @@ if conf.has('WITH_NODE_DEVICES') ] endif +if conf.has('WITH_NSS') + tests += [ + { + 'name': 'nsstest', + 'include': [ nss_inc_dir ], + 'link_with': [ nss_libvirt_impl ], + }, + { + 'name': 'nssguesttest', + 'sources': [ 'nsstest.c' ], + 'c_args': [ '-DLIBVIRT_NSS_GUEST' ], + 'include': [ nss_inc_dir ], + 'link_with': [ nss_libvirt_guest_impl ], + }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( diff --git a/tools/nss/meson.build b/tools/nss/meson.build index b07bfa4be8b..cf3eec9b24a 100644 --- a/tools/nss/meson.build +++ b/tools/nss/meson.build @@ -88,3 +88,5 @@ nss_libvirt_guest_lib = shared_library( install: true, install_dir: libdir, ) + +nss_inc_dir = include_directories('.') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 18 ------------------ tests/meson.build | 7 +++++++ 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 816d7ec8a64..6a217cd92e7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -77,11 +77,6 @@ if WITH_STORAGE_SHEEPDOG test_programs += storagebackendsheepdogtest endif WITH_STORAGE_SHEEPDOG -if WITH_NWFILTER -test_programs += nwfilterebiptablestest -test_programs += nwfilterxml2firewalltest -endif WITH_NWFILTER - if WITH_STORAGE test_programs += storagevolxml2argvtest test_programs += storagepoolxml2argvtest @@ -334,19 +329,6 @@ storagebackendsheepdogtest_LDADD = \ $(LDADDS) endif ! WITH_STORAGE_SHEEPDOG -if WITH_NWFILTER -nwfilterebiptablestest_SOURCES = \ - nwfilterebiptablestest.c \ - testutils.c testutils.h -nwfilterebiptablestest_LDADD = ../src/libvirt_driver_nwfilter_impl.la $(LDADDS) - -nwfilterxml2firewalltest_SOURCES = \ - nwfilterxml2firewalltest.c \ - testutils.c testutils.h -nwfilterxml2firewalltest_LDADD = \ - ../src/libvirt_driver_nwfilter_impl.la $(LDADDS) -endif WITH_NWFILTER - if WITH_STORAGE virstorageutiltest_SOURCES = \ virstorageutiltest.c \ diff --git a/tests/meson.build b/tests/meson.build index 0b503bca720..916b6de10f9 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -417,6 +417,13 @@ if conf.has('WITH_NSS') ] endif +if conf.has('WITH_NWFILTER') + tests += [ + { 'name': 'nwfilterebiptablestest', 'link_with': [ nwfilter_driver_impl ] }, + { 'name': 'nwfilterxml2firewalltest', 'link_with': [ nwfilter_driver_impl ] }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 12 ------------ tests/meson.build | 6 ++++++ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 6a217cd92e7..9e436512fef 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -53,10 +53,6 @@ test_programs += qemuxml2argvtest qemuxml2xmltest \ test_helpers += qemucapsprobe endif WITH_QEMU -if WITH_OPENVZ -test_programs += openvzutilstest -endif WITH_OPENVZ - if WITH_VBOX test_programs += vboxsnapshotxmltest endif WITH_VBOX @@ -284,14 +280,6 @@ qemuvhostusertest_SOURCES = \ qemuvhostusertest_LDADD = $(qemu_LDADDS) endif ! WITH_QEMU -if WITH_OPENVZ -openvzutilstest_SOURCES = \ - openvzutilstest.c \ - testutils.c testutils.h -openvzutilstest_LDADD = $(LDADDS) \ - ../src/libvirt_driver_openvz.la -endif ! WITH_OPENVZ - if WITH_VBOX vboxsnapshotxmltest_SOURCES = \ vboxsnapshotxmltest.c \ diff --git a/tests/meson.build b/tests/meson.build index 916b6de10f9..6dd926e96b8 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -424,6 +424,12 @@ if conf.has('WITH_NWFILTER') ] endif +if conf.has('WITH_OPENVZ') + tests += [ + { 'name': 'openvzutilstest', 'link_with': [ openvz_lib ] }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 138 ---------------------------------------------- tests/meson.build | 21 +++++++ 2 files changed, 21 insertions(+), 138 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 9e436512fef..a821b0e0af7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -38,18 +38,6 @@ endif WITH_ATTR endif WITH_SECDRIVER_SELINUX if WITH_QEMU -test_programs += qemuxml2argvtest qemuxml2xmltest \ - qemudomaincheckpointxml2xmltest qemudomainsnapshotxml2xmltest \ - qemumonitorjsontest qemuhotplugtest \ - qemuagenttest qemucapabilitiestest qemucaps2xmltest \ - qemumemlocktest \ - qemucommandutiltest \ - qemublocktest \ - qemumigparamstest \ - qemusecuritytest \ - qemufirmwaretest \ - qemuvhostusertest \ - $(NULL) test_helpers += qemucapsprobe endif WITH_QEMU @@ -148,136 +136,10 @@ valgrind: $(MAKE) check VG="$(LIBTOOL) --mode=execute $(VALGRIND)" if WITH_QEMU - -qemu_LDADDS = ../src/libvirt_driver_qemu_impl.la -if WITH_DTRACE_PROBES -qemu_LDADDS += ../src/libvirt_qemu_probes.lo -endif WITH_DTRACE_PROBES -qemu_LDADDS += $(LDADDS) - -qemuxml2argvtest_SOURCES = \ - qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \ - testutils.c testutils.h \ - virfilewrapper.c virfilewrapper.h \ - $(NULL) -qemuxml2argvtest_LDADD = libqemutestdriver.la libqemumonitortestutils.la \ - $(LDADDS) $(LIBXML_LIBS) - -qemuxml2xmltest_SOURCES = \ - qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \ - testutils.c testutils.h \ - virfilewrapper.c virfilewrapper.h -qemuxml2xmltest_LDADD = $(qemu_LDADDS) - -qemumonitorjsontest_SOURCES = \ - qemumonitorjsontest.c \ - testutils.c testutils.h \ - testutilsqemu.c testutilsqemu.h \ - $(NULL) -qemumonitorjsontest_LDADD = libqemumonitortestutils.la \ - $(qemu_LDADDS) - -qemucapabilitiestest_SOURCES = \ - qemucapabilitiestest.c \ - testutils.c testutils.h \ - testutilsqemu.c testutilsqemu.h \ - $(NULL) -qemucapabilitiestest_LDADD = libqemumonitortestutils.la \ - $(qemu_LDADDS) - qemucapsprobe_SOURCES = \ qemucapsprobe.c qemucapsprobe_LDADD = \ libqemutestdriver.la $(LDADDS) - -qemucommandutiltest_SOURCES = \ - qemucommandutiltest.c \ - testutils.c testutils.h \ - testutilsqemu.c testutilsqemu.h \ - $(NULL) -qemucommandutiltest_LDADD = libqemumonitortestutils.la \ - $(qemu_LDADDS) - -qemucaps2xmltest_SOURCES = \ - qemucaps2xmltest.c \ - testutils.c testutils.h \ - testutilsqemu.c testutilsqemu.h \ - $(NULL) -qemucaps2xmltest_LDADD = $(qemu_LDADDS) - -qemuagenttest_SOURCES = \ - qemuagenttest.c \ - testutils.c testutils.h \ - testutilsqemu.c testutilsqemu.h \ - $(NULL) -qemuagenttest_LDADD = libqemumonitortestutils.la $(qemu_LDADDS) - -qemuhotplugtest_SOURCES = \ - qemuhotplugtest.c \ - testutils.c testutils.h \ - testutilsqemu.c testutilsqemu.h \ - $(NULL) -qemuhotplugtest_LDADD = \ - libqemutestdriver.la \ - libqemumonitortestutils.la \ - $(qemu_LDADDS) \ - $(NULL) - -qemublocktest_SOURCES = \ - qemublocktest.c \ - testutils.h testutils.c \ - testutilsqemu.h testutilsqemu.c \ - $(NULL) -qemublocktest_LDADD = \ - libqemumonitortestutils.la \ - ../src/libvirt.la \ - $(qemu_LDADDS) \ - $(NULL) - -qemudomaincheckpointxml2xmltest_SOURCES = \ - qemudomaincheckpointxml2xmltest.c testutilsqemu.c testutilsqemu.h \ - testutils.c testutils.h -qemudomaincheckpointxml2xmltest_LDADD = $(qemu_LDADDS) - -qemudomainsnapshotxml2xmltest_SOURCES = \ - qemudomainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \ - testutils.c testutils.h -qemudomainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS) - -qemumemlocktest_SOURCES = \ - qemumemlocktest.c \ - testutilsqemu.c testutilsqemu.h \ - testutils.c testutils.h -qemumemlocktest_LDADD = $(qemu_LDADDS) - -qemumigparamstest_SOURCES = \ - qemumigparamstest.c \ - testutils.c testutils.h \ - testutilsqemu.c testutilsqemu.h \ - $(NULL) -qemumigparamstest_LDADD = libqemumonitortestutils.la \ - $(qemu_LDADDS) - -qemusecuritytest_SOURCES = \ - qemusecuritytest.c qemusecuritytest.h \ - qemusecuritymock.c \ - testutils.h testutils.c \ - testutilsqemu.h testutilsqemu.c -qemusecuritytest_LDADD = $(qemu_LDADDS) - -qemufirmwaretest_SOURCES = \ - qemufirmwaretest.c \ - testutils.h testutils.c \ - virfilewrapper.c virfilewrapper.h \ - $(NULL) -qemufirmwaretest_LDADD = $(qemu_LDADDS) - -qemuvhostusertest_SOURCES = \ - qemuvhostusertest.c \ - testutils.h testutils.c \ - virfilewrapper.c virfilewrapper.h \ - $(NULL) -qemuvhostusertest_LDADD = $(qemu_LDADDS) endif ! WITH_QEMU if WITH_VBOX diff --git a/tests/meson.build b/tests/meson.build index 6dd926e96b8..7a96d11e842 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -430,6 +430,27 @@ if conf.has('WITH_OPENVZ') ] endif +if conf.has('WITH_QEMU') + tests += [ + { 'name': 'qemuagenttest', 'link_with': [ test_utils_qemu_lib, test_qemu_driver_lib, test_utils_qemu_monitor_lib ] }, + { 'name': 'qemublocktest', 'link_with': [ test_utils_qemu_lib, test_qemu_driver_lib, test_utils_qemu_monitor_lib ] }, + { 'name': 'qemucapabilitiestest', 'link_with': [ test_utils_qemu_lib, test_qemu_driver_lib, test_utils_qemu_monitor_lib ] }, + { 'name': 'qemucaps2xmltest', 'link_with': [ test_utils_qemu_lib, test_qemu_driver_lib ] }, + { 'name': 'qemucommandutiltest', 'link_with': [ test_utils_qemu_lib, test_qemu_driver_lib, test_utils_qemu_monitor_lib ] }, + { 'name': 'qemudomaincheckpointxml2xmltest', 'link_with': [ test_utils_qemu_lib, test_qemu_driver_lib ] }, + { 'name': 'qemudomainsnapshotxml2xmltest', 'link_with': [ test_utils_qemu_lib, test_qemu_driver_lib ] }, + { 'name': 'qemufirmwaretest', 'link_with': [ test_qemu_driver_lib, test_file_wrapper_lib ] }, + { 'name': 'qemuhotplugtest', 'link_with': [ test_utils_qemu_lib, test_qemu_driver_lib, test_utils_qemu_monitor_lib ] }, + { 'name': 'qemumemlocktest', 'link_with': [ test_utils_qemu_lib, test_qemu_driver_lib ] }, + { 'name': 'qemumigparamstest', 'link_with': [ test_utils_qemu_lib, test_qemu_driver_lib, test_utils_qemu_monitor_lib ] }, + { 'name': 'qemumonitorjsontest', 'link_with': [ test_utils_qemu_lib, test_qemu_driver_lib, test_utils_qemu_monitor_lib ] }, + { 'name': 'qemusecuritytest', 'sources': [ 'qemusecuritytest.c', 'qemusecuritymock.c' ], 'link_with': [ test_utils_qemu_lib, test_qemu_driver_lib ] }, + { 'name': 'qemuvhostusertest', 'link_with': [ test_qemu_driver_lib, test_file_wrapper_lib ] }, + { 'name': 'qemuxml2argvtest', 'link_with': [ test_utils_qemu_lib, test_qemu_driver_lib, test_utils_qemu_monitor_lib, test_file_wrapper_lib ] }, + { 'name': 'qemuxml2xmltest', 'link_with': [ test_utils_qemu_lib, test_qemu_driver_lib, test_file_wrapper_lib ] }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 46 ---------------------------------------------- tests/meson.build | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 46 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index a821b0e0af7..ecc2a76a80f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,17 +16,6 @@ ## License along with this library. If not, see ## <http://www.gnu.org/licenses/>. -if WITH_REMOTE -test_programs += \ - virnetmessagetest \ - virnetsockettest \ - virnetdaemontest \ - virnetserverclienttest \ - virnettlscontexttest \ - virnettlssessiontest \ - $(NULL) -endif WITH_REMOTE - if WITH_SECDRIVER_SELINUX if WITH_ATTR test_programs += securityselinuxtest \ @@ -219,41 +208,6 @@ storagepoolcapstest_SOURCES = \ storagepoolcapstest_LDADD = $(LDADDS) endif ! WITH_STORAGE -virnetmessagetest_SOURCES = \ - virnetmessagetest.c testutils.h testutils.c -virnetmessagetest_LDADD = $(LDADDS) - -virnetsockettest_SOURCES = \ - virnetsockettest.c testutils.h testutils.c -virnetsockettest_LDADD = $(LDADDS) - -virnetdaemontest_SOURCES = \ - virnetdaemontest.c \ - testutils.h testutils.c -virnetdaemontest_LDADD = $(LDADDS) - -virnetserverclienttest_SOURCES = \ - virnetserverclienttest.c \ - testutils.h testutils.c -virnetserverclienttest_LDADD = $(LDADDS) - -virnettlscontexttest_SOURCES = \ - virnettlscontexttest.c \ - virnettlshelpers.h virnettlshelpers.c \ - testutils.h testutils.c -virnettlscontexttest_LDADD = $(LDADDS) $(GNUTLS_LIBS) -virnettlssessiontest_SOURCES = \ - virnettlssessiontest.c \ - virnettlshelpers.h virnettlshelpers.c \ - testutils.h testutils.c -virnettlssessiontest_LDADD = $(LDADDS) $(GNUTLS_LIBS) -if HAVE_LIBTASN1 -virnettlscontexttest_SOURCES += pkix_asn1_tab.c -virnettlscontexttest_LDADD += -ltasn1 -virnettlssessiontest_SOURCES += pkix_asn1_tab.c -virnettlssessiontest_LDADD += -ltasn1 -endif ! HAVE_LIBTASN1 - virstoragetest_SOURCES = \ virstoragetest.c testutils.h testutils.c virstoragetest_LDADD = $(LDADDS) \ diff --git a/tests/meson.build b/tests/meson.build index 7a96d11e842..4e01585da11 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -451,6 +451,27 @@ if conf.has('WITH_QEMU') ] endif +if conf.has('WITH_REMOTE') + tests += [ + { 'name': 'virnetdaemontest' }, + { 'name': 'virnetmessagetest' }, + { 'name': 'virnetserverclienttest' }, + { 'name': 'virnetsockettest' }, + ] + + nettls_sources = [ 'virnettlshelpers.c' ] + if conf.has('HAVE_LIBTASN1_H') + nettls_sources += 'pkix_asn1_tab.c' + endif + + libtasn1_dep = cc.find_library('tasn1', required: false) + + tests += [ + { 'name': 'virnettlscontexttest', 'sources': [ 'virnettlscontexttest.c', nettls_sources ], 'deps': [ libtasn1_dep, ] }, + { 'name': 'virnettlssessiontest', 'sources': [ 'virnettlssessiontest.c', nettls_sources ], 'deps': [ libtasn1_dep, ] }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 39 --------------------------------------- tests/meson.build | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 39 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index ecc2a76a80f..7b2cba16eff 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,16 +16,6 @@ ## License along with this library. If not, see ## <http://www.gnu.org/licenses/>. -if WITH_SECDRIVER_SELINUX -if WITH_ATTR -test_programs += securityselinuxtest \ - viridentitytest -if WITH_QEMU -test_programs += securityselinuxlabeltest -endif WITH_QEMU -endif WITH_ATTR -endif WITH_SECDRIVER_SELINUX - if WITH_QEMU test_helpers += qemucapsprobe endif WITH_QEMU @@ -215,15 +205,6 @@ virstoragetest_LDADD = $(LDADDS) \ ../src/libvirt_driver_storage_impl.la \ $(NULL) -viridentitytest_SOURCES = \ - viridentitytest.c testutils.h testutils.c -viridentitytest_LDADD = $(LDADDS) -if WITH_SELINUX -viridentitytest_LDADD += $(SELINUX_LIBS) -viridentitytest_DEPENDENCIES = libsecurityselinuxhelper.la \ - ../src/libvirt.la -endif WITH_SELINUX - if WITH_NSS ## Intentionaly not linking with anything else. ## See the test source for more detailed explanation. @@ -257,26 +238,6 @@ test_programs += \ virnetdevopenvswitchtest endif ! WITH_YAJL -if WITH_SECDRIVER_SELINUX -if WITH_ATTR - -securityselinuxtest_SOURCES = \ - securityselinuxtest.c testutils.h testutils.c -securityselinuxtest_LDADD = $(LDADDS) $(SELINUX_LIBS) -securityselinuxtest_DEPENDENCIES = libsecurityselinuxhelper.la \ - ../src/libvirt.la - -if WITH_QEMU -securityselinuxlabeltest_SOURCES = \ - securityselinuxlabeltest.c testutils.h testutils.c \ - testutilsqemu.h testutilsqemu.c -securityselinuxlabeltest_LDADD = $(qemu_LDADDS) $(SELINUX_LIBS) -securityselinuxlabeltest_DEPENDENCIES = libsecurityselinuxhelper.la \ - ../src/libvirt.la -endif WITH_QEMU -endif WITH_ATTR -endif WITH_SECDRIVER_SELINUX - virjsontest_SOURCES = \ virjsontest.c testutils.h testutils.c virjsontest_LDADD = $(LDADDS) diff --git a/tests/meson.build b/tests/meson.build index 4e01585da11..67b9cd11d1c 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -472,6 +472,21 @@ if conf.has('WITH_REMOTE') ] endif +if conf.has('WITH_SECDRIVER_SELINUX') + if conf.has('WITH_ATTR') + tests += [ + { 'name': 'securityselinuxtest' }, + { 'name': 'viridentitytest' }, + ] + + if conf.has('WITH_QEMU') + tests += [ + { 'name': 'securityselinuxlabeltest', 'link_with': [ test_utils_qemu_lib ] }, + ] + endif + endif +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 48 ----------------------------------------------- tests/meson.build | 10 ++++++++++ 2 files changed, 10 insertions(+), 48 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 7b2cba16eff..83b8e979df4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -40,14 +40,6 @@ if WITH_STORAGE_SHEEPDOG test_programs += storagebackendsheepdogtest endif WITH_STORAGE_SHEEPDOG -if WITH_STORAGE -test_programs += storagevolxml2argvtest -test_programs += storagepoolxml2argvtest -test_programs += virstorageutiltest -test_programs += storagepoolxml2xmltest -test_programs += storagepoolcapstest -endif WITH_STORAGE - if WITH_STORAGE_FS test_programs += virstoragetest endif WITH_STORAGE_FS @@ -158,46 +150,6 @@ storagebackendsheepdogtest_LDADD = \ $(LDADDS) endif ! WITH_STORAGE_SHEEPDOG -if WITH_STORAGE -virstorageutiltest_SOURCES = \ - virstorageutiltest.c \ - testutils.c \ - testutils.h \ - $(NULL) -virstorageutiltest_LDADD = \ - ../src/libvirt_driver_storage_impl.la \ - $(LDADDS) \ - $(NULL) - -storagevolxml2argvtest_SOURCES = \ - storagevolxml2argvtest.c \ - testutils.c testutils.h -storagevolxml2argvtest_LDADD = \ - $(LIBXML_LIBS) \ - ../src/libvirt_driver_storage_impl.la \ - ../src/libvirt.la \ - $(LDADDS) - -storagepoolxml2argvtest_SOURCES = \ - storagepoolxml2argvtest.c \ - testutils.c testutils.h -storagepoolxml2argvtest_LDADD = \ - $(LIBXML_LIBS) \ - ../src/libvirt_driver_storage_impl.la \ - ../src/libvirt.la \ - $(LDADDS) - -storagepoolxml2xmltest_SOURCES = \ - storagepoolxml2xmltest.c \ - testutils.c testutils.h -storagepoolxml2xmltest_LDADD = $(LDADDS) \ - ../src/libvirt_driver_storage_impl.la - -storagepoolcapstest_SOURCES = \ - storagepoolcapstest.c testutils.h testutils.c -storagepoolcapstest_LDADD = $(LDADDS) -endif ! WITH_STORAGE - virstoragetest_SOURCES = \ virstoragetest.c testutils.h testutils.c virstoragetest_LDADD = $(LDADDS) \ diff --git a/tests/meson.build b/tests/meson.build index 67b9cd11d1c..344df91a381 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -487,6 +487,16 @@ if conf.has('WITH_SECDRIVER_SELINUX') endif endif +if conf.has('WITH_STORAGE') + tests += [ + { 'name': 'storagepoolcapstest' }, + { 'name': 'storagepoolxml2argvtest', 'link_with': [ storage_driver_impl_lib ] }, + { 'name': 'storagepoolxml2xmltest', 'link_with': [ storage_driver_impl_lib ] }, + { 'name': 'storagevolxml2argvtest', 'link_with': [ storage_driver_impl_lib ] }, + { 'name': 'virstorageutiltest', 'link_with': [ storage_driver_impl_lib ] }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 11 ----------- tests/meson.build | 6 ++++++ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 83b8e979df4..4fb27e0b85d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -40,10 +40,6 @@ if WITH_STORAGE_SHEEPDOG test_programs += storagebackendsheepdogtest endif WITH_STORAGE_SHEEPDOG -if WITH_STORAGE_FS -test_programs += virstoragetest -endif WITH_STORAGE_FS - if WITH_NSS test_helpers += nsslinktest nssguestlinktest endif WITH_NSS @@ -150,13 +146,6 @@ storagebackendsheepdogtest_LDADD = \ $(LDADDS) endif ! WITH_STORAGE_SHEEPDOG -virstoragetest_SOURCES = \ - virstoragetest.c testutils.h testutils.c -virstoragetest_LDADD = $(LDADDS) \ - ../src/libvirt.la \ - ../src/libvirt_driver_storage_impl.la \ - $(NULL) - if WITH_NSS ## Intentionaly not linking with anything else. ## See the test source for more detailed explanation. diff --git a/tests/meson.build b/tests/meson.build index 344df91a381..b47580057ed 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -497,6 +497,12 @@ if conf.has('WITH_STORAGE') ] endif +if conf.has('WITH_STORAGE_FS') + tests += [ + { 'name': 'virstoragetest', 'link_with': [ storage_driver_impl_lib ] }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 14 -------------- tests/meson.build | 6 ++++++ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 4fb27e0b85d..b696d3434fe 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -36,10 +36,6 @@ if WITH_YAJL test_programs += virjsontest endif WITH_YAJL -if WITH_STORAGE_SHEEPDOG -test_programs += storagebackendsheepdogtest -endif WITH_STORAGE_SHEEPDOG - if WITH_NSS test_helpers += nsslinktest nssguestlinktest endif WITH_NSS @@ -136,16 +132,6 @@ vmwarevertest_SOURCES = \ vmwarevertest_LDADD = $(LDADDS) endif ! WITH_VMWARE -if WITH_STORAGE_SHEEPDOG -storagebackendsheepdogtest_SOURCES = \ - storagebackendsheepdogtest.c \ - testutils.c testutils.h -storagebackendsheepdogtest_LDADD = \ - ../src/libvirt_storage_backend_sheepdog_priv.la \ - ../src/libvirt_driver_storage_impl.la \ - $(LDADDS) -endif ! WITH_STORAGE_SHEEPDOG - if WITH_NSS ## Intentionaly not linking with anything else. ## See the test source for more detailed explanation. diff --git a/tests/meson.build b/tests/meson.build index b47580057ed..e9a6cd72cc7 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -503,6 +503,12 @@ if conf.has('WITH_STORAGE_FS') ] endif +if conf.has('WITH_STORAGE_SHEEPDOG') + tests += [ + { 'name': 'storagebackendsheepdogtest', 'link_with': [ storage_driver_impl_lib, storage_backend_sheepdog_priv_lib ] }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 12 ------------ tests/meson.build | 6 ++++++ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index b696d3434fe..ab45bdd6da4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -20,10 +20,6 @@ if WITH_QEMU test_helpers += qemucapsprobe endif WITH_QEMU -if WITH_VBOX -test_programs += vboxsnapshotxmltest -endif WITH_VBOX - if WITH_VMX test_programs += vmx2xmltest xml2vmxtest endif WITH_VMX @@ -105,14 +101,6 @@ qemucapsprobe_LDADD = \ libqemutestdriver.la $(LDADDS) endif ! WITH_QEMU -if WITH_VBOX -vboxsnapshotxmltest_SOURCES = \ - vboxsnapshotxmltest.c \ - testutils.c testutils.h -vbox_LDADDS = ../src/libvirt_driver_vbox_impl.la -vboxsnapshotxmltest_LDADD = $(LDADDS) $(vbox_LDADDS) -endif ! WITH_VBOX - if WITH_VMX vmx2xmltest_SOURCES = \ vmx2xmltest.c \ diff --git a/tests/meson.build b/tests/meson.build index e9a6cd72cc7..7f93d816b44 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -509,6 +509,12 @@ if conf.has('WITH_STORAGE_SHEEPDOG') ] endif +if conf.has('WITH_VBOX') + tests += [ + { 'name': 'vboxsnapshotxmltest', 'link_with': [ vbox_driver_impl ] }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 11 ----------- tests/meson.build | 6 ++++++ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index ab45bdd6da4..69506b31a3e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -24,10 +24,6 @@ if WITH_VMX test_programs += vmx2xmltest xml2vmxtest endif WITH_VMX -if WITH_VMWARE -test_programs += vmwarevertest -endif WITH_VMWARE - if WITH_YAJL test_programs += virjsontest endif WITH_YAJL @@ -113,13 +109,6 @@ xml2vmxtest_SOURCES = \ xml2vmxtest_LDADD = $(LDADDS) endif ! WITH_VMX -if WITH_VMWARE -vmwarevertest_SOURCES = \ - vmwarevertest.c \ - testutils.c testutils.h -vmwarevertest_LDADD = $(LDADDS) -endif ! WITH_VMWARE - if WITH_NSS ## Intentionaly not linking with anything else. ## See the test source for more detailed explanation. diff --git a/tests/meson.build b/tests/meson.build index 7f93d816b44..38f3823cff6 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -515,6 +515,12 @@ if conf.has('WITH_VBOX') ] endif +if conf.has('WITH_VMWARE') + tests += [ + { 'name': 'vmwarevertest' }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 16 ---------------- tests/meson.build | 7 +++++++ 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 69506b31a3e..f30fc379077 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -20,10 +20,6 @@ if WITH_QEMU test_helpers += qemucapsprobe endif WITH_QEMU -if WITH_VMX -test_programs += vmx2xmltest xml2vmxtest -endif WITH_VMX - if WITH_YAJL test_programs += virjsontest endif WITH_YAJL @@ -97,18 +93,6 @@ qemucapsprobe_LDADD = \ libqemutestdriver.la $(LDADDS) endif ! WITH_QEMU -if WITH_VMX -vmx2xmltest_SOURCES = \ - vmx2xmltest.c \ - testutils.c testutils.h -vmx2xmltest_LDADD = $(LDADDS) - -xml2vmxtest_SOURCES = \ - xml2vmxtest.c \ - testutils.c testutils.h -xml2vmxtest_LDADD = $(LDADDS) -endif ! WITH_VMX - if WITH_NSS ## Intentionaly not linking with anything else. ## See the test source for more detailed explanation. diff --git a/tests/meson.build b/tests/meson.build index 38f3823cff6..65a1f2b31c4 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -521,6 +521,13 @@ if conf.has('WITH_VMWARE') ] endif +if conf.has('WITH_VMX') + tests += [ + { 'name': 'vmx2xmltest' }, + { 'name': 'xml2vmxtest' }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 29 +++-------------------------- tests/meson.build | 8 ++++++++ 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index f30fc379077..498655d4776 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -20,10 +20,6 @@ if WITH_QEMU test_helpers += qemucapsprobe endif WITH_QEMU -if WITH_YAJL -test_programs += virjsontest -endif WITH_YAJL - if WITH_NSS test_helpers += nsslinktest nssguestlinktest endif WITH_NSS @@ -72,13 +68,12 @@ file-access-clean: endif WITH_LINUX if WITH_TESTS -noinst_PROGRAMS = $(test_programs) $(test_helpers) +noinst_PROGRAMS = $(test_helpers) else ! WITH_TESTS -check_PROGRAMS = $(test_programs) $(test_helpers) +check_PROGRAMS = $(test_helpers) endif ! WITH_TESTS -TESTS = $(test_programs) \ - $(test_scripts) +TESTS = $(test_scripts) VALGRIND = valgrind --quiet --leak-check=full --trace-children=yes \ --trace-children-skip="*/tools/virsh","*/tests/commandhelper","/usr/bin/*" \ @@ -111,21 +106,3 @@ nssguestlinktest_CFLAGS = \ nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la nssguestlinktest_LDFLAGS = $(NULL) endif ! WITH_NSS - -if WITH_YAJL -virmacmaptest_SOURCES = \ - virmacmaptest.c testutils.h testutils.c -virmacmaptest_LDADD = $(LDADDS) - -virnetdevopenvswitchtest_SOURCES = \ - virnetdevopenvswitchtest.c testutils.h testutils.c -virnetdevopenvswitchtest_LDADD = $(LDADDS) - -test_programs += \ - virmacmaptest \ - virnetdevopenvswitchtest -endif ! WITH_YAJL - -virjsontest_SOURCES = \ - virjsontest.c testutils.h testutils.c -virjsontest_LDADD = $(LDADDS) diff --git a/tests/meson.build b/tests/meson.build index 65a1f2b31c4..40acbcee6cd 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -528,6 +528,14 @@ if conf.has('WITH_VMX') ] endif +if conf.has('WITH_YAJL') + tests += [ + { 'name': 'virjsontest' }, + { 'name': 'virmacmaptest' }, + { 'name': 'virnetdevopenvswitchtest' }, + ] +endif + foreach data : tests test_sources = '@0@.c'.format(data['name']) test_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/meson.build | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/meson.build b/tests/meson.build index 40acbcee6cd..ebf53891ec7 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -566,3 +566,37 @@ foreach data : tests ) test(data['name'], test_bin, env: tests_env) endforeach + + +# helpers: +# each entry is a dictionary with following items: +# * name - name of the test which is also used as default source file name (required) +# * sources - override default sources based on name (optional, default [ '$name.c' ]) +# * c_args - args used by test (optional, default []) +# * include - include_directories (optional, default []) +# * link_with - compiled libraries to link with (optional, default []) + +helpers = [] + +foreach data : helpers + helper_sources = '@0@.c'.format(data['name']) + helper_bin = executable( + data['name'], + [ + data.get('sources', helper_sources), + ], + c_args: [ + data.get('c_args', []), + ], + dependencies: [ + tests_dep, + ], + include_directories: [ + data.get('include', []), + ], + link_with: [ + data['link_with'], + ], + export_dynamic: true, + ) +endforeach -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 39 --------------------------------------- tests/meson.build | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 39 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 498655d4776..939d97a9985 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,14 +16,6 @@ ## License along with this library. If not, see ## <http://www.gnu.org/licenses/>. -if WITH_QEMU -test_helpers += qemucapsprobe -endif WITH_QEMU - -if WITH_NSS -test_helpers += nsslinktest nssguestlinktest -endif WITH_NSS - test_scripts = libvirtd_test_scripts = \ libvirtd-fail \ @@ -67,11 +59,6 @@ file-access-clean: > test_file_access.txt endif WITH_LINUX -if WITH_TESTS -noinst_PROGRAMS = $(test_helpers) -else ! WITH_TESTS -check_PROGRAMS = $(test_helpers) -endif ! WITH_TESTS TESTS = $(test_scripts) @@ -80,29 +67,3 @@ VALGRIND = valgrind --quiet --leak-check=full --trace-children=yes \ --suppressions=$(abs_srcdir)/.valgrind.supp valgrind: $(MAKE) check VG="$(LIBTOOL) --mode=execute $(VALGRIND)" - -if WITH_QEMU -qemucapsprobe_SOURCES = \ - qemucapsprobe.c -qemucapsprobe_LDADD = \ - libqemutestdriver.la $(LDADDS) -endif ! WITH_QEMU - -if WITH_NSS -## Intentionaly not linking with anything else. -## See the test source for more detailed explanation. -nsslinktest_SOURCES = nsslinktest.c -nsslinktest_CFLAGS = \ - $(AM_CFLAGS) \ - -I$(top_srcdir)/tools/nss -nsslinktest_LDADD = ../tools/nss/libnss_libvirt_impl.la -nsslinktest_LDFLAGS = $(NULL) - -nssguestlinktest_SOURCES = nsslinktest.c -nssguestlinktest_CFLAGS = \ - -DLIBVIRT_NSS_GUEST \ - $(AM_CFLAGS) \ - -I$(top_srcdir)/tools/nss -nssguestlinktest_LDADD = ../tools/nss/libnss_libvirt_guest_impl.la -nssguestlinktest_LDFLAGS = $(NULL) -endif ! WITH_NSS diff --git a/tests/meson.build b/tests/meson.build index ebf53891ec7..5df9973ccf9 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -578,6 +578,34 @@ endforeach helpers = [] +if conf.has('WITH_NSS') + helpers += [ + # Intentionaly not linking with anything else. + # See the test source for more detailed explanation. + { + 'name': 'nsslinktest', + 'include': [ nss_inc_dir ], + 'link_with': [ nss_libvirt_impl ], + }, + { + 'name': 'nssguestlinktest', + 'sources': [ 'nsslinktest.c' ], + 'c_args': [ '-DLIBVIRT_NSS_GUEST' ], + 'include': [ nss_inc_dir ], + 'link_with': [ nss_libvirt_guest_impl ], + }, + ] +endif + +if conf.has('WITH_QEMU') + helpers += [ + { + 'name': 'qemucapsprobe', + 'link_with': [ test_qemu_driver_lib, libvirt_lib ], + }, + ] +endif + foreach data : helpers helper_sources = '@0@.c'.format(data['name']) helper_bin = executable( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- tests/Makefile.am | 34 ---------------------------------- tests/meson.build | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 34 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 939d97a9985..641ed7b390b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,38 +16,6 @@ ## License along with this library. If not, see ## <http://www.gnu.org/licenses/>. -test_scripts = -libvirtd_test_scripts = \ - libvirtd-fail \ - libvirtd-pool \ - virsh-auth \ - virsh-cpuset \ - virsh-define-dev-segfault \ - virsh-int-overflow \ - virsh-optparse \ - virsh-read-bufsiz \ - virsh-read-non-seekable \ - virsh-schedinfo \ - virsh-self-test \ - virt-admin-self-test \ - virsh-checkpoint \ - virsh-snapshot \ - virsh-start \ - virsh-undefine \ - virsh-uriprecedence \ - virsh-vcpupin \ - $(NULL) - -if WITH_LIBVIRTD -test_scripts += $(libvirtd_test_scripts) -endif ! WITH_LIBVIRTD - -if WITH_SECDRIVER_APPARMOR -if WITH_LIBVIRTD -test_scripts += virt-aa-helper-test -endif WITH_LIBVIRTD -endif WITH_SECDRIVER_APPARMOR - if WITH_LINUX check-access: file-access-clean VIR_TEST_FILE_ACCESS=1 $(MAKE) $(AM_MAKEFLAGS) check @@ -60,8 +28,6 @@ file-access-clean: endif WITH_LINUX -TESTS = $(test_scripts) - VALGRIND = valgrind --quiet --leak-check=full --trace-children=yes \ --trace-children-skip="*/tools/virsh","*/tests/commandhelper","/usr/bin/*" \ --suppressions=$(abs_srcdir)/.valgrind.supp diff --git a/tests/meson.build b/tests/meson.build index 5df9973ccf9..d6e0d2805d7 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -628,3 +628,40 @@ foreach data : helpers export_dynamic: true, ) endforeach + + +# test_scripts: +# list of test scripts to run +test_scripts = [] + +if conf.has('WITH_LIBVIRTD') + test_scripts += [ + 'libvirtd-fail', + 'libvirtd-pool', + 'virsh-auth', + 'virsh-checkpoint', + 'virsh-cpuset', + 'virsh-define-dev-segfault', + 'virsh-int-overflow', + 'virsh-optparse', + 'virsh-read-bufsiz', + 'virsh-read-non-seekable', + 'virsh-schedinfo', + 'virsh-self-test', + 'virsh-snapshot', + 'virsh-start', + 'virsh-undefine', + 'virsh-uriprecedence', + 'virsh-vcpupin', + 'virt-admin-self-test', + ] + + if conf.has('WITH_SECDRIVER_APPARMOR') + test_scripts += 'virt-aa-helper-test' + endif +endif + +foreach name : test_scripts + script = find_program(name) + test(name, script, env: tests_env) +endforeach -- 2.26.2

We need to modify check-file-access.py to be usable as wrapper for libvirt tests. This way we can run the tests using this command: meson test --setup access which will run all tests using check-file-access.py as a wrapper. With autotools all file access are written into single file for all tests and compared once the whole test suite is done. With Meson we will compare the file access after every single test because it is used as wrapper now. That requires writing the file access into separate files for every single test as they are executed in parallel. Since the wrapper is used for all tests in Meson including tests outside of tests directory we have to check for presence of the output file. We should also cleanup after ourselves. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 3 --- scripts/check-file-access.py | 24 +++++++++++++++++++----- tests/Makefile.am | 12 ------------ tests/meson.build | 8 ++++++++ tests/virtestmock.c | 2 +- 5 files changed, 28 insertions(+), 21 deletions(-) diff --git a/Makefile.am b/Makefile.am index 363c5cf66fd..d05a0c1a85a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -37,9 +37,6 @@ srpm: clean check-local: all tests -check-access: all - @($(MAKE) $(AM_MAKEFLAGS) -C tests check-access) - dist-hook: gen-AUTHORS .PHONY: gen-AUTHORS diff --git a/scripts/check-file-access.py b/scripts/check-file-access.py index aa120cafacf..f0e98f4b652 100755 --- a/scripts/check-file-access.py +++ b/scripts/check-file-access.py @@ -21,15 +21,27 @@ # # +import os +import random import re +import string import sys -if len(sys.argv) != 3: - print("syntax: %s ACCESS-FILE PERMITTED-ACCESS-FILE") - sys.exit(1) +abs_builddir = os.environ.get('abs_builddir', '') +abs_srcdir = os.environ.get('abs_srcdir', '') -access_file = sys.argv[1] -permitted_file = sys.argv[2] +filename = ''.join(random.choice(string.ascii_letters) for _ in range(16)) +access_file = os.path.join(abs_builddir, 'file-access-{0}.txt'.format(filename)) +permitted_file = os.path.join(abs_srcdir, 'permitted_file_access.txt') + +os.environ['VIR_TEST_FILE_ACCESS_OUTPUT'] = access_file + +test = ' '.join(sys.argv[1:]) + +ret = os.system(test) + +if ret != 0 or not os.is_file(access_file): + sys.exit(ret) known_actions = ["open", "fopen", "access", "stat", "lstat", "connect"] @@ -120,6 +132,8 @@ for file in files: print(": %s" % file["testname"], end="") print("") +os.remove(access_file) + if err: sys.exit(1) sys.exit(0) diff --git a/tests/Makefile.am b/tests/Makefile.am index 641ed7b390b..04c37ccda2e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,18 +16,6 @@ ## License along with this library. If not, see ## <http://www.gnu.org/licenses/>. -if WITH_LINUX -check-access: file-access-clean - VIR_TEST_FILE_ACCESS=1 $(MAKE) $(AM_MAKEFLAGS) check - $(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-file-access.py \ - $(abs_builddir)/test_file_access.txt \ - $(abs_srcdir)/permitted_file_access.txt | sort -u - -file-access-clean: - > test_file_access.txt -endif WITH_LINUX - - VALGRIND = valgrind --quiet --leak-check=full --trace-children=yes \ --trace-children-skip="*/tools/virsh","*/tests/commandhelper","/usr/bin/*" \ --suppressions=$(abs_srcdir)/.valgrind.supp diff --git a/tests/meson.build b/tests/meson.build index d6e0d2805d7..cf848678505 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -665,3 +665,11 @@ foreach name : test_scripts script = find_program(name) test(name, script, env: tests_env) endforeach + +add_test_setup( + 'access', + env: [ + 'VIR_TEST_FILE_ACCESS=1', + ], + exe_wrapper: [ meson_python_prog, check_file_access_prog ], +) diff --git a/tests/virtestmock.c b/tests/virtestmock.c index e5dccae2a87..776493f0c5d 100644 --- a/tests/virtestmock.c +++ b/tests/virtestmock.c @@ -69,7 +69,7 @@ printFile(const char *file, output = VIR_FILE_ACCESS_DEFAULT; } - if (!(fp = real_fopen(output, "a"))) { + if (!(fp = real_fopen(output, "w"))) { fprintf(stderr, "Unable to open %s: %s\n", output, g_strerror(errno)); abort(); } -- 2.26.2

On Thu, Jul 16, 2020 at 11:59:08 +0200, Pavel Hrdina wrote:
We need to modify check-file-access.py to be usable as wrapper for libvirt tests. This way we can run the tests using this command:
meson test --setup access
which will run all tests using check-file-access.py as a wrapper.
With autotools all file access are written into single file for all tests and compared once the whole test suite is done.
With Meson we will compare the file access after every single test because it is used as wrapper now. That requires writing the file access into separate files for every single test as they are executed in parallel.
Since the wrapper is used for all tests in Meson including tests outside of tests directory we have to check for presence of the output file. We should also cleanup after ourselves.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 3 --- scripts/check-file-access.py | 24 +++++++++++++++++++----- tests/Makefile.am | 12 ------------ tests/meson.build | 8 ++++++++ tests/virtestmock.c | 2 +- 5 files changed, 28 insertions(+), 21 deletions(-)
diff --git a/Makefile.am b/Makefile.am index 363c5cf66fd..d05a0c1a85a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -37,9 +37,6 @@ srpm: clean
check-local: all tests
-check-access: all - @($(MAKE) $(AM_MAKEFLAGS) -C tests check-access) - dist-hook: gen-AUTHORS
.PHONY: gen-AUTHORS diff --git a/scripts/check-file-access.py b/scripts/check-file-access.py index aa120cafacf..f0e98f4b652 100755 --- a/scripts/check-file-access.py +++ b/scripts/check-file-access.py @@ -21,15 +21,27 @@ # #
+import os +import random import re +import string import sys
-if len(sys.argv) != 3: - print("syntax: %s ACCESS-FILE PERMITTED-ACCESS-FILE") - sys.exit(1) +abs_builddir = os.environ.get('abs_builddir', '') +abs_srcdir = os.environ.get('abs_srcdir', '')
-access_file = sys.argv[1] -permitted_file = sys.argv[2] +filename = ''.join(random.choice(string.ascii_letters) for _ in range(16))
Umm, python doesn't have a 'mkostemp' equivalent? This seems a bit fishy.
+access_file = os.path.join(abs_builddir, 'file-access-{0}.txt'.format(filename)) +permitted_file = os.path.join(abs_srcdir, 'permitted_file_access.txt') + +os.environ['VIR_TEST_FILE_ACCESS_OUTPUT'] = access_file + +test = ' '.join(sys.argv[1:]) + +ret = os.system(test) + +if ret != 0 or not os.is_file(access_file): + sys.exit(ret)
known_actions = ["open", "fopen", "access", "stat", "lstat", "connect"]
@@ -120,6 +132,8 @@ for file in files: print(": %s" % file["testname"], end="") print("")
+os.remove(access_file)
Wouldn't it make sense to keep this file on failure?
+ if err: sys.exit(1) sys.exit(0)

On Tuesday, 28 July 2020 14:56:45 CEST Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:59:08 +0200, Pavel Hrdina wrote:
We need to modify check-file-access.py to be usable as wrapper for libvirt tests. This way we can run the tests using this command:
meson test --setup access
which will run all tests using check-file-access.py as a wrapper.
With autotools all file access are written into single file for all tests and compared once the whole test suite is done.
With Meson we will compare the file access after every single test because it is used as wrapper now. That requires writing the file access into separate files for every single test as they are executed in parallel.
Since the wrapper is used for all tests in Meson including tests outside of tests directory we have to check for presence of the output file. We should also cleanup after ourselves.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 3 --- scripts/check-file-access.py | 24 +++++++++++++++++++----- tests/Makefile.am | 12 ------------ tests/meson.build | 8 ++++++++ tests/virtestmock.c | 2 +- 5 files changed, 28 insertions(+), 21 deletions(-)
diff --git a/Makefile.am b/Makefile.am index 363c5cf66fd..d05a0c1a85a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -37,9 +37,6 @@ srpm: clean
check-local: all tests
-check-access: all - @($(MAKE) $(AM_MAKEFLAGS) -C tests check-access) - dist-hook: gen-AUTHORS
.PHONY: gen-AUTHORS diff --git a/scripts/check-file-access.py b/scripts/check-file-access.py index aa120cafacf..f0e98f4b652 100755 --- a/scripts/check-file-access.py +++ b/scripts/check-file-access.py @@ -21,15 +21,27 @@ # #
+import os +import random import re +import string import sys
-if len(sys.argv) != 3: - print("syntax: %s ACCESS-FILE PERMITTED-ACCESS-FILE") - sys.exit(1) +abs_builddir = os.environ.get('abs_builddir', '') +abs_srcdir = os.environ.get('abs_srcdir', '')
-access_file = sys.argv[1] -permitted_file = sys.argv[2] +filename = ''.join(random.choice(string.ascii_letters) for _ in range(16))
Umm, python doesn't have a 'mkostemp' equivalent? This seems a bit fishy.
Sure, it is the tempfile module: https://docs.python.org/3/library/tempfile.html filename = tempfile.mkstemp(dir=abs_builddir, prefix='file-access-', suffix='.txt') -- Pino Toscano

On Tue, Jul 28, 2020 at 03:19:25PM +0200, Pino Toscano wrote:
On Tuesday, 28 July 2020 14:56:45 CEST Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:59:08 +0200, Pavel Hrdina wrote:
We need to modify check-file-access.py to be usable as wrapper for libvirt tests. This way we can run the tests using this command:
meson test --setup access
which will run all tests using check-file-access.py as a wrapper.
With autotools all file access are written into single file for all tests and compared once the whole test suite is done.
With Meson we will compare the file access after every single test because it is used as wrapper now. That requires writing the file access into separate files for every single test as they are executed in parallel.
Since the wrapper is used for all tests in Meson including tests outside of tests directory we have to check for presence of the output file. We should also cleanup after ourselves.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 3 --- scripts/check-file-access.py | 24 +++++++++++++++++++----- tests/Makefile.am | 12 ------------ tests/meson.build | 8 ++++++++ tests/virtestmock.c | 2 +- 5 files changed, 28 insertions(+), 21 deletions(-)
diff --git a/Makefile.am b/Makefile.am index 363c5cf66fd..d05a0c1a85a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -37,9 +37,6 @@ srpm: clean
check-local: all tests
-check-access: all - @($(MAKE) $(AM_MAKEFLAGS) -C tests check-access) - dist-hook: gen-AUTHORS
.PHONY: gen-AUTHORS diff --git a/scripts/check-file-access.py b/scripts/check-file-access.py index aa120cafacf..f0e98f4b652 100755 --- a/scripts/check-file-access.py +++ b/scripts/check-file-access.py @@ -21,15 +21,27 @@ # #
+import os +import random import re +import string import sys
-if len(sys.argv) != 3: - print("syntax: %s ACCESS-FILE PERMITTED-ACCESS-FILE") - sys.exit(1) +abs_builddir = os.environ.get('abs_builddir', '') +abs_srcdir = os.environ.get('abs_srcdir', '')
-access_file = sys.argv[1] -permitted_file = sys.argv[2] +filename = ''.join(random.choice(string.ascii_letters) for _ in range(16))
Umm, python doesn't have a 'mkostemp' equivalent? This seems a bit fishy.
Sure, it is the tempfile module: https://docs.python.org/3/library/tempfile.html
filename = tempfile.mkstemp(dir=abs_builddir, prefix='file-access-', suffix='.txt')
I'll look into it. When porting it I just looked for any solution as this can be changed any time after the series is pushed. Thanks Pavel

On Tue, Jul 28, 2020 at 03:39:41PM +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 03:19:25PM +0200, Pino Toscano wrote:
On Tuesday, 28 July 2020 14:56:45 CEST Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:59:08 +0200, Pavel Hrdina wrote:
We need to modify check-file-access.py to be usable as wrapper for libvirt tests. This way we can run the tests using this command:
meson test --setup access
which will run all tests using check-file-access.py as a wrapper.
With autotools all file access are written into single file for all tests and compared once the whole test suite is done.
With Meson we will compare the file access after every single test because it is used as wrapper now. That requires writing the file access into separate files for every single test as they are executed in parallel.
Since the wrapper is used for all tests in Meson including tests outside of tests directory we have to check for presence of the output file. We should also cleanup after ourselves.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 3 --- scripts/check-file-access.py | 24 +++++++++++++++++++----- tests/Makefile.am | 12 ------------ tests/meson.build | 8 ++++++++ tests/virtestmock.c | 2 +- 5 files changed, 28 insertions(+), 21 deletions(-)
diff --git a/Makefile.am b/Makefile.am index 363c5cf66fd..d05a0c1a85a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -37,9 +37,6 @@ srpm: clean
check-local: all tests
-check-access: all - @($(MAKE) $(AM_MAKEFLAGS) -C tests check-access) - dist-hook: gen-AUTHORS
.PHONY: gen-AUTHORS diff --git a/scripts/check-file-access.py b/scripts/check-file-access.py index aa120cafacf..f0e98f4b652 100755 --- a/scripts/check-file-access.py +++ b/scripts/check-file-access.py @@ -21,15 +21,27 @@ # #
+import os +import random import re +import string import sys
-if len(sys.argv) != 3: - print("syntax: %s ACCESS-FILE PERMITTED-ACCESS-FILE") - sys.exit(1) +abs_builddir = os.environ.get('abs_builddir', '') +abs_srcdir = os.environ.get('abs_srcdir', '')
-access_file = sys.argv[1] -permitted_file = sys.argv[2] +filename = ''.join(random.choice(string.ascii_letters) for _ in range(16))
Umm, python doesn't have a 'mkostemp' equivalent? This seems a bit fishy.
Sure, it is the tempfile module: https://docs.python.org/3/library/tempfile.html
filename = tempfile.mkstemp(dir=abs_builddir, prefix='file-access-', suffix='.txt')
I'll look into it. When porting it I just looked for any solution as this can be changed any time after the series is pushed.
So I looked into it and the python script doesn't create the temporary file. The file is created by virtestmock.c if we run our test suite with file access check. The existence of the file is also used to check if there is something to be compared as not all of the tests needs to be check if they access some system files, for example all the check-* test cases. The tempfile is a nice module but useless in this case where we care about only getting a temporary file name. In order to use the module we would have to do something like this: fd, filename = tempfile.mkstemp(dir=abs_builddir, prefix='file-access-', suffix='.txt') os.close(fd) os.unlink() which looks ugly. So I would rather keep it as it is. Pavel

On Tue, Jul 28, 2020 at 18:48:18 +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 03:39:41PM +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 03:19:25PM +0200, Pino Toscano wrote:
On Tuesday, 28 July 2020 14:56:45 CEST Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:59:08 +0200, Pavel Hrdina wrote:
We need to modify check-file-access.py to be usable as wrapper for libvirt tests. This way we can run the tests using this command:
meson test --setup access
which will run all tests using check-file-access.py as a wrapper.
With autotools all file access are written into single file for all tests and compared once the whole test suite is done.
With Meson we will compare the file access after every single test because it is used as wrapper now. That requires writing the file access into separate files for every single test as they are executed in parallel.
Since the wrapper is used for all tests in Meson including tests outside of tests directory we have to check for presence of the output file. We should also cleanup after ourselves.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 3 --- scripts/check-file-access.py | 24 +++++++++++++++++++----- tests/Makefile.am | 12 ------------ tests/meson.build | 8 ++++++++ tests/virtestmock.c | 2 +- 5 files changed, 28 insertions(+), 21 deletions(-)
diff --git a/Makefile.am b/Makefile.am index 363c5cf66fd..d05a0c1a85a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -37,9 +37,6 @@ srpm: clean
check-local: all tests
-check-access: all - @($(MAKE) $(AM_MAKEFLAGS) -C tests check-access) - dist-hook: gen-AUTHORS
.PHONY: gen-AUTHORS diff --git a/scripts/check-file-access.py b/scripts/check-file-access.py index aa120cafacf..f0e98f4b652 100755 --- a/scripts/check-file-access.py +++ b/scripts/check-file-access.py @@ -21,15 +21,27 @@ # #
+import os +import random import re +import string import sys
-if len(sys.argv) != 3: - print("syntax: %s ACCESS-FILE PERMITTED-ACCESS-FILE") - sys.exit(1) +abs_builddir = os.environ.get('abs_builddir', '') +abs_srcdir = os.environ.get('abs_srcdir', '')
-access_file = sys.argv[1] -permitted_file = sys.argv[2] +filename = ''.join(random.choice(string.ascii_letters) for _ in range(16))
Umm, python doesn't have a 'mkostemp' equivalent? This seems a bit fishy.
Sure, it is the tempfile module: https://docs.python.org/3/library/tempfile.html
filename = tempfile.mkstemp(dir=abs_builddir, prefix='file-access-', suffix='.txt')
I'll look into it. When porting it I just looked for any solution as this can be changed any time after the series is pushed.
So I looked into it and the python script doesn't create the temporary file. The file is created by virtestmock.c if we run our test suite with file access check. The existence of the file is also used to check if there is something to be compared as not all of the tests needs to be check if they access some system files, for example all the check-* test cases.
The tempfile is a nice module but useless in this case where we care about only getting a temporary file name. In order to use the module we would have to do something like this:
fd, filename = tempfile.mkstemp(dir=abs_builddir, prefix='file-access-', suffix='.txt') os.close(fd) os.unlink()
which looks ugly. So I would rather keep it as it is.
Your algorithm is not robust enough so it could end up causing random test failures. Unlikely but possible. You can pass the filename to the test and let the mock append to the existing file and then read it.

On Tue, Jul 28, 2020 at 09:13:41PM +0200, Peter Krempa wrote:
On Tue, Jul 28, 2020 at 18:48:18 +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 03:39:41PM +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 03:19:25PM +0200, Pino Toscano wrote:
On Tuesday, 28 July 2020 14:56:45 CEST Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:59:08 +0200, Pavel Hrdina wrote:
We need to modify check-file-access.py to be usable as wrapper for libvirt tests. This way we can run the tests using this command:
meson test --setup access
which will run all tests using check-file-access.py as a wrapper.
With autotools all file access are written into single file for all tests and compared once the whole test suite is done.
With Meson we will compare the file access after every single test because it is used as wrapper now. That requires writing the file access into separate files for every single test as they are executed in parallel.
Since the wrapper is used for all tests in Meson including tests outside of tests directory we have to check for presence of the output file. We should also cleanup after ourselves.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 3 --- scripts/check-file-access.py | 24 +++++++++++++++++++----- tests/Makefile.am | 12 ------------ tests/meson.build | 8 ++++++++ tests/virtestmock.c | 2 +- 5 files changed, 28 insertions(+), 21 deletions(-)
diff --git a/Makefile.am b/Makefile.am index 363c5cf66fd..d05a0c1a85a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -37,9 +37,6 @@ srpm: clean
check-local: all tests
-check-access: all - @($(MAKE) $(AM_MAKEFLAGS) -C tests check-access) - dist-hook: gen-AUTHORS
.PHONY: gen-AUTHORS diff --git a/scripts/check-file-access.py b/scripts/check-file-access.py index aa120cafacf..f0e98f4b652 100755 --- a/scripts/check-file-access.py +++ b/scripts/check-file-access.py @@ -21,15 +21,27 @@ # #
+import os +import random import re +import string import sys
-if len(sys.argv) != 3: - print("syntax: %s ACCESS-FILE PERMITTED-ACCESS-FILE") - sys.exit(1) +abs_builddir = os.environ.get('abs_builddir', '') +abs_srcdir = os.environ.get('abs_srcdir', '')
-access_file = sys.argv[1] -permitted_file = sys.argv[2] +filename = ''.join(random.choice(string.ascii_letters) for _ in range(16))
Umm, python doesn't have a 'mkostemp' equivalent? This seems a bit fishy.
Sure, it is the tempfile module: https://docs.python.org/3/library/tempfile.html
filename = tempfile.mkstemp(dir=abs_builddir, prefix='file-access-', suffix='.txt')
I'll look into it. When porting it I just looked for any solution as this can be changed any time after the series is pushed.
So I looked into it and the python script doesn't create the temporary file. The file is created by virtestmock.c if we run our test suite with file access check. The existence of the file is also used to check if there is something to be compared as not all of the tests needs to be check if they access some system files, for example all the check-* test cases.
The tempfile is a nice module but useless in this case where we care about only getting a temporary file name. In order to use the module we would have to do something like this:
fd, filename = tempfile.mkstemp(dir=abs_builddir, prefix='file-access-', suffix='.txt') os.close(fd) os.unlink()
which looks ugly. So I would rather keep it as it is.
Your algorithm is not robust enough so it could end up causing random test failures. Unlikely but possible.
You can pass the filename to the test and let the mock append to the existing file and then read it.
You are missing the point that the presence of the file is used later in the script: if ret != 0 or not os.path.exists(access_file): sys.exit(ret) the whole point is that only if the file exists the script will do the actual check and compare the file-access-***.txt file. If the file doesn't exist the script will fail with: Traceback (most recent call last): File "/home/phrdina/work/libvirt/scripts/check-file-access.py", line 52, in <module> with open(access_file, "r") as fh: FileNotFoundError: [Errno 2] No such file or directory: 'file-access-IIyVhsUpnErLEkUm.txt' If we don't mind running the whole script for test cases where the access check doesn't make sense the example above can be changed to this: fd, filename = tempfile.mkstemp(dir=abs_builddir, prefix='file-access-', suffix='.txt') os.close(fd) ... if ret != 0: sys.exit(ret) but at this point it doesn't make any difference and we can just go with the first example where we remove the file as well. Pavel

On Tue, Jul 28, 2020 at 09:32:57PM +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 09:13:41PM +0200, Peter Krempa wrote:
On Tue, Jul 28, 2020 at 18:48:18 +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 03:39:41PM +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 03:19:25PM +0200, Pino Toscano wrote:
On Tuesday, 28 July 2020 14:56:45 CEST Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:59:08 +0200, Pavel Hrdina wrote: > We need to modify check-file-access.py to be usable as wrapper for > libvirt tests. This way we can run the tests using this command: > > meson test --setup access > > which will run all tests using check-file-access.py as a wrapper. > > With autotools all file access are written into single file for all > tests and compared once the whole test suite is done. > > With Meson we will compare the file access after every single test > because it is used as wrapper now. That requires writing the file > access into separate files for every single test as they are executed > in parallel. > > Since the wrapper is used for all tests in Meson including tests outside > of tests directory we have to check for presence of the output file. > We should also cleanup after ourselves. > > Signed-off-by: Pavel Hrdina <phrdina@redhat.com> > --- > Makefile.am | 3 --- > scripts/check-file-access.py | 24 +++++++++++++++++++----- > tests/Makefile.am | 12 ------------ > tests/meson.build | 8 ++++++++ > tests/virtestmock.c | 2 +- > 5 files changed, 28 insertions(+), 21 deletions(-) > > diff --git a/Makefile.am b/Makefile.am > index 363c5cf66fd..d05a0c1a85a 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -37,9 +37,6 @@ srpm: clean > > check-local: all tests > > -check-access: all > - @($(MAKE) $(AM_MAKEFLAGS) -C tests check-access) > - > dist-hook: gen-AUTHORS > > .PHONY: gen-AUTHORS > diff --git a/scripts/check-file-access.py b/scripts/check-file-access.py > index aa120cafacf..f0e98f4b652 100755 > --- a/scripts/check-file-access.py > +++ b/scripts/check-file-access.py > @@ -21,15 +21,27 @@ > # > # > > +import os > +import random > import re > +import string > import sys > > -if len(sys.argv) != 3: > - print("syntax: %s ACCESS-FILE PERMITTED-ACCESS-FILE") > - sys.exit(1) > +abs_builddir = os.environ.get('abs_builddir', '') > +abs_srcdir = os.environ.get('abs_srcdir', '') > > -access_file = sys.argv[1] > -permitted_file = sys.argv[2] > +filename = ''.join(random.choice(string.ascii_letters) for _ in range(16))
Umm, python doesn't have a 'mkostemp' equivalent? This seems a bit fishy.
Sure, it is the tempfile module: https://docs.python.org/3/library/tempfile.html
filename = tempfile.mkstemp(dir=abs_builddir, prefix='file-access-', suffix='.txt')
I'll look into it. When porting it I just looked for any solution as this can be changed any time after the series is pushed.
So I looked into it and the python script doesn't create the temporary file. The file is created by virtestmock.c if we run our test suite with file access check. The existence of the file is also used to check if there is something to be compared as not all of the tests needs to be check if they access some system files, for example all the check-* test cases.
The tempfile is a nice module but useless in this case where we care about only getting a temporary file name. In order to use the module we would have to do something like this:
fd, filename = tempfile.mkstemp(dir=abs_builddir, prefix='file-access-', suffix='.txt') os.close(fd) os.unlink()
which looks ugly. So I would rather keep it as it is.
Your algorithm is not robust enough so it could end up causing random test failures. Unlikely but possible.
You can pass the filename to the test and let the mock append to the existing file and then read it.
You are missing the point that the presence of the file is used later in the script:
if ret != 0 or not os.path.exists(access_file): sys.exit(ret)
the whole point is that only if the file exists the script will do the actual check and compare the file-access-***.txt file.
If the file doesn't exist the script will fail with:
Traceback (most recent call last): File "/home/phrdina/work/libvirt/scripts/check-file-access.py", line 52, in <module> with open(access_file, "r") as fh: FileNotFoundError: [Errno 2] No such file or directory: 'file-access-IIyVhsUpnErLEkUm.txt'
If we don't mind running the whole script for test cases where the access check doesn't make sense the example above can be changed to this:
fd, filename = tempfile.mkstemp(dir=abs_builddir, prefix='file-access-', suffix='.txt') os.close(fd)
...
if ret != 0: sys.exit(ret)
but at this point it doesn't make any difference and we can just go with the first example where we remove the file as well.
Pavel
So I managed to make it work without closing and opening again the file using the tempfile module. I think it's still ugly but I don't care anymore as I want to have it ready so we can push it right after release next week. Just a note, the file access testing is broken and it fails for a lot of tests. Pavel

On 7/28/20 10:45 PM, Pavel Hrdina wrote:
Just a note, the file access testing is broken and it fails for a lot of tests.
Yeah, I have patches for it, but I've never gotten around sending them. Will do today. Michal

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 4 +--- configure.ac | 3 +-- tests/Makefile.am | 23 ----------------------- tests/meson.build | 11 +++++++++++ 4 files changed, 13 insertions(+), 28 deletions(-) delete mode 100644 tests/Makefile.am diff --git a/Makefile.am b/Makefile.am index d05a0c1a85a..549ade3db20 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,7 +21,7 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-werror SUBDIRS = . docs \ - tests po examples + po examples XZ_OPT ?= -v -T0 export XZ_OPT @@ -35,8 +35,6 @@ rpm: clean srpm: clean @(unset CDPATH ; $(MAKE) dist && rpmbuild -ts $(distdir).tar.xz) -check-local: all tests - dist-hook: gen-AUTHORS .PHONY: gen-AUTHORS diff --git a/configure.ac b/configure.ac index 20926ee9f19..78676d73d2b 100644 --- a/configure.ac +++ b/configure.ac @@ -115,6 +115,5 @@ AC_CONFIG_FILES([\ libvirt-admin.pc \ libvirt.spec mingw-libvirt.spec \ po/Makefile \ - examples/Makefile \ - tests/Makefile]) + examples/Makefile]) AC_OUTPUT diff --git a/tests/Makefile.am b/tests/Makefile.am deleted file mode 100644 index 04c37ccda2e..00000000000 --- a/tests/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -## Process this file with automake to produce Makefile.in - -## Copyright (C) 2005-2019 Red Hat, Inc. -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library. If not, see -## <http://www.gnu.org/licenses/>. - -VALGRIND = valgrind --quiet --leak-check=full --trace-children=yes \ - --trace-children-skip="*/tools/virsh","*/tests/commandhelper","/usr/bin/*" \ - --suppressions=$(abs_srcdir)/.valgrind.supp -valgrind: - $(MAKE) check VG="$(LIBTOOL) --mode=execute $(VALGRIND)" diff --git a/tests/meson.build b/tests/meson.build index cf848678505..1510d6ef3f3 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -673,3 +673,14 @@ add_test_setup( ], exe_wrapper: [ meson_python_prog, check_file_access_prog ], ) + +add_test_setup( + 'valgrind', + exe_wrapper: [ + 'valgrind', '--quiet', '--leak-check=full', '--trace-children=yes', + '--trace-children-skip="*/tools/virsh,*/tests/commandhelper,/usr/bin/*"', + '--suppressions=@0@'.format(meson.current_source_dir() / '.valgrind.supp'), + '--error-exitcode=1', + ], + timeout_multiplier: 4, +) -- 2.26.2

On Thu, Jul 16, 2020 at 11:59:09 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 4 +--- configure.ac | 3 +-- tests/Makefile.am | 23 ----------------------- tests/meson.build | 11 +++++++++++ 4 files changed, 13 insertions(+), 28 deletions(-) delete mode 100644 tests/Makefile.am
diff --git a/Makefile.am b/Makefile.am index d05a0c1a85a..549ade3db20 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,7 +21,7 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-werror
SUBDIRS = . docs \ - tests po examples + po examples
XZ_OPT ?= -v -T0 export XZ_OPT @@ -35,8 +35,6 @@ rpm: clean srpm: clean @(unset CDPATH ; $(MAKE) dist && rpmbuild -ts $(distdir).tar.xz)
-check-local: all tests - dist-hook: gen-AUTHORS
.PHONY: gen-AUTHORS diff --git a/configure.ac b/configure.ac index 20926ee9f19..78676d73d2b 100644 --- a/configure.ac +++ b/configure.ac @@ -115,6 +115,5 @@ AC_CONFIG_FILES([\ libvirt-admin.pc \ libvirt.spec mingw-libvirt.spec \ po/Makefile \ - examples/Makefile \ - tests/Makefile]) + examples/Makefile]) AC_OUTPUT diff --git a/tests/Makefile.am b/tests/Makefile.am deleted file mode 100644 index 04c37ccda2e..00000000000 --- a/tests/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -## Process this file with automake to produce Makefile.in - -## Copyright (C) 2005-2019 Red Hat, Inc. -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library. If not, see -## <http://www.gnu.org/licenses/>. - -VALGRIND = valgrind --quiet --leak-check=full --trace-children=yes \ - --trace-children-skip="*/tools/virsh","*/tests/commandhelper","/usr/bin/*" \ - --suppressions=$(abs_srcdir)/.valgrind.supp -valgrind: - $(MAKE) check VG="$(LIBTOOL) --mode=execute $(VALGRIND)" diff --git a/tests/meson.build b/tests/meson.build index cf848678505..1510d6ef3f3 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -673,3 +673,14 @@ add_test_setup( ], exe_wrapper: [ meson_python_prog, check_file_access_prog ], ) + +add_test_setup( + 'valgrind', + exe_wrapper: [ + 'valgrind', '--quiet', '--leak-check=full', '--trace-children=yes', + '--trace-children-skip="*/tools/virsh,*/tests/commandhelper,/usr/bin/*"', + '--suppressions=@0@'.format(meson.current_source_dir() / '.valgrind.supp'), + '--error-exitcode=1', + ], + timeout_multiplier: 4,
Please add a note that the default timeout for meson tests is 30 seconds and that this is used to increase it for potentially long-running tests.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 2 +- configure.ac | 3 +- examples/Makefile.am | 127 ------------------------------- examples/c/admin/meson.build | 27 +++++++ examples/c/domain/meson.build | 24 ++++++ examples/c/meson.build | 3 + examples/c/misc/meson.build | 22 ++++++ examples/meson.build | 7 ++ examples/polkit/meson.build | 1 + examples/sh/meson.build | 1 + examples/systemtap/meson.build | 9 +++ examples/xml/meson.build | 2 + examples/xml/storage/meson.build | 15 ++++ examples/xml/test/meson.build | 14 ++++ meson.build | 2 + 15 files changed, 129 insertions(+), 130 deletions(-) delete mode 100644 examples/Makefile.am create mode 100644 examples/c/admin/meson.build create mode 100644 examples/c/domain/meson.build create mode 100644 examples/c/meson.build create mode 100644 examples/c/misc/meson.build create mode 100644 examples/meson.build create mode 100644 examples/polkit/meson.build create mode 100644 examples/sh/meson.build create mode 100644 examples/systemtap/meson.build create mode 100644 examples/xml/meson.build create mode 100644 examples/xml/storage/meson.build create mode 100644 examples/xml/test/meson.build diff --git a/Makefile.am b/Makefile.am index 549ade3db20..4b3abc82728 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,7 +21,7 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-werror SUBDIRS = . docs \ - po examples + po XZ_OPT ?= -v -T0 export XZ_OPT diff --git a/configure.ac b/configure.ac index 78676d73d2b..4f7ad909468 100644 --- a/configure.ac +++ b/configure.ac @@ -114,6 +114,5 @@ AC_CONFIG_FILES([\ libvirt-lxc.pc \ libvirt-admin.pc \ libvirt.spec mingw-libvirt.spec \ - po/Makefile \ - examples/Makefile]) + po/Makefile]) AC_OUTPUT diff --git a/examples/Makefile.am b/examples/Makefile.am deleted file mode 100644 index 15ff897cf1f..00000000000 --- a/examples/Makefile.am +++ /dev/null @@ -1,127 +0,0 @@ -## Process this file with automake to produce Makefile.in - -## Copyright (C) 2005-2016 Red Hat, Inc. -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library. If not, see -## <http://www.gnu.org/licenses/>. - -ADMIN_EXAMPLES = \ - $(wildcard $(srcdir)/c/admin/*.c) \ - $(NULL) - -DOMAIN_EXAMPLES = \ - $(wildcard $(srcdir)/c/domain/*.c) \ - $(NULL) - -MISC_EXAMPLES = \ - $(wildcard $(srcdir)/c/misc/*.c) \ - $(NULL) - -POLKIT_EXAMPLES = \ - $(wildcard $(srcdir)/polkit/*.rules) \ - $(NULL) - -SH_EXAMPLES = \ - $(wildcard $(srcdir)/sh/*) \ - $(NULL) - -STORAGE_XML_EXAMPLES = \ - $(wildcard $(srcdir)/xml/storage/*.xml) \ - $(NULL) - -SYSTEMTAP_EXAMPLES = \ - $(wildcard $(srcdir)/systemtap/*.stp) \ - $(NULL) - -TEST_XML_EXAMPLES = \ - $(wildcard $(srcdir)/xml/test/*.xml) \ - $(NULL) - -AM_CPPFLAGS = \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include \ - $(NULL) - -AM_CFLAGS = \ - $(WARN_CFLAGS) \ - $(NULL) - -AM_LDFLAGS = \ - $(STATIC_BINARIES) \ - $(NULL) - -LDADD = \ - $(top_builddir)/src/libvirt.la \ - $(top_builddir)/src/libvirt-admin.la \ - $(NULL) - -noinst_PROGRAMS = \ - c/admin/client_close \ - c/admin/client_info \ - c/admin/client_limits \ - c/admin/list_clients \ - c/admin/list_servers \ - c/admin/logging \ - c/admin/threadpool_params \ - c/domain/dommigrate \ - c/domain/domtop \ - c/domain/info1 \ - c/domain/rename \ - c/domain/suspend \ - c/misc/event-test \ - c/misc/hellolibvirt \ - c/misc/openauth \ - $(NULL) - -c_admin_client_close_SOURCES = c/admin/client_close.c -c_admin_client_info_SOURCES = c/admin/client_info.c -c_admin_client_limits_SOURCES = c/admin/client_limits.c -c_admin_list_clients_SOURCES = c/admin/list_clients.c -c_admin_list_servers_SOURCES = c/admin/list_servers.c -c_admin_logging_SOURCES = c/admin/logging.c -c_admin_threadpool_params_SOURCES = c/admin/threadpool_params.c -c_domain_dommigrate_SOURCES = c/domain/dommigrate.c -c_domain_domtop_SOURCES = c/domain/domtop.c -c_domain_info1_SOURCES = c/domain/info1.c -c_domain_rename_SOURCES = c/domain/rename.c -c_domain_suspend_SOURCES = c/domain/suspend.c -c_misc_event_test_SOURCES = c/misc/event-test.c -c_misc_hellolibvirt_SOURCES = c/misc/hellolibvirt.c -c_misc_openauth_SOURCES = c/misc/openauth.c - -examplesdir = $(docdir)/examples - -adminexamplesdir = $(examplesdir)/c/admin -adminexamples_DATA = $(ADMIN_EXAMPLES) - -domainexamplesdir = $(examplesdir)/c/domain -domainexamples_DATA = $(DOMAIN_EXAMPLES) - -miscexamplesdir = $(examplesdir)/c/misc -miscexamples_DATA = $(MISC_EXAMPLES) - -polkitexamplesdir = $(examplesdir)/polkit -polkitexamples_DATA = $(POLKIT_EXAMPLES) - -shexamplesdir = $(examplesdir)/sh -shexamples_DATA = $(SH_EXAMPLES) - -storagexmlexamplesdir = $(examplesdir)/xml/storage -storagexmlexamples_DATA = $(STORAGE_XML_EXAMPLES) - -systemtapexamplesdir = $(examplesdir)/systemtap -systemtapexamples_DATA = $(SYSTEMTAP_EXAMPLES) - -testxmlexamplesdir = $(examplesdir)/xml/test -testxmlexamples_DATA = $(TEST_XML_EXAMPLES) diff --git a/examples/c/admin/meson.build b/examples/c/admin/meson.build new file mode 100644 index 00000000000..094408a63c2 --- /dev/null +++ b/examples/c/admin/meson.build @@ -0,0 +1,27 @@ +example_admin_files = [ + 'client_close', + 'client_info', + 'client_limits', + 'list_clients', + 'list_servers', + 'logging', + 'threadpool_params', +] + +foreach name : example_admin_files + source_file = '@0@.c'.format(name) + executable( + name, + [ + source_file, + ], + include_directories: [ + libvirt_inc, + ], + link_with: [ + libvirt_lib, + libvirt_admin_lib, + ], + ) + install_data(source_file, install_dir: example_dir / 'c' / 'admin') +endforeach diff --git a/examples/c/domain/meson.build b/examples/c/domain/meson.build new file mode 100644 index 00000000000..51cd03afc85 --- /dev/null +++ b/examples/c/domain/meson.build @@ -0,0 +1,24 @@ +example_domain_files = [ + 'dommigrate', + 'domtop', + 'info1', + 'rename', + 'suspend', +] + +foreach name : example_domain_files + source_file = '@0@.c'.format(name) + executable( + name, + [ + source_file, + ], + include_directories: [ + libvirt_inc, + ], + link_with: [ + libvirt_lib, + ], + ) + install_data(source_file, install_dir: example_dir / 'c' / 'domain') +endforeach diff --git a/examples/c/meson.build b/examples/c/meson.build new file mode 100644 index 00000000000..727e4caafaa --- /dev/null +++ b/examples/c/meson.build @@ -0,0 +1,3 @@ +subdir('admin') +subdir('domain') +subdir('misc') diff --git a/examples/c/misc/meson.build b/examples/c/misc/meson.build new file mode 100644 index 00000000000..b106467912f --- /dev/null +++ b/examples/c/misc/meson.build @@ -0,0 +1,22 @@ +example_misc_files = [ + 'event-test', + 'hellolibvirt', + 'openauth', +] + +foreach name : example_misc_files + source_file = '@0@.c'.format(name) + executable( + name, + [ + source_file, + ], + include_directories: [ + libvirt_inc, + ], + link_with: [ + libvirt_lib, + ], + ) + install_data(source_file, install_dir: example_dir / 'c' / 'misc') +endforeach diff --git a/examples/meson.build b/examples/meson.build new file mode 100644 index 00000000000..a57820aaed5 --- /dev/null +++ b/examples/meson.build @@ -0,0 +1,7 @@ +example_dir = docdir / 'examples' + +subdir('c') +subdir('polkit') +subdir('sh') +subdir('systemtap') +subdir('xml') diff --git a/examples/polkit/meson.build b/examples/polkit/meson.build new file mode 100644 index 00000000000..d57c5a19868 --- /dev/null +++ b/examples/polkit/meson.build @@ -0,0 +1 @@ +install_data('libvirt-acl.rules', install_dir: example_dir / 'polkit') diff --git a/examples/sh/meson.build b/examples/sh/meson.build new file mode 100644 index 00000000000..0cdbe17c677 --- /dev/null +++ b/examples/sh/meson.build @@ -0,0 +1 @@ +install_data('virt-lxc-convert', install_dir: example_dir / 'sh') diff --git a/examples/systemtap/meson.build b/examples/systemtap/meson.build new file mode 100644 index 00000000000..f31187e1877 --- /dev/null +++ b/examples/systemtap/meson.build @@ -0,0 +1,9 @@ +install_data( + [ + 'rpc-monitor.stp', + 'qemu-monitor.stp', + 'lock-debug.stp', + 'events.stp', + ], + install_dir: example_dir / 'systemtap', +) diff --git a/examples/xml/meson.build b/examples/xml/meson.build new file mode 100644 index 00000000000..650d6a15d27 --- /dev/null +++ b/examples/xml/meson.build @@ -0,0 +1,2 @@ +subdir('storage') +subdir('test') diff --git a/examples/xml/storage/meson.build b/examples/xml/storage/meson.build new file mode 100644 index 00000000000..c142bb1e08d --- /dev/null +++ b/examples/xml/storage/meson.build @@ -0,0 +1,15 @@ +install_data( + [ + 'pool-dir.xml', + 'pool-fs.xml', + 'pool-logical.xml', + 'pool-netfs.xml', + 'vol-cow.xml', + 'vol-qcow.xml', + 'vol-qcow2.xml', + 'vol-raw.xml', + 'vol-sparse.xml', + 'vol-vmdk.xml', + ], + install_dir: example_dir / 'xml' / 'storage', +) diff --git a/examples/xml/test/meson.build b/examples/xml/test/meson.build new file mode 100644 index 00000000000..89ebf03a7bc --- /dev/null +++ b/examples/xml/test/meson.build @@ -0,0 +1,14 @@ +install_data( + [ + 'testdev.xml', + 'testnodeinline.xml', + 'testdomfc4.xml', + 'testdomfv0.xml', + 'testnode.xml', + 'testnetdef.xml', + 'testvol.xml', + 'testnetpriv.xml', + 'testpool.xml', + ], + install_dir: example_dir / 'xml' / 'test', +) diff --git a/meson.build b/meson.build index 2e894df1ab2..caee54a5818 100644 --- a/meson.build +++ b/meson.build @@ -2207,6 +2207,8 @@ subdir('tools') subdir('tests') +subdir('examples') + # generate meson-config.h file configure_file(output: 'meson-config.h', configuration: conf) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 3 +- configure.ac | 3 +- meson.build | 2 ++ po/Makefile.am | 87 -------------------------------------------------- po/meson.build | 35 ++++++++++++++++++++ 5 files changed, 39 insertions(+), 91 deletions(-) delete mode 100644 po/Makefile.am create mode 100644 po/meson.build diff --git a/Makefile.am b/Makefile.am index 4b3abc82728..fca0c1f5c29 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,8 +20,7 @@ # so force it explicitly DISTCHECK_CONFIGURE_FLAGS = --enable-werror -SUBDIRS = . docs \ - po +SUBDIRS = . docs XZ_OPT ?= -v -T0 export XZ_OPT diff --git a/configure.ac b/configure.ac index 4f7ad909468..91ba0c2af4e 100644 --- a/configure.ac +++ b/configure.ac @@ -113,6 +113,5 @@ AC_CONFIG_FILES([\ libvirt-qemu.pc \ libvirt-lxc.pc \ libvirt-admin.pc \ - libvirt.spec mingw-libvirt.spec \ - po/Makefile]) + libvirt.spec mingw-libvirt.spec]) AC_OUTPUT diff --git a/meson.build b/meson.build index caee54a5818..8b434929825 100644 --- a/meson.build +++ b/meson.build @@ -2209,6 +2209,8 @@ subdir('tests') subdir('examples') +subdir('po') + # generate meson-config.h file configure_file(output: 'meson-config.h', configuration: conf) diff --git a/po/Makefile.am b/po/Makefile.am deleted file mode 100644 index ff73ead6f72..00000000000 --- a/po/Makefile.am +++ /dev/null @@ -1,87 +0,0 @@ -DOMAIN = $(PACKAGE_NAME) -COPYRIGHT_HOLDER = The Libvirt authors -MSGID_BUGS_ADDRESS = https://libvirt.org/bugs.html - -LANGS := $(shell cat $(srcdir)/LINGUAS) - -POTFILES_IN = $(srcdir)/POTFILES.in -POTFILES: $(POTFILES_IN) - $(AM_V_GEN) cat $(POTFILES_IN) | \ - $(SED) 's|[@]SRCDIR[@]||' | \ - $(SED) 's|[@]BUILDDIR[@]||' > $@ -POTFILE_DEPS = $(shell cat POTFILES) -POTFILE := $(DOMAIN).pot -POFILES := $(LANGS:%=%.po) -GMOFILES := $(LANGS:%=%.gmo) - -if HAVE_GNU_GETTEXT_TOOLS - -XGETTEXT_ARGS = \ - --default-domain=$(DOMAIN) \ - --from-code=utf-8 \ - --add-comments=TRANSLATORS: \ - --keyword=_ --keyword=N_ \ - --copyright-holder='$(COPYRIGHT_HOLDER)' \ - --package-name="$(PACKAGE_NAME)" \ - --package-version="$(PACKAGE_VERSION)" \ - --msgid-bugs-address="$(MSGID_BUGS_ADDRESS)" \ - --directory="$(top_srcdir)" \ - --directory="$(top_builddir)" \ - --sort-output \ - $(NULL) - -SED_PO_FIXUP_ARGS = \ - -e "s|text/plain; charset=CHARSET|text/plain; charset=UTF-8|g" \ - -e "s|SOME DESCRIPTIVE TITLE|Libvirt package strings|g" \ - -e "s|Copyright (C) YEAR|Copyright (C) $$(date +'%Y')|" \ - $(NULL) - -update-gmo: $(GMOFILES) - -# The results of this target should not be committed to Git. The Weblate -# service is responsible for updating .po files when the .pot is changed. -update-po: $(POTFILE) - cd $(srcdir) && \ - for lang in $(LANGS); do \ - echo "Minimizing $$lang content" && \ - $(MSGMERGE) --no-location --no-fuzzy-matching --sort-output \ - $$lang.po $(POTFILE) | \ - $(SED) $(SED_PO_FIXUP_ARGS) > $$lang.po-t && \ - mv $$lang.po-t $$lang.po ; \ - done - -$(POTFILE): POTFILES - $(XGETTEXT) -o $@-t $(XGETTEXT_ARGS) \ - --files-from=$(abs_builddir)/POTFILES - $(SED) $(SED_PO_FIXUP_ARGS) < $@-t > $(srcdir)/$@ - rm -f $@-t - -%.gmo: %.po - rm -f $@ $@-t - $(MSGFMT) -c -o $@-t $< - mv $@-t $@ - -.PHONY: $(POTFILE) - -endif HAVE_GNU_GETTEXT_TOOLS - -if ENABLE_NLS - -# Cannot use 'localedir' since this conflicts with autoconf. -langinstdir = $(datadir)/locale - -install-data-hook: $(GMOFILES) - mkdir -p $(DESTDIR)$(langinstdir) - for lang in $(LANGS); do \ - d=$(DESTDIR)$(langinstdir)/$$lang/LC_MESSAGES; \ - mkdir -p $$d; \ - install -m 0644 $$lang.gmo $$d/$(DOMAIN).mo; \ - done - -uninstall-hook: - for lang in $(LANGS); do \ - d=$(DESTDIR)$(langinstdir)/$$lang/LC_MESSAGES; \ - rm -f $$d/$(DOMAIN).mo; \ - done - -endif ENABLE_NLS diff --git a/po/meson.build b/po/meson.build new file mode 100644 index 00000000000..f9677408ec9 --- /dev/null +++ b/po/meson.build @@ -0,0 +1,35 @@ +i18n = import('i18n') + +potfiles_conf = configuration_data() +potfiles_conf.set('SRCDIR', '') +potfiles_conf.set('BUILDDIR', '') + +potfiles = configure_file( + input: 'POTFILES.in', + output: 'POTFILES', + configuration: potfiles_conf, +) + +i18n.gettext( + meson.project_name(), + args: [ + '--add-comments=TRANSLATORS:', + '--directory=@0@'.format(meson.source_root()), + '--directory=@0@'.format(meson.build_root()), + '--files-from=@0@'.format(meson.current_build_dir() / 'POTFILES'), + '--msgid-bugs-address=https://libvirt.org/bugs.html', + '--package-version=@0@'.format(meson.project_version()), + '--sort-output', + ], + preset: 'glib', +) + +potfiles_dep = [ + access_gen_sources, + admin_client_generated, + admin_driver_generated, + remote_driver_generated, + remote_daemon_generated, +] + +alias_target('libvirt-pot-dep', potfiles_dep) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 31 +------------------------------ docs/meson.build | 30 ++++++++++++++++++++++++++++++ meson.build | 2 ++ 3 files changed, 33 insertions(+), 30 deletions(-) create mode 100644 docs/meson.build diff --git a/docs/Makefile.am b/docs/Makefile.am index 6d4fcdc831a..6d97ed55c5b 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -16,8 +16,6 @@ ## License along with this library. If not, see ## <http://www.gnu.org/licenses/>. -HTML_DIR = $(docdir)/html - modules = \ libvirt-common \ libvirt-domain \ @@ -140,33 +138,6 @@ logofiles = \ logofilesdir = $(HTML_DIR)/logos logofiles_DATA = $(logofiles) -assets = \ - android-chrome-192x192.png \ - android-chrome-256x256.png \ - apple-touch-icon.png \ - architecture.gif \ - browserconfig.xml \ - favicon.ico \ - favicon-16x16.png \ - favicon-32x32.png \ - generic.css \ - libvirt.css \ - libvirt-daemon-arch.png \ - libvirt-driver-arch.png \ - libvirt-object-model.png \ - libvirt-virConnect-example.png \ - main.css \ - manifest.json \ - migration-managed-direct.png \ - migration-managed-p2p.png \ - migration-native.png \ - migration-tunnel.png \ - migration-unmanaged-direct.png \ - mobile.css \ - mstile-150x150.png \ - node.gif \ - $(NULL) - internals_html_in = \ $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/internals/*.html.in)) internals_rst = \ @@ -324,7 +295,7 @@ dot_html = \ $(dot_rst_html_in:%.html.in=%.html) htmldir = $(HTML_DIR) -html_DATA = $(assets) $(dot_html) +html_DATA = $(dot_html) apidir = $(pkgdatadir)/api api_DATA = \ diff --git a/docs/meson.build b/docs/meson.build new file mode 100644 index 00000000000..529a1c003a7 --- /dev/null +++ b/docs/meson.build @@ -0,0 +1,30 @@ +docs_html_dir = docdir / 'html' + +docs_assets = [ + 'android-chrome-192x192.png', + 'android-chrome-256x256.png', + 'apple-touch-icon.png', + 'architecture.gif', + 'browserconfig.xml', + 'favicon.ico', + 'favicon-16x16.png', + 'favicon-32x32.png', + 'generic.css', + 'libvirt.css', + 'libvirt-daemon-arch.png', + 'libvirt-driver-arch.png', + 'libvirt-object-model.png', + 'libvirt-virConnect-example.png', + 'main.css', + 'manifest.json', + 'migration-managed-direct.png', + 'migration-managed-p2p.png', + 'migration-native.png', + 'migration-tunnel.png', + 'migration-unmanaged-direct.png', + 'mobile.css', + 'mstile-150x150.png', + 'node.gif', +] + +install_data(docs_assets, install_dir: docs_html_dir) diff --git a/meson.build b/meson.build index 8b434929825..65843ed574d 100644 --- a/meson.build +++ b/meson.build @@ -2211,6 +2211,8 @@ subdir('examples') subdir('po') +subdir('docs') + # generate meson-config.h file configure_file(output: 'meson-config.h', configuration: conf) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 55 --------------------------------------------- docs/meson.build | 32 ++++++++++++++++++++++++++ scripts/apibuild.py | 26 +++++++++++++-------- src/meson.build | 16 +++++++++---- 4 files changed, 61 insertions(+), 68 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index 6d97ed55c5b..1237b4c47cc 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -297,13 +297,6 @@ dot_html = \ htmldir = $(HTML_DIR) html_DATA = $(dot_html) -apidir = $(pkgdatadir)/api -api_DATA = \ - libvirt-api.xml \ - libvirt-qemu-api.xml \ - libvirt-lxc-api.xml \ - libvirt-admin-api.xml - schemadir = $(pkgdatadir)/schemas schema_DATA = $(wildcard $(srcdir)/schemas/*.rng) @@ -392,51 +385,3 @@ check-html: $(XMLLINT) --nonet --noout html/*.html check-local: check-html - -python_generated_files = $(api_DATA) - -APIBUILD=$(top_srcdir)/scripts/apibuild.py -APIBUILD_STAMP=apibuild.py.stamp - -$(python_generated_files): $(APIBUILD_STAMP) - -$(APIBUILD_STAMP): $(top_srcdir)/scripts/apibuild.py \ - $(top_srcdir)/include/libvirt/libvirt.h \ - $(top_srcdir)/include/libvirt/libvirt-common.h.in \ - $(top_srcdir)/include/libvirt/libvirt-domain-checkpoint.h \ - $(top_srcdir)/include/libvirt/libvirt-domain-snapshot.h \ - $(top_srcdir)/include/libvirt/libvirt-domain.h \ - $(top_srcdir)/include/libvirt/libvirt-event.h \ - $(top_srcdir)/include/libvirt/libvirt-host.h \ - $(top_srcdir)/include/libvirt/libvirt-interface.h \ - $(top_srcdir)/include/libvirt/libvirt-network.h \ - $(top_srcdir)/include/libvirt/libvirt-nodedev.h \ - $(top_srcdir)/include/libvirt/libvirt-nwfilter.h \ - $(top_srcdir)/include/libvirt/libvirt-secret.h \ - $(top_srcdir)/include/libvirt/libvirt-storage.h \ - $(top_srcdir)/include/libvirt/libvirt-stream.h \ - $(top_srcdir)/include/libvirt/libvirt-lxc.h \ - $(top_srcdir)/include/libvirt/libvirt-qemu.h \ - $(top_srcdir)/include/libvirt/libvirt-admin.h \ - $(top_srcdir)/include/libvirt/virterror.h \ - $(top_srcdir)/src/libvirt.c \ - $(top_srcdir)/src/libvirt-domain-checkpoint.c \ - $(top_srcdir)/src/libvirt-domain-snapshot.c \ - $(top_srcdir)/src/libvirt-domain.c \ - $(top_srcdir)/src/libvirt-host.c \ - $(top_srcdir)/src/libvirt-interface.c \ - $(top_srcdir)/src/libvirt-network.c \ - $(top_srcdir)/src/libvirt-nodedev.c \ - $(top_srcdir)/src/libvirt-nwfilter.c \ - $(top_srcdir)/src/libvirt-secret.c \ - $(top_srcdir)/src/libvirt-storage.c \ - $(top_srcdir)/src/libvirt-stream.c \ - $(top_srcdir)/src/libvirt-lxc.c \ - $(top_srcdir)/src/libvirt-qemu.c \ - $(top_srcdir)/src/admin/libvirt-admin.c \ - $(top_srcdir)/src/util/virerror.c \ - $(top_srcdir)/src/util/virevent.c \ - $(top_srcdir)/src/util/virtypedparam-public.c - $(AM_V_GEN)srcdir=$(srcdir) builddir=$(builddir) \ - $(RUNUTF8) $(PYTHON) $(APIBUILD) - touch $@ diff --git a/docs/meson.build b/docs/meson.build index 529a1c003a7..c67e114751e 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -28,3 +28,35 @@ docs_assets = [ ] install_data(docs_assets, install_dir: docs_html_dir) + +docs_api_generated = custom_target( + 'generate-api', + output: [ + 'libvirt-api.xml', + 'libvirt-lxc-api.xml', + 'libvirt-qemu-api.xml', + 'libvirt-admin-api.xml', + ], + command: [ + meson_python_prog, + apibuild_prog, + meson.current_source_dir(), + meson.current_build_dir(), + ], + install: true, + install_dir: pkgdatadir / 'api', + depend_files: [ + libvirt_common_h_in, + libvirt_include, + driver_sources, + libvirt_qemu_sources, + libvirt_lxc_sources, + admin_sources, + util_public_sources, + ], +) + +docs_api_xml = docs_api_generated[0] +docs_lxc_api_xml = docs_api_generated[1] +docs_qemu_api_xml = docs_api_generated[2] +docs_admin_api_xml = docs_api_generated[3] diff --git a/scripts/apibuild.py b/scripts/apibuild.py index 7cac9b136b4..58ae76d29cf 100755 --- a/scripts/apibuild.py +++ b/scripts/apibuild.py @@ -12,6 +12,7 @@ import os import sys import glob import re +import argparse quiet = True warnings = 0 @@ -2404,13 +2405,11 @@ class app: warnings = warnings + 1 print(msg) - def rebuild(self, name): + def rebuild(self, name, srcdir, builddir): if name not in ["libvirt", "libvirt-qemu", "libvirt-lxc", "libvirt-admin"]: self.warning("rebuild() failed, unknown module %s" % name) return None builder = None - srcdir = os.path.abspath((os.environ["srcdir"])) - builddir = os.path.abspath((os.environ["builddir"])) if glob.glob(srcdir + "/../src/libvirt.c") != []: if not quiet: print("Rebuilding API description for %s" % name) @@ -2438,15 +2437,24 @@ class app: if __name__ == "__main__": + parser = argparse.ArgumentParser(description="XML API builder") + parser.add_argument("srcdir", type=str, help="path to docs source dir") + parser.add_argument("builddir", type=str, help="path to docs build dir") + parser.add_argument("-d", "--debug", type=str, help="path to source file") + + args = parser.parse_args() + app = app() - if len(sys.argv) > 1: + + if args.debug: debug = 1 - app.parse(sys.argv[1]) + app.parse(args.debug) else: - app.rebuild("libvirt") - app.rebuild("libvirt-qemu") - app.rebuild("libvirt-lxc") - app.rebuild("libvirt-admin") + app.rebuild("libvirt", args.srcdir, args.builddir) + app.rebuild("libvirt-qemu", args.srcdir, args.builddir) + app.rebuild("libvirt-lxc", args.srcdir, args.builddir) + app.rebuild("libvirt-admin", args.srcdir, args.builddir) + if warnings > 0: sys.exit(2) else: diff --git a/src/meson.build b/src/meson.build index 946c124079a..b8ad300e558 100644 --- a/src/meson.build +++ b/src/meson.build @@ -271,7 +271,7 @@ subdir('vmware') subdir('vz') -driver_sources = [ +driver_sources = files( 'driver.c', 'libvirt.c', 'libvirt-domain.c', @@ -285,7 +285,7 @@ driver_sources = [ 'libvirt-secret.c', 'libvirt-storage.c', 'libvirt-stream.c', -] + ) driver_headers = [ 'driver-hypervisor.h', @@ -415,9 +415,13 @@ libvirt_qemu_syms_flags = '@0@@1@'.format( libvirt_qemu_syms_path, ) +libvirt_qemu_sources = files( + 'libvirt-qemu.c', +) + libvirt_qemu_lib = shared_library( 'virt-qemu', - 'libvirt-qemu.c', + libvirt_qemu_sources, dependencies: [ src_dep, ], @@ -463,9 +467,13 @@ libvirt_lxc_syms_flags = '@0@@1@'.format( libvirt_lxc_syms_path, ) +libvirt_lxc_sources = files( + 'libvirt-lxc.c', +) + libvirt_lxc_lib = shared_library( 'virt-lxc', - 'libvirt-lxc.c', + libvirt_lxc_sources, dependencies: [ apparmor_dep, selinux_dep, -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 7 ------- docs/meson.build | 2 ++ scripts/meson-timestamp.sh | 8 ++++++++ scripts/meson.build | 1 + 4 files changed, 11 insertions(+), 7 deletions(-) create mode 100755 scripts/meson-timestamp.sh diff --git a/docs/Makefile.am b/docs/Makefile.am index 1237b4c47cc..f54336cf35d 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -306,13 +306,6 @@ aclperms.htmlinc: $(top_srcdir)/src/access/viraccessperm.h \ $(top_srcdir)/scripts/genaclperms.py Makefile.am $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/genaclperms.py $< > $@ -timestamp="$(shell if test -n "$$SOURCE_DATE_EPOCH"; \ - then \ - date -u --date="@$$SOURCE_DATE_EPOCH"; \ - else \ - date -u; \ - fi)" - hvsupport.html: hvsupport.html.in hvsupport.html.in: $(top_srcdir)/scripts/hvsupport.py $(api_DATA) \ diff --git a/docs/meson.build b/docs/meson.build index c67e114751e..8a0b459f598 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -29,6 +29,8 @@ docs_assets = [ install_data(docs_assets, install_dir: docs_html_dir) +docs_timestamp = run_command(meson_timestamp_prog).stdout() + docs_api_generated = custom_target( 'generate-api', output: [ diff --git a/scripts/meson-timestamp.sh b/scripts/meson-timestamp.sh new file mode 100755 index 00000000000..e68be1926cf --- /dev/null +++ b/scripts/meson-timestamp.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +if test -n "$SOURCE_DATE_EPOCH"; +then + date -u --date="$SOURCE_DATE_EPOCH" +else + date -u +fi diff --git a/scripts/meson.build b/scripts/meson.build index 05bf6ff7231..12d18b8ce52 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -24,6 +24,7 @@ scripts = [ 'install-dirs.sh', 'install-symlink.sh', 'meson-python.sh', + 'meson-timestamp.sh', 'mock-noinline.py', 'prohibit-duplicate-header.py', 'test-wrap-argv.py', -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 6 ------ docs/meson.build | 10 ++++++++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index f54336cf35d..0584702f7a1 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -300,12 +300,6 @@ html_DATA = $(dot_html) schemadir = $(pkgdatadir)/schemas schema_DATA = $(wildcard $(srcdir)/schemas/*.rng) -acl_generated = aclperms.htmlinc - -aclperms.htmlinc: $(top_srcdir)/src/access/viraccessperm.h \ - $(top_srcdir)/scripts/genaclperms.py Makefile.am - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/genaclperms.py $< > $@ - hvsupport.html: hvsupport.html.in hvsupport.html.in: $(top_srcdir)/scripts/hvsupport.py $(api_DATA) \ diff --git a/docs/meson.build b/docs/meson.build index 8a0b459f598..bbe012491f3 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -29,6 +29,16 @@ docs_assets = [ install_data(docs_assets, install_dir: docs_html_dir) +aclperms_gen = custom_target( + 'aclperms.htmlinc', + input: access_perm_h, + output: 'aclperms.htmlinc', + command: [ + meson_python_prog, genaclperms_prog, '@INPUT@', + ], + capture: true, +) + docs_timestamp = run_command(meson_timestamp_prog).stdout() docs_api_generated = custom_target( -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 4 ---- docs/meson.build | 7 +++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index 0584702f7a1..a2fe2fbdc75 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -320,10 +320,6 @@ news.html.in: $(top_srcdir)/NEWS.rst $(AM_V_GEN)$(MKDIR_P) `dirname $@` && \ $(RST2HTML) --strict $< > $@ || { rm $@ && exit 1; } -%.html.in: %.rst - $(AM_V_GEN)$(MKDIR_P) `dirname $@` && \ - $(RST2HTML) --strict $< > $@ || { rm $@ && exit 1; } - %.html.tmp: %.html.in site.xsl subsite.xsl page.xsl \ $(acl_generated) $(AM_V_GEN)name=`echo $@ | sed -e 's/.tmp//'`; \ diff --git a/docs/meson.build b/docs/meson.build index bbe012491f3..b3f41a188ff 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -72,3 +72,10 @@ docs_api_xml = docs_api_generated[0] docs_lxc_api_xml = docs_api_generated[1] docs_qemu_api_xml = docs_api_generated[2] docs_admin_api_xml = docs_api_generated[3] + +docs_rst2html_gen = generator( + rst2html_prog, + output: '@BASENAME@.html.in', + arguments: [ '--strict', '@INPUT@' ], + capture: true, +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 26 --------------------- scripts/meson-html-gen.py | 49 +++++++++++++++++++++++++++++++++++++++ scripts/meson.build | 1 + 3 files changed, 50 insertions(+), 26 deletions(-) create mode 100755 scripts/meson-html-gen.py diff --git a/docs/Makefile.am b/docs/Makefile.am index a2fe2fbdc75..0c42db2badb 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -320,32 +320,6 @@ news.html.in: $(top_srcdir)/NEWS.rst $(AM_V_GEN)$(MKDIR_P) `dirname $@` && \ $(RST2HTML) --strict $< > $@ || { rm $@ && exit 1; } -%.html.tmp: %.html.in site.xsl subsite.xsl page.xsl \ - $(acl_generated) - $(AM_V_GEN)name=`echo $@ | sed -e 's/.tmp//'`; \ - genhtmlin=`echo $@ | sed -e 's/.tmp/.in/'`; \ - rst=`echo $@ | sed -e 's/.html.tmp/.rst/'`; \ - src="$$genhtmlin"; \ - test -f "$$genhtmlin" && src="$$rst"; \ - dir=`dirname $@` ; \ - if test "$$dir" = "."; \ - then \ - style=site.xsl; \ - else \ - $(MKDIR_P) $$dir; \ - style=subsite.xsl; \ - fi; \ - $(XSLTPROC) --stringparam pagename $$name \ - --stringparam pagesrc $$src \ - --stringparam builddir '$(abs_top_builddir)' \ - --stringparam timestamp $(timestamp) --nonet \ - $(top_srcdir)/docs/$$style $< > $@ \ - || { rm $@ && exit 1; } - -%.html: %.html.tmp - $(AM_V_GEN)$(XMLLINT) --nonet --format $< > $@ \ - || { rm $@ && exit 1; } - $(apihtml_generated): html/index.html $(apiadminhtml_generated): html/index-admin.html $(apiqemuhtml_generated): html/index-qemu.html diff --git a/scripts/meson-html-gen.py b/scripts/meson-html-gen.py new file mode 100755 index 00000000000..9ac649a9ef7 --- /dev/null +++ b/scripts/meson-html-gen.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 + +import argparse +import os +import subprocess + +parser = argparse.ArgumentParser() +parser.add_argument("xsltproc", type=str, help="path to xsltproc bin") +parser.add_argument("xmllint", type=str, help="path to xmllint bin") +parser.add_argument("builddir", type=str, help="build root dir path") +parser.add_argument("timestamp", type=str, help="docs timestamp") +parser.add_argument("style", type=str, help="XSL stile file") +parser.add_argument("infile", type=str, help="path to source HTML file") +parser.add_argument("htmlfile", type=str, help="path to generated HTML file") +args = parser.parse_args() + +name = os.path.basename(args.htmlfile).replace('.html', '') + +pagesrc = args.infile +rstfile = pagesrc.replace('.html.in', '.rst') +if os.path.exists(rstfile): + pagesrc = rstfile + +with open(args.infile, 'rb') as infile: + html_in_data = infile.read() + +html_tmp = subprocess.run( + [ + args.xsltproc, + '--stringparam', 'pagename', name, + '--stringparam', 'pagesrc', pagesrc, + '--stringparam', 'builddir', args.builddir, + '--stringparam', 'timestamp', args.timestamp, + '--nonet', args.style, '-', + ], + input=html_in_data, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, +) + +html = subprocess.run( + [args.xmllint, '--nonet', '--format', '-'], + input=html_tmp.stdout, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, +) + +with open(args.htmlfile, 'wb') as outfile: + outfile.write(html.stdout) diff --git a/scripts/meson.build b/scripts/meson.build index 12d18b8ce52..3bcd6e85ce5 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -23,6 +23,7 @@ scripts = [ 'hyperv_wmi_generator.py', 'install-dirs.sh', 'install-symlink.sh', + 'meson-html-gen.py', 'meson-python.sh', 'meson-timestamp.sh', 'mock-noinline.py', -- 2.26.2

On Thu, Jul 16, 2020 at 11:59:17 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 26 --------------------- scripts/meson-html-gen.py | 49 +++++++++++++++++++++++++++++++++++++++ scripts/meson.build | 1 + 3 files changed, 50 insertions(+), 26 deletions(-) create mode 100755 scripts/meson-html-gen.py
diff --git a/docs/Makefile.am b/docs/Makefile.am index a2fe2fbdc75..0c42db2badb 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -320,32 +320,6 @@ news.html.in: $(top_srcdir)/NEWS.rst $(AM_V_GEN)$(MKDIR_P) `dirname $@` && \ $(RST2HTML) --strict $< > $@ || { rm $@ && exit 1; }
-%.html.tmp: %.html.in site.xsl subsite.xsl page.xsl \ - $(acl_generated) - $(AM_V_GEN)name=`echo $@ | sed -e 's/.tmp//'`; \ - genhtmlin=`echo $@ | sed -e 's/.tmp/.in/'`; \ - rst=`echo $@ | sed -e 's/.html.tmp/.rst/'`; \ - src="$$genhtmlin"; \ - test -f "$$genhtmlin" && src="$$rst"; \ - dir=`dirname $@` ; \ - if test "$$dir" = "."; \ - then \ - style=site.xsl; \ - else \ - $(MKDIR_P) $$dir; \ - style=subsite.xsl; \ - fi; \ - $(XSLTPROC) --stringparam pagename $$name \ - --stringparam pagesrc $$src \ - --stringparam builddir '$(abs_top_builddir)' \ - --stringparam timestamp $(timestamp) --nonet \ - $(top_srcdir)/docs/$$style $< > $@ \ - || { rm $@ && exit 1; } - -%.html: %.html.tmp - $(AM_V_GEN)$(XMLLINT) --nonet --format $< > $@ \ - || { rm $@ && exit 1; } - $(apihtml_generated): html/index.html $(apiadminhtml_generated): html/index-admin.html $(apiqemuhtml_generated): html/index-qemu.html diff --git a/scripts/meson-html-gen.py b/scripts/meson-html-gen.py new file mode 100755 index 00000000000..9ac649a9ef7 --- /dev/null +++ b/scripts/meson-html-gen.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 + +import argparse +import os +import subprocess + +parser = argparse.ArgumentParser() +parser.add_argument("xsltproc", type=str, help="path to xsltproc bin") +parser.add_argument("xmllint", type=str, help="path to xmllint bin") +parser.add_argument("builddir", type=str, help="build root dir path") +parser.add_argument("timestamp", type=str, help="docs timestamp") +parser.add_argument("style", type=str, help="XSL stile file") +parser.add_argument("infile", type=str, help="path to source HTML file") +parser.add_argument("htmlfile", type=str, help="path to generated HTML file") +args = parser.parse_args() + +name = os.path.basename(args.htmlfile).replace('.html', '') + +pagesrc = args.infile +rstfile = pagesrc.replace('.html.in', '.rst') +if os.path.exists(rstfile): + pagesrc = rstfile + +with open(args.infile, 'rb') as infile: + html_in_data = infile.read() + +html_tmp = subprocess.run( + [ + args.xsltproc, + '--stringparam', 'pagename', name, + '--stringparam', 'pagesrc', pagesrc, + '--stringparam', 'builddir', args.builddir, + '--stringparam', 'timestamp', args.timestamp, + '--nonet', args.style, '-', + ], + input=html_in_data, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE,
xsltproc can take an input file as argument so if all of this is just for feeding it the input, it's not necessary to do it so.
+) + +html = subprocess.run( + [args.xmllint, '--nonet', '--format', '-'], + input=html_tmp.stdout, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE,
We can then do this as separate stage.

On Tue, Jul 28, 2020 at 03:18:23PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:59:17 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 26 --------------------- scripts/meson-html-gen.py | 49 +++++++++++++++++++++++++++++++++++++++ scripts/meson.build | 1 + 3 files changed, 50 insertions(+), 26 deletions(-) create mode 100755 scripts/meson-html-gen.py
diff --git a/docs/Makefile.am b/docs/Makefile.am index a2fe2fbdc75..0c42db2badb 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -320,32 +320,6 @@ news.html.in: $(top_srcdir)/NEWS.rst $(AM_V_GEN)$(MKDIR_P) `dirname $@` && \ $(RST2HTML) --strict $< > $@ || { rm $@ && exit 1; }
-%.html.tmp: %.html.in site.xsl subsite.xsl page.xsl \ - $(acl_generated) - $(AM_V_GEN)name=`echo $@ | sed -e 's/.tmp//'`; \ - genhtmlin=`echo $@ | sed -e 's/.tmp/.in/'`; \ - rst=`echo $@ | sed -e 's/.html.tmp/.rst/'`; \ - src="$$genhtmlin"; \ - test -f "$$genhtmlin" && src="$$rst"; \ - dir=`dirname $@` ; \ - if test "$$dir" = "."; \ - then \ - style=site.xsl; \ - else \ - $(MKDIR_P) $$dir; \ - style=subsite.xsl; \ - fi; \ - $(XSLTPROC) --stringparam pagename $$name \ - --stringparam pagesrc $$src \ - --stringparam builddir '$(abs_top_builddir)' \ - --stringparam timestamp $(timestamp) --nonet \ - $(top_srcdir)/docs/$$style $< > $@ \ - || { rm $@ && exit 1; } - -%.html: %.html.tmp - $(AM_V_GEN)$(XMLLINT) --nonet --format $< > $@ \ - || { rm $@ && exit 1; } - $(apihtml_generated): html/index.html $(apiadminhtml_generated): html/index-admin.html $(apiqemuhtml_generated): html/index-qemu.html diff --git a/scripts/meson-html-gen.py b/scripts/meson-html-gen.py new file mode 100755 index 00000000000..9ac649a9ef7 --- /dev/null +++ b/scripts/meson-html-gen.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python3 + +import argparse +import os +import subprocess + +parser = argparse.ArgumentParser() +parser.add_argument("xsltproc", type=str, help="path to xsltproc bin") +parser.add_argument("xmllint", type=str, help="path to xmllint bin") +parser.add_argument("builddir", type=str, help="build root dir path") +parser.add_argument("timestamp", type=str, help="docs timestamp") +parser.add_argument("style", type=str, help="XSL stile file") +parser.add_argument("infile", type=str, help="path to source HTML file") +parser.add_argument("htmlfile", type=str, help="path to generated HTML file") +args = parser.parse_args() + +name = os.path.basename(args.htmlfile).replace('.html', '') + +pagesrc = args.infile +rstfile = pagesrc.replace('.html.in', '.rst') +if os.path.exists(rstfile): + pagesrc = rstfile + +with open(args.infile, 'rb') as infile: + html_in_data = infile.read() + +html_tmp = subprocess.run( + [ + args.xsltproc, + '--stringparam', 'pagename', name, + '--stringparam', 'pagesrc', pagesrc, + '--stringparam', 'builddir', args.builddir, + '--stringparam', 'timestamp', args.timestamp, + '--nonet', args.style, '-', + ], + input=html_in_data, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE,
xsltproc can take an input file as argument so if all of this is just for feeding it the input, it's not necessary to do it so.
Nice catch, leftover from one of the previous versions where I was modifying the infile data directly in python, hence the open() call and passing it to stdin. I'll remove it.
+) + +html = subprocess.run( + [args.xmllint, '--nonet', '--format', '-'], + input=html_tmp.stdout, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE,
We can then do this as separate stage.
What do you mean by separate stage? Not following here. Pavel

On Tue, Jul 28, 2020 at 15:57:16 +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 03:18:23PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:59:17 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 26 --------------------- scripts/meson-html-gen.py | 49 +++++++++++++++++++++++++++++++++++++++ scripts/meson.build | 1 + 3 files changed, 50 insertions(+), 26 deletions(-) create mode 100755 scripts/meson-html-gen.py
[...]
+) + +html = subprocess.run( + [args.xmllint, '--nonet', '--format', '-'], + input=html_tmp.stdout, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE,
We can then do this as separate stage.
What do you mean by separate stage? Not following here.
I was arguing that the reformatting done by xmllint can be done as a separate build target thus eliminating the need to have this script completely.

On Tue, Jul 28, 2020 at 03:59:58PM +0200, Peter Krempa wrote:
On Tue, Jul 28, 2020 at 15:57:16 +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 03:18:23PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:59:17 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 26 --------------------- scripts/meson-html-gen.py | 49 +++++++++++++++++++++++++++++++++++++++ scripts/meson.build | 1 + 3 files changed, 50 insertions(+), 26 deletions(-) create mode 100755 scripts/meson-html-gen.py
[...]
+) + +html = subprocess.run( + [args.xmllint, '--nonet', '--format', '-'], + input=html_tmp.stdout, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE,
We can then do this as separate stage.
What do you mean by separate stage? Not following here.
I was arguing that the reformatting done by xmllint can be done as a separate build target thus eliminating the need to have this script completely.
Right, I guess now it can be done like that since there is not the part that modified the string directly in python. However, I would like to keep it like this. We will not have temporary files in the build directory. With two targets the temporary file should not be removed otherwise ninja would rebuild it every single time and that would cause to rebuild the resulting HTML as well. Pavel

On Tue, Jul 28, 2020 at 16:14:03 +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 03:59:58PM +0200, Peter Krempa wrote:
On Tue, Jul 28, 2020 at 15:57:16 +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 03:18:23PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:59:17 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 26 --------------------- scripts/meson-html-gen.py | 49 +++++++++++++++++++++++++++++++++++++++ scripts/meson.build | 1 + 3 files changed, 50 insertions(+), 26 deletions(-) create mode 100755 scripts/meson-html-gen.py
[...]
+) + +html = subprocess.run( + [args.xmllint, '--nonet', '--format', '-'], + input=html_tmp.stdout, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE,
We can then do this as separate stage.
What do you mean by separate stage? Not following here.
I was arguing that the reformatting done by xmllint can be done as a separate build target thus eliminating the need to have this script completely.
Right, I guess now it can be done like that since there is not the part that modified the string directly in python. However, I would like to keep it like this.
Well, and I don't like the extra python wrapper which obscures what is happening. Arguably we could write everything ourselves and just invoke a massive script from make/meson/whatever.
We will not have temporary files in the build directory. With two targets the temporary file should not be removed otherwise ninja would rebuild it every single time and that would cause to rebuild the resulting HTML as well.
Umm there's plenty of temporary stuff in the build directory. I don't think we care.

On Tue, Jul 28, 2020 at 04:23:15PM +0200, Peter Krempa wrote:
On Tue, Jul 28, 2020 at 16:14:03 +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 03:59:58PM +0200, Peter Krempa wrote:
On Tue, Jul 28, 2020 at 15:57:16 +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 03:18:23PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:59:17 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 26 --------------------- scripts/meson-html-gen.py | 49 +++++++++++++++++++++++++++++++++++++++ scripts/meson.build | 1 + 3 files changed, 50 insertions(+), 26 deletions(-) create mode 100755 scripts/meson-html-gen.py
[...]
+) + +html = subprocess.run( + [args.xmllint, '--nonet', '--format', '-'], + input=html_tmp.stdout, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE,
We can then do this as separate stage.
What do you mean by separate stage? Not following here.
I was arguing that the reformatting done by xmllint can be done as a separate build target thus eliminating the need to have this script completely.
Right, I guess now it can be done like that since there is not the part that modified the string directly in python. However, I would like to keep it like this.
Well, and I don't like the extra python wrapper which obscures what is happening. Arguably we could write everything ourselves and just invoke a massive script from make/meson/whatever.
Thanks for invalid argument.
We will not have temporary files in the build directory. With two targets the temporary file should not be removed otherwise ninja would rebuild it every single time and that would cause to rebuild the resulting HTML as well.
Umm there's plenty of temporary stuff in the build directory. I don't think we care.
Not in the docs directory. But I take it as it was not a strong argument from my side. However, there is another argument. It is called from docs/meson.build, docs/internals/meson.build, docs/kbase/meson.build and docs/manpages/meson.build. In order to avoid repetition in meson it is recommended to use scripts as meson doesn't support functions. To avoid the repetition we could do the same trick as in src/ directory by using list of dictionaries which would be processed only in docs/meson.build. If there majority agrees on removing the script I would rather do it as a followup series. Pavel

On Tue, Jul 28, 2020 at 16:46:55 +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 04:23:15PM +0200, Peter Krempa wrote:
On Tue, Jul 28, 2020 at 16:14:03 +0200, Pavel Hrdina wrote:
[...]
If there majority agrees on removing the script I would rather do it as a followup series.
I don't care that much about repetition of build target declarations accross various subdirectories. In this case I care that stuff is put into a script which doesn't need to be there and meson can handle it just fine. In the end many of the subdirectories do it directly. Fair enough, but you should compile a list of all that stuff you want to postpone as part of the final submission so that it won't be forgotten.

On Tue, Jul 28, 2020 at 04:52:18PM +0200, Peter Krempa wrote:
On Tue, Jul 28, 2020 at 16:46:55 +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 04:23:15PM +0200, Peter Krempa wrote:
On Tue, Jul 28, 2020 at 16:14:03 +0200, Pavel Hrdina wrote:
[...]
If there majority agrees on removing the script I would rather do it as a followup series.
I don't care that much about repetition of build target declarations accross various subdirectories. In this case I care that stuff is put into a script which doesn't need to be there and meson can handle it just fine. In the end many of the subdirectories do it directly.
The issue with repetition is a possibility to forget to change all places in the future if we need to modify the code.
Fair enough, but you should compile a list of all that stuff you want to postpone as part of the final submission so that it won't be forgotten.
I have that list together with all the fixes done based on review and other fixes that where needed because of changes in master. I'll include all of the notes with all the changes when sending a mail with v2. Pavel

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/meson.build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/meson.build b/docs/meson.build index b3f41a188ff..fa6b1f940fe 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -41,6 +41,11 @@ aclperms_gen = custom_target( docs_timestamp = run_command(meson_timestamp_prog).stdout() +site_xsl = files('site.xsl') +subsite_xsl = files('subsite.xsl') +page_xsl = files('page.xsl') +newapi_xsl = files('newapi.xsl') + docs_api_generated = custom_target( 'generate-api', output: [ -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 2 - docs/meson.build | 104 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+), 2 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index 0c42db2badb..4e69f9ae7fa 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -281,8 +281,6 @@ manpages_DATA = $(manpages_html) dot_html_generated_in = \ hvsupport.html.in \ $(NULL) -dot_html_in = \ - $(notdir $(wildcard $(srcdir)/*.html.in)) dot_rst = \ $(notdir $(wildcard $(srcdir)/*.rst)) dot_rst_html_in = \ diff --git a/docs/meson.build b/docs/meson.build index fa6b1f940fe..36fd2388b69 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -27,6 +27,84 @@ docs_assets = [ 'node.gif', ] +docs_html_in_files = [ + '404', + 'acl', + 'aclpolkit', + 'api_extension', + 'api', + 'apps', + 'architecture', + 'auditlog', + 'auth', + 'bindings', + 'bugs', + 'cgroups', + 'compiling', + 'contact', + 'contribute', + 'csharp', + 'dbus', + 'devguide', + 'docs', + 'downloads', + 'drivers', + 'drvbhyve', + 'drvesx', + 'drvhyperv', + 'drvlxc', + 'drvnodedev', + 'drvopenvz', + 'drvqemu', + 'drvremote', + 'drvsecret', + 'drvtest', + 'drvvbox', + 'drvvirtuozzo', + 'drvvmware', + 'drvxen', + 'errors', + 'firewall', + 'formatcaps', + 'formatdomaincaps', + 'formatdomain', + 'format', + 'formatnetwork', + 'formatnetworkport', + 'formatnode', + 'formatnwfilter', + 'formatsecret', + 'formatsnapshot', + 'formatstoragecaps', + 'formatstorageencryption', + 'formatstorage', + 'goals', + 'governance', + 'hooks', + 'index', + 'internals', + 'java', + 'kbase', + 'logging', + 'migration', + 'nss', + 'pci-hotplug', + 'php', + 'python', + 'remote', + 'securityprocess', + 'storage', + 'strategy', + 'support', + 'testapi', + 'testsuites', + 'testtck', + 'tlscerts', + 'uri', + 'virshcmdref', + 'windows', +] + install_data(docs_assets, install_dir: docs_html_dir) aclperms_gen = custom_target( @@ -84,3 +162,29 @@ docs_rst2html_gen = generator( arguments: [ '--strict', '@INPUT@' ], capture: true, ) + +foreach name : docs_html_in_files + html_in_file = '@0@.html.in'.format(name) + html_file = '@0@.html'.format(name) + + custom_target( + html_file, + input: html_in_file, + output: html_file, + command: [ + meson_python_prog, + meson_html_gen_prog, + xsltproc_prog.path(), + xmllint_prog.path(), + meson.build_root(), + docs_timestamp, + site_xsl, + '@INPUT@', + '@OUTPUT@', + ], + depends: [ aclperms_gen ], + depend_files: [ page_xsl ], + install: true, + install_dir: docs_html_dir, + ) +endforeach -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 3 --- docs/meson.build | 61 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 3 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index 4e69f9ae7fa..f1ac68f1d50 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -281,10 +281,7 @@ manpages_DATA = $(manpages_html) dot_html_generated_in = \ hvsupport.html.in \ $(NULL) -dot_rst = \ - $(notdir $(wildcard $(srcdir)/*.rst)) dot_rst_html_in = \ - $(dot_rst:%.rst=%.html.in) \ news.html.in \ $(NULL) dot_html = \ diff --git a/docs/meson.build b/docs/meson.build index 36fd2388b69..2da051e75ed 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -105,6 +105,27 @@ docs_html_in_files = [ 'windows', ] +docs_rst_files = [ + 'advanced-tests', + 'best-practices', + 'ci', + 'coding-style', + 'committer-guidelines', + 'daemons', + 'developer-tooling', + 'formatbackup', + 'formatcheckpoint', + 'hacking', + 'libvirt-go', + 'libvirt-go-xml', + 'newreposetup', + 'pci-addresses', + 'platforms', + 'programming-languages', + 'styleguide', + 'submitting-patches', +] + install_data(docs_assets, install_dir: docs_html_dir) aclperms_gen = custom_target( @@ -188,3 +209,43 @@ foreach name : docs_html_in_files install_dir: docs_html_dir, ) endforeach + + +# docs_html_in_gen: +# each entry is a dictionary with following items: +# name - base file name (required) +# file - generated file (required) +docs_html_in_gen = [] + +foreach name : docs_rst_files + rst_file = '@0@.rst'.format(name) + docs_html_in_gen += { + 'name': name, + 'file': docs_rst2html_gen.process(rst_file), + } +endforeach + +foreach data : docs_html_in_gen + html_file = '@0@.html'.format(data['name']) + + custom_target( + html_file, + input: data['file'], + output: html_file, + command: [ + meson_python_prog, + meson_html_gen_prog, + xsltproc_prog.path(), + xmllint_prog.path(), + meson.build_root(), + docs_timestamp, + site_xsl, + '@INPUT@', + '@OUTPUT@', + ], + depends: [ aclperms_gen ], + depend_files: [ page_xsl ], + install: true, + install_dir: docs_html_dir, + ) +endforeach -- 2.26.2

On Thu, Jul 16, 2020 at 11:59:20 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 3 --- docs/meson.build | 61 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 3 deletions(-)
This and the previous commit can actually be optimized: https://www.redhat.com/archives/libvir-list/2020-July/msg01627.html Obviously it can be done later with my patch.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 13 ------------- docs/meson.build | 25 +++++++++++++++++++++++++ src/meson.build | 4 +++- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index f1ac68f1d50..73d3d26422a 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -277,10 +277,6 @@ manpages/virkeyname-%.rst: $(top_srcdir)/src/keycodemapdb/data/keymaps.csv \ manpagesdir = $(HTML_DIR)/manpages manpages_DATA = $(manpages_html) -# Generate hvsupport.html first, since it takes one extra step. -dot_html_generated_in = \ - hvsupport.html.in \ - $(NULL) dot_rst_html_in = \ news.html.in \ $(NULL) @@ -295,15 +291,6 @@ html_DATA = $(dot_html) schemadir = $(pkgdatadir)/schemas schema_DATA = $(wildcard $(srcdir)/schemas/*.rng) -hvsupport.html: hvsupport.html.in - -hvsupport.html.in: $(top_srcdir)/scripts/hvsupport.py $(api_DATA) \ - $(top_srcdir)/src/libvirt_public.syms \ - $(top_srcdir)/src/libvirt_qemu.syms $(top_srcdir)/src/libvirt_lxc.syms \ - $(top_srcdir)/src/driver.h - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/hvsupport.py \ - $(top_srcdir) $(top_builddir) > $@ || { rm $@ && exit 1; } - manpages/%.html.in: manpages/%.rst $(AM_V_GEN)$(MKDIR_P) `dirname $@` && \ grep -v '^:Manual ' < $< | \ diff --git a/docs/meson.build b/docs/meson.build index 2da051e75ed..252f16262be 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -225,6 +225,31 @@ foreach name : docs_rst_files } endforeach +hvsupport_html_in = custom_target( + 'hvsupport.html.in', + output: 'hvsupport.html.in', + command: [ + meson_python_prog, + hvsupport_prog, + meson.source_root(), + meson.build_root(), + ], + capture: true, + depend_files: [ + public_sym_file, + libvirt_qemu_syms, + libvirt_lxc_syms, + driver_header, + ], + depends: [ + docs_api_generated, + ], +) +docs_html_in_gen += { + 'name': 'hvsupport', + 'file': hvsupport_html_in, +} + foreach data : docs_html_in_gen html_file = '@0@.html'.format(data['name']) diff --git a/src/meson.build b/src/meson.build index b8ad300e558..66aa6201550 100644 --- a/src/meson.build +++ b/src/meson.build @@ -80,7 +80,7 @@ rpc_probe_files = [] # symbol files -public_sym_file = 'libvirt_public.syms' +public_sym_file = files('libvirt_public.syms') used_sym_files = [ 'libvirt_private.syms', @@ -299,6 +299,8 @@ driver_headers = [ 'driver-stream.h', ] +driver_header = files('driver.h') + driver_lib = static_library( 'virt_driver', [ -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 15 --------------- docs/meson.build | 6 ++++++ 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index 73d3d26422a..1a5ae23b0ae 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -277,17 +277,6 @@ manpages/virkeyname-%.rst: $(top_srcdir)/src/keycodemapdb/data/keymaps.csv \ manpagesdir = $(HTML_DIR)/manpages manpages_DATA = $(manpages_html) -dot_rst_html_in = \ - news.html.in \ - $(NULL) -dot_html = \ - $(dot_html_generated_in:%.html.in=%.html) \ - $(dot_html_in:%.html.in=%.html) \ - $(dot_rst_html_in:%.html.in=%.html) - -htmldir = $(HTML_DIR) -html_DATA = $(dot_html) - schemadir = $(pkgdatadir)/schemas schema_DATA = $(wildcard $(srcdir)/schemas/*.rng) @@ -298,10 +287,6 @@ manpages/%.html.in: manpages/%.rst -e 's|RUNSTATEDIR|$(runstatedir)|g' | \ $(RST2HTML) --strict > $@ || { rm $@ && exit 1; } -news.html.in: $(top_srcdir)/NEWS.rst - $(AM_V_GEN)$(MKDIR_P) `dirname $@` && \ - $(RST2HTML) --strict $< > $@ || { rm $@ && exit 1; } - $(apihtml_generated): html/index.html $(apiadminhtml_generated): html/index-admin.html $(apiqemuhtml_generated): html/index-qemu.html diff --git a/docs/meson.build b/docs/meson.build index 252f16262be..463caa5e3e1 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -250,6 +250,12 @@ docs_html_in_gen += { 'file': hvsupport_html_in, } +news_html_in = docs_rst2html_gen.process(meson.source_root() / 'NEWS.rst') +docs_html_in_gen += { + 'name': 'news', + 'file': news_html_in, +} + foreach data : docs_html_in_gen html_file = '@0@.html'.format(data['name']) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 4 ---- docs/meson.build | 7 +++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index 1a5ae23b0ae..ae504358d26 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -46,10 +46,6 @@ vpathhack: do \ test -e $$dir || ln -s $(srcdir)/$$dir $$dir ; \ done - @for file in $(assets); \ - do \ - test -e $$file || ln -s $(srcdir)/$$file $$file ; \ - done apihtml = \ html/index.html \ diff --git a/docs/meson.build b/docs/meson.build index 463caa5e3e1..bc9524eb69e 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -280,3 +280,10 @@ foreach data : docs_html_in_gen install_dir: docs_html_dir, ) endforeach + + +# This hack enables us to view the web pages +# from within the uninstalled build tree +foreach file : docs_assets + configure_file(input: file, output: file, copy: true) +endforeach -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 19 +------------------ docs/fonts/meson.build | 22 ++++++++++++++++++++++ docs/meson.build | 2 ++ 3 files changed, 25 insertions(+), 18 deletions(-) create mode 100644 docs/fonts/meson.build diff --git a/docs/Makefile.am b/docs/Makefile.am index ae504358d26..7398628b6c0 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -42,7 +42,7 @@ all: vpathhack # This hack enables us to view the web pages # from within the uninstalled build tree vpathhack: - @for dir in fonts js logos; \ + @for dir in js logos; \ do \ test -e $$dir || ln -s $(srcdir)/$$dir $$dir ; \ done @@ -95,23 +95,6 @@ javascript = \ javascriptdir = $(HTML_DIR)/js javascript_DATA = $(javascript) -fonts = \ - fonts/LICENSE.rst \ - fonts/stylesheet.css \ - fonts/overpass-bold-italic.woff \ - fonts/overpass-bold.woff \ - fonts/overpass-italic.woff \ - fonts/overpass-light-italic.woff \ - fonts/overpass-light.woff \ - fonts/overpass-mono-bold.woff \ - fonts/overpass-mono-light.woff \ - fonts/overpass-mono-regular.woff \ - fonts/overpass-mono-semibold.woff \ - fonts/overpass-regular.woff - -fontsdir = $(HTML_DIR)/fonts -fonts_DATA = $(fonts) - logofiles = \ logos/logo-base.svg \ logos/logo-square.svg \ diff --git a/docs/fonts/meson.build b/docs/fonts/meson.build new file mode 100644 index 00000000000..8c0a2f1554d --- /dev/null +++ b/docs/fonts/meson.build @@ -0,0 +1,22 @@ +fonts = [ + 'LICENSE.rst', + 'stylesheet.css', + 'overpass-bold-italic.woff', + 'overpass-bold.woff', + 'overpass-italic.woff', + 'overpass-light-italic.woff', + 'overpass-light.woff', + 'overpass-mono-bold.woff', + 'overpass-mono-light.woff', + 'overpass-mono-regular.woff', + 'overpass-mono-semibold.woff', + 'overpass-regular.woff', +] + +install_data(fonts, install_dir: docs_html_dir / 'fonts') + +# This hack enables us to view the web pages +# from within the uninstalled build tree +foreach file : fonts + configure_file(input: file, output: file, copy: true) +endforeach diff --git a/docs/meson.build b/docs/meson.build index bc9524eb69e..7dc2bbdc42a 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -281,6 +281,8 @@ foreach data : docs_html_in_gen ) endforeach +subdir('fonts') + # This hack enables us to view the web pages # from within the uninstalled build tree -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 39 +------------------------------------- docs/html/meson.build | 44 +++++++++++++++++++++++++++++++++++++++++++ docs/meson.build | 4 ++++ 3 files changed, 49 insertions(+), 38 deletions(-) create mode 100644 docs/html/meson.build diff --git a/docs/Makefile.am b/docs/Makefile.am index 7398628b6c0..7c30d75b997 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -16,23 +16,6 @@ ## License along with this library. If not, see ## <http://www.gnu.org/licenses/>. -modules = \ - libvirt-common \ - libvirt-domain \ - libvirt-domain-checkpoint \ - libvirt-domain-snapshot \ - libvirt-event \ - libvirt-host \ - libvirt-interface \ - libvirt-network \ - libvirt-nodedev \ - libvirt-nwfilter \ - libvirt-secret \ - libvirt-storage \ - libvirt-stream \ - virterror \ - $(NULL) - modules_admin = libvirt-admin modules_qemu = libvirt-qemu modules_lxc = libvirt-lxc @@ -47,14 +30,6 @@ vpathhack: test -e $$dir || ln -s $(srcdir)/$$dir $$dir ; \ done -apihtml = \ - html/index.html \ - $(apihtml_generated) - -apihtml_generated = \ - $(addprefix html/libvirt-,$(addsuffix .html,$(modules))) \ - $(NULL) - apiadminhtml = \ html/index-admin.html \ $(apiadminhtml_generated) @@ -79,14 +54,8 @@ apilxchtml_generated = \ $(addprefix html/libvirt-,$(addsuffix .html,$(modules_lxc))) \ $(NULL) -apipng = \ - html/left.png \ - html/up.png \ - html/home.png \ - html/right.png - apirefdir = $(HTML_DIR)/html -apiref_DATA = $(apihtml) $(apiadminhtml) $(apiqemuhtml) $(apilxchtml) $(apipng) +apiref_DATA = $(apihtml) $(apiadminhtml) $(apiqemuhtml) $(apilxchtml) javascript = \ js/main.js \ @@ -271,12 +240,6 @@ $(apiadminhtml_generated): html/index-admin.html $(apiqemuhtml_generated): html/index-qemu.html $(apilxchtml_generated): html/index-lxc.html -html/index.html: libvirt-api.xml newapi.xsl page.xsl $(APIBUILD_STAMP) - $(AM_V_GEN)$(XSLTPROC) --nonet -o ./ \ - --stringparam builddir '$(abs_top_builddir)' \ - --stringparam timestamp $(timestamp) \ - $(srcdir)/newapi.xsl libvirt-api.xml - html/index-%.html: libvirt-%-api.xml newapi.xsl page.xsl $(APIBUILD_STAMP) $(AM_V_GEN)$(XSLTPROC) --nonet -o ./ \ --stringparam builddir '$(abs_top_builddir)' \ diff --git a/docs/html/meson.build b/docs/html/meson.build new file mode 100644 index 00000000000..67356c7d657 --- /dev/null +++ b/docs/html/meson.build @@ -0,0 +1,44 @@ +apipng = [ + 'home.png', + 'left.png', + 'right.png', + 'up.png', +] + +install_data(apipng, install_dir: docs_html_dir / 'html') + +custom_target( + 'index-api', + input: [ + newapi_xsl, + docs_api_xml, + ], + output: [ + 'index.html', + 'libvirt-libvirt-common.html', + 'libvirt-libvirt-domain.html', + 'libvirt-libvirt-domain-checkpoint.html', + 'libvirt-libvirt-domain-snapshot.html', + 'libvirt-libvirt-event.html', + 'libvirt-libvirt-host.html', + 'libvirt-libvirt-interface.html', + 'libvirt-libvirt-network.html', + 'libvirt-libvirt-nodedev.html', + 'libvirt-libvirt-nwfilter.html', + 'libvirt-libvirt-secret.html', + 'libvirt-libvirt-storage.html', + 'libvirt-libvirt-stream.html', + 'libvirt-virterror.html', + ], + command: [ + xsltproc_prog, '--nonet', '-o', docs_builddir, + '--stringparam', 'builddir', meson.build_root(), + '--stringparam', 'timestamp', docs_timestamp, + '@INPUT@', + ], + install: true, + install_dir: docs_html_dir / 'html', + depend_files: [ + page_xsl, + ], +) diff --git a/docs/meson.build b/docs/meson.build index 7dc2bbdc42a..d6944ad642a 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -1,5 +1,8 @@ docs_html_dir = docdir / 'html' +# xsltproc requires that the -o path ends with '/' +docs_builddir = meson.current_build_dir() / '' + docs_assets = [ 'android-chrome-192x192.png', 'android-chrome-256x256.png', @@ -282,6 +285,7 @@ foreach data : docs_html_in_gen endforeach subdir('fonts') +subdir('html') # This hack enables us to view the web pages -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 43 ------------------------------------------- docs/html/meson.build | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 43 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index 7c30d75b997..9e3479f010e 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -16,10 +16,6 @@ ## License along with this library. If not, see ## <http://www.gnu.org/licenses/>. -modules_admin = libvirt-admin -modules_qemu = libvirt-qemu -modules_lxc = libvirt-lxc - all: vpathhack # This hack enables us to view the web pages @@ -30,33 +26,6 @@ vpathhack: test -e $$dir || ln -s $(srcdir)/$$dir $$dir ; \ done -apiadminhtml = \ - html/index-admin.html \ - $(apiadminhtml_generated) - -apiadminhtml_generated = \ - $(addprefix html/libvirt-,$(addsuffix .html,$(modules_admin))) \ - $(NULL) - -apiqemuhtml = \ - html/index-qemu.html \ - $(apiqemuhtml_generated) - -apiqemuhtml_generated = \ - $(addprefix html/libvirt-,$(addsuffix .html,$(modules_qemu))) \ - $(NULL) - -apilxchtml = \ - html/index-lxc.html \ - $(apilxchtml_generated) - -apilxchtml_generated = \ - $(addprefix html/libvirt-,$(addsuffix .html,$(modules_lxc))) \ - $(NULL) - -apirefdir = $(HTML_DIR)/html -apiref_DATA = $(apihtml) $(apiadminhtml) $(apiqemuhtml) $(apilxchtml) - javascript = \ js/main.js \ $(NULL) @@ -235,18 +204,6 @@ manpages/%.html.in: manpages/%.rst -e 's|RUNSTATEDIR|$(runstatedir)|g' | \ $(RST2HTML) --strict > $@ || { rm $@ && exit 1; } -$(apihtml_generated): html/index.html -$(apiadminhtml_generated): html/index-admin.html -$(apiqemuhtml_generated): html/index-qemu.html -$(apilxchtml_generated): html/index-lxc.html - -html/index-%.html: libvirt-%-api.xml newapi.xsl page.xsl $(APIBUILD_STAMP) - $(AM_V_GEN)$(XSLTPROC) --nonet -o ./ \ - --stringparam builddir '$(abs_top_builddir)' \ - --stringparam timestamp $(timestamp) \ - --stringparam indexfile $(@:html/%=%) \ - $(srcdir)/newapi.xsl $< - check-html: $(XMLLINT) --nonet --noout html/*.html diff --git a/docs/html/meson.build b/docs/html/meson.build index 67356c7d657..7be5abe5fe5 100644 --- a/docs/html/meson.build +++ b/docs/html/meson.build @@ -42,3 +42,29 @@ custom_target( page_xsl, ], ) + +foreach name : [ 'admin', 'lxc', 'qemu' ] + custom_target( + 'index-@0@-api'.format(name), + input: [ + newapi_xsl, + get_variable('docs_@0@_api_xml'.format(name)), + ], + output: [ + 'index-@0@.html'.format(name), + 'libvirt-libvirt-@0@.html'.format(name), + ], + command: [ + xsltproc_prog, '--nonet', '-o', docs_builddir, + '--stringparam', 'builddir', meson.build_root(), + '--stringparam', 'timestamp', docs_timestamp, + '--stringparam', 'indexfile', 'index-@0@.html'.format(name), + '@INPUT@', + ], + install: true, + install_dir: docs_html_dir / 'html', + depend_files: [ + page_xsl, + ], + ) +endforeach -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 13 ------------- docs/internals/meson.build | 32 ++++++++++++++++++++++++++++++++ docs/meson.build | 1 + 3 files changed, 33 insertions(+), 13 deletions(-) create mode 100644 docs/internals/meson.build diff --git a/docs/Makefile.am b/docs/Makefile.am index 9e3479f010e..0e59b00961c 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -55,19 +55,6 @@ logofiles = \ logofilesdir = $(HTML_DIR)/logos logofiles_DATA = $(logofiles) -internals_html_in = \ - $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/internals/*.html.in)) -internals_rst = \ - $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/internals/*.rst)) -internals_rst_html_in = \ - $(internals_rst:%.rst=%.html.in) -internals_html = \ - $(internals_html_in:%.html.in=%.html) \ - $(internals_rst_html_in:%.html.in=%.html) - -internalsdir = $(HTML_DIR)/internals -internals_DATA = $(internals_html) - kbase_html_in = \ $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/kbase/*.html.in)) kbase_rst = \ diff --git a/docs/internals/meson.build b/docs/internals/meson.build new file mode 100644 index 00000000000..944903ae27f --- /dev/null +++ b/docs/internals/meson.build @@ -0,0 +1,32 @@ +internals_in_files = [ + 'command', + 'eventloop', + 'locking', + 'rpc', +] + +foreach name : internals_in_files + html_in_file = '@0@.html.in'.format(name) + html_file = '@0@.html'.format(name) + + custom_target( + html_file, + input: html_in_file, + output: html_file, + command: [ + meson_python_prog, + meson_html_gen_prog, + xsltproc_prog.path(), + xmllint_prog.path(), + meson.build_root(), + docs_timestamp, + site_xsl, + '@INPUT@', + '@OUTPUT@', + ], + depends: [ aclperms_gen ], + depend_files: [ page_xsl ], + install: true, + install_dir: docs_html_dir / 'internals', + ) +endforeach diff --git a/docs/meson.build b/docs/meson.build index d6944ad642a..b211a377f59 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -286,6 +286,7 @@ endforeach subdir('fonts') subdir('html') +subdir('internals') # This hack enables us to view the web pages -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 9 +-------- docs/js/meson.build | 11 +++++++++++ docs/meson.build | 1 + 3 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 docs/js/meson.build diff --git a/docs/Makefile.am b/docs/Makefile.am index 0e59b00961c..6b2ee2747e2 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -21,18 +21,11 @@ all: vpathhack # This hack enables us to view the web pages # from within the uninstalled build tree vpathhack: - @for dir in js logos; \ + @for dir in logos; \ do \ test -e $$dir || ln -s $(srcdir)/$$dir $$dir ; \ done -javascript = \ - js/main.js \ - $(NULL) - -javascriptdir = $(HTML_DIR)/js -javascript_DATA = $(javascript) - logofiles = \ logos/logo-base.svg \ logos/logo-square.svg \ diff --git a/docs/js/meson.build b/docs/js/meson.build new file mode 100644 index 00000000000..da90cbf96e1 --- /dev/null +++ b/docs/js/meson.build @@ -0,0 +1,11 @@ +docs_js_files = [ + 'main.js', +] + +install_data(docs_js_files, install_dir: docs_html_dir / 'js') + +# This hack enables us to view the web pages +# from within the uninstalled build tree +foreach file : docs_js_files + configure_file(input: file, output: file, copy: true) +endforeach diff --git a/docs/meson.build b/docs/meson.build index b211a377f59..bbd6faaa786 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -287,6 +287,7 @@ endforeach subdir('fonts') subdir('html') subdir('internals') +subdir('js') # This hack enables us to view the web pages -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 13 ------------- docs/kbase/meson.build | 41 +++++++++++++++++++++++++++++++++++++++++ docs/meson.build | 1 + 3 files changed, 42 insertions(+), 13 deletions(-) create mode 100644 docs/kbase/meson.build diff --git a/docs/Makefile.am b/docs/Makefile.am index 6b2ee2747e2..a25fe49b6b7 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -48,19 +48,6 @@ logofiles = \ logofilesdir = $(HTML_DIR)/logos logofiles_DATA = $(logofiles) -kbase_html_in = \ - $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/kbase/*.html.in)) -kbase_rst = \ - $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/kbase/*.rst)) -kbase_rst_html_in = \ - $(kbase_rst:%.rst=%.html.in) -kbase_html = \ - $(kbase_html_in:%.html.in=%.html) \ - $(kbase_rst_html_in:%.html.in=%.html) - -kbasedir = $(HTML_DIR)/kbase -kbase_DATA = $(kbase_html) - # Sync with src/util/ KEYCODES = linux osx atset1 atset2 atset3 xtkbd usb win32 qnum KEYNAMES = linux osx win32 diff --git a/docs/kbase/meson.build b/docs/kbase/meson.build new file mode 100644 index 00000000000..6a17d674436 --- /dev/null +++ b/docs/kbase/meson.build @@ -0,0 +1,41 @@ +docs_kbase_files = [ + 'backing_chains', + 'domainstatecapture', + 'launch_security_sev', + 'locking-lockd', + 'locking', + 'locking-sanlock', + 'migrationinternals', + 'qemu-passthrough-security', + 'rpm-deployment', + 'secureusage', + 'virtiofs', +] + +foreach name : docs_kbase_files + rst_file = '@0@.rst'.format(name) + html_file = '@0@.html'.format(name) + + html_in = docs_rst2html_gen.process(rst_file) + + custom_target( + html_file, + input: html_in, + output: html_file, + command: [ + meson_python_prog, + meson_html_gen_prog, + xsltproc_prog.path(), + xmllint_prog.path(), + meson.build_root(), + docs_timestamp, + site_xsl, + '@INPUT@', + '@OUTPUT@', + ], + depends: [ aclperms_gen ], + depend_files: [ page_xsl ], + install: true, + install_dir: docs_html_dir / 'kbase', + ) +endforeach diff --git a/docs/meson.build b/docs/meson.build index bbd6faaa786..069778ce890 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -288,6 +288,7 @@ subdir('fonts') subdir('html') subdir('internals') subdir('js') +subdir('kbase') # This hack enables us to view the web pages -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 32 -------------------------------- docs/logos/meson.build | 29 +++++++++++++++++++++++++++++ docs/meson.build | 1 + 3 files changed, 30 insertions(+), 32 deletions(-) create mode 100644 docs/logos/meson.build diff --git a/docs/Makefile.am b/docs/Makefile.am index a25fe49b6b7..d17455f135e 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -16,38 +16,6 @@ ## License along with this library. If not, see ## <http://www.gnu.org/licenses/>. -all: vpathhack - -# This hack enables us to view the web pages -# from within the uninstalled build tree -vpathhack: - @for dir in logos; \ - do \ - test -e $$dir || ln -s $(srcdir)/$$dir $$dir ; \ - done - -logofiles = \ - logos/logo-base.svg \ - logos/logo-square.svg \ - logos/logo-square-powered.svg \ - logos/logo-banner-dark.svg \ - logos/logo-banner-light.svg \ - logos/logo-square-96.png \ - logos/logo-square-128.png \ - logos/logo-square-192.png \ - logos/logo-square-256.png \ - logos/logo-square-powered-96.png \ - logos/logo-square-powered-128.png \ - logos/logo-square-powered-192.png \ - logos/logo-square-powered-256.png \ - logos/logo-banner-dark-256.png \ - logos/logo-banner-dark-800.png \ - logos/logo-banner-light-256.png \ - logos/logo-banner-light-800.png - -logofilesdir = $(HTML_DIR)/logos -logofiles_DATA = $(logofiles) - # Sync with src/util/ KEYCODES = linux osx atset1 atset2 atset3 xtkbd usb win32 qnum KEYNAMES = linux osx win32 diff --git a/docs/logos/meson.build b/docs/logos/meson.build new file mode 100644 index 00000000000..da92c397cde --- /dev/null +++ b/docs/logos/meson.build @@ -0,0 +1,29 @@ +docs_logo_files = [ + 'logo-banner-dark-256.png', + 'logo-banner-dark-800.png', + 'logo-banner-dark.svg', + 'logo-banner-light-256.png', + 'logo-banner-light-800.png', + 'logo-banner-light.svg', + 'logo-base.svg', + 'logo-square-128.png', + 'logo-square-192.png', + 'logo-square-256.png', + 'logo-square-96.png', + 'logo-square-powered-128.png', + 'logo-square-powered-192.png', + 'logo-square-powered-256.png', + 'logo-square-powered-96.png', + 'logo-square-powered.svg', + 'logo-square.svg', + 'logo-sticker-hexagon.svg', + 'logo-sticker-square.svg', +] + +install_data(docs_logo_files, install_dir: docs_html_dir / 'logos') + +# This hack enables us to view the web pages +# from within the uninstalled build tree +foreach file : docs_logo_files + configure_file(input: file, output: file, copy: true) +endforeach diff --git a/docs/meson.build b/docs/meson.build index 069778ce890..17c8f956870 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -289,6 +289,7 @@ subdir('html') subdir('internals') subdir('js') subdir('kbase') +subdir('logos') # This hack enables us to view the web pages -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 120 ----------------- docs/manpages/{index.rst => index.rst.in} | 0 .../{libvirtd.rst => libvirtd.rst.in} | 0 docs/manpages/meson.build | 126 ++++++++++++++++++ docs/manpages/{virsh.rst => virsh.rst.in} | 0 .../{virt-admin.rst => virt-admin.rst.in} | 0 ...validate.rst => virt-host-validate.rst.in} | 0 ...ogin-shell.rst => virt-login-shell.rst.in} | 0 ...-validate.rst => virt-pki-validate.rst.in} | 0 ...virt-qemu-run.rst => virt-qemu-run.rst.in} | 0 ...leanup.rst => virt-sanlock-cleanup.rst.in} | 0 ...-validate.rst => virt-xml-validate.rst.in} | 0 .../{virtlockd.rst => virtlockd.rst.in} | 0 .../{virtlogd.rst => virtlogd.rst.in} | 0 docs/meson.build | 1 + 15 files changed, 127 insertions(+), 120 deletions(-) rename docs/manpages/{index.rst => index.rst.in} (100%) rename docs/manpages/{libvirtd.rst => libvirtd.rst.in} (100%) create mode 100644 docs/manpages/meson.build rename docs/manpages/{virsh.rst => virsh.rst.in} (100%) rename docs/manpages/{virt-admin.rst => virt-admin.rst.in} (100%) rename docs/manpages/{virt-host-validate.rst => virt-host-validate.rst.in} (100%) rename docs/manpages/{virt-login-shell.rst => virt-login-shell.rst.in} (100%) rename docs/manpages/{virt-pki-validate.rst => virt-pki-validate.rst.in} (100%) rename docs/manpages/{virt-qemu-run.rst => virt-qemu-run.rst.in} (100%) rename docs/manpages/{virt-sanlock-cleanup.rst => virt-sanlock-cleanup.rst.in} (100%) rename docs/manpages/{virt-xml-validate.rst => virt-xml-validate.rst.in} (100%) rename docs/manpages/{virtlockd.rst => virtlockd.rst.in} (100%) rename docs/manpages/{virtlogd.rst => virtlogd.rst.in} (100%) diff --git a/docs/Makefile.am b/docs/Makefile.am index d17455f135e..8fe0959bc2d 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -16,129 +16,9 @@ ## License along with this library. If not, see ## <http://www.gnu.org/licenses/>. -# Sync with src/util/ -KEYCODES = linux osx atset1 atset2 atset3 xtkbd usb win32 qnum -KEYNAMES = linux osx win32 - -manpages_rst = \ - manpages/index.rst \ - $(NULL) -manpages1_rst = \ - manpages/virt-pki-validate.rst \ - manpages/virt-xml-validate.rst \ - manpages/virt-admin.rst \ - manpages/virsh.rst \ - $(NULL) -manpages7_rst = \ - $(KEYCODES:%=manpages/virkeycode-%.rst) \ - $(KEYNAMES:%=manpages/virkeyname-%.rst) \ - $(NULL) -manpages8_rst = $(NULL) -manpages_rst += \ - $(manpages1_rst) \ - $(manpages7_rst) \ - $(manpages8_rst) \ - $(NULL) -if WITH_LIBVIRTD -manpages8_rst += \ - manpages/libvirtd.rst \ - manpages/virtlockd.rst \ - manpages/virtlogd.rst \ - $(NULL) -else ! WITH_LIBVIRTD -manpages_rst += \ - manpages/libvirtd.rst \ - manpages/virtlockd.rst \ - manpages/virtlogd.rst \ - $(NULL) -endif ! WITH_LIBVIRTD -if WITH_HOST_VALIDATE - manpages1_rst += manpages/virt-host-validate.rst -else ! WITH_HOST_VALIDATE - manpages_rst += manpages/virt-host-validate.rst -endif ! WITH_HOST_VALIDATE -if WITH_LOGIN_SHELL - manpages1_rst += manpages/virt-login-shell.rst -else ! WITH_LOGIN_SHELL - manpages_rst += manpages/virt-login-shell.rst -endif ! WITH_LOGIN_SHELL -if WITH_SANLOCK - manpages8_rst += manpages/virt-sanlock-cleanup.rst -else ! WITH_SANLOCK - manpages_rst += manpages/virt-sanlock-cleanup.rst -endif ! WITH_SANLOCK -if WITH_QEMU - manpages1_rst += manpages/virt-qemu-run.rst -else ! WITH_QEMU - manpages_rst += manpages/virt-qemu-run.rst -endif ! WITH_QEMU -manpages_rst_html_in = \ - $(manpages_rst:%.rst=%.html.in) -manpages_html = \ - $(manpages_rst_html_in:%.html.in=%.html) - -man1_MANS = $(manpages1_rst:%.rst=%.1) -man7_MANS = $(manpages7_rst:%.rst=%.7) -man8_MANS = $(manpages8_rst:%.rst=%.8) - -%.1: %.rst - $(AM_V_GEN)$(MKDIR_P) `dirname $@` && \ - grep -v '^\.\. contents::' < $< | \ - sed -e 's|SYSCONFDIR|$(sysconfdir)|g' \ - -e 's|RUNSTATEDIR|$(runstatedir)|g' | \ - $(RST2MAN) --strict > $@ || { rm $@ && exit 1; } - -%.7: %.rst - $(AM_V_GEN)$(MKDIR_P) `dirname $@` && \ - grep -v '^\.\. contents::' < $< | \ - sed -e 's|SYSCONFDIR|$(sysconfdir)|g' \ - -e 's|RUNSTATEDIR|$(runstatedir)|g' | \ - $(RST2MAN) --strict > $@ || { rm $@ && exit 1; } - -%.8: %.rst - $(AM_V_GEN)$(MKDIR_P) `dirname $@` && \ - grep -v '^\.\. contents::' < $< | \ - sed -e 's|SYSCONFDIR|$(sysconfdir)|g' \ - -e 's|RUNSTATEDIR|$(runstatedir)|g' | \ - $(RST2MAN) --strict > $@ || { rm $@ && exit 1; } - -manpages/virkeycode-%.rst: $(top_srcdir)/src/keycodemapdb/data/keymaps.csv \ - $(top_srcdir)/src/keycodemapdb/tools/keymap-gen Makefile.am - $(AM_V_GEN)export NAME=`echo $@ | \ - sed -e 's,manpages/virkeycode-,,' -e 's,\.rst,,'` && \ - $(MKDIR_P) manpages/ && \ - $(RUNUTF8) $(PYTHON) $(top_srcdir)/src/keycodemapdb/tools/keymap-gen \ - code-docs \ - --lang rst \ - --title "virkeycode-$$NAME" \ - --subtitle "Key code values for $$NAME" \ - $(top_srcdir)/src/keycodemapdb/data/keymaps.csv $$NAME > $@ - -manpages/virkeyname-%.rst: $(top_srcdir)/src/keycodemapdb/data/keymaps.csv \ - $(top_srcdir)/src/keycodemapdb/tools/keymap-gen Makefile.am - $(AM_V_GEN)export NAME=`echo $@ | \ - sed -e 's,manpages/virkeyname-,,' -e 's,\.rst,,'` && \ - $(MKDIR_P) manpages/ && \ - $(RUNUTF8) $(PYTHON) $(top_srcdir)/src/keycodemapdb/tools/keymap-gen \ - name-docs \ - --lang rst \ - --title "virkeyname-$$NAME" \ - --subtitle "Key name values for $$NAME" \ - $(top_srcdir)/src/keycodemapdb/data/keymaps.csv $$NAME > $@ - -manpagesdir = $(HTML_DIR)/manpages -manpages_DATA = $(manpages_html) - schemadir = $(pkgdatadir)/schemas schema_DATA = $(wildcard $(srcdir)/schemas/*.rng) -manpages/%.html.in: manpages/%.rst - $(AM_V_GEN)$(MKDIR_P) `dirname $@` && \ - grep -v '^:Manual ' < $< | \ - sed -e 's|SYSCONFDIR|$(sysconfdir)|g' \ - -e 's|RUNSTATEDIR|$(runstatedir)|g' | \ - $(RST2HTML) --strict > $@ || { rm $@ && exit 1; } - check-html: $(XMLLINT) --nonet --noout html/*.html diff --git a/docs/manpages/index.rst b/docs/manpages/index.rst.in similarity index 100% rename from docs/manpages/index.rst rename to docs/manpages/index.rst.in diff --git a/docs/manpages/libvirtd.rst b/docs/manpages/libvirtd.rst.in similarity index 100% rename from docs/manpages/libvirtd.rst rename to docs/manpages/libvirtd.rst.in diff --git a/docs/manpages/meson.build b/docs/manpages/meson.build new file mode 100644 index 00000000000..72d362e92d8 --- /dev/null +++ b/docs/manpages/meson.build @@ -0,0 +1,126 @@ +# docs_man_files +# each entry is a dictionary with following items: +# name - man page name (required) +# section - man page section (required) +# install - whether to build and install the man page (required) +# file - generated RST file (optional, default none) + +docs_man_files = [ + { 'name': 'index', 'section': '', 'install': false }, + + { 'name': 'virsh', 'section': '1', 'install': true }, + { 'name': 'virt-admin', 'section': '1', 'install': true }, + { 'name': 'virt-host-validate', 'section': '1', 'install': conf.has('WITH_HOST_VALIDATE') }, + { 'name': 'virt-login-shell', 'section': '1', 'install': conf.has('WITH_LOGIN_SHELL') }, + { 'name': 'virt-pki-validate', 'section': '1', 'install': true }, + { 'name': 'virt-qemu-run', 'section': '1', 'install': conf.has('WITH_QEMU') }, + { 'name': 'virt-xml-validate', 'section': '1', 'install': true }, + + { 'name': 'libvirtd', 'section': '8', 'install': conf.has('WITH_LIBVIRTD') }, + { 'name': 'virt-sanlock-cleanup', 'section': '8', 'install': sanlock_dep.found() }, + { 'name': 'virtlockd', 'section': '8', 'install': conf.has('WITH_LIBVIRTD') }, + { 'name': 'virtlogd', 'section': '8', 'install': conf.has('WITH_LIBVIRTD') }, +] + +foreach name : keycode_list + rst_file = custom_target( + 'virkeycode-@0@.rst'.format(name), + input: keymap_src_file, + output: 'virkeycode-@0@.rst'.format(name), + command: [ + meson_python_prog, python3_prog, keymap_gen_prog, 'code-docs', + '--lang', 'rst', + '--title', 'virkeycode-@0@'.format(name), + '--subtitle', 'Key code values for @0@'.format(name), + '@INPUT@', name, + ], + capture: true, + build_by_default: true, + ) + + docs_man_files += { + 'name': 'virkeycode-@0@'.format(name), 'section': '7', 'install': true, 'file': rst_file, + } +endforeach + +foreach name : keyname_list + rst_file = custom_target( + 'virkeyname-@0@.rst'.format(name), + input: keymap_src_file, + output: 'virkeyname-@0@.rst'.format(name), + command: [ + meson_python_prog, python3_prog, keymap_gen_prog, 'name-docs', + '--lang', 'rst', + '--title', 'virkeyname-@0@'.format(name), + '--subtitle', 'Key name values for @0@'.format(name), + '@INPUT@', name, + ], + capture: true, + build_by_default: true, + ) + + docs_man_files += { + 'name': 'virkeyname-@0@'.format(name), 'section': '7', 'install': true, 'file': rst_file, + } +endforeach + +docs_man_conf = configuration_data() +docs_man_conf.set('SYSCONFDIR', sysconfdir) +docs_man_conf.set('RUNSTATEDIR', runstatedir) + +foreach data : docs_man_files + rst_in_file = '@0@.rst.in'.format(data['name']) + html_in_file = '@0@.html.in'.format(data['name']) + html_file = '@0@.html'.format(data['name']) + + if data.has_key('file') + rst_file = data['file'] + else + rst_file = configure_file( + input: rst_in_file, + output: '@0@.rst'.format(data['name']), + configuration: docs_man_conf, + ) + endif + + if data['install'] + man_file = '@0@.@1@'.format(data['name'], data['section']) + man_page = custom_target( + man_file, + input: rst_file, + output: man_file, + command: [ rst2man_prog, '--strict', '@INPUT@', '@OUTPUT@' ], + install: true, + install_dir: mandir / 'man@0@'.format(data['section']), + ) + endif + + html_in = custom_target( + html_in_file, + input: rst_file, + output: html_in_file, + command: [ rst2html_prog, '--strict', '@INPUT@' ], + capture: true, + ) + + custom_target( + html_file, + input: html_in, + output: html_file, + command: [ + meson_python_prog, + meson_html_gen_prog, + xsltproc_prog.path(), + xmllint_prog.path(), + meson.build_root(), + docs_timestamp, + site_xsl, + '@INPUT@', + '@OUTPUT@', + ], + depends: [ aclperms_gen ], + depend_files: [ page_xsl ], + install: true, + install_dir: docs_html_dir / 'manpages', + ) +endforeach diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst.in similarity index 100% rename from docs/manpages/virsh.rst rename to docs/manpages/virsh.rst.in diff --git a/docs/manpages/virt-admin.rst b/docs/manpages/virt-admin.rst.in similarity index 100% rename from docs/manpages/virt-admin.rst rename to docs/manpages/virt-admin.rst.in diff --git a/docs/manpages/virt-host-validate.rst b/docs/manpages/virt-host-validate.rst.in similarity index 100% rename from docs/manpages/virt-host-validate.rst rename to docs/manpages/virt-host-validate.rst.in diff --git a/docs/manpages/virt-login-shell.rst b/docs/manpages/virt-login-shell.rst.in similarity index 100% rename from docs/manpages/virt-login-shell.rst rename to docs/manpages/virt-login-shell.rst.in diff --git a/docs/manpages/virt-pki-validate.rst b/docs/manpages/virt-pki-validate.rst.in similarity index 100% rename from docs/manpages/virt-pki-validate.rst rename to docs/manpages/virt-pki-validate.rst.in diff --git a/docs/manpages/virt-qemu-run.rst b/docs/manpages/virt-qemu-run.rst.in similarity index 100% rename from docs/manpages/virt-qemu-run.rst rename to docs/manpages/virt-qemu-run.rst.in diff --git a/docs/manpages/virt-sanlock-cleanup.rst b/docs/manpages/virt-sanlock-cleanup.rst.in similarity index 100% rename from docs/manpages/virt-sanlock-cleanup.rst rename to docs/manpages/virt-sanlock-cleanup.rst.in diff --git a/docs/manpages/virt-xml-validate.rst b/docs/manpages/virt-xml-validate.rst.in similarity index 100% rename from docs/manpages/virt-xml-validate.rst rename to docs/manpages/virt-xml-validate.rst.in diff --git a/docs/manpages/virtlockd.rst b/docs/manpages/virtlockd.rst.in similarity index 100% rename from docs/manpages/virtlockd.rst rename to docs/manpages/virtlockd.rst.in diff --git a/docs/manpages/virtlogd.rst b/docs/manpages/virtlogd.rst.in similarity index 100% rename from docs/manpages/virtlogd.rst rename to docs/manpages/virtlogd.rst.in diff --git a/docs/meson.build b/docs/meson.build index 17c8f956870..a03beb86b77 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -290,6 +290,7 @@ subdir('internals') subdir('js') subdir('kbase') subdir('logos') +subdir('manpages') # This hack enables us to view the web pages -- 2.26.2

On Thu, Jul 16, 2020 at 11:59:31 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> ---
[...]
+foreach name : keyname_list + rst_file = custom_target( + 'virkeyname-@0@.rst'.format(name), + input: keymap_src_file, + output: 'virkeyname-@0@.rst'.format(name), + command: [ + meson_python_prog, python3_prog, keymap_gen_prog, 'name-docs', + '--lang', 'rst', + '--title', 'virkeyname-@0@'.format(name), + '--subtitle', 'Key name values for @0@'.format(name), + '@INPUT@', name, + ], + capture: true, + build_by_default: true, + ) + + docs_man_files += { + 'name': 'virkeyname-@0@'.format(name), 'section': '7', 'install': true, 'file': rst_file, + } +endforeach + +docs_man_conf = configuration_data() +docs_man_conf.set('SYSCONFDIR', sysconfdir) +docs_man_conf.set('RUNSTATEDIR', runstatedir) + +foreach data : docs_man_files + rst_in_file = '@0@.rst.in'.format(data['name']) + html_in_file = '@0@.html.in'.format(data['name']) + html_file = '@0@.html'.format(data['name']) + + if data.has_key('file') + rst_file = data['file'] + else + rst_file = configure_file( + input: rst_in_file, + output: '@0@.rst'.format(data['name']), + configuration: docs_man_conf, + ) + endif
I must say it feels weird process these through configure_file. Also it's super weird that they've overloaded 3 modes into configure_file. What's the difference to generator() by the way, since we use it for rst->html conversion? I'd expect that we could use configure_file there or generator here then. Also is there a possibility where the input and output file will have the same name? I'm not very fond of the .rst.in files.

On Wed, Jul 22, 2020 at 06:51:58PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:59:31 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> ---
[...]
+foreach name : keyname_list + rst_file = custom_target( + 'virkeyname-@0@.rst'.format(name), + input: keymap_src_file, + output: 'virkeyname-@0@.rst'.format(name), + command: [ + meson_python_prog, python3_prog, keymap_gen_prog, 'name-docs', + '--lang', 'rst', + '--title', 'virkeyname-@0@'.format(name), + '--subtitle', 'Key name values for @0@'.format(name), + '@INPUT@', name, + ], + capture: true, + build_by_default: true, + ) + + docs_man_files += { + 'name': 'virkeyname-@0@'.format(name), 'section': '7', 'install': true, 'file': rst_file, + } +endforeach + +docs_man_conf = configuration_data() +docs_man_conf.set('SYSCONFDIR', sysconfdir) +docs_man_conf.set('RUNSTATEDIR', runstatedir) + +foreach data : docs_man_files + rst_in_file = '@0@.rst.in'.format(data['name']) + html_in_file = '@0@.html.in'.format(data['name']) + html_file = '@0@.html'.format(data['name']) + + if data.has_key('file') + rst_file = data['file'] + else + rst_file = configure_file( + input: rst_in_file, + output: '@0@.rst'.format(data['name']), + configuration: docs_man_conf, + ) + endif
I must say it feels weird process these through configure_file. Also it's super weird that they've overloaded 3 modes into configure_file.
What's the difference to generator() by the way, since we use it for rst->html conversion? I'd expect that we could use configure_file there or generator here then.
The main difference is that configure_file() is done during meson setup but generator() is executed while building the project. Another main difference is that generator() outputs the files into target-private directory. There is a note in documentation: "NOTE: Generators should only be used for outputs that will only be used as inputs for a build target or a custom target. When you use the processed output of a generator in multiple targets, the generator will be run multiple times to create outputs for each target. Each output will be created in a target-private directory @BUILD_DIR@." The reason why I went with configure_file is that we create a dictionary of placeholders that should be replaced in the input file. The other option would be custom_target() and calling 'sed'. The reason why we can use generator() for the rst->html.in conversion is that the output is used in custom_target to create html from html.in files.
Also is there a possibility where the input and output file will have the same name? I'm not very fond of the .rst.in files.
It should be possible but I prefer using .in suffix to make it clear that this file needs to be processed. Pavel

On Wed, Jul 22, 2020 at 19:14:01 +0200, Pavel Hrdina wrote:
On Wed, Jul 22, 2020 at 06:51:58PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:59:31 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> ---
[...]
+foreach name : keyname_list + rst_file = custom_target( + 'virkeyname-@0@.rst'.format(name), + input: keymap_src_file, + output: 'virkeyname-@0@.rst'.format(name), + command: [ + meson_python_prog, python3_prog, keymap_gen_prog, 'name-docs', + '--lang', 'rst', + '--title', 'virkeyname-@0@'.format(name), + '--subtitle', 'Key name values for @0@'.format(name), + '@INPUT@', name, + ], + capture: true, + build_by_default: true, + ) + + docs_man_files += { + 'name': 'virkeyname-@0@'.format(name), 'section': '7', 'install': true, 'file': rst_file, + } +endforeach + +docs_man_conf = configuration_data() +docs_man_conf.set('SYSCONFDIR', sysconfdir) +docs_man_conf.set('RUNSTATEDIR', runstatedir) + +foreach data : docs_man_files + rst_in_file = '@0@.rst.in'.format(data['name']) + html_in_file = '@0@.html.in'.format(data['name']) + html_file = '@0@.html'.format(data['name']) + + if data.has_key('file') + rst_file = data['file'] + else + rst_file = configure_file( + input: rst_in_file, + output: '@0@.rst'.format(data['name']), + configuration: docs_man_conf, + ) + endif
I must say it feels weird process these through configure_file. Also it's super weird that they've overloaded 3 modes into configure_file.
What's the difference to generator() by the way, since we use it for rst->html conversion? I'd expect that we could use configure_file there or generator here then.
The main difference is that configure_file() is done during meson setup but generator() is executed while building the project. Another main
So how does it then handle if the file is modified prior to another build? Is 'ninja' re-running the setup phase?
difference is that generator() outputs the files into target-private directory.
There is a note in documentation:
"NOTE: Generators should only be used for outputs that will only be used as inputs for a build target or a custom target. When you use the processed output of a generator in multiple targets, the generator will be run multiple times to create outputs for each target. Each output will be created in a target-private directory @BUILD_DIR@."
The reason why I went with configure_file is that we create a dictionary of placeholders that should be replaced in the input file. The other option would be custom_target() and calling 'sed'.
The reason why we can use generator() for the rst->html.in conversion is that the output is used in custom_target to create html from html.in files.
Also is there a possibility where the input and output file will have the same name? I'm not very fond of the .rst.in files.
It should be possible but I prefer using .in suffix to make it clear that this file needs to be processed.
I think we should keep the source files named .rst. The .rst format is good for human consumption even in the pre-processed state. You can also see different behaviour e.g. when viewing them via gitlab web interface: https://gitlab.com/phrdina/libvirt/-/blob/meson/docs/kbase/domainstatecaptur... vs https://gitlab.com/phrdina/libvirt/-/blob/meson/docs/manpages/virt-admin.rst... vs current state https://gitlab.com/libvirt/libvirt/-/blob/master/docs/manpages/virt-admin.rs...

On Wed, Jul 22, 2020 at 07:22:34PM +0200, Peter Krempa wrote:
On Wed, Jul 22, 2020 at 19:14:01 +0200, Pavel Hrdina wrote:
On Wed, Jul 22, 2020 at 06:51:58PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:59:31 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> ---
[...]
+foreach name : keyname_list + rst_file = custom_target( + 'virkeyname-@0@.rst'.format(name), + input: keymap_src_file, + output: 'virkeyname-@0@.rst'.format(name), + command: [ + meson_python_prog, python3_prog, keymap_gen_prog, 'name-docs', + '--lang', 'rst', + '--title', 'virkeyname-@0@'.format(name), + '--subtitle', 'Key name values for @0@'.format(name), + '@INPUT@', name, + ], + capture: true, + build_by_default: true, + ) + + docs_man_files += { + 'name': 'virkeyname-@0@'.format(name), 'section': '7', 'install': true, 'file': rst_file, + } +endforeach + +docs_man_conf = configuration_data() +docs_man_conf.set('SYSCONFDIR', sysconfdir) +docs_man_conf.set('RUNSTATEDIR', runstatedir) + +foreach data : docs_man_files + rst_in_file = '@0@.rst.in'.format(data['name']) + html_in_file = '@0@.html.in'.format(data['name']) + html_file = '@0@.html'.format(data['name']) + + if data.has_key('file') + rst_file = data['file'] + else + rst_file = configure_file( + input: rst_in_file, + output: '@0@.rst'.format(data['name']), + configuration: docs_man_conf, + ) + endif
I must say it feels weird process these through configure_file. Also it's super weird that they've overloaded 3 modes into configure_file.
What's the difference to generator() by the way, since we use it for rst->html conversion? I'd expect that we could use configure_file there or generator here then.
The main difference is that configure_file() is done during meson setup but generator() is executed while building the project. Another main
So how does it then handle if the file is modified prior to another build? Is 'ninja' re-running the setup phase?
Correct, if the source file changes ninja will re-run meson setup phase.
difference is that generator() outputs the files into target-private directory.
There is a note in documentation:
"NOTE: Generators should only be used for outputs that will only be used as inputs for a build target or a custom target. When you use the processed output of a generator in multiple targets, the generator will be run multiple times to create outputs for each target. Each output will be created in a target-private directory @BUILD_DIR@."
The reason why I went with configure_file is that we create a dictionary of placeholders that should be replaced in the input file. The other option would be custom_target() and calling 'sed'.
The reason why we can use generator() for the rst->html.in conversion is that the output is used in custom_target to create html from html.in files.
Also is there a possibility where the input and output file will have the same name? I'm not very fond of the .rst.in files.
It should be possible but I prefer using .in suffix to make it clear that this file needs to be processed.
I think we should keep the source files named .rst. The .rst format is good for human consumption even in the pre-processed state.
You can also see different behaviour e.g. when viewing them via gitlab web interface:
https://gitlab.com/phrdina/libvirt/-/blob/meson/docs/kbase/domainstatecaptur...
vs
https://gitlab.com/phrdina/libvirt/-/blob/meson/docs/manpages/virt-admin.rst...
vs current state
https://gitlab.com/libvirt/libvirt/-/blob/master/docs/manpages/virt-admin.rs...
OK, this is a solid point which convinced me to remove the .in suffix. Pavel

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/Makefile.am | 3 --- docs/meson.build | 1 + docs/schemas/meson.build | 26 ++++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 docs/schemas/meson.build diff --git a/docs/Makefile.am b/docs/Makefile.am index 8fe0959bc2d..40b4d224d71 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -16,9 +16,6 @@ ## License along with this library. If not, see ## <http://www.gnu.org/licenses/>. -schemadir = $(pkgdatadir)/schemas -schema_DATA = $(wildcard $(srcdir)/schemas/*.rng) - check-html: $(XMLLINT) --nonet --noout html/*.html diff --git a/docs/meson.build b/docs/meson.build index a03beb86b77..6d3d002fd7c 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -291,6 +291,7 @@ subdir('js') subdir('kbase') subdir('logos') subdir('manpages') +subdir('schemas') # This hack enables us to view the web pages diff --git a/docs/schemas/meson.build b/docs/schemas/meson.build new file mode 100644 index 00000000000..7fc7ff05038 --- /dev/null +++ b/docs/schemas/meson.build @@ -0,0 +1,26 @@ +docs_schema_files = [ + 'basictypes.rng', + 'capability.rng', + 'cputypes.rng', + 'domainbackup.rng', + 'domaincaps.rng', + 'domaincheckpoint.rng', + 'domaincommon.rng', + 'domain.rng', + 'domainsnapshot.rng', + 'interface.rng', + 'networkcommon.rng', + 'networkport.rng', + 'network.rng', + 'nodedev.rng', + 'nwfilterbinding.rng', + 'nwfilter_params.rng', + 'nwfilter.rng', + 'secret.rng', + 'storagecommon.rng', + 'storagepoolcaps.rng', + 'storagepool.rng', + 'storagevol.rng', +] + +install_data(docs_schema_files, install_dir: pkgdatadir / 'schemas') -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 2 +- configure.ac | 2 +- docs/Makefile.am | 22 ---------------------- docs/html/meson.build | 28 ++++++++++++++++++++++++++-- 4 files changed, 28 insertions(+), 26 deletions(-) delete mode 100644 docs/Makefile.am diff --git a/Makefile.am b/Makefile.am index fca0c1f5c29..d538d037eb0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,7 +20,7 @@ # so force it explicitly DISTCHECK_CONFIGURE_FLAGS = --enable-werror -SUBDIRS = . docs +SUBDIRS = . XZ_OPT ?= -v -T0 export XZ_OPT diff --git a/configure.ac b/configure.ac index 91ba0c2af4e..06e7f7491e4 100644 --- a/configure.ac +++ b/configure.ac @@ -106,7 +106,7 @@ m4_if(m4_version_compare([2.61a.100], AC_CONFIG_FILES([run], [chmod +x,-w run]) AC_CONFIG_FILES([\ - Makefile docs/Makefile \ + Makefile \ .color_coded \ .ycm_extra_conf.py \ libvirt.pc \ diff --git a/docs/Makefile.am b/docs/Makefile.am deleted file mode 100644 index 40b4d224d71..00000000000 --- a/docs/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -## Process this file with automake to produce Makefile.in - -## Copyright (C) 2005-2016 Red Hat, Inc. -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library. If not, see -## <http://www.gnu.org/licenses/>. - -check-html: - $(XMLLINT) --nonet --noout html/*.html - -check-local: check-html diff --git a/docs/html/meson.build b/docs/html/meson.build index 7be5abe5fe5..c87cc9f7ea2 100644 --- a/docs/html/meson.build +++ b/docs/html/meson.build @@ -7,7 +7,10 @@ apipng = [ install_data(apipng, install_dir: docs_html_dir / 'html') -custom_target( +docs_html_gen = [] +docs_html_dep = [] + +index_api_gen = custom_target( 'index-api', input: [ newapi_xsl, @@ -43,8 +46,11 @@ custom_target( ], ) +docs_html_gen += index_api_gen.to_list() +docs_html_dep += index_api_gen + foreach name : [ 'admin', 'lxc', 'qemu' ] - custom_target( + index_api_gen = custom_target( 'index-@0@-api'.format(name), input: [ newapi_xsl, @@ -67,4 +73,22 @@ foreach name : [ 'admin', 'lxc', 'qemu' ] page_xsl, ], ) + + docs_html_gen += index_api_gen.to_list() + docs_html_dep += index_api_gen endforeach + +docs_html_paths = [] + +foreach file : docs_html_gen + docs_html_paths += file.full_path() +endforeach + +test( + 'check-html', + xmllint_prog, + args: [ + '--nonet', '--noout', docs_html_paths, + ], + depends: docs_html_dep, +) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 3 --- configure.ac | 4 ---- meson.build | 29 +++++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/Makefile.am b/Makefile.am index d538d037eb0..e6a37deb4a5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -25,9 +25,6 @@ SUBDIRS = . XZ_OPT ?= -v -T0 export XZ_OPT -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libvirt.pc libvirt-qemu.pc libvirt-lxc.pc libvirt-admin.pc - rpm: clean @(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.xz) diff --git a/configure.ac b/configure.ac index 06e7f7491e4..b0a6cad178a 100644 --- a/configure.ac +++ b/configure.ac @@ -109,9 +109,5 @@ AC_CONFIG_FILES([\ Makefile \ .color_coded \ .ycm_extra_conf.py \ - libvirt.pc \ - libvirt-qemu.pc \ - libvirt-lxc.pc \ - libvirt-admin.pc \ libvirt.spec mingw-libvirt.spec]) AC_OUTPUT diff --git a/meson.build b/meson.build index 65843ed574d..7b858797388 100644 --- a/meson.build +++ b/meson.build @@ -2214,6 +2214,35 @@ subdir('po') subdir('docs') +# install pkgconfig files +pkgconfig_files = [ + 'libvirt.pc.in', + 'libvirt-qemu.pc.in', + 'libvirt-lxc.pc.in', + 'libvirt-admin.pc.in', +] + +pkgconfig_conf = configuration_data() +pkgconfig_conf.set('VERSION', meson.project_version()) +pkgconfig_conf.set('datadir', datadir) +pkgconfig_conf.set('datarootdir', datadir) +pkgconfig_conf.set('exec_prefix', prefix) +pkgconfig_conf.set('includedir', includedir) +pkgconfig_conf.set('libdir', libdir) +pkgconfig_conf.set('prefix', prefix) + +pkgconfig_dir = libdir / 'pkgconfig' + +foreach file : pkgconfig_files + configure_file( + input: file, + output: '@BASENAME@', + configuration: pkgconfig_conf, + install: true, + install_dir: pkgconfig_dir, + ) +endforeach + # generate meson-config.h file configure_file(output: 'meson-config.h', configuration: conf) -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 19 --------------- configure.ac | 3 +-- meson.build | 45 ++++++++++++++++++++++++++++++++++++ scripts/meson-dist.sh | 6 +++++ scripts/meson-gen-authors.sh | 4 ++++ scripts/meson.build | 2 ++ 6 files changed, 58 insertions(+), 21 deletions(-) create mode 100755 scripts/meson-dist.sh create mode 100755 scripts/meson-gen-authors.sh diff --git a/Makefile.am b/Makefile.am index e6a37deb4a5..7490acbcfba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,24 +31,5 @@ rpm: clean srpm: clean @(unset CDPATH ; $(MAKE) dist && rpmbuild -ts $(distdir).tar.xz) -dist-hook: gen-AUTHORS - -.PHONY: gen-AUTHORS -gen-AUTHORS: - $(AM_V_GEN)\ - if test -d $(srcdir)/.git; then \ - ( \ - cd $(srcdir) && \ - git log --pretty=format:'%aN <%aE>' | sort -u \ - ) > all.list && \ - sort -u $(srcdir)/AUTHORS.in > maint.list && \ - comm -23 all.list maint.list > contrib.list && \ - contrib="`cat contrib.list`" && \ - perl -p -e "s/#contributorslist#// and print '$$contrib'" \ - < $(srcdir)/AUTHORS.in > $(distdir)/AUTHORS-tmp && \ - mv -f $(distdir)/AUTHORS-tmp $(distdir)/AUTHORS && \ - rm -f all.list maint.list contrib.list; \ - fi - ci-%: $(MAKE) -C $(srcdir)/ci/ $@ diff --git a/configure.ac b/configure.ac index b0a6cad178a..b70aa17cb23 100644 --- a/configure.ac +++ b/configure.ac @@ -108,6 +108,5 @@ AC_CONFIG_FILES([run], AC_CONFIG_FILES([\ Makefile \ .color_coded \ - .ycm_extra_conf.py \ - libvirt.spec mingw-libvirt.spec]) + .ycm_extra_conf.py]) AC_OUTPUT diff --git a/meson.build b/meson.build index 7b858797388..9d0a0c1665b 100644 --- a/meson.build +++ b/meson.build @@ -2243,6 +2243,51 @@ foreach file : pkgconfig_files ) endforeach + +# generate dist files + +if git + spec_files = [ + 'libvirt.spec.in', + 'mingw-libvirt.spec.in', + ] + + spec_conf = configuration_data() + spec_conf.set('VERSION', meson.project_version()) + + foreach file : spec_files + configure_file( + input: file, + output: '@BASENAME@', + configuration: spec_conf, + ) + endforeach + + authors = run_command(meson_gen_authors_prog) + authors_file = 'AUTHORS.in' + + authors_conf = configuration_data() + authors_conf.set('contributorslist', authors.stdout()) + + configure_file( + input: authors_file, + output: '@BASENAME@', + configuration: authors_conf, + ) + + # Using return values from configure_file in add_dist_script is possible since 0.55.0 + dist_files = [ + 'libvirt.spec', + 'mingw-libvirt.spec', + 'AUTHORS', + ] + + foreach file : dist_files + meson.add_dist_script(meson_dist_prog.path(), meson.build_root(), file) + endforeach +endif + + # generate meson-config.h file configure_file(output: 'meson-config.h', configuration: conf) diff --git a/scripts/meson-dist.sh b/scripts/meson-dist.sh new file mode 100755 index 00000000000..fdcc0154e02 --- /dev/null +++ b/scripts/meson-dist.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +MESON_BUILD_ROOT=$1 +FILE=$2 + +cp $MESON_BUILD_ROOT/$FILE $MESON_DIST_ROOT/$FILE diff --git a/scripts/meson-gen-authors.sh b/scripts/meson-gen-authors.sh new file mode 100755 index 00000000000..bf0a3b63886 --- /dev/null +++ b/scripts/meson-gen-authors.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +cd $MESON_SOURCE_ROOT +git log --pretty=format:'* %aN <%aE>' | sort -u diff --git a/scripts/meson.build b/scripts/meson.build index 3bcd6e85ce5..fa2ed57c99d 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -23,6 +23,8 @@ scripts = [ 'hyperv_wmi_generator.py', 'install-dirs.sh', 'install-symlink.sh', + 'meson-dist.sh', + 'meson-gen-authors.sh', 'meson-html-gen.py', 'meson-python.sh', 'meson-timestamp.sh', -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 2 -- meson.build | 11 +++++++++++ run.in | 2 +- scripts/meson-change-perms.sh | 6 ++++++ 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 scripts/meson-change-perms.sh diff --git a/configure.ac b/configure.ac index b70aa17cb23..64d4f56b509 100644 --- a/configure.ac +++ b/configure.ac @@ -103,8 +103,6 @@ m4_if(m4_version_compare([2.61a.100], [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [], [GNUmakefile=$GNUmakefile])]) -AC_CONFIG_FILES([run], - [chmod +x,-w run]) AC_CONFIG_FILES([\ Makefile \ .color_coded \ diff --git a/meson.build b/meson.build index 9d0a0c1665b..2519b48b63f 100644 --- a/meson.build +++ b/meson.build @@ -2292,6 +2292,17 @@ endif configure_file(output: 'meson-config.h', configuration: conf) +# generate run helper +run_conf = configuration_data() +run_conf.set('abs_builddir', meson.build_root()) +configure_file( + input: 'run.in', + output: 'run', + configuration: run_conf, +) +run_command('scripts/meson-change-perms.sh', 'a+x', 'run') + + # print configuration summary driver_summary = { diff --git a/run.in b/run.in index 1a0dee4d9ee..73bebbf805f 100644 --- a/run.in +++ b/run.in @@ -71,4 +71,4 @@ random_val="$(awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)" export MALLOC_PERTURB_=$random_val # Run the program. -exec $b/libtool --mode=execute "$@" +exec "$@" diff --git a/scripts/meson-change-perms.sh b/scripts/meson-change-perms.sh new file mode 100644 index 00000000000..b366d80077e --- /dev/null +++ b/scripts/meson-change-perms.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +perms=$1 +file=$2 + +chmod $perms $MESON_BUILD_ROOT/$file -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 4 +--- meson.build | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 64d4f56b509..4ba70bb43b5 100644 --- a/configure.ac +++ b/configure.ac @@ -104,7 +104,5 @@ m4_if(m4_version_compare([2.61a.100], [GNUmakefile=$GNUmakefile])]) AC_CONFIG_FILES([\ - Makefile \ - .color_coded \ - .ycm_extra_conf.py]) + Makefile]) AC_OUTPUT diff --git a/meson.build b/meson.build index 2519b48b63f..d14223829e2 100644 --- a/meson.build +++ b/meson.build @@ -2303,6 +2303,25 @@ configure_file( run_command('scripts/meson-change-perms.sh', 'a+x', 'run') +# generate developer tooling files +tooling_files = [ + '.color_coded.in', + '.ycm_extra_conf.py.in', +] + +tooling_conf = configuration_data() +tooling_conf.set('abs_top_builddir', meson.build_root()) +tooling_conf.set('abs_top_srcdir', meson.source_root()) + +foreach file : tooling_files + configure_file( + input: file, + output: '@BASENAME@', + configuration: tooling_conf, + ) +endforeach + + # print configuration summary driver_summary = { -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- build-aux/Makefile.in | 9 +++ .../Makefile.nonreentrant | 0 build-aux/meson.build | 30 +++++++++ build-aux/syntax-check.mk | 62 +++++++++---------- meson.build | 2 + 5 files changed, 72 insertions(+), 31 deletions(-) create mode 100644 build-aux/Makefile.in rename Makefile.nonreentrant => build-aux/Makefile.nonreentrant (100%) create mode 100644 build-aux/meson.build diff --git a/build-aux/Makefile.in b/build-aux/Makefile.in new file mode 100644 index 00000000000..601f1ad7a19 --- /dev/null +++ b/build-aux/Makefile.in @@ -0,0 +1,9 @@ +# define variables + +top_srcdir = @top_srcdir@ +top_builddir = @top_builddir@ +FLAKE8 = @flake8_path@ +RUNUTF8 = @runutf8@ + +# include syntax-check.mk file +include $(top_srcdir)/build-aux/syntax-check.mk diff --git a/Makefile.nonreentrant b/build-aux/Makefile.nonreentrant similarity index 100% rename from Makefile.nonreentrant rename to build-aux/Makefile.nonreentrant diff --git a/build-aux/meson.build b/build-aux/meson.build new file mode 100644 index 00000000000..de916793cad --- /dev/null +++ b/build-aux/meson.build @@ -0,0 +1,30 @@ +syntax_check_conf = configuration_data() +syntax_check_conf.set('top_srcdir', meson.source_root()) +syntax_check_conf.set('top_builddir', meson.build_root()) + +flake8_path = '' +if flake8_prog.found() + flake8_path = flake8_prog.path() +endif +syntax_check_conf.set('flake8_path', flake8_path) +syntax_check_conf.set('runutf8', ' '.join(runutf8)) + +configure_file( + input: 'Makefile.in', + output: '@BASENAME@', + configuration: syntax_check_conf, +) + +make_prog = find_program('make') + +# There is no way how to pass value to -j using run_target so let's use +# it without any value to run all tests in parallel. +run_target( + 'syntax-check', + command: [ + make_prog, '-C', meson.current_build_dir(), '-j', 'syntax-check', + ], + depends: [ + potfiles_dep, + ], +) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 3d7b644f01f..1fe2da4e637 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -21,7 +21,7 @@ # This is reported not to work with make-3.79.1 # ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -ME := $(_build-aux)/syntax-check.mk +ME := build-aux/syntax-check.mk # These variables ought to be defined through the configure.ac section # of the module description. But some packages import this file directly, @@ -42,29 +42,29 @@ _equal = $(and $(findstring $(1),$(2)),$(findstring $(2),$(1))) GIT = git VC = $(GIT) -VC_LIST = $(srcdir)/$(_build-aux)/vc-list-files -C $(srcdir) +VC_LIST = $(top_srcdir)/build-aux/vc-list-files -C $(top_srcdir) # You can override this variable in syntax-check.mk to set your own regexp # matching files to ignore. VC_LIST_ALWAYS_EXCLUDE_REGEX ?= ^$$ # This is to preprocess robustly the output of $(VC_LIST), so that even -# when $(srcdir) is a pathological name like "....", the leading sed command +# when $(top_srcdir) is a pathological name like "....", the leading sed command # removes only the intended prefix. -_dot_escaped_srcdir = $(subst .,\.,$(srcdir)) -_dot_escaped_builddir = $(subst .,\.,$(builddir)) +_dot_escaped_srcdir = $(subst .,\.,$(top_srcdir)) +_dot_escaped_builddir = $(subst .,\.,$(top_builddir)) -# Post-process $(VC_LIST) output, prepending $(srcdir)/, but only -# when $(srcdir) is not ".". -ifeq ($(srcdir),.) +# Post-process $(VC_LIST) output, prepending $(top_srcdir)/, but only +# when $(top_srcdir) is not ".". +ifeq ($(top_srcdir),.) _prepend_srcdir_prefix = else - _prepend_srcdir_prefix = | $(SED) 's|^|$(srcdir)/|' + _prepend_srcdir_prefix = | $(SED) 's|^|$(top_srcdir)/|' endif # In order to be able to consistently filter "."-relative names, -# (i.e., with no $(srcdir) prefix), this definition is careful to -# remove any $(srcdir) prefix, and to restore what it removes. +# (i.e., with no $(top_srcdir) prefix), this definition is careful to +# remove any $(top_srcdir) prefix, and to restore what it removes. _sc_excl = \ $(or $(exclude_file_name_regexp--$@),^$$) VC_LIST_EXCEPT = \ @@ -84,11 +84,11 @@ export LC_ALL = C ## Sanity checks. ## ## --------------- ## -_cfg_mk := $(wildcard $(srcdir)/$(_build-aux)/syntax-check.mk) +_cfg_mk := $(wildcard $(top_srcdir)/build-aux/syntax-check.mk) # Collect the names of rules starting with 'sc_'. syntax-check-rules := $(sort $(shell $(SED) -n \ - 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' $(srcdir)/$(ME) $(_cfg_mk))) + 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' $(top_srcdir)/$(ME) $(_cfg_mk))) .PHONY: $(syntax-check-rules) ifeq ($(shell $(VC_LIST) >/dev/null 2>&1; echo $$?),0) @@ -333,11 +333,11 @@ sc_flags_debug: # than d). The existence of long long, and of documentation about # flags, makes the regex in the third test slightly harder. sc_flags_usage: - @test "$$(cat $(srcdir)/include/libvirt/libvirt-domain.h \ - $(srcdir)/include/libvirt/virterror.h \ - $(srcdir)/include/libvirt/libvirt-qemu.h \ - $(srcdir)/include/libvirt/libvirt-lxc.h \ - $(srcdir)/include/libvirt/libvirt-admin.h \ + @test "$$(cat $(top_srcdir)/include/libvirt/libvirt-domain.h \ + $(top_srcdir)/include/libvirt/virterror.h \ + $(top_srcdir)/include/libvirt/libvirt-qemu.h \ + $(top_srcdir)/include/libvirt/libvirt-lxc.h \ + $(top_srcdir)/include/libvirt/libvirt-admin.h \ | $(GREP) -c '\(long\|unsigned\) flags')" != 4 && \ { echo '$(ME): new API should use "unsigned int flags"' 1>&2; \ exit 1; } || : @@ -496,7 +496,7 @@ sc_prohibit_PATH_MAX: halt='dynamically allocate paths, do not use PATH_MAX' \ $(_sc_search_regexp) -include $(srcdir)/Makefile.nonreentrant +include $(top_srcdir)/build-aux/Makefile.nonreentrant sc_prohibit_nonreentrant: @prohibit="\\<(${NON_REENTRANT_RE}) *\\(" \ halt="use re-entrant functions (usually ending with _r)" \ @@ -833,7 +833,7 @@ sc_prohibit_gettext_markup: # Our code is divided into modular subdirectories for a reason, and # lower-level code must not include higher-level headers. -cross_dirs=$(patsubst $(srcdir)/src/%.,%,$(wildcard $(srcdir)/src/*/.)) +cross_dirs=$(patsubst $(top_srcdir)/src/%.,%,$(wildcard $(top_srcdir)/src/*/.)) cross_dirs_re=($(subst / ,/|,$(cross_dirs))) mid_dirs=access|admin|conf|cpu|locking|logging|rpc|security sc_prohibit_cross_inclusion: @@ -1177,7 +1177,7 @@ sc_prohibit_dirent_d_type: # grep-E-style regexp selecting the files to check. For in_vc_files, # the regexp is used to select matching files from the list of all # version-controlled files; for in_files, it's from the names printed -# by "find $(srcdir)". When neither is specified, use all files that +# by "find $(top_srcdir)". When neither is specified, use all files that # are under version control. # # containing | non_containing @@ -1249,7 +1249,7 @@ define _sc_search_regexp \ : Filter by file name; \ if test -n "$$in_files"; then \ - files=$$(find $(srcdir) | $(GREP) -E "$$in_files" \ + files=$$(find $(top_srcdir) | $(GREP) -E "$$in_files" \ | $(GREP) -Ev '$(_sc_excl)'); \ else \ files=$$($(VC_LIST_EXCEPT)); \ @@ -1293,7 +1293,7 @@ sc_avoid_if_before_free: @$(VC_LIST_EXCEPT) \ | $(GREP) -v useless-if-before-free \ | xargs \ - $(srcdir)/$(_build-aux)/useless-if-before-free \ + $(top_srcdir)/build-aux/useless-if-before-free \ $(useless_free_options) \ && { printf '$(ME): found useless "if"' \ ' before "free" above\n' 1>&2; \ @@ -1781,9 +1781,6 @@ sc_const_long_option: halt='add "const" to the above declarations' \ $(_sc_search_regexp) -gen_source_files: - $(MAKE) -C src generated-sources - fix_po_file_diag = \ 'you have changed the set of files with translatable diagnostics;\n\ apply the above patch\n' @@ -1805,26 +1802,26 @@ perl_translatable_files_list_ = \ # Verify that all source files using _() (more specifically, files that # match $(_gl_translatable_string_re)) are listed in po/POTFILES.in. -po_file ?= $(srcdir)/po/POTFILES.in +po_file ?= $(top_srcdir)/po/POTFILES.in # List of additional files that we want to pick up in our POTFILES.in # This is all generated files for RPC code. generated_files = \ - $(builddir)/src/*.[ch] \ - $(builddir)/src/*/*.[ch] + $(top_builddir)/src/*.[ch] \ + $(top_builddir)/src/*/*.[ch] _gl_translatable_string_re ?= \b(N?_|gettext *)\([^)"]*("|$$) # sc_po_check can fail if generated files are not built first -sc_po_check: gen_source_files +sc_po_check: @if test -f $(po_file); then \ $(GREP) -E -v '^(#|$$)' $(po_file) \ | $(GREP) -v '^src/false\.c$$' | sort > $@-1; \ { $(VC_LIST_EXCEPT); echo $(generated_files); } \ | xargs perl $(perl_translatable_files_list_) \ | xargs $(GREP) -E -l '$(_gl_translatable_string_re)' \ - | $(SED) 's|^$(_dot_escaped_srcdir)/|@SRCDIR@|' \ | $(SED) 's|^$(_dot_escaped_builddir)/|@BUILDDIR@|' \ + | $(SED) 's|^$(_dot_escaped_srcdir)/|@SRCDIR@|' \ | sort -u > $@-2; \ diff -u -L $(po_file) -L $(po_file) $@-1 $@-2 \ || { printf '$(ME): '$(fix_po_file_diag) 1>&2; exit 1; }; \ @@ -2074,3 +2071,6 @@ exclude_file_name_regexp--sc_prohibit_backslash_alignment = \ exclude_file_name_regexp--sc_prohibit_select = \ ^build-aux/syntax-check\.mk|src/util/vireventglibwatch\.c$$ + +exclude_file_name_regexp--sc_prohibit_config_h_in_headers = \ + ^config\.h$$ diff --git a/meson.build b/meson.build index d14223829e2..587e05a02da 100644 --- a/meson.build +++ b/meson.build @@ -2213,6 +2213,8 @@ subdir('po') subdir('docs') +subdir('build-aux') + # install pkgconfig files pkgconfig_files = [ -- 2.26.2

On Thu, Jul 16, 2020 at 11:59:38 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- build-aux/Makefile.in | 9 +++ .../Makefile.nonreentrant | 0 build-aux/meson.build | 30 +++++++++ build-aux/syntax-check.mk | 62 +++++++++---------- meson.build | 2 + 5 files changed, 72 insertions(+), 31 deletions(-) create mode 100644 build-aux/Makefile.in rename Makefile.nonreentrant => build-aux/Makefile.nonreentrant (100%) create mode 100644 build-aux/meson.build
[...]
+make_prog = find_program('make') + +# There is no way how to pass value to -j using run_target so let's use +# it without any value to run all tests in parallel. +run_target( + 'syntax-check', + command: [ + make_prog, '-C', meson.current_build_dir(), '-j', 'syntax-check', + ],
While I do run syntax check with unlimited '-j'. I don't think it's entirely cool to impose that on everybody. Specifically overcommiting the system is not cool. Since meson is automagically scaling can't we use the meson-detected cpu number here?

On Tue, Jul 28, 2020 at 03:48:29PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:59:38 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- build-aux/Makefile.in | 9 +++ .../Makefile.nonreentrant | 0 build-aux/meson.build | 30 +++++++++ build-aux/syntax-check.mk | 62 +++++++++---------- meson.build | 2 + 5 files changed, 72 insertions(+), 31 deletions(-) create mode 100644 build-aux/Makefile.in rename Makefile.nonreentrant => build-aux/Makefile.nonreentrant (100%) create mode 100644 build-aux/meson.build
[...]
+make_prog = find_program('make') + +# There is no way how to pass value to -j using run_target so let's use +# it without any value to run all tests in parallel. +run_target( + 'syntax-check', + command: [ + make_prog, '-C', meson.current_build_dir(), '-j', 'syntax-check', + ],
While I do run syntax check with unlimited '-j'. I don't think it's entirely cool to impose that on everybody. Specifically overcommiting the system is not cool. Since meson is automagically scaling can't we use the meson-detected cpu number here?
Unfortunately no, that was the first thing I was trying to figure out by going through meson code as well. It's not ideal I know. Other options are to not use -j at all which is no-go or we can add some code to detect the available number of CPUs. But again it would not reflect the fact if user runs 'ninja -j N'. Pavel

On Tue, Jul 28, 2020 at 04:04:39PM +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 03:48:29PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:59:38 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- build-aux/Makefile.in | 9 +++ .../Makefile.nonreentrant | 0 build-aux/meson.build | 30 +++++++++ build-aux/syntax-check.mk | 62 +++++++++---------- meson.build | 2 + 5 files changed, 72 insertions(+), 31 deletions(-) create mode 100644 build-aux/Makefile.in rename Makefile.nonreentrant => build-aux/Makefile.nonreentrant (100%) create mode 100644 build-aux/meson.build
[...]
+make_prog = find_program('make') + +# There is no way how to pass value to -j using run_target so let's use +# it without any value to run all tests in parallel. +run_target( + 'syntax-check', + command: [ + make_prog, '-C', meson.current_build_dir(), '-j', 'syntax-check', + ],
While I do run syntax check with unlimited '-j'. I don't think it's entirely cool to impose that on everybody. Specifically overcommiting the system is not cool. Since meson is automagically scaling can't we use the meson-detected cpu number here?
Unfortunately no, that was the first thing I was trying to figure out by going through meson code as well. It's not ideal I know.
Other options are to not use -j at all which is no-go or we can add some code to detect the available number of CPUs. But again it would not reflect the fact if user runs 'ninja -j N'.
In libosinfo we put "syntax-check" as part of the unit tests, rather than as a separate meson target. With that you don't need to pass -j to syntax-check, because other unit tests are running in parallel already, and chances are syntax-check will finish first even when serialized. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Tue, Jul 28, 2020 at 15:08:11 +0100, Daniel Berrange wrote:
On Tue, Jul 28, 2020 at 04:04:39PM +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 03:48:29PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:59:38 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- build-aux/Makefile.in | 9 +++ .../Makefile.nonreentrant | 0 build-aux/meson.build | 30 +++++++++ build-aux/syntax-check.mk | 62 +++++++++---------- meson.build | 2 + 5 files changed, 72 insertions(+), 31 deletions(-) create mode 100644 build-aux/Makefile.in rename Makefile.nonreentrant => build-aux/Makefile.nonreentrant (100%) create mode 100644 build-aux/meson.build
[...]
+make_prog = find_program('make') + +# There is no way how to pass value to -j using run_target so let's use +# it without any value to run all tests in parallel. +run_target( + 'syntax-check', + command: [ + make_prog, '-C', meson.current_build_dir(), '-j', 'syntax-check', + ],
While I do run syntax check with unlimited '-j'. I don't think it's entirely cool to impose that on everybody. Specifically overcommiting the system is not cool. Since meson is automagically scaling can't we use the meson-detected cpu number here?
Unfortunately no, that was the first thing I was trying to figure out by going through meson code as well. It's not ideal I know.
Other options are to not use -j at all which is no-go or we can add some code to detect the available number of CPUs. But again it would not reflect the fact if user runs 'ninja -j N'.
In libosinfo we put "syntax-check" as part of the unit tests, rather than as a separate meson target. With that you don't need to pass -j to syntax-check, because other unit tests are running in parallel already, and chances are syntax-check will finish first even when serialized.
Unfortunately it's not even close. Serialized syntax-check: real 0m22.139s user 0m24.209s sys 0m6.788s test suite: real 0m4.833s user 0m12.408s sys 0m3.918s syntax-check with -j == ncpus: (24 thread box) real 0m2.099s user 0m28.558s sys 0m7.739s As said, I'm a big fan of -jncpus or -j. so I really want to keep it especially given the data above, but on the other hand I don't want to set the CI boxes on fire.

On Tue, Jul 28, 2020 at 04:19:56PM +0200, Peter Krempa wrote:
On Tue, Jul 28, 2020 at 15:08:11 +0100, Daniel Berrange wrote:
On Tue, Jul 28, 2020 at 04:04:39PM +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 03:48:29PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:59:38 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- build-aux/Makefile.in | 9 +++ .../Makefile.nonreentrant | 0 build-aux/meson.build | 30 +++++++++ build-aux/syntax-check.mk | 62 +++++++++---------- meson.build | 2 + 5 files changed, 72 insertions(+), 31 deletions(-) create mode 100644 build-aux/Makefile.in rename Makefile.nonreentrant => build-aux/Makefile.nonreentrant (100%) create mode 100644 build-aux/meson.build
[...]
+make_prog = find_program('make') + +# There is no way how to pass value to -j using run_target so let's use +# it without any value to run all tests in parallel. +run_target( + 'syntax-check', + command: [ + make_prog, '-C', meson.current_build_dir(), '-j', 'syntax-check', + ],
While I do run syntax check with unlimited '-j'. I don't think it's entirely cool to impose that on everybody. Specifically overcommiting the system is not cool. Since meson is automagically scaling can't we use the meson-detected cpu number here?
Unfortunately no, that was the first thing I was trying to figure out by going through meson code as well. It's not ideal I know.
Other options are to not use -j at all which is no-go or we can add some code to detect the available number of CPUs. But again it would not reflect the fact if user runs 'ninja -j N'.
In libosinfo we put "syntax-check" as part of the unit tests, rather than as a separate meson target. With that you don't need to pass -j to syntax-check, because other unit tests are running in parallel already, and chances are syntax-check will finish first even when serialized.
Unfortunately it's not even close.
Serialized syntax-check: real 0m22.139s user 0m24.209s sys 0m6.788s
test suite: real 0m4.833s user 0m12.408s sys 0m3.918s
syntax-check with -j == ncpus: (24 thread box)
real 0m2.099s user 0m28.558s sys 0m7.739s
As said, I'm a big fan of -jncpus or -j. so I really want to keep it especially given the data above, but on the other hand I don't want to set the CI boxes on fire.
So I was trying to figure out what to do with our syntax-check and this could be one solution: rc = run_command( 'sed', '-n', 's/^\\(sc_[a-zA-Z0-9_-]*\\):.*/\\1/p', meson.current_source_dir() / 'syntax-check.mk', check: true, ) sc_tests = rc.stdout().strip().split() This is how syntax-check.mk gets the list of targets to run for syntax-check target. We can use the same list to define tests like this: foreach target : sc_tests rc = run_command( python3_prog, '-c', 'print("@0@".replace("sc_", ""))'.format(target), check: true, env: runutf8, ) name = rc.stdout().strip() test( name, make_prog, args: [ '-C', meson.current_build_dir(), target ], depends: [ potfiles_dep, ], suite: 'syntax-check', ) endforeach It could be simplified if we don't care that all the syntax-check tests would have 'sc_' prefix. To use it with meson/ninja would be possible with the following commands: ninja test - will run all tests regardless of the test suite, it is not possible to specify test suite meson test - same as ninja test meson test --no-suite syntax-check - this would be equivalent to make check meson test --suite syntax-check - this would be equivalent to make syntax-check In addition we can add `suite: 'check'` to the remaining test() calls to make `meson test --suite check` available as well. With this change running `meson test --suite syntax-check` takes on my machine 3.037s compared to `ninja syntax-check` which takes 2.256s. Pavel

On Wed, Jul 29, 2020 at 09:11:11AM +0200, Pavel Hrdina wrote:
So I was trying to figure out what to do with our syntax-check and this could be one solution:
rc = run_command( 'sed', '-n', 's/^\\(sc_[a-zA-Z0-9_-]*\\):.*/\\1/p', meson.current_source_dir() / 'syntax-check.mk', check: true, )
sc_tests = rc.stdout().strip().split()
This is how syntax-check.mk gets the list of targets to run for syntax-check target. We can use the same list to define tests like this:
foreach target : sc_tests rc = run_command( python3_prog, '-c', 'print("@0@".replace("sc_", ""))'.format(target), check: true, env: runutf8, ) name = rc.stdout().strip()
test( name, make_prog, args: [ '-C', meson.current_build_dir(), target ], depends: [ potfiles_dep, ], suite: 'syntax-check', ) endforeach
I like this idea as it eliminates a little bit more of the "make" usage. BTW, can we just run them more directly instead of via "python_prog" ? The tests don't use python, so avoiding creating a python intepretor for each syntax check rule probably wins for performance a litle Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Wed, Jul 29, 2020 at 10:29:46AM +0100, Daniel P. Berrangé wrote:
On Wed, Jul 29, 2020 at 09:11:11AM +0200, Pavel Hrdina wrote:
So I was trying to figure out what to do with our syntax-check and this could be one solution:
rc = run_command( 'sed', '-n', 's/^\\(sc_[a-zA-Z0-9_-]*\\):.*/\\1/p', meson.current_source_dir() / 'syntax-check.mk', check: true, )
sc_tests = rc.stdout().strip().split()
This is how syntax-check.mk gets the list of targets to run for syntax-check target. We can use the same list to define tests like this:
foreach target : sc_tests rc = run_command( python3_prog, '-c', 'print("@0@".replace("sc_", ""))'.format(target), check: true, env: runutf8, ) name = rc.stdout().strip()
test( name, make_prog, args: [ '-C', meson.current_build_dir(), target ], depends: [ potfiles_dep, ], suite: 'syntax-check', ) endforeach
I like this idea as it eliminates a little bit more of the "make" usage. BTW, can we just run them more directly instead of via "python_prog" ? The tests don't use python, so avoiding creating a python intepretor for each syntax check rule probably wins for performance a litle
The run_command() using python3_prog is executed during `meson setup` phase and the only purpose of that is to rename `sc_test_name` to `test_name`. It will not affect the performance of running meson test as that one will execute only `make_prog -C builddir sc_test_name`. I'm OK with dropping the run_command() part completely, which would make the output of `meson test` look like this: 147/154 libvirt:syntax-check / sc_prohibit_test_double_equal OK instead of 147/154 libvirt:syntax-check / prohibit_test_double_equal OK I just realized a huge drawback of this approach. In order to run `meson test` or `ninja test` it will first compile everything. It can be disabled by running `meson test --no-rebuild` which will ignore explicit dependencies as well. To workaround it for our CI codestyle job we would have to run these commands: meson build ninja -C build libvirt-pot-dep meson test -C build --suite syntax-check --no-rebuild The libvirt-pot-dep is an alias target which ensures that all generated sources are created in order to build libvirt.pot or for our syntax-check script. Pavel

On Wed, Jul 29, 2020 at 11:47:31 +0200, Pavel Hrdina wrote:
On Wed, Jul 29, 2020 at 10:29:46AM +0100, Daniel P. Berrangé wrote:
On Wed, Jul 29, 2020 at 09:11:11AM +0200, Pavel Hrdina wrote:
So I was trying to figure out what to do with our syntax-check and this could be one solution:
rc = run_command( 'sed', '-n', 's/^\\(sc_[a-zA-Z0-9_-]*\\):.*/\\1/p', meson.current_source_dir() / 'syntax-check.mk', check: true, )
sc_tests = rc.stdout().strip().split()
This is how syntax-check.mk gets the list of targets to run for syntax-check target. We can use the same list to define tests like this:
foreach target : sc_tests rc = run_command( python3_prog, '-c', 'print("@0@".replace("sc_", ""))'.format(target), check: true, env: runutf8, ) name = rc.stdout().strip()
test( name, make_prog, args: [ '-C', meson.current_build_dir(), target ], depends: [ potfiles_dep, ], suite: 'syntax-check', ) endforeach
I like this idea as it eliminates a little bit more of the "make" usage. BTW, can we just run them more directly instead of via "python_prog" ? The tests don't use python, so avoiding creating a python intepretor for each syntax check rule probably wins for performance a litle
The run_command() using python3_prog is executed during `meson setup` phase and the only purpose of that is to rename `sc_test_name` to `test_name`. It will not affect the performance of running meson test as that one will execute only `make_prog -C builddir sc_test_name`.
I'm OK with dropping the run_command() part completely, which would make the output of `meson test` look like this:
147/154 libvirt:syntax-check / sc_prohibit_test_double_equal OK
I think this is okay. It even helps you finding the checking rule.
instead of
147/154 libvirt:syntax-check / prohibit_test_double_equal OK
I just realized a huge drawback of this approach. In order to run `meson test` or `ninja test` it will first compile everything. It can be disabled by running `meson test --no-rebuild` which will ignore explicit dependencies as well.
To workaround it for our CI codestyle job we would have to run these commands:
meson build ninja -C build libvirt-pot-dep meson test -C build --suite syntax-check --no-rebuild
IMO we can live with this. CI can be fixed. Downstreams which specifically care about backporting non-conformat patches will probably disable the syntax-check suite anyways. For developers, you usually compile stuff anyways before running tests.

On Wed, Jul 29, 2020 at 12:00:46PM +0200, Peter Krempa wrote:
On Wed, Jul 29, 2020 at 11:47:31 +0200, Pavel Hrdina wrote:
On Wed, Jul 29, 2020 at 10:29:46AM +0100, Daniel P. Berrangé wrote:
On Wed, Jul 29, 2020 at 09:11:11AM +0200, Pavel Hrdina wrote:
So I was trying to figure out what to do with our syntax-check and this could be one solution:
rc = run_command( 'sed', '-n', 's/^\\(sc_[a-zA-Z0-9_-]*\\):.*/\\1/p', meson.current_source_dir() / 'syntax-check.mk', check: true, )
sc_tests = rc.stdout().strip().split()
This is how syntax-check.mk gets the list of targets to run for syntax-check target. We can use the same list to define tests like this:
foreach target : sc_tests rc = run_command( python3_prog, '-c', 'print("@0@".replace("sc_", ""))'.format(target), check: true, env: runutf8, ) name = rc.stdout().strip()
test( name, make_prog, args: [ '-C', meson.current_build_dir(), target ], depends: [ potfiles_dep, ], suite: 'syntax-check', ) endforeach
I like this idea as it eliminates a little bit more of the "make" usage. BTW, can we just run them more directly instead of via "python_prog" ? The tests don't use python, so avoiding creating a python intepretor for each syntax check rule probably wins for performance a litle
The run_command() using python3_prog is executed during `meson setup` phase and the only purpose of that is to rename `sc_test_name` to `test_name`. It will not affect the performance of running meson test as that one will execute only `make_prog -C builddir sc_test_name`.
I'm OK with dropping the run_command() part completely, which would make the output of `meson test` look like this:
147/154 libvirt:syntax-check / sc_prohibit_test_double_equal OK
I think this is okay. It even helps you finding the checking rule.
instead of
147/154 libvirt:syntax-check / prohibit_test_double_equal OK
I just realized a huge drawback of this approach. In order to run `meson test` or `ninja test` it will first compile everything. It can be disabled by running `meson test --no-rebuild` which will ignore explicit dependencies as well.
To workaround it for our CI codestyle job we would have to run these commands:
meson build ninja -C build libvirt-pot-dep meson test -C build --suite syntax-check --no-rebuild
IMO we can live with this. CI can be fixed. Downstreams which specifically care about backporting non-conformat patches will probably disable the syntax-check suite anyways. For developers, you usually compile stuff anyways before running tests.
Perfect, I'm OK with all of the above so I'll go with it. Thanks Pavel

On Tue, Jul 28, 2020 at 03:08:11PM +0100, Daniel P. Berrangé wrote:
On Tue, Jul 28, 2020 at 04:04:39PM +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 03:48:29PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:59:38 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- build-aux/Makefile.in | 9 +++ .../Makefile.nonreentrant | 0 build-aux/meson.build | 30 +++++++++ build-aux/syntax-check.mk | 62 +++++++++---------- meson.build | 2 + 5 files changed, 72 insertions(+), 31 deletions(-) create mode 100644 build-aux/Makefile.in rename Makefile.nonreentrant => build-aux/Makefile.nonreentrant (100%) create mode 100644 build-aux/meson.build
[...]
+make_prog = find_program('make') + +# There is no way how to pass value to -j using run_target so let's use +# it without any value to run all tests in parallel. +run_target( + 'syntax-check', + command: [ + make_prog, '-C', meson.current_build_dir(), '-j', 'syntax-check', + ],
While I do run syntax check with unlimited '-j'. I don't think it's entirely cool to impose that on everybody. Specifically overcommiting the system is not cool. Since meson is automagically scaling can't we use the meson-detected cpu number here?
Unfortunately no, that was the first thing I was trying to figure out by going through meson code as well. It's not ideal I know.
Other options are to not use -j at all which is no-go or we can add some code to detect the available number of CPUs. But again it would not reflect the fact if user runs 'ninja -j N'.
In libosinfo we put "syntax-check" as part of the unit tests, rather than as a separate meson target. With that you don't need to pass -j to syntax-check, because other unit tests are running in parallel already, and chances are syntax-check will finish first even when serialized.
That was my idea as well, but I know that we don't want to run syntax-check in downstream packaging as it usually fails because of outdated tools or GCC or other bit's involved in syntax check. On the other hand we would have syntax-check part of the meson dist command which is equivalent to make distcheck. Not sure if desired. To solve the issue with downstream packaging meson supports labels by using 'suite' argument when calling test() function. We can use suite: 'syntax-check' for this purpose and in spec file we can have this line: VIR_TEST_DEBUG=1 %meson_test --no-suite syntax-check With all that in mind, running 'meson test' or 'ninja test' will show that our syntax-check running using single thread takes really long. On my box all the whole test suite without syntax-check takes 5.793s so let's say 6s but the syntax-check part takes 24.716s. I don't think we want to do that. Pavel

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- libvirt.spec.in | 203 +++++++++++++++++++++--------------------------- meson.build | 1 - 2 files changed, 89 insertions(+), 115 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 522e36b6a51..94c8715faa1 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -12,11 +12,6 @@ %define supported_platform 0 %endif -# Default to skipping autoreconf. Distros can change just this one line -# (or provide a command-line override) if they backport any patches that -# touch configure.ac or Makefile.am. -%{!?enable_autotools:%global enable_autotools 0} - # The hypervisor drivers that run in libvirtd %define with_qemu 0%{!?_without_qemu:1} %define with_lxc 0%{!?_without_lxc:1} @@ -203,9 +198,9 @@ # compiler warning into errors without being worried about frequent # changes in reported warnings %if 0%{?rhel} - %define enable_werror --enable-werror + %define enable_werror -Dwerror=true %else - %define enable_werror --disable-werror + %define enable_werror -Dwerror=false %endif %if 0%{?rhel} == 7 @@ -257,12 +252,7 @@ Requires: libvirt-libs = %{version}-%{release} # All build-time requirements. Run-time requirements are # listed against each sub-RPM -%if 0%{?enable_autotools} -BuildRequires: autoconf -BuildRequires: automake BuildRequires: gettext-devel -BuildRequires: libtool -%endif %if 0%{?rhel} == 7 BuildRequires: python36-docutils %else @@ -1006,219 +996,209 @@ exit 1 %endif %if %{with_qemu} - %define arg_qemu --with-qemu + %define arg_qemu -Ddriver_qemu=enabled %else - %define arg_qemu --without-qemu + %define arg_qemu -Ddriver_qemu=disabled %endif %if %{with_openvz} - %define arg_openvz --with-openvz + %define arg_openvz -Ddriver_openvz=enabled %else - %define arg_openvz --without-openvz + %define arg_openvz -Ddriver_openvz=disabled %endif %if %{with_lxc} - %define arg_lxc --with-lxc - %define arg_login_shell --with-login-shell + %define arg_lxc -Ddriver_lxc=enabled + %define arg_login_shell -Dlogin_shell=enabled %else - %define arg_lxc --without-lxc - %define arg_login_shell --without-login-shell + %define arg_lxc -Ddriver_lxc=disabled + %define arg_login_shell -Dlogin_shell=disabled %endif %if %{with_vbox} - %define arg_vbox --with-vbox + %define arg_vbox -Ddriver_vbox=enabled %else - %define arg_vbox --without-vbox + %define arg_vbox -Ddriver_vbox=disabled %endif %if %{with_libxl} - %define arg_libxl --with-libxl + %define arg_libxl -Ddriver_libxl=enabled %else - %define arg_libxl --without-libxl + %define arg_libxl -Ddriver_libxl=disabled %endif %if %{with_esx} - %define arg_esx --with-esx + %define arg_esx -Ddriver_esx=enabled %else - %define arg_esx --without-esx + %define arg_esx -Ddriver_esx=disabled %endif %if %{with_hyperv} - %define arg_hyperv --with-hyperv + %define arg_hyperv -Ddriver_hyperv=enabled %else - %define arg_hyperv --without-hyperv + %define arg_hyperv -Ddriver_hyperv=disabled %endif %if %{with_vmware} - %define arg_vmware --with-vmware + %define arg_vmware -Ddriver_vmware=enabled %else - %define arg_vmware --without-vmware + %define arg_vmware -Ddriver_vmware=disabled %endif %if %{with_storage_rbd} - %define arg_storage_rbd --with-storage-rbd + %define arg_storage_rbd -Dstorage_rbd=enabled %else - %define arg_storage_rbd --without-storage-rbd + %define arg_storage_rbd -Dstorage_rbd=disabled %endif %if %{with_storage_sheepdog} - %define arg_storage_sheepdog --with-storage-sheepdog + %define arg_storage_sheepdog -Dstorage_sheepdog=enabled %else - %define arg_storage_sheepdog --without-storage-sheepdog + %define arg_storage_sheepdog -Dstorage_sheepdog=disabled %endif %if %{with_storage_gluster} - %define arg_storage_gluster --with-storage-gluster + %define arg_storage_gluster -Dstorage_gluster=enabled %else - %define arg_storage_gluster --without-storage-gluster + %define arg_storage_gluster -Dstorage_gluster=disabled %endif %if %{with_storage_zfs} - %define arg_storage_zfs --with-storage-zfs + %define arg_storage_zfs -Dstorage_zfs=enabled %else - %define arg_storage_zfs --without-storage-zfs + %define arg_storage_zfs -Dstorage_zfs=disabled %endif %if %{with_numactl} - %define arg_numactl --with-numactl + %define arg_numactl -Dnumactl=enabled %else - %define arg_numactl --without-numactl + %define arg_numactl -Dnumactl=disabled %endif %if %{with_numad} - %define arg_numad --with-numad + %define arg_numad -Dnumad=enabled %else - %define arg_numad --without-numad + %define arg_numad -Dnumad=disabled %endif %if %{with_fuse} - %define arg_fuse --with-fuse + %define arg_fuse -Dfuse=enabled %else - %define arg_fuse --without-fuse + %define arg_fuse -Dfuse=disabled %endif %if %{with_sanlock} - %define arg_sanlock --with-sanlock + %define arg_sanlock -Dsanlock=enabled %else - %define arg_sanlock --without-sanlock + %define arg_sanlock -Dsanlock=disabled %endif %if %{with_firewalld} - %define arg_firewalld --with-firewalld + %define arg_firewalld -Dfirewalld=enabled %else - %define arg_firewalld --without-firewalld + %define arg_firewalld -Dfirewalld=disabled %endif %if %{with_firewalld_zone} - %define arg_firewalld_zone --with-firewalld-zone + %define arg_firewalld_zone -Dfirewalld_zone=enabled %else - %define arg_firewalld_zone --without-firewalld-zone + %define arg_firewalld_zone -Dfirewalld_zone=disabled %endif %if %{with_wireshark} - %define arg_wireshark --with-wireshark-dissector + %define arg_wireshark -Dwireshark_dissector=enabled %else - %define arg_wireshark --without-wireshark-dissector + %define arg_wireshark -Dwireshark_dissector=disabled %endif %if %{with_storage_iscsi_direct} - %define arg_storage_iscsi_direct --with-storage-iscsi-direct + %define arg_storage_iscsi_direct -Dstorage_iscsi_direct=enabled %else - %define arg_storage_iscsi_direct --without-storage-iscsi-direct + %define arg_storage_iscsi_direct -Dstorage_iscsi_direct=disabled %endif %define when %(date +"%%F-%%T") %define where %(hostname) %define who %{?packager}%{!?packager:Unknown} -%define arg_packager --with-packager="%{who}, %{when}, %{where}" -%define arg_packager_version --with-packager-version="%{release}" +%define arg_packager -Dpackager="%{who}, %{when}, %{where}" +%define arg_packager_version -Dpackager_version="%{release}" -%define arg_selinux_mount --with-selinux-mount="/sys/fs/selinux" +%define arg_selinux_mount -Dselinux_mount="/sys/fs/selinux" # place macros above and build commands below this comment export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec) -%if 0%{?enable_autotools} - autoreconf -if -%endif - -rm -f po/stamp-po - -%define _configure ../configure -mkdir %{_vpath_builddir} -cd %{_vpath_builddir} - -%configure --enable-dependency-tracking \ - --with-runstatedir=%{_rundir} \ +%meson \ + -Drunstatedir=%{_rundir} \ %{?arg_qemu} \ %{?arg_openvz} \ %{?arg_lxc} \ %{?arg_vbox} \ %{?arg_libxl} \ - --with-sasl \ - --with-polkit \ - --with-libvirtd \ + -Dsasl=enabled \ + -Dpolkit=enabled \ + -Ddriver_libvirtd=enabled \ %{?arg_esx} \ %{?arg_hyperv} \ %{?arg_vmware} \ - --without-vz \ - --without-bhyve \ - --with-remote-default-mode=legacy \ - --with-interface \ - --with-network \ - --with-storage-fs \ - --with-storage-lvm \ - --with-storage-iscsi \ + -Ddriver_vz=disabled \ + -Ddriver_bhyve=disabled \ + -Dremote_default_mode=legacy \ + -Ddriver_interface=enabled \ + -Ddriver_network=enabled \ + -Dstorage_fs=enabled \ + -Dstorage_lvm=enabled \ + -Dstorage_iscsi=enabled \ %{?arg_storage_iscsi_direct} \ - --with-storage-scsi \ - --with-storage-disk \ - --with-storage-mpath \ + -Dstorage_scsi=enabled \ + -Dstorage_disk=enabled \ + -Dstorage_mpath=enabled \ %{?arg_storage_rbd} \ %{?arg_storage_sheepdog} \ %{?arg_storage_gluster} \ %{?arg_storage_zfs} \ - --without-storage-vstorage \ + -Dstorage_vstorage=disabled \ %{?arg_numactl} \ %{?arg_numad} \ - --with-capng \ + -Dcapng=enabled \ %{?arg_fuse} \ - --with-netcf \ - --with-selinux \ + -Dnetcf=enabled \ + -Dselinux=enabled \ %{?arg_selinux_mount} \ - --without-apparmor \ - --without-hal \ - --with-udev \ - --with-yajl \ + -Dapparmor=disabled \ + -Dsecdriver_apparmor=disabled \ + -Dhal=disabled \ + -Dudev=enabled \ + -Dyajl=enabled \ %{?arg_sanlock} \ - --with-libpcap \ - --with-macvtap \ - --with-audit \ - --with-dtrace \ - --with-driver-modules \ + -Dlibpcap=enabled \ + -Dmacvtap=enabled \ + -Daudit=enabled \ + -Ddtrace=enabled \ %{?arg_firewalld} \ %{?arg_firewalld_zone} \ %{?arg_wireshark} \ - --without-pm-utils \ - --with-nss-plugin \ + -Dpm_utils=disabled \ + -Dnss=enabled \ %{arg_packager} \ %{arg_packager_version} \ - --with-qemu-user=%{qemu_user} \ - --with-qemu-group=%{qemu_group} \ - --with-tls-priority=%{tls_priority} \ + -Dqemu_user=%{qemu_user} \ + -Dqemu_group=%{qemu_group} \ + -Dtls_priority=%{tls_priority} \ %{?enable_werror} \ - --enable-expensive-tests \ - --with-init-script=systemd \ + -Dexpensive_tests=enabled \ + -Dinit_script=systemd \ %{?arg_login_shell} -make %{?_smp_mflags} V=1 + +%meson_build %install rm -fr %{buildroot} export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec) -cd %{_vpath_builddir} -%make_install %{?_smp_mflags} SYSTEMD_UNIT_DIR=%{_unitdir} V=1 +%meson_install rm -f $RPM_BUILD_ROOT%{_libdir}/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/*.a @@ -1299,12 +1279,7 @@ mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes.stp \ %endif %check -cd %{_vpath_builddir} -if ! make %{?_smp_mflags} check VIR_TEST_DEBUG=1 -then - cat tests/test-suite.log || true - exit 1 -fi +VIR_TEST_DEBUG=1 %meson_test %post libs %if 0%{?rhel} == 7 @@ -1511,7 +1486,7 @@ exit 0 %files docs %doc AUTHORS ChangeLog NEWS.rst README README.rst -%doc %{_vpath_builddir}/libvirt-docs/* +%doc libvirt-docs/* %files daemon @@ -1884,7 +1859,7 @@ exit 0 %config(noreplace) %{_sysconfdir}/sysconfig/libvirt-guests %attr(0755, root, root) %{_libexecdir}/libvirt-guests.sh -%files libs -f %{_vpath_builddir}/%{name}.lang +%files libs -f %{name}.lang %license COPYING COPYING.LESSER %config(noreplace) %{_sysconfdir}/libvirt/libvirt.conf %config(noreplace) %{_sysconfdir}/libvirt/libvirt-admin.conf diff --git a/meson.build b/meson.build index 587e05a02da..69aead8a442 100644 --- a/meson.build +++ b/meson.build @@ -2280,7 +2280,6 @@ if git # Using return values from configure_file in add_dist_script is possible since 0.55.0 dist_files = [ 'libvirt.spec', - 'mingw-libvirt.spec', 'AUTHORS', ] -- 2.26.2

On Thu, Jul 16, 2020 at 11:59:39 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- libvirt.spec.in | 203 +++++++++++++++++++++--------------------------- meson.build | 1 - 2 files changed, 89 insertions(+), 115 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in index 522e36b6a51..94c8715faa1 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in
[...]
@@ -257,12 +252,7 @@ Requires: libvirt-libs = %{version}-%{release}
# All build-time requirements. Run-time requirements are # listed against each sub-RPM -%if 0%{?enable_autotools} -BuildRequires: autoconf -BuildRequires: automake BuildRequires: gettext-devel -BuildRequires: libtool -%endif
Shouldn't actually 'meson' and 'ninja' be added to BuildRequires?

On Tue, Jul 28, 2020 at 03:51:43PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:59:39 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- libvirt.spec.in | 203 +++++++++++++++++++++--------------------------- meson.build | 1 - 2 files changed, 89 insertions(+), 115 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in index 522e36b6a51..94c8715faa1 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in
[...]
@@ -257,12 +252,7 @@ Requires: libvirt-libs = %{version}-%{release}
# All build-time requirements. Run-time requirements are # listed against each sub-RPM -%if 0%{?enable_autotools} -BuildRequires: autoconf -BuildRequires: automake BuildRequires: gettext-devel -BuildRequires: libtool -%endif
Shouldn't actually 'meson' and 'ninja' be added to BuildRequires?
Right, I wanted to wait on how we solve the downstream issue with missing correct meson version. But I guess it will be up to downstream to modify the spec file so I'll add it. Pavel

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/fonts/meson.build | 6 ++++-- docs/html/meson.build | 7 +++++++ docs/internals/meson.build | 5 ++++- docs/js/meson.build | 6 ++++-- docs/kbase/meson.build | 5 ++++- docs/logos/meson.build | 6 ++++-- docs/manpages/meson.build | 5 ++++- docs/meson.build | 26 ++++++++++++++++++++++---- scripts/meson-install-web.py | 10 ++++++++++ scripts/meson.build | 1 + 10 files changed, 64 insertions(+), 13 deletions(-) create mode 100755 scripts/meson-install-web.py diff --git a/docs/fonts/meson.build b/docs/fonts/meson.build index 8c0a2f1554d..e4109c6e7dc 100644 --- a/docs/fonts/meson.build +++ b/docs/fonts/meson.build @@ -15,8 +15,10 @@ fonts = [ install_data(fonts, install_dir: docs_html_dir / 'fonts') -# This hack enables us to view the web pages -# from within the uninstalled build tree foreach file : fonts + # This hack enables us to view the web pages + # from within the uninstalled build tree configure_file(input: file, output: file, copy: true) + + install_web_files += '@0@:@1@'.format(meson.current_source_dir() / file, docs_html_dir / 'fonts') endforeach diff --git a/docs/html/meson.build b/docs/html/meson.build index c87cc9f7ea2..e194b5942c2 100644 --- a/docs/html/meson.build +++ b/docs/html/meson.build @@ -7,6 +7,10 @@ apipng = [ install_data(apipng, install_dir: docs_html_dir / 'html') +foreach file : apipng + install_web_files += '@0@:@1@'.format(meson.current_source_dir() / file, docs_html_dir / 'html') +endforeach + docs_html_gen = [] docs_html_dep = [] @@ -80,8 +84,11 @@ endforeach docs_html_paths = [] +install_web_deps += docs_html_dep + foreach file : docs_html_gen docs_html_paths += file.full_path() + install_web_files += '@0@:@1@'.format(file.full_path(), docs_html_dir / 'html') endforeach test( diff --git a/docs/internals/meson.build b/docs/internals/meson.build index 944903ae27f..e600c84af60 100644 --- a/docs/internals/meson.build +++ b/docs/internals/meson.build @@ -9,7 +9,7 @@ foreach name : internals_in_files html_in_file = '@0@.html.in'.format(name) html_file = '@0@.html'.format(name) - custom_target( + out_file = custom_target( html_file, input: html_in_file, output: html_file, @@ -29,4 +29,7 @@ foreach name : internals_in_files install: true, install_dir: docs_html_dir / 'internals', ) + + install_web_deps += out_file + install_web_files += '@0@:@1@'.format(out_file.full_path(), docs_html_dir / 'internals') endforeach diff --git a/docs/js/meson.build b/docs/js/meson.build index da90cbf96e1..cbf2dc2633c 100644 --- a/docs/js/meson.build +++ b/docs/js/meson.build @@ -4,8 +4,10 @@ docs_js_files = [ install_data(docs_js_files, install_dir: docs_html_dir / 'js') -# This hack enables us to view the web pages -# from within the uninstalled build tree foreach file : docs_js_files + # This hack enables us to view the web pages + # from within the uninstalled build tree configure_file(input: file, output: file, copy: true) + + install_web_files += '@0@:@1@'.format(meson.current_source_dir() / file, docs_html_dir / 'js') endforeach diff --git a/docs/kbase/meson.build b/docs/kbase/meson.build index 6a17d674436..d46289245b2 100644 --- a/docs/kbase/meson.build +++ b/docs/kbase/meson.build @@ -18,7 +18,7 @@ foreach name : docs_kbase_files html_in = docs_rst2html_gen.process(rst_file) - custom_target( + out_file = custom_target( html_file, input: html_in, output: html_file, @@ -38,4 +38,7 @@ foreach name : docs_kbase_files install: true, install_dir: docs_html_dir / 'kbase', ) + + install_web_deps += out_file + install_web_files += '@0@:@1@'.format(out_file.full_path(), docs_html_dir / 'kbase') endforeach diff --git a/docs/logos/meson.build b/docs/logos/meson.build index da92c397cde..70ba67d71c7 100644 --- a/docs/logos/meson.build +++ b/docs/logos/meson.build @@ -22,8 +22,10 @@ docs_logo_files = [ install_data(docs_logo_files, install_dir: docs_html_dir / 'logos') -# This hack enables us to view the web pages -# from within the uninstalled build tree foreach file : docs_logo_files + # This hack enables us to view the web pages + # from within the uninstalled build tree configure_file(input: file, output: file, copy: true) + + install_web_files += '@0@:@1@'.format(meson.current_source_dir() / file, docs_html_dir / 'logos') endforeach diff --git a/docs/manpages/meson.build b/docs/manpages/meson.build index 72d362e92d8..c53109c8d29 100644 --- a/docs/manpages/meson.build +++ b/docs/manpages/meson.build @@ -103,7 +103,7 @@ foreach data : docs_man_files capture: true, ) - custom_target( + out_file = custom_target( html_file, input: html_in, output: html_file, @@ -123,4 +123,7 @@ foreach data : docs_man_files install: true, install_dir: docs_html_dir / 'manpages', ) + + install_web_deps += out_file + install_web_files += '@0@:@1@'.format(out_file.full_path(), docs_html_dir / 'manpages') endforeach diff --git a/docs/meson.build b/docs/meson.build index 6d3d002fd7c..773e127ca74 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -129,6 +129,10 @@ docs_rst_files = [ 'submitting-patches', ] +# list of web targets to build for docs/web rule +install_web_deps = [] +install_web_files = [] + install_data(docs_assets, install_dir: docs_html_dir) aclperms_gen = custom_target( @@ -191,7 +195,7 @@ foreach name : docs_html_in_files html_in_file = '@0@.html.in'.format(name) html_file = '@0@.html'.format(name) - custom_target( + out_file = custom_target( html_file, input: html_in_file, output: html_file, @@ -211,6 +215,9 @@ foreach name : docs_html_in_files install: true, install_dir: docs_html_dir, ) + + install_web_deps += out_file + install_web_files += '@0@:@1@'.format(out_file.full_path(), docs_html_dir) endforeach @@ -262,7 +269,7 @@ docs_html_in_gen += { foreach data : docs_html_in_gen html_file = '@0@.html'.format(data['name']) - custom_target( + out_file = custom_target( html_file, input: data['file'], output: html_file, @@ -282,6 +289,9 @@ foreach data : docs_html_in_gen install: true, install_dir: docs_html_dir, ) + + install_web_deps += out_file + install_web_files += '@0@:@1@'.format(out_file.full_path(), docs_html_dir) endforeach subdir('fonts') @@ -294,8 +304,16 @@ subdir('manpages') subdir('schemas') -# This hack enables us to view the web pages -# from within the uninstalled build tree foreach file : docs_assets + # This hack enables us to view the web pages + # from within the uninstalled build tree configure_file(input: file, output: file, copy: true) + + install_web_files += '@0@:@1@'.format(meson.current_source_dir() / file, docs_html_dir) endforeach + +run_target( + 'install-web', + command: [ meson_python_prog, meson_install_web_prog.path(), install_web_files ], + depends: install_web_deps, +) diff --git a/scripts/meson-install-web.py b/scripts/meson-install-web.py new file mode 100755 index 00000000000..a03f8523cd9 --- /dev/null +++ b/scripts/meson-install-web.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 + +import os +import shutil +import sys + +for desc in sys.argv[1:]: + inst = desc.split(':') + os.makedirs(inst[1], exist_ok=True) + shutil.copy(inst[0], inst[1]) diff --git a/scripts/meson.build b/scripts/meson.build index fa2ed57c99d..2f46ece59fb 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -26,6 +26,7 @@ scripts = [ 'meson-dist.sh', 'meson-gen-authors.sh', 'meson-html-gen.py', + 'meson-install-web.py', 'meson-python.sh', 'meson-timestamp.sh', 'mock-noinline.py', -- 2.26.2

There is no alternative to DISTCHECK_CONFIGURE_FLAGS in Meson. We could enable -Werror unconditionally but that would affect all users. It is mainly used in our CI environment so we can run meson with --werror to enable it in configure time which will be picked up by meson dist as well. XZ_OPT is not relevant with meson since it uses shutil.make_archive which uses lzma python module to do the compression. Introducing rpm and srpm rules should be possible with Meson but we don't even use them in our CI and it's easy to run 'ninja dist' followed by rpmbuild manually. As for the ci rules that is simply not possible in the same way, we would have to have a lot of aliases for all the ci rules and that would be just insane. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- Makefile.am | 35 ----------------------------------- configure.ac | 2 -- 2 files changed, 37 deletions(-) delete mode 100644 Makefile.am diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 7490acbcfba..00000000000 --- a/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -## Process this file with automake to produce Makefile.in - -## Copyright (C) 2005-2013 Red Hat, Inc. -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library. If not, see -## <http://www.gnu.org/licenses/>. - -# when building from tarball -Werror isn't auto enabled -# so force it explicitly -DISTCHECK_CONFIGURE_FLAGS = --enable-werror - -SUBDIRS = . - -XZ_OPT ?= -v -T0 -export XZ_OPT - -rpm: clean - @(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.xz) - -srpm: clean - @(unset CDPATH ; $(MAKE) dist && rpmbuild -ts $(distdir).tar.xz) - -ci-%: - $(MAKE) -C $(srcdir)/ci/ $@ diff --git a/configure.ac b/configure.ac index 4ba70bb43b5..3a88a0e0154 100644 --- a/configure.ac +++ b/configure.ac @@ -103,6 +103,4 @@ m4_if(m4_version_compare([2.61a.100], [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [], [GNUmakefile=$GNUmakefile])]) -AC_CONFIG_FILES([\ - Makefile]) AC_OUTPUT -- 2.26.2

None of the directives from GNUmakefile are converted to meson as they don't make any sense. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- GNUmakefile | 74 ---------------------------------------------------- configure.ac | 7 ----- 2 files changed, 81 deletions(-) delete mode 100644 GNUmakefile diff --git a/GNUmakefile b/GNUmakefile deleted file mode 100644 index 78d06751f6c..00000000000 --- a/GNUmakefile +++ /dev/null @@ -1,74 +0,0 @@ -# Having a separate GNUmakefile lets me 'include' the dynamically -# generated rules created via cfg.mk (package-local configuration) -# as well as maint.mk (generic maintainer rules). -# This makefile is used only if you run GNU Make. -# It is necessary if you want to build targets usually of interest -# only to the maintainer. - -# Copyright (C) 2001, 2003, 2006-2019 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - -_build-aux ?= build-aux -_autoreconf ?= autoreconf -v - -# If the user runs GNU make but has not yet run ./configure, -# give them a diagnostic. -_gl-Makefile := $(wildcard [M]akefile) -ifneq ($(_gl-Makefile),) - -# Make tar archive easier to reproduce. -export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner - -# Allow the user to add to this in the Makefile. -ALL_RECURSIVE_TARGETS = - -include Makefile -include $(srcdir)/$(_build-aux)/syntax-check.mk - -else - -.DEFAULT_GOAL := abort-due-to-no-makefile -srcdir = . - -# The package can override .DEFAULT_GOAL to run actions like autoreconf. -include $(srcdir)/$(_build-aux)/syntax-check.mk - -ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile) -$(MAKECMDGOALS): abort-due-to-no-makefile -endif - -abort-due-to-no-makefile: - @echo There seems to be no Makefile in this directory. 1>&2 - @echo "You must run ./configure before running 'make'." 1>&2 - @exit 1 - -endif - -# Tell version 3.79 and up of GNU make to not build goals in this -# directory in parallel, in case someone tries to build multiple -# targets, and one of them can cause a recursive target to be invoked. - -# Only set this if Automake doesn't provide it. -AM_RECURSIVE_TARGETS ?= $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) \ - dist distcheck tags ctags - -ALL_RECURSIVE_TARGETS += $(AM_RECURSIVE_TARGETS) - -ifneq ($(word 2, $(MAKECMDGOALS)), ) -ifneq ($(filter $(ALL_RECURSIVE_TARGETS), $(MAKECMDGOALS)), ) -.NOTPARALLEL: -endif -endif diff --git a/configure.ac b/configure.ac index 3a88a0e0154..111992b3aae 100644 --- a/configure.ac +++ b/configure.ac @@ -96,11 +96,4 @@ test "$enable_shared" = no && lt_cv_objdir=. LV_LIBTOOL_OBJDIR=${lt_cv_objdir-.} AC_SUBST([LV_LIBTOOL_OBJDIR]) - -GNUmakefile=GNUmakefile -m4_if(m4_version_compare([2.61a.100], - m4_defn([m4_PACKAGE_VERSION])), [1], [], - [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [], - [GNUmakefile=$GNUmakefile])]) - AC_OUTPUT -- 2.26.2

AC_CANONICAL_HOST adds --host option to configure which is provided automatically by Meson as --cross-file. All of the AC_PROG_CC, AC_PROG_INSTALL, AC_PROG_CPP, AM_PROG_CC_C_O, AM_PROG_LD, PKG_PROG_PKG_CONFIG are automatically checked by Meson. libtool is not used by meson so there is no need for that as well and the remaining directives are not relevant for Meson. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- configure.ac | 99 ---------------------------------------------------- 1 file changed, 99 deletions(-) delete mode 100644 configure.ac diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 111992b3aae..00000000000 --- a/configure.ac +++ /dev/null @@ -1,99 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. - -dnl Copyright (C) 2005-2015 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 <http://www.gnu.org/licenses/>. - -AC_CONFIG_AUX_DIR([build-aux]) -dnl Make automake keep quiet about wildcards & other GNUmake-isms -AM_INIT_AUTOMAKE([ - foreign - -Wno-portability - tar-pax - no-dist-gzip - dist-xz - subdir-objects - ]) -dnl older automake's default of ARFLAGS=cru is noisy on newer binutils; -dnl we don't really need the 'u' even in older toolchains. Then there is -dnl older libtool, which spelled it AR_FLAGS -m4_divert_text([DEFAULTS], [: "${ARFLAGS=cr} ${AR_FLAGS=cr}"]) - -# Default to using the silent-rules feature when possible. Formatting -# chosen to bypass 'grep' checks that cause older automake to warn. -# Users (include rpm) can still change the default at configure time. -m4_ifndef([AM_SILENT_RULES], - [m4_define([AM_SILENT_RULES],[])])AM_SILENT_RULES([yes]) - -AC_CANONICAL_HOST - -dnl Checks for C compiler. -AC_PROG_CC -AC_PROG_INSTALL -AC_PROG_CPP - -dnl get 64-int interfaces on 32-bit platforms -AC_SYS_LARGEFILE - -dnl Support building Win32 DLLs (must appear *before* AM_PROG_LIBTOOL) -AC_LIBTOOL_WIN32_DLL - -m4_ifndef([LT_INIT], [ - AM_PROG_LIBTOOL -], [ - LT_INIT([shared disable-static]) -]) -AM_PROG_CC_C_O -AM_PROG_LD - -dnl Make some notes about which OS we're compiling for, as the lxc and qemu -dnl drivers require linux headers, and storage_mpath, dtrace, and nwfilter -dnl are also linux specific. The "network" and storage_fs drivers are known -dnl to not work on macOS presently, so we also make a note if compiling -dnl for that - -with_linux=no with_macos=no with_freebsd=no with_win=no -case $host in - *-*-linux*) with_linux=yes ;; - *-*-darwin*) with_macos=yes ;; - *-*-freebsd*) with_freebsd=yes ;; - *-*-mingw* | *-*-msvc* ) with_win=yes ;; -esac - -AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"]) -AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"]) -AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" = "yes"]) - - -dnl -dnl in case someone want to build static binaries -dnl STATIC_BINARIES="-static" -dnl -STATIC_BINARIES= -AC_SUBST([STATIC_BINARIES]) - - -dnl Need to test if pkg-config exists -PKG_PROG_PKG_CONFIG - - -# Set LV_LIBTOOL_OBJDIR to "." or $lt_cv_objdir, depending on whether -# we're building shared libraries. This is the name of the directory -# in which .o files will be created. -test "$enable_shared" = no && lt_cv_objdir=. -LV_LIBTOOL_OBJDIR=${lt_cv_objdir-.} -AC_SUBST([LV_LIBTOOL_OBJDIR]) - -AC_OUTPUT -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- .gitignore | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.gitignore b/.gitignore index 6c167e423b1..405dacb7776 100644 --- a/.gitignore +++ b/.gitignore @@ -8,27 +8,6 @@ .#* *~ -# autotools related ignores -!/m4/virt-*.m4 -*.cov -/AUTHORS -/INSTALL -/aclocal.m4 -/autom4te.cache -/build-aux/compile -/build-aux/config.guess -/build-aux/config.sub -/build-aux/depcomp -/build-aux/install-sh -/build-aux/ltmain.sh -/build-aux/missing -/build-aux/test-driver -/config.h.in -/config.log -/configure -/m4/* -Makefile.in - # git related ignores *.rej *.orig -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- CONTRIBUTING.rst | 9 ++++---- docs/advanced-tests.rst | 14 ++++++------ docs/best-practices.rst | 2 +- docs/committer-guidelines.rst | 6 +++--- docs/compiling.html.in | 40 ++++++++++++++++------------------- docs/hacking.rst | 4 ++-- docs/strategy.html.in | 27 ++++++----------------- docs/windows.html.in | 18 +++++++--------- 8 files changed, 50 insertions(+), 70 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 972b1898736..bda5cae6270 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -12,13 +12,12 @@ your git clone run: :: - $ mkdir build && cd build - $ ../autogen.sh - $ make + $ meson build + $ ninja -C build You'll find the freshly-built document in ``docs/contribute.html``. -If ``configure`` fails because of missing dependencies, you can set +If ``meson setup`` fails because of missing dependencies, you can set up your system by calling :: @@ -39,7 +38,7 @@ to run :: - $ sudo dnf install gcc make libtool autoconf automake rpm-build + $ sudo dnf install gcc make ninja-build rpm-build You might still be missing some dependencies if your distribution is shipping an old libvirt version, but that will get you much closer to diff --git a/docs/advanced-tests.rst b/docs/advanced-tests.rst index d2d29d976d9..c8c02eabe06 100644 --- a/docs/advanced-tests.rst +++ b/docs/advanced-tests.rst @@ -6,8 +6,8 @@ The basic requirement before submitting changes to libvirt is that :: - $ make check - $ make syntax-check + $ ninja test + $ ninja syntax-check succeed after each commit. @@ -17,7 +17,7 @@ by running :: - $ make -C tests valgrind + $ meson test --setup valgrind `Valgrind <http://valgrind.org/>`__ is a test that checks for memory management issues, such as leaks or use of uninitialized @@ -27,13 +27,13 @@ Some tests are skipped by default in a development environment, based on the time they take in comparison to the likelihood that those tests will turn up problems during incremental builds. These tests default to being run when building from a -tarball or with the configure option --enable-expensive-tests; +tarball or with the configure option -Dexpensive_tests=enabled; you can also force a one-time toggle of these tests by setting VIR_TEST_EXPENSIVE to 0 or 1 at make time, as in: :: - $ make check VIR_TEST_EXPENSIVE=1 + $ VIR_TEST_EXPENSIVE=1 ninja test If you encounter any failing tests, the VIR_TEST_DEBUG environment variable may provide extra information to debug the @@ -42,8 +42,8 @@ amounts of information: :: - $ VIR_TEST_DEBUG=1 make check (or) - $ VIR_TEST_DEBUG=2 make check + $ VIR_TEST_DEBUG=1 ninja test (or) + $ VIR_TEST_DEBUG=2 ninja test When debugging failures during development, it is possible to focus in on just the failing subtests by using VIR_TEST_RANGE. diff --git a/docs/best-practices.rst b/docs/best-practices.rst index 4a28b03b652..b2572c81100 100644 --- a/docs/best-practices.rst +++ b/docs/best-practices.rst @@ -26,7 +26,7 @@ with minimal back-and-forth. and an explanation of how the sequence of patches fits together. Moreover, please keep in mind that it's required to be able to compile cleanly (**including** - ``make check`` and ``make syntax-check``) after each + ``ninja test`` and ``ninja syntax-check``) after each patch. A feature does not have to work until the end of a series, but intermediate patches must compile and not cause test-suite failures (this is to preserve the usefulness of diff --git a/docs/committer-guidelines.rst b/docs/committer-guidelines.rst index 3be08e6fed3..1f879ddf934 100644 --- a/docs/committer-guidelines.rst +++ b/docs/committer-guidelines.rst @@ -12,7 +12,7 @@ objection on the list it should be good to go. If the patch touches a part of the code where you're not the main maintainer, or where you do not have a very clear idea of how things work, it's better to wait for a more authoritative feedback though. -Before committing, please also rebuild locally, run 'make check +Before committing, please also rebuild locally, run 'ninja test syntax-check', and make sure you don't raise errors. An exception to 'review and approval on the list first' is fixing @@ -21,10 +21,10 @@ failures to build: - if a recently committed patch breaks compilation on a platform or for a given driver, then it's fine to commit a minimal fix directly without getting the review feedback first -- if make check or make syntax-check breaks, if there is an +- if ninja test or ninja syntax-check breaks, if there is an obvious fix, it's fine to commit immediately. The patch should still be sent to the list (or tell what the fix was if - trivial), and 'make check syntax-check' should pass too, before + trivial), and 'ninja test syntax-check' should pass too, before committing anything - fixes for documentation and code comments can be managed in the same way, but still make sure they get reviewed if non-trivial. diff --git a/docs/compiling.html.in b/docs/compiling.html.in index 0e12a9218e3..2a65fa7b8b0 100644 --- a/docs/compiling.html.in +++ b/docs/compiling.html.in @@ -9,28 +9,26 @@ <h2><a id="compiling">Compiling a release tarball</a></h2> <p> - libvirt uses the standard configure/make/install steps and mandates + libvirt uses the standard setup/build/install steps and mandates that the build directory is different that the source directory: </p> <pre> $ xz -c libvirt-x.x.x.tar.xz | tar xvf - $ cd libvirt-x.x.x -$ mkdir build && cd build -$ ../configure</pre> +$ meson build</pre> <p> - The <i>configure</i> script can be given options to change its default + The <i>meson</i> script can be given options to change its default behaviour. </p> <p> - To get the complete list of the options it can take, pass it the - <i>--help</i> option like this: + To get the complete list of the options run the following command: </p> <pre> -$ ../configure <i>--help</i></pre> +$ meson configure</pre> <p> When you have determined which options you want to use (if any), @@ -38,7 +36,7 @@ $ ../configure <i>--help</i></pre> </p> <p> - Note the use of <b>sudo</b> with the <i>make install</i> command + Note the use of <b>sudo</b> with the <i>ninja install</i> command below. Using sudo is only required when installing to a location your user does not have write access to. Installing to a system location is a good example of this. @@ -46,14 +44,14 @@ $ ../configure <i>--help</i></pre> <p> If you are installing to a location that your user <i>does</i> have write - access to, then you can instead run the <i>make install</i> command + access to, then you can instead run the <i>ninja install</i> command without putting <b>sudo</b> before it. </p> <pre> -$ ../configure <i>[possible options]</i> -$ make -$ <b>sudo</b> <i>make install</i></pre> +$ meson build <i>[possible options]</i> +$ ninja -C build +$ <b>sudo</b> <i>ninja -C build install</i></pre> <p> At this point you <b>may</b> have to run ldconfig or a similar utility @@ -63,12 +61,10 @@ $ <b>sudo</b> <i>make install</i></pre> <h2><a id="building">Building from a GIT checkout</a></h2> <p> - The libvirt build process uses GNU autotools, so after obtaining a - checkout it is necessary to generate the configure script and Makefile.in - templates using the <code>autogen.sh</code> command. By default when - the <code>configure</code> script is run from within a GIT checkout, it + The libvirt build process uses Meson build system. By default when + the <code>meson</code> is run from within a GIT checkout, it will turn on -Werror for builds. This can be disabled with - --disable-werror, but this is not recommended. + --werror=false, but this is not recommended. </p> <p>To build & install libvirt to your home @@ -76,9 +72,9 @@ $ <b>sudo</b> <i>make install</i></pre> </p> <pre> -$ ./autogen.sh --prefix=$HOME/usr -$ make -$ <b>sudo</b> make install</pre> +$ meson build --prefix=$HOME/usr +$ ninja -C build +$ ninja -C build install</pre> <p> Be aware though, that binaries built with a custom prefix will not @@ -88,8 +84,8 @@ $ <b>sudo</b> make install</pre> </p> <pre> -$ ./autogen.sh --system -$ make +$ meson build -Dsystem=true +$ ninja -C build </pre> <p> diff --git a/docs/hacking.rst b/docs/hacking.rst index ccc94010b3a..4a9a1e19565 100644 --- a/docs/hacking.rst +++ b/docs/hacking.rst @@ -30,8 +30,8 @@ changes. That is: :: - $ make check - $ make syntax-check + $ ninja test + $ ninja syntax-check These tests help making sure that your changes don't introduce regressions in libvirt, as well as validating that any new code diff --git a/docs/strategy.html.in b/docs/strategy.html.in index 42c285d9f6a..0d845d006af 100644 --- a/docs/strategy.html.in +++ b/docs/strategy.html.in @@ -22,13 +22,12 @@ in the C language.</dd> <dt>Python</dt> <dd>Various supporting build/test scripts are written in Python, with - compatibility for Python 2 and 3.</dd> + compatibility for Python 3.</dd> <dt>Perl</dt> <dd>Various supporting build/test scripts are written in Perl. It is also used for many syntax-check inline rules</dd> <dt>Shell</dt> - <dd><code>configure</code>, generated by autoconf, is a shell script. - Shell is also used for some simple build/test scripts. At runtime + <dd>Shell is used for some simple build/test scripts. At runtime libvirt avoids shell except when using SSH tunnels to a remote host</dd> <dt>XSLT</dt> @@ -38,14 +37,10 @@ <dt>HTML</dt> <dd>The website documentation is all written in plain HTML. Some HTML is also auto-generated for API documentation</dd> - <dt>M4</dt> - <dd>The autoconf <code>configure</code> script uses a large number of - M4 macros to generate its content</dd> + <dt>Meson</dt> + <dd>The core build system uses the new Meson build system</dd> <dt>make</dt> - <dd>The core build system uses the traditional GNU make recipes</dd> - <dt>automake</dt> - <dd>The make recipes use automake's language extensions which are - then turned into regular make rules</dd> + <dd>The syntax-check uses make recipes</dd> <dt>awk/sed</dt> <dd>A number of the syntax-check inline rules involve use of awk/sed scripts</dd> @@ -58,8 +53,8 @@ The wide range of languages used present a knowledge burden for developers involved in libvirt, especially when there are multiple languages all used in the same problem spaces. This is most notable - in the build system which uses a combination of shell, M4, make, - automake, awk, sed, Perl and Python, with debugging requiring + in the build system which uses a combination of Meson, shell, awk, + sed, Perl and Python, with debugging requiring understanding of the interactions between many languages. The popularity of Perl has declined, while Python has become more popular. This directly influences the amount and quality of @@ -119,14 +114,6 @@ code. </p> - <p> - The Meson build system is written in Python 3. This directly informs the - choice of Python 3 as the language for all supporting build scripts, - re-inforcing the other benefits of Python over Perl, Shell, M4, - automake, etc. There is no intention to support Python 2 given Meson's - requirement for Python 3. - </p> - <p> Using the RST format for documentation allows for the use of XSLT to be eliminated from the build process. RST and the Sphinx toolkit are widely diff --git a/docs/windows.html.in b/docs/windows.html.in index a0ff525e1ad..13dab1f6a40 100644 --- a/docs/windows.html.in +++ b/docs/windows.html.in @@ -180,16 +180,14 @@ </p> <pre> -mkdir build && cd build -../configure \ - --without-sasl \ - --without-polkit \ - --without-python \ - --without-libxl \ - --without-qemu \ - --without-lxc \ - --without-openvz \ - --without-libvirtd +meson build \ + -Dsasl=disabled \ + -Dpolkit=disabled \ + -Ddriver_libxl=disabled \ + -Ddriver_qemu=disabled \ + -Ddriver_lxc=disabled \ + -Ddriver_openvz=disabled \ + -Ddriver_libvirtd=disabled </pre> </body> -- 2.26.2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- .gitlab-ci.yml | 57 ++++++++++--------- ci/aarch64-linux-gnu.meson | 11 ++++ ci/arm-linux-gnueabi.meson | 11 ++++ ci/arm-linux-gnueabihf.meson | 11 ++++ ci/cirrus/build.yml | 10 ++-- ci/cirrus/libvirt-freebsd-12.vars | 4 +- ci/cirrus/libvirt-macos-1015.vars | 4 +- ci/containers/libvirt-centos-7.Dockerfile | 2 +- ci/containers/libvirt-centos-8.Dockerfile | 4 +- .../libvirt-centos-stream.Dockerfile | 4 +- ...libvirt-debian-10-cross-aarch64.Dockerfile | 5 +- .../libvirt-debian-10-cross-armv6l.Dockerfile | 6 +- .../libvirt-debian-10-cross-armv7l.Dockerfile | 6 +- .../libvirt-debian-10-cross-i686.Dockerfile | 5 +- .../libvirt-debian-10-cross-mips.Dockerfile | 5 +- ...ibvirt-debian-10-cross-mips64el.Dockerfile | 5 +- .../libvirt-debian-10-cross-mipsel.Dockerfile | 5 +- ...libvirt-debian-10-cross-ppc64le.Dockerfile | 5 +- .../libvirt-debian-10-cross-s390x.Dockerfile | 5 +- ci/containers/libvirt-debian-10.Dockerfile | 4 +- ...ibvirt-debian-sid-cross-aarch64.Dockerfile | 5 +- ...libvirt-debian-sid-cross-armv6l.Dockerfile | 6 +- ...libvirt-debian-sid-cross-armv7l.Dockerfile | 6 +- .../libvirt-debian-sid-cross-i686.Dockerfile | 5 +- ...bvirt-debian-sid-cross-mips64el.Dockerfile | 5 +- ...libvirt-debian-sid-cross-mipsel.Dockerfile | 6 +- ...ibvirt-debian-sid-cross-ppc64le.Dockerfile | 5 +- .../libvirt-debian-sid-cross-s390x.Dockerfile | 5 +- ci/containers/libvirt-debian-sid.Dockerfile | 4 +- ci/containers/libvirt-fedora-31.Dockerfile | 4 +- ci/containers/libvirt-fedora-32.Dockerfile | 4 +- ...rt-fedora-rawhide-cross-mingw32.Dockerfile | 4 +- ...rt-fedora-rawhide-cross-mingw64.Dockerfile | 4 +- .../libvirt-fedora-rawhide.Dockerfile | 4 +- ci/containers/libvirt-opensuse-151.Dockerfile | 2 +- ci/containers/libvirt-ubuntu-1804.Dockerfile | 2 +- ci/containers/libvirt-ubuntu-2004.Dockerfile | 4 +- ci/i686-linux-gnu.meson | 11 ++++ ci/mips-linux-gnu.meson | 11 ++++ ci/mips64el-linux-gnuabi64.meson | 11 ++++ ci/mipsel-linux-gnu.meson | 11 ++++ ci/powerpc64le-linux-gnu.meson | 11 ++++ ci/s390x-linux-gnu.meson | 11 ++++ 43 files changed, 246 insertions(+), 64 deletions(-) create mode 100644 ci/aarch64-linux-gnu.meson create mode 100644 ci/arm-linux-gnueabi.meson create mode 100644 ci/arm-linux-gnueabihf.meson create mode 100644 ci/i686-linux-gnu.meson create mode 100644 ci/mips-linux-gnu.meson create mode 100644 ci/mips64el-linux-gnuabi64.meson create mode 100644 ci/mipsel-linux-gnu.meson create mode 100644 ci/powerpc64le-linux-gnu.meson create mode 100644 ci/s390x-linux-gnu.meson diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c997dc6df25..c789f1f4fea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,6 @@ stages: - builds .script_variables: &script_variables | - export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)" export CCACHE_BASEDIR="$(pwd)" export CCACHE_DIR="$CCACHE_BASEDIR/ccache" export CCACHE_MAXSIZE="500M" @@ -50,10 +49,25 @@ stages: before_script: - *script_variables script: - - mkdir build - - cd build - - ../autogen.sh || (cat config.log && exit 1) - - $MAKE distcheck + - meson build --werror || (cat build/meson-logs/meson-log.txt && exit 1) + - ninja -C build dist + +# Default native build job only for CentOS 7 that is always run +# meson dist fails on CentOS 7 because of old git that fails to clone +# from shallow git repository which is done when running meson dist +.native_build_centos_7_job_template: &native_build_centos_7_job_definition + stage: builds + image: $CI_REGISTRY_IMAGE/ci-$NAME:latest + cache: + paths: + - ccache/ + key: "$CI_JOB_NAME" + before_script: + - *script_variables + script: + - meson build --werror || (cat build/meson-logs/meson-log.txt && exit 1) + - ninja -C build + - ninja -C build test # Jobs that we delegate to Cirrus CI because they require an operating # system other than Linux. These jobs will only run if the required @@ -84,6 +98,8 @@ stages: -e "s|[@]PKGS@|$PKGS|g" -e "s|[@]MAKE@|$MAKE|g" -e "s|[@]PYTHON@|$PYTHON|g" + -e "s|[@]PIP@|$PIP|g" + -e "s|[@]PYPI_PKGS@|$PYPI_PKGS|g" <ci/cirrus/build.yml >ci/cirrus/$NAME.yml - cat ci/cirrus/$NAME.yml - cirrus-run ci/cirrus/$NAME.yml @@ -102,10 +118,8 @@ stages: before_script: - *script_variables script: - - mkdir build - - cd build - - ../autogen.sh $CONFIGURE_OPTS || (cat config.log && exit 1) - - $MAKE + - meson build --werror $MESON_OPTS || (cat build/meson-logs/meson-log.txt && exit 1) + - ninja -C build # Native container build jobs @@ -277,7 +291,7 @@ x64-debian-sid: NAME: debian-sid x64-centos-7: - <<: *native_build_job_definition + <<: *native_build_centos_7_job_definition variables: NAME: centos-7 @@ -420,12 +434,8 @@ website: before_script: - *script_variables script: - - mkdir build - - cd build - - ../autogen.sh --prefix=$(pwd)/../vroot || (cat config.log && exit 1) - - $MAKE -C docs - - $MAKE -C docs install - - cd .. + - meson build --prefix=$(pwd)/vroot || (cat build/meson-logs/meson-log.txt && exit 1) + - ninja -C build install-web - mv vroot/share/doc/libvirt/html/ website artifacts: expose_as: 'Website' @@ -442,10 +452,8 @@ codestyle: before_script: - *script_variables script: - - mkdir build - - cd build - - ../autogen.sh || (cat config.log && exit 1) - - $MAKE syntax-check + - meson build || (cat build/meson-logs/meson-log.txt && exit 1) + - ninja -C build syntax-check # This artifact published by this job is downloaded to push to Weblate @@ -459,12 +467,9 @@ potfile: before_script: - *script_variables script: - - mkdir build - - cd build - - ../autogen.sh || (cat config.log && exit 1) - - $MAKE -C src generated-sources - - $MAKE -C po libvirt.pot - - cd .. + - meson build || (cat build/meson-logs/meson-log.txt && exit 1) + - ninja -C build libvirt-pot-dep + - ninja -C build libvirt-pot - cp po/libvirt.pot libvirt.pot artifacts: expose_as: 'Potfile' diff --git a/ci/aarch64-linux-gnu.meson b/ci/aarch64-linux-gnu.meson new file mode 100644 index 00000000000..1da8d6025c0 --- /dev/null +++ b/ci/aarch64-linux-gnu.meson @@ -0,0 +1,11 @@ +[binaries] +c = '/usr/bin/aarch64-linux-gnu-gcc' +ar = '/usr/bin/aarch64-linux-gnu-gcc-ar' +strip = '/usr/bin/aarch64-linux-gnu-strip' +pkgconfig = '/usr/bin/aarch64-linux-gnu-pkg-config' + +[host_machine] +system = 'linux' +cpu_family = 'aarch64' +cpu = 'aarch64' +endian = 'little' diff --git a/ci/arm-linux-gnueabi.meson b/ci/arm-linux-gnueabi.meson new file mode 100644 index 00000000000..9e5e06b84dc --- /dev/null +++ b/ci/arm-linux-gnueabi.meson @@ -0,0 +1,11 @@ +[binaries] +c = '/usr/bin/arm-linux-gnueabi-gcc' +ar = '/usr/bin/arm-linux-gnueabi-gcc-ar' +strip = '/usr/bin/arm-linux-gnueabi-strip' +pkgconfig = '/usr/bin/arm-linux-gnueabi-pkg-config' + +[host_machine] +system = 'linux' +cpu_family = 'arm' +cpu = 'arm' +endian = 'little' diff --git a/ci/arm-linux-gnueabihf.meson b/ci/arm-linux-gnueabihf.meson new file mode 100644 index 00000000000..c761707d495 --- /dev/null +++ b/ci/arm-linux-gnueabihf.meson @@ -0,0 +1,11 @@ +[binaries] +c = '/usr/bin/arm-linux-gnueabihf-gcc' +ar = '/usr/bin/arm-linux-gnueabihf-gcc-ar' +strip = '/usr/bin/arm-linux-gnueabihf-strip' +pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config' + +[host_machine] +system = 'linux' +cpu_family = 'arm' +cpu = 'armhf' +endian = 'little' diff --git a/ci/cirrus/build.yml b/ci/cirrus/build.yml index 49e90b6d67b..aff461ccbc1 100644 --- a/ci/cirrus/build.yml +++ b/ci/cirrus/build.yml @@ -13,14 +13,12 @@ env: build_task: install_script: - @INSTALL_COMMAND@ @PKGS@ + - @PIP@ install @PYPI_PKGS@ clone_script: - git clone --depth 1000 "$CI_REPOSITORY_URL" . - git fetch origin "$CI_COMMIT_REF_NAME" - git reset --hard "$CI_COMMIT_SHA" build_script: - - mkdir build - - cd build - - ../autogen.sh --prefix=$(pwd)/install-root - - $MAKE -j3 - - $MAKE -j3 install - - $MAKE -j3 dist + - meson build --prefix=$(pwd)/install-root + - ninja -C build + - ninja -C build install diff --git a/ci/cirrus/libvirt-freebsd-12.vars b/ci/cirrus/libvirt-freebsd-12.vars index c7d4fbab0ff..7c29c6f8993 100644 --- a/ci/cirrus/libvirt-freebsd-12.vars +++ b/ci/cirrus/libvirt-freebsd-12.vars @@ -4,4 +4,6 @@ CCACHE='/usr/local/bin/ccache' MAKE='/usr/local/bin/gmake' NINJA='/usr/local/bin/ninja' PYTHON='/usr/local/bin/python3' -PKGS='augeas autoconf automake avahi bash bash-completion ca_root_nss ccache chrony cppi curl cyrus-sasl dbus diskscrub dnsmasq fusefs-libs gdb gettext gettext-tools git glib gmake gnutls hal libpcap libpciaccess libssh libssh2 libtool libxml2 libxslt lsof meson ncurses ninja p5-App-cpanminus patch perl5 pkgconf polkit py37-docutils py37-flake8 py37-pip py37-setuptools py37-wheel python3 qemu-utils radvd readline screen sudo vim yajl' +PIP='/usr/local/bin/pip-3.7' +PKGS='augeas autoconf automake avahi bash bash-completion ca_root_nss ccache chrony cppi curl cyrus-sasl dbus diskscrub dnsmasq fusefs-libs gdb gettext gettext-tools git glib gmake gnutls hal libpcap libpciaccess libssh libssh2 libtool libxml2 libxslt lsof ncurses ninja p5-App-cpanminus patch perl5 pkgconf polkit py37-docutils py37-flake8 py37-pip py37-setuptools py37-wheel python3 qemu-utils radvd readline screen sudo vim yajl' +PYPI_PKGS='meson==0.54.0' diff --git a/ci/cirrus/libvirt-macos-1015.vars b/ci/cirrus/libvirt-macos-1015.vars index a14c41a277b..7704d747dfc 100644 --- a/ci/cirrus/libvirt-macos-1015.vars +++ b/ci/cirrus/libvirt-macos-1015.vars @@ -4,4 +4,6 @@ CCACHE='/usr/local/bin/ccache' MAKE='/usr/local/bin/gmake' NINJA='/usr/local/bin/ninja' PYTHON='/usr/local/bin/python3' -PKGS='augeas autoconf automake bash bash-completion ccache cpanminus cppi curl dbus dnsmasq docutils flake8 gdb gettext git glib gnutls gpatch libiscsi libpcap libssh libssh2 libtool libxml2 libxslt lsof make meson ncurses ninja perl pkg-config python3 qemu readline rpcgen screen scrub vim xz yajl' +PIP='/usr/local/bin/pip3' +PKGS='augeas autoconf automake bash bash-completion ccache cpanminus cppi curl dbus dnsmasq docutils flake8 gdb gettext git glib gnutls gpatch libiscsi libpcap libssh libssh2 libtool libxml2 libxslt lsof make ncurses ninja perl pkg-config python3 qemu readline rpcgen screen scrub vim xz yajl' +PYPI_PKGS='meson==0.54.0' diff --git a/ci/containers/libvirt-centos-7.Dockerfile b/ci/containers/libvirt-centos-7.Dockerfile index 08d93866443..a1879e08ece 100644 --- a/ci/containers/libvirt-centos-7.Dockerfile +++ b/ci/containers/libvirt-centos-7.Dockerfile @@ -128,7 +128,7 @@ WEiJKtQrZDJloqtyi/mmRa1VsV7RYR0VPJjhK/R8EQ7Ysshy\n\ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/$(basename /usr/bin/gcc) RUN pip3 install \ - meson==0.49.0 + meson==0.54.0 ENV LANG "en_US.UTF-8" diff --git a/ci/containers/libvirt-centos-8.Dockerfile b/ci/containers/libvirt-centos-8.Dockerfile index 2ac825fc807..fc66c4e4ea7 100644 --- a/ci/containers/libvirt-centos-8.Dockerfile +++ b/ci/containers/libvirt-centos-8.Dockerfile @@ -59,7 +59,6 @@ RUN dnf install 'dnf-command(config-manager)' -y && \ lsof \ lvm2 \ make \ - meson \ ncurses-devel \ net-tools \ netcf-devel \ @@ -102,6 +101,9 @@ RUN dnf install 'dnf-command(config-manager)' -y && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/$(basename /usr/bin/gcc) +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" diff --git a/ci/containers/libvirt-centos-stream.Dockerfile b/ci/containers/libvirt-centos-stream.Dockerfile index e0025e2acb2..2fac2683b27 100644 --- a/ci/containers/libvirt-centos-stream.Dockerfile +++ b/ci/containers/libvirt-centos-stream.Dockerfile @@ -60,7 +60,6 @@ RUN dnf install -y centos-release-stream && \ lsof \ lvm2 \ make \ - meson \ ncurses-devel \ net-tools \ netcf-devel \ @@ -103,6 +102,9 @@ RUN dnf install -y centos-release-stream && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/$(basename /usr/bin/gcc) +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" diff --git a/ci/containers/libvirt-debian-10-cross-aarch64.Dockerfile b/ci/containers/libvirt-debian-10-cross-aarch64.Dockerfile index 2d49f5e6e77..ed8a813b32b 100644 --- a/ci/containers/libvirt-debian-10-cross-aarch64.Dockerfile +++ b/ci/containers/libvirt-debian-10-cross-aarch64.Dockerfile @@ -33,7 +33,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-common \ ninja-build \ @@ -113,6 +112,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get autoremove -y && \ apt-get autoclean -y +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" @@ -123,3 +125,4 @@ ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV ABI "aarch64-linux-gnu" ENV CONFIGURE_OPTS "--host=aarch64-linux-gnu" +ENV MESON_OPTS "--cross-file=ci/aarch64-linux-gnu.meson" diff --git a/ci/containers/libvirt-debian-10-cross-armv6l.Dockerfile b/ci/containers/libvirt-debian-10-cross-armv6l.Dockerfile index f9d6ee4c9f4..2c7eddf90fc 100644 --- a/ci/containers/libvirt-debian-10-cross-armv6l.Dockerfile +++ b/ci/containers/libvirt-debian-10-cross-armv6l.Dockerfile @@ -33,7 +33,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-common \ ninja-build \ @@ -93,6 +92,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libncurses-dev:armel \ libnl-3-dev:armel \ libnl-route-3-dev:armel \ + libnuma-dev:armel \ libparted-dev:armel \ libpcap0.8-dev:armel \ libpciaccess-dev:armel \ @@ -111,6 +111,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get autoremove -y && \ apt-get autoclean -y +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" @@ -121,3 +124,4 @@ ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV ABI "arm-linux-gnueabi" ENV CONFIGURE_OPTS "--host=arm-linux-gnueabi" +ENV MESON_OPTS "--cross-file=ci/arm-linux-gnueabi.meson" diff --git a/ci/containers/libvirt-debian-10-cross-armv7l.Dockerfile b/ci/containers/libvirt-debian-10-cross-armv7l.Dockerfile index f26e0595352..80907b10805 100644 --- a/ci/containers/libvirt-debian-10-cross-armv7l.Dockerfile +++ b/ci/containers/libvirt-debian-10-cross-armv7l.Dockerfile @@ -33,7 +33,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-common \ ninja-build \ @@ -93,6 +92,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libncurses-dev:armhf \ libnl-3-dev:armhf \ libnl-route-3-dev:armhf \ + libnuma-dev:armhf \ libparted-dev:armhf \ libpcap0.8-dev:armhf \ libpciaccess-dev:armhf \ @@ -112,6 +112,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get autoremove -y && \ apt-get autoclean -y +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" @@ -122,3 +125,4 @@ ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV ABI "arm-linux-gnueabihf" ENV CONFIGURE_OPTS "--host=arm-linux-gnueabihf" +ENV MESON_OPTS "--cross-file=ci/arm-linux-gnueabihf.meson" diff --git a/ci/containers/libvirt-debian-10-cross-i686.Dockerfile b/ci/containers/libvirt-debian-10-cross-i686.Dockerfile index eaca5ee20b3..fc27ab47c63 100644 --- a/ci/containers/libvirt-debian-10-cross-i686.Dockerfile +++ b/ci/containers/libvirt-debian-10-cross-i686.Dockerfile @@ -33,7 +33,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-common \ ninja-build \ @@ -112,6 +111,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get autoremove -y && \ apt-get autoclean -y +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" @@ -122,3 +124,4 @@ ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV ABI "i686-linux-gnu" ENV CONFIGURE_OPTS "--host=i686-linux-gnu" +ENV MESON_OPTS "--cross-file=ci/i686-linux-gnu.meson" diff --git a/ci/containers/libvirt-debian-10-cross-mips.Dockerfile b/ci/containers/libvirt-debian-10-cross-mips.Dockerfile index 7909471dccf..96a99b356fe 100644 --- a/ci/containers/libvirt-debian-10-cross-mips.Dockerfile +++ b/ci/containers/libvirt-debian-10-cross-mips.Dockerfile @@ -33,7 +33,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-common \ ninja-build \ @@ -112,6 +111,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get autoremove -y && \ apt-get autoclean -y +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" @@ -122,3 +124,4 @@ ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV ABI "mips-linux-gnu" ENV CONFIGURE_OPTS "--host=mips-linux-gnu" +ENV MESON_OPTS "--cross-file=ci/mips-linux-gnu.meson" diff --git a/ci/containers/libvirt-debian-10-cross-mips64el.Dockerfile b/ci/containers/libvirt-debian-10-cross-mips64el.Dockerfile index 0e8bb6f4fb6..d70577678f9 100644 --- a/ci/containers/libvirt-debian-10-cross-mips64el.Dockerfile +++ b/ci/containers/libvirt-debian-10-cross-mips64el.Dockerfile @@ -33,7 +33,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-common \ ninja-build \ @@ -112,6 +111,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get autoremove -y && \ apt-get autoclean -y +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" @@ -122,3 +124,4 @@ ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV ABI "mips64el-linux-gnuabi64" ENV CONFIGURE_OPTS "--host=mips64el-linux-gnuabi64" +ENV MESON_OPTS "--cross-file=ci/mips64el-linux-gnuabi64.meson" diff --git a/ci/containers/libvirt-debian-10-cross-mipsel.Dockerfile b/ci/containers/libvirt-debian-10-cross-mipsel.Dockerfile index 9faf47dff10..08553d9cdf2 100644 --- a/ci/containers/libvirt-debian-10-cross-mipsel.Dockerfile +++ b/ci/containers/libvirt-debian-10-cross-mipsel.Dockerfile @@ -33,7 +33,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-common \ ninja-build \ @@ -112,6 +111,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get autoremove -y && \ apt-get autoclean -y +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" @@ -122,3 +124,4 @@ ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV ABI "mipsel-linux-gnu" ENV CONFIGURE_OPTS "--host=mipsel-linux-gnu" +ENV MESON_OPTS "--cross-file=ci/mipsel-linux-gnu.meson" diff --git a/ci/containers/libvirt-debian-10-cross-ppc64le.Dockerfile b/ci/containers/libvirt-debian-10-cross-ppc64le.Dockerfile index 68a438485d8..276a357a5a4 100644 --- a/ci/containers/libvirt-debian-10-cross-ppc64le.Dockerfile +++ b/ci/containers/libvirt-debian-10-cross-ppc64le.Dockerfile @@ -33,7 +33,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-common \ ninja-build \ @@ -112,6 +111,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get autoremove -y && \ apt-get autoclean -y +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" @@ -122,3 +124,4 @@ ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV ABI "powerpc64le-linux-gnu" ENV CONFIGURE_OPTS "--host=powerpc64le-linux-gnu" +ENV MESON_OPTS "--cross-file=ci/powerpc64le-linux-gnu.meson" diff --git a/ci/containers/libvirt-debian-10-cross-s390x.Dockerfile b/ci/containers/libvirt-debian-10-cross-s390x.Dockerfile index 473ad32435b..2da2bb0125f 100644 --- a/ci/containers/libvirt-debian-10-cross-s390x.Dockerfile +++ b/ci/containers/libvirt-debian-10-cross-s390x.Dockerfile @@ -33,7 +33,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-common \ ninja-build \ @@ -112,6 +111,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get autoremove -y && \ apt-get autoclean -y +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" @@ -122,3 +124,4 @@ ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV ABI "s390x-linux-gnu" ENV CONFIGURE_OPTS "--host=s390x-linux-gnu" +ENV MESON_OPTS "--cross-file=ci/s390x-linux-gnu.meson" diff --git a/ci/containers/libvirt-debian-10.Dockerfile b/ci/containers/libvirt-debian-10.Dockerfile index e1c97f2bf0f..a3fd428757d 100644 --- a/ci/containers/libvirt-debian-10.Dockerfile +++ b/ci/containers/libvirt-debian-10.Dockerfile @@ -69,7 +69,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-common \ ninja-build \ @@ -106,6 +105,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/$(basename /usr/bin/gcc) +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" diff --git a/ci/containers/libvirt-debian-sid-cross-aarch64.Dockerfile b/ci/containers/libvirt-debian-sid-cross-aarch64.Dockerfile index 9aedc673305..d227d933c76 100644 --- a/ci/containers/libvirt-debian-sid-cross-aarch64.Dockerfile +++ b/ci/containers/libvirt-debian-sid-cross-aarch64.Dockerfile @@ -33,7 +33,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-common \ ninja-build \ @@ -113,6 +112,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get autoremove -y && \ apt-get autoclean -y +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" @@ -123,3 +125,4 @@ ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV ABI "aarch64-linux-gnu" ENV CONFIGURE_OPTS "--host=aarch64-linux-gnu" +ENV MESON_OPTS "--cross-file=ci/aarch64-linux-gnu.meson" diff --git a/ci/containers/libvirt-debian-sid-cross-armv6l.Dockerfile b/ci/containers/libvirt-debian-sid-cross-armv6l.Dockerfile index 3f5ccba66a6..5b93c8353df 100644 --- a/ci/containers/libvirt-debian-sid-cross-armv6l.Dockerfile +++ b/ci/containers/libvirt-debian-sid-cross-armv6l.Dockerfile @@ -33,7 +33,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-common \ ninja-build \ @@ -93,6 +92,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libncurses-dev:armel \ libnl-3-dev:armel \ libnl-route-3-dev:armel \ + libnuma-dev:armel \ libparted-dev:armel \ libpcap0.8-dev:armel \ libpciaccess-dev:armel \ @@ -111,6 +111,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get autoremove -y && \ apt-get autoclean -y +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" @@ -121,3 +124,4 @@ ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV ABI "arm-linux-gnueabi" ENV CONFIGURE_OPTS "--host=arm-linux-gnueabi" +ENV MESON_OPTS "--cross-file=ci/arm-linux-gnueabi.meson" diff --git a/ci/containers/libvirt-debian-sid-cross-armv7l.Dockerfile b/ci/containers/libvirt-debian-sid-cross-armv7l.Dockerfile index f67f13cf85b..76027933fcd 100644 --- a/ci/containers/libvirt-debian-sid-cross-armv7l.Dockerfile +++ b/ci/containers/libvirt-debian-sid-cross-armv7l.Dockerfile @@ -33,7 +33,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-common \ ninja-build \ @@ -93,6 +92,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libncurses-dev:armhf \ libnl-3-dev:armhf \ libnl-route-3-dev:armhf \ + libnuma-dev:armhf \ libparted-dev:armhf \ libpcap0.8-dev:armhf \ libpciaccess-dev:armhf \ @@ -112,6 +112,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get autoremove -y && \ apt-get autoclean -y +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" @@ -122,3 +125,4 @@ ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV ABI "arm-linux-gnueabihf" ENV CONFIGURE_OPTS "--host=arm-linux-gnueabihf" +ENV MESON_OPTS "--cross-file=ci/arm-linux-gnueabihf.meson" diff --git a/ci/containers/libvirt-debian-sid-cross-i686.Dockerfile b/ci/containers/libvirt-debian-sid-cross-i686.Dockerfile index 0ed089f9ab2..19f0e787066 100644 --- a/ci/containers/libvirt-debian-sid-cross-i686.Dockerfile +++ b/ci/containers/libvirt-debian-sid-cross-i686.Dockerfile @@ -33,7 +33,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-common \ ninja-build \ @@ -112,6 +111,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get autoremove -y && \ apt-get autoclean -y +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" @@ -122,3 +124,4 @@ ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV ABI "i686-linux-gnu" ENV CONFIGURE_OPTS "--host=i686-linux-gnu" +ENV MESON_OPTS "--cross-file=ci/i686-linux-gnu.meson" diff --git a/ci/containers/libvirt-debian-sid-cross-mips64el.Dockerfile b/ci/containers/libvirt-debian-sid-cross-mips64el.Dockerfile index cdafb2aef81..07307e083ae 100644 --- a/ci/containers/libvirt-debian-sid-cross-mips64el.Dockerfile +++ b/ci/containers/libvirt-debian-sid-cross-mips64el.Dockerfile @@ -33,7 +33,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-common \ ninja-build \ @@ -112,6 +111,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get autoremove -y && \ apt-get autoclean -y +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" @@ -122,3 +124,4 @@ ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV ABI "mips64el-linux-gnuabi64" ENV CONFIGURE_OPTS "--host=mips64el-linux-gnuabi64" +ENV MESON_OPTS "--cross-file=ci/mips64el-linux-gnuabi64.meson" diff --git a/ci/containers/libvirt-debian-sid-cross-mipsel.Dockerfile b/ci/containers/libvirt-debian-sid-cross-mipsel.Dockerfile index 532b70be3bf..98b1dff49aa 100644 --- a/ci/containers/libvirt-debian-sid-cross-mipsel.Dockerfile +++ b/ci/containers/libvirt-debian-sid-cross-mipsel.Dockerfile @@ -33,7 +33,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-common \ ninja-build \ @@ -97,6 +96,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libparted-dev:mipsel \ libpcap0.8-dev:mipsel \ libpciaccess-dev:mipsel \ + librbd-dev:mipsel \ libreadline-dev:mipsel \ libsanlock-dev:mipsel \ libsasl2-dev:mipsel \ @@ -111,6 +111,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get autoremove -y && \ apt-get autoclean -y +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" @@ -121,3 +124,4 @@ ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV ABI "mipsel-linux-gnu" ENV CONFIGURE_OPTS "--host=mipsel-linux-gnu" +ENV MESON_OPTS "--cross-file=ci/mipsel-linux-gnu.meson" diff --git a/ci/containers/libvirt-debian-sid-cross-ppc64le.Dockerfile b/ci/containers/libvirt-debian-sid-cross-ppc64le.Dockerfile index 8bc32873bc6..00271ac1a7b 100644 --- a/ci/containers/libvirt-debian-sid-cross-ppc64le.Dockerfile +++ b/ci/containers/libvirt-debian-sid-cross-ppc64le.Dockerfile @@ -33,7 +33,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-common \ ninja-build \ @@ -112,6 +111,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get autoremove -y && \ apt-get autoclean -y +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" @@ -122,3 +124,4 @@ ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV ABI "powerpc64le-linux-gnu" ENV CONFIGURE_OPTS "--host=powerpc64le-linux-gnu" +ENV MESON_OPTS "--cross-file=ci/powerpc64le-linux-gnu.meson" diff --git a/ci/containers/libvirt-debian-sid-cross-s390x.Dockerfile b/ci/containers/libvirt-debian-sid-cross-s390x.Dockerfile index 6a98b30326b..60d1ddd35ea 100644 --- a/ci/containers/libvirt-debian-sid-cross-s390x.Dockerfile +++ b/ci/containers/libvirt-debian-sid-cross-s390x.Dockerfile @@ -33,7 +33,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-common \ ninja-build \ @@ -112,6 +111,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get autoremove -y && \ apt-get autoclean -y +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" @@ -122,3 +124,4 @@ ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" ENV ABI "s390x-linux-gnu" ENV CONFIGURE_OPTS "--host=s390x-linux-gnu" +ENV MESON_OPTS "--cross-file=ci/s390x-linux-gnu.meson" diff --git a/ci/containers/libvirt-debian-sid.Dockerfile b/ci/containers/libvirt-debian-sid.Dockerfile index b8ec601ef12..80c828e9c05 100644 --- a/ci/containers/libvirt-debian-sid.Dockerfile +++ b/ci/containers/libvirt-debian-sid.Dockerfile @@ -69,7 +69,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-common \ ninja-build \ @@ -106,6 +105,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/$(basename /usr/bin/gcc) +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" diff --git a/ci/containers/libvirt-fedora-31.Dockerfile b/ci/containers/libvirt-fedora-31.Dockerfile index 7b492d30c05..972ea16c5d9 100644 --- a/ci/containers/libvirt-fedora-31.Dockerfile +++ b/ci/containers/libvirt-fedora-31.Dockerfile @@ -57,7 +57,6 @@ RUN dnf update -y && \ lsof \ lvm2 \ make \ - meson \ ncurses-devel \ net-tools \ netcf-devel \ @@ -103,6 +102,9 @@ RUN dnf update -y && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/$(basename /usr/bin/gcc) +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" diff --git a/ci/containers/libvirt-fedora-32.Dockerfile b/ci/containers/libvirt-fedora-32.Dockerfile index f208f82a2ae..a2099683110 100644 --- a/ci/containers/libvirt-fedora-32.Dockerfile +++ b/ci/containers/libvirt-fedora-32.Dockerfile @@ -57,7 +57,6 @@ RUN dnf update -y && \ lsof \ lvm2 \ make \ - meson \ ncurses-devel \ net-tools \ netcf-devel \ @@ -103,6 +102,9 @@ RUN dnf update -y && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/$(basename /usr/bin/gcc) +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" diff --git a/ci/containers/libvirt-fedora-rawhide-cross-mingw32.Dockerfile b/ci/containers/libvirt-fedora-rawhide-cross-mingw32.Dockerfile index c1cce71e5f2..290d1de2d4a 100644 --- a/ci/containers/libvirt-fedora-rawhide-cross-mingw32.Dockerfile +++ b/ci/containers/libvirt-fedora-rawhide-cross-mingw32.Dockerfile @@ -31,7 +31,6 @@ RUN dnf update -y --nogpgcheck fedora-gpg-keys && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-utils \ ninja-build \ @@ -81,6 +80,9 @@ RUN dnf install -y \ mingw32-readline && \ dnf clean all -y +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" diff --git a/ci/containers/libvirt-fedora-rawhide-cross-mingw64.Dockerfile b/ci/containers/libvirt-fedora-rawhide-cross-mingw64.Dockerfile index 8c1829be131..77a136a5ed2 100644 --- a/ci/containers/libvirt-fedora-rawhide-cross-mingw64.Dockerfile +++ b/ci/containers/libvirt-fedora-rawhide-cross-mingw64.Dockerfile @@ -31,7 +31,6 @@ RUN dnf update -y --nogpgcheck fedora-gpg-keys && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-utils \ ninja-build \ @@ -81,6 +80,9 @@ RUN dnf install -y \ mingw64-readline && \ dnf clean all -y +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" diff --git a/ci/containers/libvirt-fedora-rawhide.Dockerfile b/ci/containers/libvirt-fedora-rawhide.Dockerfile index 8e092744f6e..a8509c9ca83 100644 --- a/ci/containers/libvirt-fedora-rawhide.Dockerfile +++ b/ci/containers/libvirt-fedora-rawhide.Dockerfile @@ -58,7 +58,6 @@ RUN dnf update -y --nogpgcheck fedora-gpg-keys && \ lsof \ lvm2 \ make \ - meson \ ncurses-devel \ net-tools \ netcf-devel \ @@ -104,6 +103,9 @@ RUN dnf update -y --nogpgcheck fedora-gpg-keys && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/$(basename /usr/bin/gcc) +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" diff --git a/ci/containers/libvirt-opensuse-151.Dockerfile b/ci/containers/libvirt-opensuse-151.Dockerfile index 2ba408efb74..0cc5df2a1bb 100644 --- a/ci/containers/libvirt-opensuse-151.Dockerfile +++ b/ci/containers/libvirt-opensuse-151.Dockerfile @@ -100,7 +100,7 @@ RUN zypper update -y && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/$(basename /usr/bin/gcc) RUN pip3 install \ - meson==0.49.0 + meson==0.54.0 ENV LANG "en_US.UTF-8" diff --git a/ci/containers/libvirt-ubuntu-1804.Dockerfile b/ci/containers/libvirt-ubuntu-1804.Dockerfile index 96751307704..5cb4384aed3 100644 --- a/ci/containers/libvirt-ubuntu-1804.Dockerfile +++ b/ci/containers/libvirt-ubuntu-1804.Dockerfile @@ -108,7 +108,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/$(basename /usr/bin/gcc) RUN pip3 install \ - meson==0.49.0 + meson==0.54.0 ENV LANG "en_US.UTF-8" diff --git a/ci/containers/libvirt-ubuntu-2004.Dockerfile b/ci/containers/libvirt-ubuntu-2004.Dockerfile index 2457e7a8dba..ae0b048c47a 100644 --- a/ci/containers/libvirt-ubuntu-2004.Dockerfile +++ b/ci/containers/libvirt-ubuntu-2004.Dockerfile @@ -70,7 +70,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ lsof \ lvm2 \ make \ - meson \ net-tools \ nfs-common \ ninja-build \ @@ -107,6 +106,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \ ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/$(basename /usr/bin/gcc) +RUN pip3 install \ + meson==0.54.0 + ENV LANG "en_US.UTF-8" ENV MAKE "/usr/bin/make" diff --git a/ci/i686-linux-gnu.meson b/ci/i686-linux-gnu.meson new file mode 100644 index 00000000000..638113e1d21 --- /dev/null +++ b/ci/i686-linux-gnu.meson @@ -0,0 +1,11 @@ +[binaries] +c = '/usr/bin/i686-linux-gnu-gcc' +ar = '/usr/bin/i686-linux-gnu-gcc-ar' +strip = '/usr/bin/i686-linux-gnu-strip' +pkgconfig = '/usr/bin/i686-linux-gnu-pkg-config' + +[host_machine] +system = 'linux' +cpu_family = 'x86' +cpu = 'i686' +endian = 'little' diff --git a/ci/mips-linux-gnu.meson b/ci/mips-linux-gnu.meson new file mode 100644 index 00000000000..2c4c21c1e02 --- /dev/null +++ b/ci/mips-linux-gnu.meson @@ -0,0 +1,11 @@ +[binaries] +c = '/usr/bin/mips-linux-gnu-gcc' +ar = '/usr/bin/mips-linux-gnu-gcc-ar' +strip = '/usr/bin/mips-linux-gnu-strip' +pkgconfig = '/usr/bin/mips-linux-gnu-pkg-config' + +[host_machine] +system = 'linux' +cpu_family = 'mips' +cpu = 'mips' +endian = 'little' diff --git a/ci/mips64el-linux-gnuabi64.meson b/ci/mips64el-linux-gnuabi64.meson new file mode 100644 index 00000000000..459c8154d7b --- /dev/null +++ b/ci/mips64el-linux-gnuabi64.meson @@ -0,0 +1,11 @@ +[binaries] +c = '/usr/bin/mips64el-linux-gnuabi64-gcc' +ar = '/usr/bin/mips64el-linux-gnuabi64-gcc-ar' +strip = '/usr/bin/mips64el-linux-gnuabi64-strip' +pkgconfig = '/usr/bin/mips64el-linux-gnuabi64-pkg-config' + +[host_machine] +system = 'linux' +cpu_family = 'mips64' +cpu = 'mips64el' +endian = 'little' diff --git a/ci/mipsel-linux-gnu.meson b/ci/mipsel-linux-gnu.meson new file mode 100644 index 00000000000..308bda511ee --- /dev/null +++ b/ci/mipsel-linux-gnu.meson @@ -0,0 +1,11 @@ +[binaries] +c = '/usr/bin/mipsel-linux-gnu-gcc' +ar = '/usr/bin/mipsel-linux-gnu-gcc-ar' +strip = '/usr/bin/mipsel-linux-gnu-strip' +pkgconfig = '/usr/bin/mipsel-linux-gnu-pkg-config' + +[host_machine] +system = 'linux' +cpu_family = 'mips' +cpu = 'mipsel' +endian = 'little' diff --git a/ci/powerpc64le-linux-gnu.meson b/ci/powerpc64le-linux-gnu.meson new file mode 100644 index 00000000000..9a151e2c12f --- /dev/null +++ b/ci/powerpc64le-linux-gnu.meson @@ -0,0 +1,11 @@ +[binaries] +c = '/usr/bin/powerpc64le-linux-gnu-gcc' +ar = '/usr/bin/powerpc64le-linux-gnu-gcc-ar' +strip = '/usr/bin/powerpc64le-linux-gnu-strip' +pkgconfig = '/usr/bin/powerpc64le-linux-gnu-pkg-config' + +[host_machine] +system = 'linux' +cpu_family = 'ppc64' +cpu = 'powerpc64le' +endian = 'little' diff --git a/ci/s390x-linux-gnu.meson b/ci/s390x-linux-gnu.meson new file mode 100644 index 00000000000..28a292c7203 --- /dev/null +++ b/ci/s390x-linux-gnu.meson @@ -0,0 +1,11 @@ +[binaries] +c = '/usr/bin/s390x-linux-gnu-gcc' +ar = '/usr/bin/s390x-linux-gnu-gcc-ar' +strip = '/usr/bin/s390x-linux-gnu-strip' +pkgconfig = '/usr/bin/s390x-linux-gnu-pkg-config' + +[host_machine] +system = 'linux' +cpu_family = 's390x' +cpu = 's390x' +endian = 'little' -- 2.26.2

On Debian Sid there are broken headers for cross compilation. There is no <asm/kvm.h> header unconditionally included by <linux/kvm.h>. With autotools the build works correctly because the header detection tries to compile simple code that includes the header but with Meson the detection works differently. We check <linux/kvm.h> which is present so it should be safe to include it. We could workaround it in libvirt by checking for presence of <asm/kvm.h> as well but I don't believe that's a correct approach. IMHO it should be fixed in Debian. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- .gitlab-ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c789f1f4fea..04b664bc7fc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -364,6 +364,12 @@ armv6l-debian-10: NAME: debian-10 CROSS: armv6l +armv7l-debian-10: + <<: *cross_build_job_definition + variables: + NAME: debian-10 + CROSS: armv7l + mips64el-debian-10: <<: *cross_build_job_definition variables: @@ -394,12 +400,6 @@ s390x-debian-sid: NAME: debian-sid CROSS: s390x -armv7l-debian-sid: - <<: *cross_build_job_definition - variables: - NAME: debian-sid - CROSS: armv7l - i686-debian-sid: <<: *cross_build_job_definition variables: -- 2.26.2

On Thu, Jul 16, 2020 at 11:53:56AM +0200, Pavel Hrdina wrote:
So I was finally able to produce the patches to port libvirt to Meson. Obviously, it is a lot of changes. It might look that some of the patches could be squashed together but I would rather have it as separated as possible to make the review not that difficult.
Once we are done with review I suggest to squash all patches to single patch as it doesn't make sense to keep them separated as it will not be possible to build complete libvirt code by any of the build systems. Trying to achieve that would be even more challenging and the review would me more difficult.
The reasoning behind taking this approach is to have 1:1 conversion from autotools to Meson where each patch removes that part from autotools. It serves as a check that nothing is skipped and to make sure that the conversion is complete.
Can you clarify a bit more what the expected behaviour is for the intermediate patches in the series ? eg if I was to "git bisect" across this series, how much will work vs break ? I'm not fussed if stuff like "make dist" breaks, but does the basic "make" and "make check" (or meson equivalent) work ? I'm also not fussed if the intermediate stages require running *both* make and meson as separate commands in order to full build. Personally I'd really like to avoid squashing them, because splitting up big patches is not merely to benefit the initial pre-merge review, but to also benefit people who need to debug stuff that's already merged and understand the scope of the intended change. So being able to look back at the changes in isolation after commit is still a big plus point.
As probably most of us know Meson is completely different build system and one of the most challenging things was to deal with the fact that meson doesn't allow user functions and that everything has to be defined before it is used.
Patches are available in my Gitlab repo as well:
git clone -b meson https://gitlab.com/phrdina/libvirt.git
and link to Giltab pipeline:
https://gitlab.com/phrdina/libvirt/-/pipelines/167276632
The pipeline is not for the latest version is I tweaked some commit messages.
Pavel Hrdina (351): meson: ci: increase git clone depth to 1000 meson: remove automake specific directives meson: drop driver_module configure argument meson: drop loader_nvram build option meson: Makefile: drop cov target meson: syntax-check: drop Makefile and m4 related checks meson: m4: drop not relevant m4 files meson: src/util/virfile: rewrite virFileActivateDirOverrideForProg meson: tests: remove '.libs' from all relevant paths meson: introduce meson build files meson: build everything with PIE meson: move content from config-post.h to config.h meson: set windows variables for AI_ADDRCONFIG meson: generate configmake.h meson: add packager build options meson: add test_suite build option meson: add expensive_tests build option meson: add test_coverage build option meson: add static analysis detection meson: add manywarnings meson: add compiler warnings meson: add linker checks meson: add scripts directory meson: add include directory meson: add functions check meson: add headers check meson: add symbols check meson: add types check meson: add members check meson: add sizeof check meson: add programs checks meson: add iscsiadm as optional program meson: add acl build dependency meson: add AppArmor build dependency meson: add attr build option meson: add audit build dependency meson: add readline build option meson: add bash_completion build options meson: add blkid build dependency meson: add capng build dependency meson: add curl build dependency meson: add dbus build dependency meson: add devmapper build dependency meson: add dlopen build dependency meson: add firewalld build option meson: add firewalld_zone build option meson: add fuse build dependency meson: add GLib dependency meson: add glusterfs build dependency meson: add GnuTLS build dependency meson: add hal build dependency meson: add kvm build dependency meson: add libiscsi build dependency meson: add macvtap build option meson: add libnl build dependency meson: add libparted dependency meson: add libpcap build option meson: add libssh build dependency meson: add libssh2 build dependency meson: add libxml build dependency meson: add netcf build options meson: add nls build dependency meson: add numactl build dependency meson: add openwsman build dependency meson: add parallels-sdk build check meson: add pciaccess build option meson: add polkit build option meson: add rbd build dependency meson: add sanlock build option meson: add sasl build dependency meson: add SELinux build dependency meson: add thread build dependency meson: add udev build options meson: add util build dependency meson: add virtualport build dependency meson: add win32 build dependency meson: add wireshark build dependency meson: add xdr build dependency meson: add yajl build dependency meson: add driver_remote build option meson: add libvirtd driver build option meson: add BHyVe build option meson: add ESX driver build option meson: add Hyper-V driver build option meson: add libxl driver build option meson: add LXC driver build option meson: add OpenVZ driver build option meson: add qemu driver build options meson: add test driver build option meson: add vbox driver build options meson: add VMWare driver build option meson: add Virtuozzo driver build option meson: add secdriver build options meson: add network driver build option meson: add interface driver build option meson: add secrets driver build option meson: add node_device driver check meson: add storage build check meson: add storage dir build option meson: add storage disk build option meson: add storage fs driver build option meson: add storage gluster build option meson: add storage iscsi build option meson: add storage iscsi-direct build option meson: add storage lvm build options meson: add storage mpath build options meson: add storage rbd build option meson: add storage SCSI build option meson: add storage sheepdog build option meson: add storage vstorage build option meson: add storage ZFS build option meson: add chrdev_lock_files build option meson: add debug_logs build option meson: add default_editor build option meson: add driver_modules build check meson: add dtrace build dependency meson: add host_validate build option meson: add init_script build option meson: add login_shell build option meson: add nss build option meson: add numad build option meson: add nwfilter build check meson: add pm_utils build option meson: add sysctl_config build option meson: add tls_priority option meson: add runutf8 env vars and meson-python.sh script meson: introduce src directory meson: src: define secdriver_dep meson: src: build dtrace files meson: src: build libvirt_util.a static lib meson: src: build libvirt_conf.a static lib meson: src: build libvirt_rpc static libs meson: src: build libvirt_access.a static library meson: src: build libvirt_driver_admin.a static lib meson: src: build libvirt_cpu.a static library meson: src: build libvirt_vmx.a static library meson: src: build libvirt_vmware.a static library meson: src: build libvirt_driver_esx.a static library meson: src: build libvirt_driver_hyperv.a static library meson: src: build libvirt_hypervisor.a static library meson: src: build libvirt_openvz.a static library meson: src: build libvirt_test.a static library meson: src: build libvirt_driver_lock.a static library meson: src: build libvirt_driver_log.a static library meson: src: build libvirt_driver_remote.a static library meson: src: build libvirt_security_manager.a static library meson: introduce datatypes sources meson: src: build libvirt_driver.a static library meson: scripts: introduce gen-def-files.sh script meson: scripts: introduce gen-sym-files.sh script meson: src: build libvirt.syms and libvirt.def symbol files meson: src: build libvirt.so library meson: src: install cpu_map data meson: src: build libvirt-qemu.so library meson: src: build libvirt-lxc.so library meson: src: build libvirt-admin.so library meson: src: build libvirt_driver_bhyve_impl.a static library meson: src: build libvirt_driver_libxl_impl.a static library meson: src: build liblockd_impl.a static library meson: src: build libvirt_driver_lxc_impl.a static library meson: src: build libvirt_driver_network_impl.a static library meson: src: build libvirt_driver_nodedev_impl.a static library meson: src: build libvirt_driver_nwfilter_impl.a static library meson: src: build libvirt_driver_qemu_impl.a static library meson: src: build libvirt_storage_driver_impl.a static library meson: src: build libvirt_driver_vbox_impl.a static library meson: src: build libvirt_driver_vz_impl.a static library meson: src: add code to build shared modules meson: src: build libvirt_driver_bhyve.so shared module meson: src: build libvirt_driver_interface.so shared module meson: src: build libvirt_driver_libxl.so shared module meson: src: build libvirt_driver_lxc.so shared module meson: src: build libvirt_driver_network.so shared module meson: src: build libvirt_driver_nodedev.so shared module meson: src: build libvirt_driver_nwfilter.so shared module meson: src: build libvirt_driver_qemu.so shared module meson: src: build libvirt_driver_secret.so shared module meson: src: build libvirt_driver_vbox.so shared module meson: src: build libvirt_driver_vz.so shared module meson: src: build lockd.so shared module meson: src: build sanlock.so shared module meson: src: build libvirt_storage_driver.so shared module meson: src: build libvirt_storage_backedn_fs.so shared module meson: src: build libvirt_storage_file_fs.so shared module meson: src: build libvirt_storage_backend_logical.so shared module meson: src: build libvirt_storage_backend_iscsi.so shared module meson: src: build libvirt_storage_backend_iscsi_direct.so shared module meson: src: build libvirt_storage_backend_scsi.so shared module meson: src: build libvirt_storage_backend_mpath.so shared module meson: src: build libvirt_storage_backend_disk.so shared module meson: src: build libvirt_storage_backend_rbd.so shared module meson: src: build libvirt_storage_backend_sheepdog.so shared module meson: src: build libvirt_storage_*_gluster.so shared modules meson: src: build libvirt_storage_backend_zfs.so shared module meson: src: build libvirt_storage_backend_vstorage.so shared module meson: src: prepare sources for libvirt daemons meson: src: add support for building daemon binaries meson: src: build virtbhyved daemon binary meson: src: build virtinterfaced daemon binary meson: src: build virtxend daemon binary meson: src: build virtlockd daemon binary meson: src: build virtlogd daemon binary meson: src: build virtlxcd daemon binary meson: src: build virtnetworkd daemon binary meson: src: build virtnodedevd daemon binary meson: src: build virtnwfilterd daemon binary meson: src: build virtqemud daemon binary meson: src: build libvirtd daemon binary meson: src: build virtproxyd daemon binary meson: src: build virtsecretd daemon binary meson: src: build virtstoraged daemon binary meson: src: build virtvboxd daemon binary meson: src: build virtvzd daemon binary meson: src: add support for building helpers meson: src: build libvirt_sanlock_helper binary meson: src: build libvirt_lxc binary meson: src: build libvirt_leaseshelper binary meson: src: build virt-qemu-run binary meson: src: build virt-aa-helper binary meson: src: build libvirt_parthelper binary meson: src: build libvirt_iohelper binary meson: src: add support for installing libvirt conf and augeas files meson: src: install libvirt daemon conf and augeas files meson: src: generate libvirt daemon augeas test files meson: src: generate libvirt daemon conf and augeas files meson: src: generate systemd unit files for libvirt daemons meson: src: generate openrc init files meson: src: install libvirt daemon sysconf files meson: src: install empty directories meson: src: generate logrotate files meson: src/access: generate org.libvirt.api.policy meson: src/access: generate libvirt_access*.xml files meson: src/network: install default network xml meson: src/network: install firewalld zone file meson: src/nwfilter: install nwfilter XML files meson: src/remote: install libvirt sysctl config file meson: src/remote: install polkit files meson: src/remote: install libvirtd sasl file meson: src/security: install apparmor profile files meson: src: add check-symfile test meson: src: add check-symsorting meson: src: add check-drivername test meson: src: add check-driverimpls test meson: src: add check-aclrules test meson: src/access: add check-aclperms test meson: src: add check-augeas test meson: src: build libvirt_functions.stp meson: src: add check*protocol tests meson: src: add check-admin-symfile test meson: src: add check-admin-symsorting test meson: src: add check-admin-drivername test meson: src: configure pkg-config files used by run script meson: add tools directory meson: tools: build libvirt_shell.a static library meson: tools: build virt-host-validate binary meson: tools: build virt-login-shell binary meson: tools: build virt-login-shell-helper binary meson: tools: build virsh_win_icon object file meson: tools: build virsh binary meson: tools: build virt-admin binary meson: tools: generate virt-xml-validate script meson: tools: generate virt-pki-validate script meson: tools: generate virt-sanlock-cleanup script meson: tools: generate libvirt-guests.sh script meson: tools: install virt-login-shell.conf meson: tools: install libvirt-guests sysconf file meson: tools: generate libvirt-guests.service systemd unit meson: tools: install bash-completion files meson: tools: introduce nss directory meson: tools: build libnss_libvirt_impl.a static library meson: tools: build libnss_libvirt_guest_impl.a static library meson: tools: build libnss_libvirt.so shared library meson: tools: build libnss_libvirt_guest.so shared_library meson: tools: introduce wireshark directory meson: tools: modify genxdrstub to work with meson meson: tools/wireshark: generate protocol header files meson: tools/wireshark: build libvirt.so wireshark module meson: introduce tests directory meson: tests: build mock shared modules meson: tests: built utils static libraries meson: tests: build commandhelper binary meson: tests: build fake ssh binary meson: tests: add test environment variables meson: tests: build shared libraries meson: tests: add test binaries build support meson: tests: introduce generic tests meson: tests: add linux specific tests meson: tests: add bhyve specific tests meson: tests: add dbus specific tests meson: tests: add ESX specific tests meson: tests: add libvirtd specific tests meson: tests: add libxl specific tests meson: tests: add lxc specific tests meson: tests: add network specific tests meson: tests: add node device specific tests meson: tests: add nss specific tests meson: tests: add nwfilter specific tests meson: tests: add openvz specific tests meson: tests: add qemu specific tests meson: tests: add remote specific tests meson: tests: add selinux specific tests meson: tests: add storage specific tests meson: tests: add storage_fs specific tests meson: tests: add storage_sheepdog specific tests meson: tests: add vbox specific tests meson: tests: add vmware specific tests meson: tests: add vmx specific tests meson: tests: add yajl specific tests meson: tests: add helper binaries build support meson: tests: build helper binaries meson: tests: add test scripts meson: tests: add file access test setup meson: tests: add valgrind test setup meson: examples: build and install example files meson: po: introduce libvirt translation meson: docs: introduce docs directory meson: docs: build api XML files meson: docs: generate docs timestamp meson: docs: generate aclperms.htmlinc meson: docs: introduce docs_rst2html_gen generator meson: docs: introduce meson-html-gen.py helper meson: docs: introduce XSL files meson: docs: build *.html files from *.html.in files meson: docs: build *.html files from *.rst files meson: docs: build hvsupport.html meson: docs: build news.html from news.xml meson: docs: copy asset data to build dir meson: docs/fonts: install font files meson: docs/html: generate libvirt API documentation meson: docs/html: generate admin,lxc and qemu API documentation meson: docs/internals: build html files meson: docs/js: install javascript files meson: docs/kbase: build html files meson: docs/logos: install logo files meson: docs/manpages: install man pages meson: docs/schemas: install RNG schemas meson: docs/html: add html test meson: install pkgconfig files meson: generate and distribute spec files and AUTHORS meson: generate run helper meson: generate developer tooling files meson: add syntax-check meson: update spec file to use meson meson: add rule to build and install only web documentation meson: drop remaining bits from Makefile.am meson: remove unused bits from GNUmakefile meson: drop all unused bits from configure.ac meson: now we can drop all autoconf related gitignore lines meson: adjust our documentation to mention meson instead of autoconf meson: update .gitlab-ci.yml file meson: .gitlab-ci.yml: switch armv7l build to Debian 10
.gitignore | 21 - .gitlab-ci.yml | 71 +- CONTRIBUTING.rst | 9 +- GNUmakefile | 74 - Makefile.am | 180 -- autogen.sh | 53 - build-aux/Makefile.in | 9 + .../Makefile.nonreentrant | 0 build-aux/meson.build | 30 + build-aux/syntax-check.mk | 120 +- ci/aarch64-linux-gnu.meson | 11 + ci/arm-linux-gnueabi.meson | 11 + ci/arm-linux-gnueabihf.meson | 11 + ci/cirrus/build.yml | 12 +- ci/cirrus/libvirt-freebsd-12.vars | 4 +- ci/cirrus/libvirt-macos-1015.vars | 4 +- ci/containers/libvirt-centos-7.Dockerfile | 2 +- ci/containers/libvirt-centos-8.Dockerfile | 4 +- .../libvirt-centos-stream.Dockerfile | 4 +- ...libvirt-debian-10-cross-aarch64.Dockerfile | 5 +- .../libvirt-debian-10-cross-armv6l.Dockerfile | 6 +- .../libvirt-debian-10-cross-armv7l.Dockerfile | 6 +- .../libvirt-debian-10-cross-i686.Dockerfile | 5 +- .../libvirt-debian-10-cross-mips.Dockerfile | 5 +- ...ibvirt-debian-10-cross-mips64el.Dockerfile | 5 +- .../libvirt-debian-10-cross-mipsel.Dockerfile | 5 +- ...libvirt-debian-10-cross-ppc64le.Dockerfile | 5 +- .../libvirt-debian-10-cross-s390x.Dockerfile | 5 +- ci/containers/libvirt-debian-10.Dockerfile | 4 +- ...ibvirt-debian-sid-cross-aarch64.Dockerfile | 5 +- ...libvirt-debian-sid-cross-armv6l.Dockerfile | 6 +- ...libvirt-debian-sid-cross-armv7l.Dockerfile | 6 +- .../libvirt-debian-sid-cross-i686.Dockerfile | 5 +- ...bvirt-debian-sid-cross-mips64el.Dockerfile | 5 +- ...libvirt-debian-sid-cross-mipsel.Dockerfile | 6 +- ...ibvirt-debian-sid-cross-ppc64le.Dockerfile | 5 +- .../libvirt-debian-sid-cross-s390x.Dockerfile | 5 +- ci/containers/libvirt-debian-sid.Dockerfile | 4 +- ci/containers/libvirt-fedora-31.Dockerfile | 4 +- ci/containers/libvirt-fedora-32.Dockerfile | 4 +- ...rt-fedora-rawhide-cross-mingw32.Dockerfile | 4 +- ...rt-fedora-rawhide-cross-mingw64.Dockerfile | 4 +- .../libvirt-fedora-rawhide.Dockerfile | 4 +- ci/containers/libvirt-opensuse-151.Dockerfile | 2 +- ci/containers/libvirt-ubuntu-1804.Dockerfile | 2 +- ci/containers/libvirt-ubuntu-2004.Dockerfile | 4 +- ci/i686-linux-gnu.meson | 11 + ci/mips-linux-gnu.meson | 11 + ci/mips64el-linux-gnuabi64.meson | 11 + ci/mipsel-linux-gnu.meson | 11 + ci/powerpc64le-linux-gnu.meson | 11 + ci/s390x-linux-gnu.meson | 11 + config-post.h => config.h | 25 +- configmake.h.in | 16 + configure.ac | 1063 ------- docs/Makefile.am | 522 ---- docs/advanced-tests.rst | 14 +- docs/best-practices.rst | 2 +- docs/committer-guidelines.rst | 6 +- docs/compiling.html.in | 40 +- docs/fonts/meson.build | 24 + docs/hacking.rst | 4 +- docs/html/meson.build | 101 + docs/internals/meson.build | 35 + docs/js/meson.build | 13 + docs/kbase/meson.build | 44 + docs/logging.html.in | 2 +- docs/logos/meson.build | 31 + docs/manpages/{index.rst => index.rst.in} | 0 .../{libvirtd.rst => libvirtd.rst.in} | 0 docs/manpages/meson.build | 129 + docs/manpages/{virsh.rst => virsh.rst.in} | 0 .../{virt-admin.rst => virt-admin.rst.in} | 0 ...validate.rst => virt-host-validate.rst.in} | 0 ...ogin-shell.rst => virt-login-shell.rst.in} | 0 ...-validate.rst => virt-pki-validate.rst.in} | 0 ...virt-qemu-run.rst => virt-qemu-run.rst.in} | 0 ...leanup.rst => virt-sanlock-cleanup.rst.in} | 0 ...-validate.rst => virt-xml-validate.rst.in} | 0 .../{virtlockd.rst => virtlockd.rst.in} | 0 .../{virtlogd.rst => virtlogd.rst.in} | 0 docs/meson.build | 319 +++ docs/schemas/meson.build | 26 + docs/strategy.html.in | 27 +- docs/windows.html.in | 18 +- examples/Makefile.am | 135 - examples/c/admin/meson.build | 27 + examples/c/domain/meson.build | 24 + examples/c/meson.build | 3 + examples/c/misc/meson.build | 22 + examples/meson.build | 7 + examples/polkit/meson.build | 1 + examples/sh/meson.build | 1 + examples/systemtap/lock-debug.stp | 2 +- examples/systemtap/meson.build | 9 + examples/xml/meson.build | 2 + examples/xml/storage/meson.build | 15 + examples/xml/test/meson.build | 14 + include/libvirt/Makefile.am | 28 - include/libvirt/meson.build | 36 + include/meson.build | 3 + libvirt.spec.in | 203 +- m4/virt-acl.m4 | 37 - m4/virt-apparmor.m4 | 41 - m4/virt-arg.m4 | 154 -- m4/virt-attr.m4 | 13 - m4/virt-audit.m4 | 31 - m4/virt-bash-completion.m4 | 70 - m4/virt-blkid.m4 | 30 - m4/virt-capng.m4 | 30 - m4/virt-chrdev-lock-files.m4 | 52 - m4/virt-compile-pie.m4 | 35 - m4/virt-compile-warnings.m4 | 255 -- m4/virt-curl.m4 | 38 - m4/virt-dbus.m4 | 41 - m4/virt-debug.m4 | 33 - m4/virt-default-editor.m4 | 32 - m4/virt-devmapper.m4 | 32 - m4/virt-dlopen.m4 | 45 - m4/virt-driver-bhyve.m4 | 56 - m4/virt-driver-esx.m4 | 57 - m4/virt-driver-hyperv.m4 | 47 - m4/virt-driver-interface.m4 | 49 - m4/virt-driver-libvirtd.m4 | 33 - m4/virt-driver-libxl.m4 | 74 - m4/virt-driver-lxc.m4 | 74 - m4/virt-driver-modules.m4 | 53 - m4/virt-driver-network.m4 | 51 - m4/virt-driver-openvz.m4 | 42 - m4/virt-driver-qemu.m4 | 132 - m4/virt-driver-remote.m4 | 48 - m4/virt-driver-test.m4 | 33 - m4/virt-driver-vbox.m4 | 44 - m4/virt-driver-vmware.m4 | 33 - m4/virt-driver-vz.m4 | 47 - m4/virt-dtrace.m4 | 45 - m4/virt-external-programs.m4 | 106 - m4/virt-firewalld-zone.m4 | 45 - m4/virt-firewalld.m4 | 43 - m4/virt-fuse.m4 | 30 - m4/virt-glib.m4 | 36 - m4/virt-gluster.m4 | 32 - m4/virt-gnutls.m4 | 30 - m4/virt-hal.m4 | 30 - m4/virt-host-validate.m4 | 43 - m4/virt-init-script.m4 | 61 - m4/virt-lib.m4 | 386 --- m4/virt-libiscsi.m4 | 30 - m4/virt-libnl.m4 | 47 - m4/virt-libpcap.m4 | 62 - m4/virt-libssh.m4 | 51 - m4/virt-libxml.m4 | 36 - m4/virt-linker-no-indirect.m4 | 32 - m4/virt-linker-no-undefined.m4 | 32 - m4/virt-linker-relro.m4 | 35 - m4/virt-loader-nvram.m4 | 49 - m4/virt-login-shell.m4 | 43 - m4/virt-macvtap.m4 | 56 - m4/virt-manywarnings.m4 | 339 --- m4/virt-netcf.m4 | 30 - m4/virt-nls.m4 | 72 - m4/virt-nss.m4 | 86 - m4/virt-numactl.m4 | 34 - m4/virt-numad.m4 | 58 - m4/virt-nwfilter.m4 | 32 - m4/virt-openwsman.m4 | 30 - m4/virt-parted.m4 | 38 - m4/virt-pciaccess.m4 | 30 - m4/virt-pm-utils.m4 | 45 - m4/virt-polkit.m4 | 62 - m4/virt-pthread.m4 | 58 - m4/virt-readline.m4 | 86 - m4/virt-result.m4 | 42 - m4/virt-sanlock.m4 | 47 - m4/virt-sasl.m4 | 30 - m4/virt-secdriver-apparmor.m4 | 50 - m4/virt-secdriver-selinux.m4 | 43 - m4/virt-selinux.m4 | 47 - m4/virt-ssh2.m4 | 30 - m4/virt-storage-dir.m4 | 33 - m4/virt-storage-disk.m4 | 58 - m4/virt-storage-fs.m4 | 89 - m4/virt-storage-gluster.m4 | 43 - m4/virt-storage-iscsi-direct.m4 | 44 - m4/virt-storage-iscsi.m4 | 50 - m4/virt-storage-lvm.m4 | 90 - m4/virt-storage-mpath.m4 | 53 - m4/virt-storage-rbd.m4 | 62 - m4/virt-storage-scsi.m4 | 36 - m4/virt-storage-sheepdog.m4 | 56 - m4/virt-storage-vstorage.m4 | 73 - m4/virt-storage-zfs.m4 | 56 - m4/virt-sysctl.m4 | 43 - m4/virt-tls-priority.m4 | 33 - m4/virt-udev.m4 | 36 - m4/virt-virtualport.m4 | 65 - m4/virt-warnings.m4 | 115 - m4/virt-win-common.m4 | 42 - m4/virt-win-mingw.m4 | 28 - m4/virt-win-symbols.m4 | 40 - m4/virt-win-windres.m4 | 36 - m4/virt-wireshark.m4 | 71 - m4/virt-xdr.m4 | 40 - m4/virt-yajl.m4 | 42 - meson.build | 2461 +++++++++++++++++ meson_options.txt | 104 + po/Makefile.am | 94 - po/meson.build | 35 + run.in | 4 +- scripts/apibuild.py | 26 +- scripts/check-augeas.sh | 12 + scripts/check-file-access.py | 24 +- scripts/check-remote-protocol.py | 75 +- scripts/gen-def-files.sh | 5 + scripts/gen-sym-files.sh | 15 + scripts/install-dirs.sh | 5 + scripts/install-symlink.sh | 7 + scripts/meson-change-perms.sh | 6 + scripts/meson-dist.sh | 6 + scripts/meson-gen-authors.sh | 4 + scripts/meson-html-gen.py | 49 + scripts/meson-install-web.py | 10 + scripts/meson-python.sh | 3 + scripts/meson-timestamp.sh | 8 + scripts/meson.build | 40 + src/Makefile.am | 693 ----- src/access/Makefile.inc.am | 153 - src/access/meson.build | 121 + src/admin/Makefile.inc.am | 146 - src/admin/meson.build | 114 + src/bhyve/Makefile.inc.am | 106 - src/bhyve/meson.build | 62 + src/conf/Makefile.inc.am | 191 -- src/conf/meson.build | 110 + src/cpu/Makefile.inc.am | 27 - src/cpu/meson.build | 21 + src/cpu_map/Makefile.inc.am | 80 - src/cpu_map/meson.build | 75 + src/driver.c | 2 +- src/esx/Makefile.inc.am | 91 - src/esx/meson.build | 67 + src/hyperv/Makefile.inc.am | 59 - src/hyperv/meson.build | 43 + src/hypervisor/Makefile.inc.am | 20 - src/hypervisor/meson.build | 23 + src/interface/Makefile.inc.am | 125 - src/interface/meson.build | 64 + src/libvirt-lxc.pc.in | 2 +- src/libvirt-qemu.pc.in | 2 +- src/libvirt.pc.in | 2 +- src/libxl/Makefile.inc.am | 163 -- src/libxl/meson.build | 89 + src/locking/Makefile.inc.am | 298 -- src/locking/lock_manager.c | 2 +- src/locking/meson.build | 249 ++ src/logging/Makefile.inc.am | 147 - src/logging/meson.build | 100 + src/lxc/Makefile.inc.am | 293 -- src/lxc/meson.build | 190 ++ src/meson.build | 969 +++++++ src/network/Makefile.inc.am | 197 -- src/network/{default.xml => default.xml.in} | 0 src/network/meson.build | 129 + src/node_device/Makefile.inc.am | 151 - src/node_device/meson.build | 77 + src/nwfilter/Makefile.inc.am | 134 - src/nwfilter/meson.build | 73 + src/nwfilter/xml/meson.build | 22 + src/openvz/Makefile.inc.am | 30 - src/openvz/meson.build | 28 + src/qemu/Makefile.inc.am | 268 -- src/{ => qemu}/libvirt_qemu_probes.d | 0 src/qemu/meson.build | 173 ++ src/remote/Makefile.inc.am | 490 ---- src/remote/meson.build | 288 ++ ...n.target.in => virt-guest-shutdown.target} | 0 src/rpc/Makefile.inc.am | 144 - src/rpc/meson.build | 136 + src/secret/Makefile.inc.am | 110 - src/secret/meson.build | 53 + src/security/Makefile.inc.am | 142 - src/security/apparmor/meson.build | 38 + .../usr.lib.libvirt.virt-aa-helper.local | 1 + src/security/meson.build | 57 + src/storage/Makefile.inc.am | 476 ---- src/storage/meson.build | 306 ++ src/storage/storage_backend.c | 2 +- src/test/Makefile.inc.am | 28 - src/test/meson.build | 26 + src/util/Makefile.inc.am | 318 --- src/util/meson.build | 212 ++ src/util/virfile.c | 34 +- src/util/virstoragefilebackend.c | 2 +- src/vbox/Makefile.inc.am | 138 - src/vbox/meson.build | 78 + src/vmware/Makefile.inc.am | 29 - src/vmware/meson.build | 26 + src/vmx/Makefile.inc.am | 24 - src/vmx/meson.build | 28 + src/vz/Makefile.inc.am | 117 - src/vz/meson.build | 68 + tests/Makefile.am | 1571 ----------- tests/meson.build | 686 +++++ tests/securityselinuxlabeltest.c | 2 +- tests/securityselinuxtest.c | 2 +- tests/shunloadtest.c | 4 +- tests/testutils.c | 2 +- tests/testutils.h | 2 +- tests/viridentitytest.c | 2 +- tests/virsh-optparse | 58 +- tests/virsh-schedinfo | 12 +- tests/virt-aa-helper-test | 2 +- tests/virtestmock.c | 2 +- tools/Makefile.am | 529 ---- tools/bash-completion/meson.build | 13 + tools/meson.build | 292 ++ tools/nss/meson.build | 92 + tools/wireshark/meson.build | 3 + tools/wireshark/src/libvirt/meson.build | 20 + tools/wireshark/src/meson.build | 17 + tools/wireshark/util/genxdrstub.pl | 9 +- 321 files changed, 9526 insertions(+), 15979 deletions(-) delete mode 100644 GNUmakefile delete mode 100644 Makefile.am delete mode 100755 autogen.sh create mode 100644 build-aux/Makefile.in rename Makefile.nonreentrant => build-aux/Makefile.nonreentrant (100%) create mode 100644 build-aux/meson.build create mode 100644 ci/aarch64-linux-gnu.meson create mode 100644 ci/arm-linux-gnueabi.meson create mode 100644 ci/arm-linux-gnueabihf.meson create mode 100644 ci/i686-linux-gnu.meson create mode 100644 ci/mips-linux-gnu.meson create mode 100644 ci/mips64el-linux-gnuabi64.meson create mode 100644 ci/mipsel-linux-gnu.meson create mode 100644 ci/powerpc64le-linux-gnu.meson create mode 100644 ci/s390x-linux-gnu.meson rename config-post.h => config.h (65%) create mode 100644 configmake.h.in delete mode 100644 configure.ac delete mode 100644 docs/Makefile.am create mode 100644 docs/fonts/meson.build create mode 100644 docs/html/meson.build create mode 100644 docs/internals/meson.build create mode 100644 docs/js/meson.build create mode 100644 docs/kbase/meson.build create mode 100644 docs/logos/meson.build rename docs/manpages/{index.rst => index.rst.in} (100%) rename docs/manpages/{libvirtd.rst => libvirtd.rst.in} (100%) create mode 100644 docs/manpages/meson.build rename docs/manpages/{virsh.rst => virsh.rst.in} (100%) rename docs/manpages/{virt-admin.rst => virt-admin.rst.in} (100%) rename docs/manpages/{virt-host-validate.rst => virt-host-validate.rst.in} (100%) rename docs/manpages/{virt-login-shell.rst => virt-login-shell.rst.in} (100%) rename docs/manpages/{virt-pki-validate.rst => virt-pki-validate.rst.in} (100%) rename docs/manpages/{virt-qemu-run.rst => virt-qemu-run.rst.in} (100%) rename docs/manpages/{virt-sanlock-cleanup.rst => virt-sanlock-cleanup.rst.in} (100%) rename docs/manpages/{virt-xml-validate.rst => virt-xml-validate.rst.in} (100%) rename docs/manpages/{virtlockd.rst => virtlockd.rst.in} (100%) rename docs/manpages/{virtlogd.rst => virtlogd.rst.in} (100%) create mode 100644 docs/meson.build create mode 100644 docs/schemas/meson.build delete mode 100644 examples/Makefile.am create mode 100644 examples/c/admin/meson.build create mode 100644 examples/c/domain/meson.build create mode 100644 examples/c/meson.build create mode 100644 examples/c/misc/meson.build create mode 100644 examples/meson.build create mode 100644 examples/polkit/meson.build create mode 100644 examples/sh/meson.build create mode 100644 examples/systemtap/meson.build create mode 100644 examples/xml/meson.build create mode 100644 examples/xml/storage/meson.build create mode 100644 examples/xml/test/meson.build delete mode 100644 include/libvirt/Makefile.am create mode 100644 include/libvirt/meson.build create mode 100644 include/meson.build delete mode 100644 m4/virt-acl.m4 delete mode 100644 m4/virt-apparmor.m4 delete mode 100644 m4/virt-arg.m4 delete mode 100644 m4/virt-attr.m4 delete mode 100644 m4/virt-audit.m4 delete mode 100644 m4/virt-bash-completion.m4 delete mode 100644 m4/virt-blkid.m4 delete mode 100644 m4/virt-capng.m4 delete mode 100644 m4/virt-chrdev-lock-files.m4 delete mode 100644 m4/virt-compile-pie.m4 delete mode 100644 m4/virt-compile-warnings.m4 delete mode 100644 m4/virt-curl.m4 delete mode 100644 m4/virt-dbus.m4 delete mode 100644 m4/virt-debug.m4 delete mode 100644 m4/virt-default-editor.m4 delete mode 100644 m4/virt-devmapper.m4 delete mode 100644 m4/virt-dlopen.m4 delete mode 100644 m4/virt-driver-bhyve.m4 delete mode 100644 m4/virt-driver-esx.m4 delete mode 100644 m4/virt-driver-hyperv.m4 delete mode 100644 m4/virt-driver-interface.m4 delete mode 100644 m4/virt-driver-libvirtd.m4 delete mode 100644 m4/virt-driver-libxl.m4 delete mode 100644 m4/virt-driver-lxc.m4 delete mode 100644 m4/virt-driver-modules.m4 delete mode 100644 m4/virt-driver-network.m4 delete mode 100644 m4/virt-driver-openvz.m4 delete mode 100644 m4/virt-driver-qemu.m4 delete mode 100644 m4/virt-driver-remote.m4 delete mode 100644 m4/virt-driver-test.m4 delete mode 100644 m4/virt-driver-vbox.m4 delete mode 100644 m4/virt-driver-vmware.m4 delete mode 100644 m4/virt-driver-vz.m4 delete mode 100644 m4/virt-dtrace.m4 delete mode 100644 m4/virt-external-programs.m4 delete mode 100644 m4/virt-firewalld-zone.m4 delete mode 100644 m4/virt-firewalld.m4 delete mode 100644 m4/virt-fuse.m4 delete mode 100644 m4/virt-glib.m4 delete mode 100644 m4/virt-gluster.m4 delete mode 100644 m4/virt-gnutls.m4 delete mode 100644 m4/virt-hal.m4 delete mode 100644 m4/virt-host-validate.m4 delete mode 100644 m4/virt-init-script.m4 delete mode 100644 m4/virt-lib.m4 delete mode 100644 m4/virt-libiscsi.m4 delete mode 100644 m4/virt-libnl.m4 delete mode 100644 m4/virt-libpcap.m4 delete mode 100644 m4/virt-libssh.m4 delete mode 100644 m4/virt-libxml.m4 delete mode 100644 m4/virt-linker-no-indirect.m4 delete mode 100644 m4/virt-linker-no-undefined.m4 delete mode 100644 m4/virt-linker-relro.m4 delete mode 100644 m4/virt-loader-nvram.m4 delete mode 100644 m4/virt-login-shell.m4 delete mode 100644 m4/virt-macvtap.m4 delete mode 100644 m4/virt-manywarnings.m4 delete mode 100644 m4/virt-netcf.m4 delete mode 100644 m4/virt-nls.m4 delete mode 100644 m4/virt-nss.m4 delete mode 100644 m4/virt-numactl.m4 delete mode 100644 m4/virt-numad.m4 delete mode 100644 m4/virt-nwfilter.m4 delete mode 100644 m4/virt-openwsman.m4 delete mode 100644 m4/virt-parted.m4 delete mode 100644 m4/virt-pciaccess.m4 delete mode 100644 m4/virt-pm-utils.m4 delete mode 100644 m4/virt-polkit.m4 delete mode 100644 m4/virt-pthread.m4 delete mode 100644 m4/virt-readline.m4 delete mode 100644 m4/virt-result.m4 delete mode 100644 m4/virt-sanlock.m4 delete mode 100644 m4/virt-sasl.m4 delete mode 100644 m4/virt-secdriver-apparmor.m4 delete mode 100644 m4/virt-secdriver-selinux.m4 delete mode 100644 m4/virt-selinux.m4 delete mode 100644 m4/virt-ssh2.m4 delete mode 100644 m4/virt-storage-dir.m4 delete mode 100644 m4/virt-storage-disk.m4 delete mode 100644 m4/virt-storage-fs.m4 delete mode 100644 m4/virt-storage-gluster.m4 delete mode 100644 m4/virt-storage-iscsi-direct.m4 delete mode 100644 m4/virt-storage-iscsi.m4 delete mode 100644 m4/virt-storage-lvm.m4 delete mode 100644 m4/virt-storage-mpath.m4 delete mode 100644 m4/virt-storage-rbd.m4 delete mode 100644 m4/virt-storage-scsi.m4 delete mode 100644 m4/virt-storage-sheepdog.m4 delete mode 100644 m4/virt-storage-vstorage.m4 delete mode 100644 m4/virt-storage-zfs.m4 delete mode 100644 m4/virt-sysctl.m4 delete mode 100644 m4/virt-tls-priority.m4 delete mode 100644 m4/virt-udev.m4 delete mode 100644 m4/virt-virtualport.m4 delete mode 100644 m4/virt-warnings.m4 delete mode 100644 m4/virt-win-common.m4 delete mode 100644 m4/virt-win-mingw.m4 delete mode 100644 m4/virt-win-symbols.m4 delete mode 100644 m4/virt-win-windres.m4 delete mode 100644 m4/virt-wireshark.m4 delete mode 100644 m4/virt-xdr.m4 delete mode 100644 m4/virt-yajl.m4 create mode 100644 meson.build create mode 100644 meson_options.txt delete mode 100644 po/Makefile.am create mode 100644 po/meson.build create mode 100644 scripts/check-augeas.sh create mode 100755 scripts/gen-def-files.sh create mode 100755 scripts/gen-sym-files.sh create mode 100644 scripts/install-dirs.sh create mode 100644 scripts/install-symlink.sh create mode 100644 scripts/meson-change-perms.sh create mode 100755 scripts/meson-dist.sh create mode 100755 scripts/meson-gen-authors.sh create mode 100755 scripts/meson-html-gen.py create mode 100755 scripts/meson-install-web.py create mode 100755 scripts/meson-python.sh create mode 100755 scripts/meson-timestamp.sh create mode 100644 scripts/meson.build delete mode 100644 src/Makefile.am delete mode 100644 src/access/Makefile.inc.am create mode 100644 src/access/meson.build delete mode 100644 src/admin/Makefile.inc.am create mode 100644 src/admin/meson.build delete mode 100644 src/bhyve/Makefile.inc.am create mode 100644 src/bhyve/meson.build delete mode 100644 src/conf/Makefile.inc.am create mode 100644 src/conf/meson.build delete mode 100644 src/cpu/Makefile.inc.am create mode 100644 src/cpu/meson.build delete mode 100644 src/cpu_map/Makefile.inc.am create mode 100644 src/cpu_map/meson.build delete mode 100644 src/esx/Makefile.inc.am create mode 100644 src/esx/meson.build delete mode 100644 src/hyperv/Makefile.inc.am create mode 100644 src/hyperv/meson.build delete mode 100644 src/hypervisor/Makefile.inc.am create mode 100644 src/hypervisor/meson.build delete mode 100644 src/interface/Makefile.inc.am create mode 100644 src/interface/meson.build delete mode 100644 src/libxl/Makefile.inc.am create mode 100644 src/libxl/meson.build delete mode 100644 src/locking/Makefile.inc.am create mode 100644 src/locking/meson.build delete mode 100644 src/logging/Makefile.inc.am create mode 100644 src/logging/meson.build delete mode 100644 src/lxc/Makefile.inc.am create mode 100644 src/lxc/meson.build create mode 100644 src/meson.build delete mode 100644 src/network/Makefile.inc.am rename src/network/{default.xml => default.xml.in} (100%) create mode 100644 src/network/meson.build delete mode 100644 src/node_device/Makefile.inc.am create mode 100644 src/node_device/meson.build delete mode 100644 src/nwfilter/Makefile.inc.am create mode 100644 src/nwfilter/meson.build create mode 100644 src/nwfilter/xml/meson.build delete mode 100644 src/openvz/Makefile.inc.am create mode 100644 src/openvz/meson.build delete mode 100644 src/qemu/Makefile.inc.am rename src/{ => qemu}/libvirt_qemu_probes.d (100%) create mode 100644 src/qemu/meson.build delete mode 100644 src/remote/Makefile.inc.am create mode 100644 src/remote/meson.build rename src/remote/{virt-guest-shutdown.target.in => virt-guest-shutdown.target} (100%) delete mode 100644 src/rpc/Makefile.inc.am create mode 100644 src/rpc/meson.build delete mode 100644 src/secret/Makefile.inc.am create mode 100644 src/secret/meson.build delete mode 100644 src/security/Makefile.inc.am create mode 100644 src/security/apparmor/meson.build create mode 100644 src/security/apparmor/usr.lib.libvirt.virt-aa-helper.local create mode 100644 src/security/meson.build delete mode 100644 src/storage/Makefile.inc.am create mode 100644 src/storage/meson.build delete mode 100644 src/test/Makefile.inc.am create mode 100644 src/test/meson.build delete mode 100644 src/util/Makefile.inc.am create mode 100644 src/util/meson.build delete mode 100644 src/vbox/Makefile.inc.am create mode 100644 src/vbox/meson.build delete mode 100644 src/vmware/Makefile.inc.am create mode 100644 src/vmware/meson.build delete mode 100644 src/vmx/Makefile.inc.am create mode 100644 src/vmx/meson.build delete mode 100644 src/vz/Makefile.inc.am create mode 100644 src/vz/meson.build delete mode 100644 tests/Makefile.am create mode 100644 tests/meson.build delete mode 100644 tools/Makefile.am create mode 100644 tools/bash-completion/meson.build create mode 100644 tools/meson.build create mode 100644 tools/nss/meson.build create mode 100644 tools/wireshark/meson.build create mode 100644 tools/wireshark/src/libvirt/meson.build create mode 100644 tools/wireshark/src/meson.build
-- 2.26.2
Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Thu, Jul 16, 2020 at 01:59:00PM +0100, Daniel P. Berrangé wrote:
On Thu, Jul 16, 2020 at 11:53:56AM +0200, Pavel Hrdina wrote:
So I was finally able to produce the patches to port libvirt to Meson. Obviously, it is a lot of changes. It might look that some of the patches could be squashed together but I would rather have it as separated as possible to make the review not that difficult.
Once we are done with review I suggest to squash all patches to single patch as it doesn't make sense to keep them separated as it will not be possible to build complete libvirt code by any of the build systems. Trying to achieve that would be even more challenging and the review would me more difficult.
The reasoning behind taking this approach is to have 1:1 conversion from autotools to Meson where each patch removes that part from autotools. It serves as a check that nothing is skipped and to make sure that the conversion is complete.
Can you clarify a bit more what the expected behaviour is for the intermediate patches in the series ? eg if I was to "git bisect" across this series, how much will work vs break ? I'm not fussed if stuff like "make dist" breaks, but does the basic "make" and "make check" (or meson equivalent) work ? I'm also not fussed if the intermediate stages require running *both* make and meson as separate commands in order to full build.
The way how the patches are done will mean that autotools will not work or randomly fail and things like that. I was not basically paying any attention to not breaking autotools. Some of the bits removed from autotools throughout the series will definitely break even simple make invocation. Running both to fully build libvirt would be IMHO insane and complicated so I was not even considering that option. I tried it and the current state is that make will break with patch [PATCH 002/351] meson: remove automake specific directives it complains a lot about incompatible endif reminder where deleted the else branch of the if-else-endif structure. Invoking meson will work since patch: [PATCH 010/351] meson: introduce meson build files But it will not do any actual build until patch: [PATCH 129/351] meson: src: build dtrace files I also tried running git rebase with: --exec='git clean -dfx && meson build && ninja -C build' and discovered that I would have to move patch [PATCH 080/351] meson: add driver_remote build option before patch that requires 'driver_remote' option: [PATCH 058/351] meson: add libssh build dependency otherwise running meson between patches 58 and 80 will fail.
Personally I'd really like to avoid squashing them, because splitting up big patches is not merely to benefit the initial pre-merge review, but to also benefit people who need to debug stuff that's already merged and understand the scope of the intended change. So being able to look back at the changes in isolation after commit is still a big plus point.
I would like to avoid squashing the patches as well and in most cases I would object to it as well. I only suggested that to not break git bisect. If we don't care about git bisect and the fact that we would not be able to build libvirt correctly within these patches I'm OK with pushing it without squashing. Pavel

On Thu, Jul 16, 2020 at 03:44:25PM +0200, Pavel Hrdina wrote:
On Thu, Jul 16, 2020 at 01:59:00PM +0100, Daniel P. Berrangé wrote:
Personally I'd really like to avoid squashing them, because splitting up big patches is not merely to benefit the initial pre-merge review, but to also benefit people who need to debug stuff that's already merged and understand the scope of the intended change. So being able to look back at the changes in isolation after commit is still a big plus point.
I would like to avoid squashing the patches as well and in most cases I would object to it as well. I only suggested that to not break git bisect.
If we don't care about git bisect and the fact that we would not be able to build libvirt correctly within these patches I'm OK with pushing it without squashing.
git bisect reliabity is key, so I reluctantly think we'll need to squash. I don't want to hit a pathc in this series with a bisect and be unable to continue the bisect due to inability to build the code. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Fri, Jul 17, 2020 at 03:02:10PM +0100, Daniel P. Berrangé wrote:
On Thu, Jul 16, 2020 at 03:44:25PM +0200, Pavel Hrdina wrote:
On Thu, Jul 16, 2020 at 01:59:00PM +0100, Daniel P. Berrangé wrote:
Personally I'd really like to avoid squashing them, because splitting up big patches is not merely to benefit the initial pre-merge review, but to also benefit people who need to debug stuff that's already merged and understand the scope of the intended change. So being able to look back at the changes in isolation after commit is still a big plus point.
I would like to avoid squashing the patches as well and in most cases I would object to it as well. I only suggested that to not break git bisect.
If we don't care about git bisect and the fact that we would not be able to build libvirt correctly within these patches I'm OK with pushing it without squashing.
git bisect reliabity is key, so I reluctantly think we'll need to squash. I don't want to hit a pathc in this series with a bisect and be unable to continue the bisect due to inability to build the code.
I can try to rearrange the patches to not break git bisect. It will still require some script to be used for git bisect to detect if it should run autotools or Meson. Pavel

On Fri, Jul 17, 2020 at 04:10:01PM +0200, Pavel Hrdina wrote:
On Fri, Jul 17, 2020 at 03:02:10PM +0100, Daniel P. Berrangé wrote:
On Thu, Jul 16, 2020 at 03:44:25PM +0200, Pavel Hrdina wrote:
On Thu, Jul 16, 2020 at 01:59:00PM +0100, Daniel P. Berrangé wrote:
Personally I'd really like to avoid squashing them, because splitting up big patches is not merely to benefit the initial pre-merge review, but to also benefit people who need to debug stuff that's already merged and understand the scope of the intended change. So being able to look back at the changes in isolation after commit is still a big plus point.
I would like to avoid squashing the patches as well and in most cases I would object to it as well. I only suggested that to not break git bisect.
If we don't care about git bisect and the fact that we would not be able to build libvirt correctly within these patches I'm OK with pushing it without squashing.
git bisect reliabity is key, so I reluctantly think we'll need to squash. I don't want to hit a pathc in this series with a bisect and be unable to continue the bisect due to inability to build the code.
I can try to rearrange the patches to not break git bisect. It will still require some script to be used for git bisect to detect if it should run autotools or Meson.
Maybe there's a reasonable tradeoff - instead of a 350 patch series, just a 10-20 patch series. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Fri, Jul 17, 2020 at 03:12:00PM +0100, Daniel P. Berrangé wrote:
On Fri, Jul 17, 2020 at 04:10:01PM +0200, Pavel Hrdina wrote:
On Fri, Jul 17, 2020 at 03:02:10PM +0100, Daniel P. Berrangé wrote:
On Thu, Jul 16, 2020 at 03:44:25PM +0200, Pavel Hrdina wrote:
On Thu, Jul 16, 2020 at 01:59:00PM +0100, Daniel P. Berrangé wrote:
Personally I'd really like to avoid squashing them, because splitting up big patches is not merely to benefit the initial pre-merge review, but to also benefit people who need to debug stuff that's already merged and understand the scope of the intended change. So being able to look back at the changes in isolation after commit is still a big plus point.
I would like to avoid squashing the patches as well and in most cases I would object to it as well. I only suggested that to not break git bisect.
If we don't care about git bisect and the fact that we would not be able to build libvirt correctly within these patches I'm OK with pushing it without squashing.
git bisect reliabity is key, so I reluctantly think we'll need to squash. I don't want to hit a pathc in this series with a bisect and be unable to continue the bisect due to inability to build the code.
I can try to rearrange the patches to not break git bisect. It will still require some script to be used for git bisect to detect if it should run autotools or Meson.
Maybe there's a reasonable tradeoff - instead of a 350 patch series, just a 10-20 patch series.
One other option would be a semi-linear merge. bisect would try the commit before the rewrite and after, if both of them worked or both were broken then it will not try the commits in the middle. If it does, then you know it was because of the autotools=>meson rewrite. You will not break git-bisect and you'll keep the history of the commits.
Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Fri, Jul 17, 2020 at 07:27:50PM +0200, Martin Kletzander wrote:
On Fri, Jul 17, 2020 at 03:12:00PM +0100, Daniel P. Berrangé wrote:
On Fri, Jul 17, 2020 at 04:10:01PM +0200, Pavel Hrdina wrote:
On Fri, Jul 17, 2020 at 03:02:10PM +0100, Daniel P. Berrangé wrote:
On Thu, Jul 16, 2020 at 03:44:25PM +0200, Pavel Hrdina wrote:
On Thu, Jul 16, 2020 at 01:59:00PM +0100, Daniel P. Berrangé wrote:
Personally I'd really like to avoid squashing them, because splitting up big patches is not merely to benefit the initial pre-merge review, but to also benefit people who need to debug stuff that's already merged and understand the scope of the intended change. So being able to look back at the changes in isolation after commit is still a big plus point.
I would like to avoid squashing the patches as well and in most cases I would object to it as well. I only suggested that to not break git bisect.
If we don't care about git bisect and the fact that we would not be able to build libvirt correctly within these patches I'm OK with pushing it without squashing.
git bisect reliabity is key, so I reluctantly think we'll need to squash. I don't want to hit a pathc in this series with a bisect and be unable to continue the bisect due to inability to build the code.
I can try to rearrange the patches to not break git bisect. It will still require some script to be used for git bisect to detect if it should run autotools or Meson.
Maybe there's a reasonable tradeoff - instead of a 350 patch series, just a 10-20 patch series.
One other option would be a semi-linear merge. bisect would try the commit before the rewrite and after, if both of them worked or both were broken then it will not try the commits in the middle. If it does, then you know it was because of the autotools=>meson rewrite. You will not break git-bisect and you'll keep the history of the commits.
I'm not sure I follow exactly what you are saying here, so let me try to illustrate what I think you mean and you can correct me. Consider that - The current repo has commits A, B and C - The Meson series has commits R, S, T and U - After meson, we add commits H, I and J IIUC, by "semi-linear merge" you mean a graph that looks like this: A----B----C---------------------------H----I----J | | +-----R-----S----T-----U----+ Now we notice a regression at J and know the last good commit was B. IIUC you're saying that when "git bisect" runs it will stop on commits 'C' and 'H', and only bisect into R, S, T, & U, if the results of C & H show the problem is in the meson series. That would certainly be nice, but I can't find any documentation that clearly says this is what git bisect will do. The docs I see merely say that bisect will look for a commit half way between the current good & bad markers, but doesn't clarify what "half way" means when there are two possible paths to follow in the graph. You seem to be saying it will choose the shorter of the two paths, but I don't see that mentioned anywhere. I could easily see it deciding the "S" was the first half-way points to try, not C or H. If someone can point me to credible docs explaining what git does wrt merges I'd be interested if I'm right or wrong. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Tue, Jul 28, 2020 at 10:46:07AM +0100, Daniel P. Berrangé wrote:
On Fri, Jul 17, 2020 at 07:27:50PM +0200, Martin Kletzander wrote:
On Fri, Jul 17, 2020 at 03:12:00PM +0100, Daniel P. Berrangé wrote:
On Fri, Jul 17, 2020 at 04:10:01PM +0200, Pavel Hrdina wrote:
On Fri, Jul 17, 2020 at 03:02:10PM +0100, Daniel P. Berrangé wrote:
On Thu, Jul 16, 2020 at 03:44:25PM +0200, Pavel Hrdina wrote:
On Thu, Jul 16, 2020 at 01:59:00PM +0100, Daniel P. Berrangé wrote: > Personally I'd really like to avoid squashing them, because splitting > up big patches is not merely to benefit the initial pre-merge review, > but to also benefit people who need to debug stuff that's already > merged and understand the scope of the intended change. So being able > to look back at the changes in isolation after commit is still a big > plus point.
I would like to avoid squashing the patches as well and in most cases I would object to it as well. I only suggested that to not break git bisect.
If we don't care about git bisect and the fact that we would not be able to build libvirt correctly within these patches I'm OK with pushing it without squashing.
git bisect reliabity is key, so I reluctantly think we'll need to squash. I don't want to hit a pathc in this series with a bisect and be unable to continue the bisect due to inability to build the code.
I can try to rearrange the patches to not break git bisect. It will still require some script to be used for git bisect to detect if it should run autotools or Meson.
Maybe there's a reasonable tradeoff - instead of a 350 patch series, just a 10-20 patch series.
One other option would be a semi-linear merge. bisect would try the commit before the rewrite and after, if both of them worked or both were broken then it will not try the commits in the middle. If it does, then you know it was because of the autotools=>meson rewrite. You will not break git-bisect and you'll keep the history of the commits.
I'm not sure I follow exactly what you are saying here, so let me try to illustrate what I think you mean and you can correct me.
Consider that
- The current repo has commits A, B and C - The Meson series has commits R, S, T and U - After meson, we add commits H, I and J
IIUC, by "semi-linear merge" you mean a graph that looks like this:
A----B----C---------------------------H----I----J | | +-----R-----S----T-----U----+
Now we notice a regression at J and know the last good commit was B.
IIUC you're saying that when "git bisect" runs it will stop on commits 'C' and 'H', and only bisect into R, S, T, & U, if the results of C & H show the problem is in the meson series.
That would certainly be nice, but I can't find any documentation that clearly says this is what git bisect will do.
The docs I see merely say that bisect will look for a commit half way between the current good & bad markers, but doesn't clarify what "half way" means when there are two possible paths to follow in the graph. You seem to be saying it will choose the shorter of the two paths, but I don't see that mentioned anywhere. I could easily see it deciding the "S" was the first half-way points to try, not C or H.
If someone can point me to credible docs explaining what git does wrt merges I'd be interested if I'm right or wrong.
Thank you for correcting me. I genuinely believed that this was happening in another project that I was bisecting, but I should've checked more. I spent some more time looking at the workarounds and there are ways how to achieve what I described. Unfortunately it is not built in the bisect command itself and there is nowhere to supply your own bisect helper or list of skipped commits per-repo (which would be pretty easy and helpful, actually). Anyway, whatever does not work automatically with the unmodified `git bisect` command is not going to be helpful, no matter how much we'd document it. One other idea would be to have a Makefile (or some other mean) that just tells you what to do if you got to any of the commits in the middle a bisect. But maybe I'm overthinking it. Sorry, let's leave this, I guess. I do not have any time to look at adding the feature in git :)
Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Fri, Jul 17, 2020 at 15:02:10 +0100, Daniel Berrange wrote:
On Thu, Jul 16, 2020 at 03:44:25PM +0200, Pavel Hrdina wrote:
On Thu, Jul 16, 2020 at 01:59:00PM +0100, Daniel P. Berrangé wrote:
Personally I'd really like to avoid squashing them, because splitting up big patches is not merely to benefit the initial pre-merge review, but to also benefit people who need to debug stuff that's already merged and understand the scope of the intended change. So being able to look back at the changes in isolation after commit is still a big plus point.
I would like to avoid squashing the patches as well and in most cases I would object to it as well. I only suggested that to not break git bisect.
If we don't care about git bisect and the fact that we would not be able to build libvirt correctly within these patches I'm OK with pushing it without squashing.
git bisect reliabity is key, so I reluctantly think we'll need to squash. I don't want to hit a pathc in this series with a bisect and be unable to continue the bisect due to inability to build the code.
I agree. It's definitely necessary that the build is complete at any point in time. I'm reluctantly willing to accept that the build fails with an appropriate error message until the build system is able to build everything if we opt for commiting a patchset for simplicity. What's off-limits is if build "succeeds", but is incomplete due to missing steps in the implementation. I'm not going to want to guess which part is already built or which isn't. Given that the rewrite is a singularity anyways it doesn't really matter that we will not be able to bisect problems caused by the build system across the boundary.

On Mon, Jul 27, 2020 at 12:11 PM Peter Krempa <pkrempa@redhat.com> wrote:
On Fri, Jul 17, 2020 at 15:02:10 +0100, Daniel Berrange wrote:
On Thu, Jul 16, 2020 at 03:44:25PM +0200, Pavel Hrdina wrote:
On Thu, Jul 16, 2020 at 01:59:00PM +0100, Daniel P. Berrangé wrote:
Personally I'd really like to avoid squashing them, because splitting up big patches is not merely to benefit the initial pre-merge review, but to also benefit people who need to debug stuff that's already merged and understand the scope of the intended change. So being able to look back at the changes in isolation after commit is still a big plus point.
I would like to avoid squashing the patches as well and in most cases I would object to it as well. I only suggested that to not break git bisect.
If we don't care about git bisect and the fact that we would not be able to build libvirt correctly within these patches I'm OK with pushing it without squashing.
git bisect reliabity is key, so I reluctantly think we'll need to squash. I don't want to hit a pathc in this series with a bisect and be unable to continue the bisect due to inability to build the code.
I agree. It's definitely necessary that the build is complete at any point in time.
I'm reluctantly willing to accept that the build fails with an appropriate error message until the build system is able to build everything if we opt for commiting a patchset for simplicity. What's off-limits is if build "succeeds", but is incomplete due to missing steps in the implementation. I'm not going to want to guess which part is already built or which isn't.
Given that the rewrite is a singularity anyways it doesn't really matter that we will not be able to bisect problems caused by the build system across the boundary.
Unfortunately, this is where email based workflows completely fall apart. If this was represented as a merge request, it'd be straightforward to look at it from either the "changeset view" (the delta from upstream main branch and the branch containing the changes) or the "per-change view" (the delta across a commit). I literally could not figure out how to review this entire change set (despite my best efforts) because pulling down this 351-patch changeset is quite difficult for me. At least, not until I realized the cover letter pointed to a GitLab repository with the commits present. 😅 But email is the workflow we have, not the one we deserve, so I'd rather see this re-sent as a single patch. That patch will be too big to send as an email, though, so it will likely need to be sent as an attachment. Or maybe this could be the inaugural change merged in through a merge request in GitLab.com? One could only hope... -- 真実はいつも一つ!/ Always, there's only one truth!

On Mon, Jul 27, 2020 at 20:43:05 -0400, Neal Gompa wrote:
On Mon, Jul 27, 2020 at 12:11 PM Peter Krempa <pkrempa@redhat.com> wrote:
On Fri, Jul 17, 2020 at 15:02:10 +0100, Daniel Berrange wrote:
[...]
I agree. It's definitely necessary that the build is complete at any point in time.
I'm reluctantly willing to accept that the build fails with an appropriate error message until the build system is able to build everything if we opt for commiting a patchset for simplicity. What's off-limits is if build "succeeds", but is incomplete due to missing steps in the implementation. I'm not going to want to guess which part is already built or which isn't.
Given that the rewrite is a singularity anyways it doesn't really matter that we will not be able to bisect problems caused by the build system across the boundary.
Unfortunately, this is where email based workflows completely fall apart. If this was represented as a merge request, it'd be straightforward to look at it from either the "changeset view" (the delta from upstream main branch and the branch containing the changes) or the "per-change view" (the delta across a commit). I literally
You can do the same once you apply the patches on your local repository. In the end a the merge request is just that. A repo with the patches applied and the "cover letter" is represented as the merge request "justification". The only difference is how you get those ...
could not figure out how to review this entire change set (despite my best efforts) because pulling down this 351-patch changeset is quite difficult for me. At least, not until I realized the cover letter pointed to a GitLab repository with the commits present.
... and Pavel provided both views in case your e-mail client doesn't enable you to extract a patchset quickly. Please note that in my reply I was specifically refering only to the state once it's commited to the main repository and not in any way refering to review. Once the patchset is comitted it's same situation for everybody.
But email is the workflow we have, not the one we deserve, so I'd rather see this re-sent as a single patch. That patch will be too big to send as an email, though, so it will likely need to be sent as an attachment.
The resulting squashed mail is 880K. We had bigger ones e.g. when Daniel changed the translation systems which had 1.0M and 1.2M emails and they went through just fine.

On Mon, Jul 27, 2020 at 06:11:11PM +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 15:02:10 +0100, Daniel Berrange wrote:
On Thu, Jul 16, 2020 at 03:44:25PM +0200, Pavel Hrdina wrote:
On Thu, Jul 16, 2020 at 01:59:00PM +0100, Daniel P. Berrangé wrote:
Personally I'd really like to avoid squashing them, because splitting up big patches is not merely to benefit the initial pre-merge review, but to also benefit people who need to debug stuff that's already merged and understand the scope of the intended change. So being able to look back at the changes in isolation after commit is still a big plus point.
I would like to avoid squashing the patches as well and in most cases I would object to it as well. I only suggested that to not break git bisect.
If we don't care about git bisect and the fact that we would not be able to build libvirt correctly within these patches I'm OK with pushing it without squashing.
git bisect reliabity is key, so I reluctantly think we'll need to squash. I don't want to hit a pathc in this series with a bisect and be unable to continue the bisect due to inability to build the code.
I agree. It's definitely necessary that the build is complete at any point in time.
I'm reluctantly willing to accept that the build fails with an appropriate error message until the build system is able to build everything if we opt for commiting a patchset for simplicity. What's off-limits is if build "succeeds", but is incomplete due to missing steps in the implementation. I'm not going to want to guess which part is already built or which isn't.
Given that the rewrite is a singularity anyways it doesn't really matter that we will not be able to bisect problems caused by the build system across the boundary.
So based on all the comments we have these options for pushing this series: 1) Squash it into single commit. Pros: - no issues with git bisect Cons: - we will not have the history of changes 2) Keep the patches as they are and running meson build & ninja will not fail. Pros: - full history of changes where each commit removes the relevant bits from autotools - git bisect is not broken as compilation will not fail Cons: - meson build && ninja will not produce complete libvirt binaries and there is no autogen.sh - script used for git bisect will have to detect if tested binaries are compiled or use git bisect skip 3) Keep the patches as they are but error out in meson until the conversion is complete. The error can be used to detect if git bisect is withing the meson rewrite. Pros: - full history of changes where each commit removes the relevant bits from autotools - git bisect is not broken if failed compilation is not an issue and marked as git bisect skip Cons: - meson build will fail and there is no autogen.sh so no way how to compile libvirt even partially - script used for git bisect will have to skip failed compilation with an option to check for specific error 4) Rework the series to have patches adding meson bits without removing anything from autotools and drop the autotools files in a single commit once the meson rewrite is complete Pros: - full history of changes - git bisect not broken because autogen.sh && make will work the whole time until meson build && ninja is ready Cons: - no reference of the meson changes to autotools code - additional work for me to redo the patches There is a possible workaround as Martin suggested that when running git bisect the script/developer would test libvirt before meson rewrite and right after it to figure out if the issue is caused by meson rewrite or not and then continue purely with meson or autotools to look for the broken commit. This would make sense for option 2) and 3). Looking forward to your ideas and comments or suggestion with other options. Pavel

On Tue, Jul 28, 2020 at 10:00:20 +0200, Pavel Hrdina wrote:
On Mon, Jul 27, 2020 at 06:11:11PM +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 15:02:10 +0100, Daniel Berrange wrote:
On Thu, Jul 16, 2020 at 03:44:25PM +0200, Pavel Hrdina wrote:
On Thu, Jul 16, 2020 at 01:59:00PM +0100, Daniel P. Berrangé wrote:
Personally I'd really like to avoid squashing them, because splitting up big patches is not merely to benefit the initial pre-merge review, but to also benefit people who need to debug stuff that's already merged and understand the scope of the intended change. So being able to look back at the changes in isolation after commit is still a big plus point.
I would like to avoid squashing the patches as well and in most cases I would object to it as well. I only suggested that to not break git bisect.
If we don't care about git bisect and the fact that we would not be able to build libvirt correctly within these patches I'm OK with pushing it without squashing.
git bisect reliabity is key, so I reluctantly think we'll need to squash. I don't want to hit a pathc in this series with a bisect and be unable to continue the bisect due to inability to build the code.
I agree. It's definitely necessary that the build is complete at any point in time.
I'm reluctantly willing to accept that the build fails with an appropriate error message until the build system is able to build everything if we opt for commiting a patchset for simplicity. What's off-limits is if build "succeeds", but is incomplete due to missing steps in the implementation. I'm not going to want to guess which part is already built or which isn't.
Given that the rewrite is a singularity anyways it doesn't really matter that we will not be able to bisect problems caused by the build system across the boundary.
So based on all the comments we have these options for pushing this series:
1) Squash it into single commit.
Pros: - no issues with git bisect
Cons: - we will not have the history of changes
2) Keep the patches as they are and running meson build & ninja will not fail.
Pros: - full history of changes where each commit removes the relevant bits from autotools
- git bisect is not broken as compilation will not fail
You can't claim that 'git bisect' is not broken if "compilation does not fail". That is plainly and utterly misleading ...
Cons: - meson build && ninja will not produce complete libvirt binaries and there is no autogen.sh
... as bisect is used to figure out when some code broke. If you don't compile the code, then bisect _IS_ broken. Not breaking bisect means that everything must compile.
- script used for git bisect will have to detect if tested binaries are compiled or use git bisect skip
No. Just no. As I've pointed out earlier, you won't use bisect to find when build system change broke things, because the complete rewrite invalidates everything anyways. Build system can be bisected only prior to the change and only after the change but nothing between. Option 4 is the winner usability wise and change-insight wise. 1 follows with just usability benefits. Option 3 is acceptable. Option 2 is not at all.

On Tue, Jul 28, 2020 at 10:09:42AM +0200, Peter Krempa wrote:
On Tue, Jul 28, 2020 at 10:00:20 +0200, Pavel Hrdina wrote:
On Mon, Jul 27, 2020 at 06:11:11PM +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 15:02:10 +0100, Daniel Berrange wrote:
On Thu, Jul 16, 2020 at 03:44:25PM +0200, Pavel Hrdina wrote:
On Thu, Jul 16, 2020 at 01:59:00PM +0100, Daniel P. Berrangé wrote:
Personally I'd really like to avoid squashing them, because splitting up big patches is not merely to benefit the initial pre-merge review, but to also benefit people who need to debug stuff that's already merged and understand the scope of the intended change. So being able to look back at the changes in isolation after commit is still a big plus point.
I would like to avoid squashing the patches as well and in most cases I would object to it as well. I only suggested that to not break git bisect.
If we don't care about git bisect and the fact that we would not be able to build libvirt correctly within these patches I'm OK with pushing it without squashing.
git bisect reliabity is key, so I reluctantly think we'll need to squash. I don't want to hit a pathc in this series with a bisect and be unable to continue the bisect due to inability to build the code.
I agree. It's definitely necessary that the build is complete at any point in time.
I'm reluctantly willing to accept that the build fails with an appropriate error message until the build system is able to build everything if we opt for commiting a patchset for simplicity. What's off-limits is if build "succeeds", but is incomplete due to missing steps in the implementation. I'm not going to want to guess which part is already built or which isn't.
Given that the rewrite is a singularity anyways it doesn't really matter that we will not be able to bisect problems caused by the build system across the boundary.
So based on all the comments we have these options for pushing this series:
1) Squash it into single commit.
Pros: - no issues with git bisect
Cons: - we will not have the history of changes
2) Keep the patches as they are and running meson build & ninja will not fail.
Pros: - full history of changes where each commit removes the relevant bits from autotools
- git bisect is not broken as compilation will not fail
You can't claim that 'git bisect' is not broken if "compilation does not fail". That is plainly and utterly misleading ...
The wording should have been: git bisect is not broken if successful compilation that may not build all binaries is not an issue and marked as git bisect skip to match the wording for option 3 which was: git bisect is not broken if failed compilation is not an issue and marked as git bisect skip
Cons: - meson build && ninja will not produce complete libvirt binaries and there is no autogen.sh
... as bisect is used to figure out when some code broke. If you don't compile the code, then bisect _IS_ broken.
Not breaking bisect means that everything must compile.
Here I disagree, it also means that compilation should not fail. We do comments all the time to patch series that every single commit should compile correctly on it's own within the series. To me personally both option 2) and option 3) are similar. In both cases you will have to end up with the workaround mentioned by Martin and basically skip the whole meson rewrite when doing git bisect.
- script used for git bisect will have to detect if tested binaries are compiled or use git bisect skip
No. Just no.
As I've pointed out earlier, you won't use bisect to find when build system change broke things, because the complete rewrite invalidates everything anyways.
Build system can be bisected only prior to the change and only after the change but nothing between.
Option 4 is the winner usability wise and change-insight wise. 1 follows with just usability benefits. Option 3 is acceptable. Option 2 is not at all.

On Tue, Jul 28, 2020 at 10:33:52 +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 10:09:42AM +0200, Peter Krempa wrote:
[...]
Here I disagree, it also means that compilation should not fail. We do comments all the time to patch series that every single commit should compile correctly on it's own within the series.
Doing a 'return 0' is not compiling code correctly. The idea of requirements to bulild cleanly is that you can test the code. In this case we need to observe it from a different angle though. In reality an incomplete build is a failed build regardless of what the return value of the build system is. And that is important here. The main reason for the build system is to build everything so the only success is when everything is built. If you don't have the resulting binary it's impossible to test the code or do anything else. What would be even worse is to get a compiled binary that e.g. doesn't have the dependencies installed (such as RNG schemas, cpu XML docs and such) and fails in magic ways. At that point you can't be sure whether it's the bug you are trying to locate or just plainly broken build which the build system lied to you that it's complete.

On Tue, Jul 28, 2020 at 12:15:25PM +0200, Peter Krempa wrote:
On Tue, Jul 28, 2020 at 10:33:52 +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 10:09:42AM +0200, Peter Krempa wrote:
[...]
Here I disagree, it also means that compilation should not fail. We do comments all the time to patch series that every single commit should compile correctly on it's own within the series.
Doing a 'return 0' is not compiling code correctly. The idea of requirements to bulild cleanly is that you can test the code.
In this case we need to observe it from a different angle though.
In reality an incomplete build is a failed build regardless of what the return value of the build system is. And that is important here. The main reason for the build system is to build everything so the only success is when everything is built.
If you don't have the resulting binary it's impossible to test the code or do anything else.
What would be even worse is to get a compiled binary that e.g. doesn't have the dependencies installed (such as RNG schemas, cpu XML docs and such) and fails in magic ways. At that point you can't be sure whether it's the bug you are trying to locate or just plainly broken build which the build system lied to you that it's complete.
Obviously this would be a big issue if it would randomly fail because of some missing files that are not yet compiled. I have no objection here. If your only use-case is to run binaries during git bisect then yes having not-complete build when build system returns 0 is not correct. I'm just saying there might be some other use-cases for git bisect where having incomplete build is not an issue and we should not dismiss these use-case. Pavel

On Tue, 2020-07-28 at 10:00 +0200, Pavel Hrdina wrote:
So based on all the comments we have these options for pushing this series:
1) Squash it into single commit.
2) Keep the patches as they are and running meson build & ninja will not fail.
3) Keep the patches as they are but error out in meson until the conversion is complete. The error can be used to detect if git bisect is withing the meson rewrite.
4) Rework the series to have patches adding meson bits without removing anything from autotools and drop the autotools files in a single commit once the meson rewrite is complete
I suggest going for option 1, with the caveat that before pushing you you should post a fully-reviewed and fixed vN to the mailing list and include a link to it in the message for the squashed commit. This will allow us to look back at the original reasoning behind a change in the same way the reviewer could, without affecting bisectability. Options 4 would be acceptable as well, but it requires more work on your side and still requires hitting the mailing list archives to get the full picture of the rewrite, so I don't think is worth it. Options 2 and 3 result in a partially-built libvirt over a pretty big range of commits, which I feel is actually worse than breaking bisectability. -- Andrea Bolognani / Red Hat / Virtualization

On Tue, Jul 28, 2020 at 10:00:20AM +0200, Pavel Hrdina wrote:
On Mon, Jul 27, 2020 at 06:11:11PM +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 15:02:10 +0100, Daniel Berrange wrote:
On Thu, Jul 16, 2020 at 03:44:25PM +0200, Pavel Hrdina wrote:
On Thu, Jul 16, 2020 at 01:59:00PM +0100, Daniel P. Berrangé wrote:
Personally I'd really like to avoid squashing them, because splitting up big patches is not merely to benefit the initial pre-merge review, but to also benefit people who need to debug stuff that's already merged and understand the scope of the intended change. So being able to look back at the changes in isolation after commit is still a big plus point.
I would like to avoid squashing the patches as well and in most cases I would object to it as well. I only suggested that to not break git bisect.
If we don't care about git bisect and the fact that we would not be able to build libvirt correctly within these patches I'm OK with pushing it without squashing.
git bisect reliabity is key, so I reluctantly think we'll need to squash. I don't want to hit a pathc in this series with a bisect and be unable to continue the bisect due to inability to build the code.
I agree. It's definitely necessary that the build is complete at any point in time.
I'm reluctantly willing to accept that the build fails with an appropriate error message until the build system is able to build everything if we opt for commiting a patchset for simplicity. What's off-limits is if build "succeeds", but is incomplete due to missing steps in the implementation. I'm not going to want to guess which part is already built or which isn't.
Given that the rewrite is a singularity anyways it doesn't really matter that we will not be able to bisect problems caused by the build system across the boundary.
So based on all the comments we have these options for pushing this series:
1) Squash it into single commit.
Pros: - no issues with git bisect
Cons: - we will not have the history of changes
2) Keep the patches as they are and running meson build & ninja will not fail.
Pros: - full history of changes where each commit removes the relevant bits from autotools
- git bisect is not broken as compilation will not fail
Cons: - meson build && ninja will not produce complete libvirt binaries and there is no autogen.sh
- script used for git bisect will have to detect if tested binaries are compiled or use git bisect skip
So basically any time git bisect lands on one of the meson conversion patches, we'll need to use "git bisect skip". You might have todo that multiple times. It'll make bisect less efficient, but assuming the problem was not part of the meson series, git will eventually show you the broken commit. The problem here is remembering which commits are ones which need to be skipped.....
3) Keep the patches as they are but error out in meson until the conversion is complete. The error can be used to detect if git bisect is withing the meson rewrite.
Pros: - full history of changes where each commit removes the relevant bits from autotools
- git bisect is not broken if failed compilation is not an issue and marked as git bisect skip
Cons: - meson build will fail and there is no autogen.sh so no way how to compile libvirt even partially
- script used for git bisect will have to skip failed compilation with an option to check for specific error
..So explicitly failing the meson build is a significant improvement. We could have - Meson build is forced to fail out of the box - An option "force_incomplete_build" to turn off the fail - When failing prints an error message "This commit is part of the meson conversion and does not build a complete libvirt. If bisecting, use "git bisect skip" to continue, or "-Dforce_incomplete_build=true" to perform a partial build" So with that we would have full history, and git bisect would be able to identify problems in ANY commit that is NOT part of the meson series, except the single commit that is immediately either side of the meson series. That should be viable I think.
4) Rework the series to have patches adding meson bits without removing anything from autotools and drop the autotools files in a single commit once the meson rewrite is complete
Pros: - full history of changes
- git bisect not broken because autogen.sh && make will work the whole time until meson build && ninja is ready
Cons: - no reference of the meson changes to autotools code
- additional work for me to redo the patches
Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Tue, Jul 28, 2020 at 10:58:03AM +0100, Daniel P. Berrangé wrote:
On Tue, Jul 28, 2020 at 10:00:20AM +0200, Pavel Hrdina wrote:
On Mon, Jul 27, 2020 at 06:11:11PM +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 15:02:10 +0100, Daniel Berrange wrote:
On Thu, Jul 16, 2020 at 03:44:25PM +0200, Pavel Hrdina wrote:
On Thu, Jul 16, 2020 at 01:59:00PM +0100, Daniel P. Berrangé wrote:
Personally I'd really like to avoid squashing them, because splitting up big patches is not merely to benefit the initial pre-merge review, but to also benefit people who need to debug stuff that's already merged and understand the scope of the intended change. So being able to look back at the changes in isolation after commit is still a big plus point.
I would like to avoid squashing the patches as well and in most cases I would object to it as well. I only suggested that to not break git bisect.
If we don't care about git bisect and the fact that we would not be able to build libvirt correctly within these patches I'm OK with pushing it without squashing.
git bisect reliabity is key, so I reluctantly think we'll need to squash. I don't want to hit a pathc in this series with a bisect and be unable to continue the bisect due to inability to build the code.
I agree. It's definitely necessary that the build is complete at any point in time.
I'm reluctantly willing to accept that the build fails with an appropriate error message until the build system is able to build everything if we opt for commiting a patchset for simplicity. What's off-limits is if build "succeeds", but is incomplete due to missing steps in the implementation. I'm not going to want to guess which part is already built or which isn't.
Given that the rewrite is a singularity anyways it doesn't really matter that we will not be able to bisect problems caused by the build system across the boundary.
So based on all the comments we have these options for pushing this series:
1) Squash it into single commit.
Pros: - no issues with git bisect
Cons: - we will not have the history of changes
2) Keep the patches as they are and running meson build & ninja will not fail.
Pros: - full history of changes where each commit removes the relevant bits from autotools
- git bisect is not broken as compilation will not fail
Cons: - meson build && ninja will not produce complete libvirt binaries and there is no autogen.sh
- script used for git bisect will have to detect if tested binaries are compiled or use git bisect skip
So basically any time git bisect lands on one of the meson conversion patches, we'll need to use "git bisect skip". You might have todo that multiple times. It'll make bisect less efficient, but assuming the problem was not part of the meson series, git will eventually show you the broken commit.
The problem here is remembering which commits are ones which need to be skipped.....
3) Keep the patches as they are but error out in meson until the conversion is complete. The error can be used to detect if git bisect is withing the meson rewrite.
Pros: - full history of changes where each commit removes the relevant bits from autotools
- git bisect is not broken if failed compilation is not an issue and marked as git bisect skip
Cons: - meson build will fail and there is no autogen.sh so no way how to compile libvirt even partially
- script used for git bisect will have to skip failed compilation with an option to check for specific error
..So explicitly failing the meson build is a significant improvement.
We could have
- Meson build is forced to fail out of the box - An option "force_incomplete_build" to turn off the fail - When failing prints an error message
"This commit is part of the meson conversion and does not build a complete libvirt. If bisecting, use "git bisect skip" to continue, or "-Dforce_incomplete_build=true" to perform a partial build"
So with that we would have full history, and git bisect would be able to identify problems in ANY commit that is NOT part of the meson series, except the single commit that is immediately either side of the meson series. That should be viable I think.
I like the extra option which would be removed once we remove the error message as well. It makes nice compromise between options 2) and 3). Peter suggested using the error message in a private conversation that we had and this improves it a bit more so if we can agree on this I'll go with it. Thanks Pavel
4) Rework the series to have patches adding meson bits without removing anything from autotools and drop the autotools files in a single commit once the meson rewrite is complete
Pros: - full history of changes
- git bisect not broken because autogen.sh && make will work the whole time until meson build && ninja is ready
Cons: - no reference of the meson changes to autotools code
- additional work for me to redo the patches

On Tue, Jul 28, 2020 at 12:08:17 +0200, Pavel Hrdina wrote:
On Tue, Jul 28, 2020 at 10:58:03AM +0100, Daniel P. Berrangé wrote:
On Tue, Jul 28, 2020 at 10:00:20AM +0200, Pavel Hrdina wrote:
[...]
- Meson build is forced to fail out of the box - An option "force_incomplete_build" to turn off the fail - When failing prints an error message
"This commit is part of the meson conversion and does not build a complete libvirt. If bisecting, use "git bisect skip" to continue, or "-Dforce_incomplete_build=true" to perform a partial build"
So with that we would have full history, and git bisect would be able to identify problems in ANY commit that is NOT part of the meson series, except the single commit that is immediately either side of the meson series. That should be viable I think.
I like the extra option which would be removed once we remove the error message as well. It makes nice compromise between options 2) and 3).
Peter suggested using the error message in a private conversation that we had and this improves it a bit more so if we can agree on this I'll go with it.
I reckon that doing a build at any point partway in the series is generally not useful, but sure option 3 is my minimum requirement, so if that is what happens by default I don't mind if you add the extra option.

On a Tuesday in 2020, Daniel P. Berrangé wrote:
On Tue, Jul 28, 2020 at 10:00:20AM +0200, Pavel Hrdina wrote:
3) Keep the patches as they are but error out in meson until the conversion is complete. The error can be used to detect if git bisect is withing the meson rewrite.
Pros: - full history of changes where each commit removes the relevant bits from autotools
- git bisect is not broken if failed compilation is not an issue and marked as git bisect skip
Cons: - meson build will fail and there is no autogen.sh so no way how to compile libvirt even partially
- script used for git bisect will have to skip failed compilation with an option to check for specific error
..So explicitly failing the meson build is a significant improvement.
We could have
- Meson build is forced to fail out of the box - An option "force_incomplete_build" to turn off the fail - When failing prints an error message
"This commit is part of the meson conversion and does not build a complete libvirt. If bisecting, use "git bisect skip" to continue, or "-Dforce_incomplete_build=true" to perform a partial build"
For unattended bisects, it would be nice to return 125 which is the magic value meaning 'skip' to 'git bisect run'. Jano
So with that we would have full history, and git bisect would be able to identify problems in ANY commit that is NOT part of the meson series, except the single commit that is immediately either side of the meson series. That should be viable I think.
4) Rework the series to have patches adding meson bits without removing anything from autotools and drop the autotools files in a single commit once the meson rewrite is complete
Pros: - full history of changes
- git bisect not broken because autogen.sh && make will work the whole time until meson build && ninja is ready
Cons: - no reference of the meson changes to autotools code
- additional work for me to redo the patches
Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Tue, Jul 28, 2020 at 12:24:56PM +0200, Ján Tomko wrote:
On a Tuesday in 2020, Daniel P. Berrangé wrote:
On Tue, Jul 28, 2020 at 10:00:20AM +0200, Pavel Hrdina wrote:
3) Keep the patches as they are but error out in meson until the conversion is complete. The error can be used to detect if git bisect is withing the meson rewrite.
Pros: - full history of changes where each commit removes the relevant bits from autotools
- git bisect is not broken if failed compilation is not an issue and marked as git bisect skip
Cons: - meson build will fail and there is no autogen.sh so no way how to compile libvirt even partially
- script used for git bisect will have to skip failed compilation with an option to check for specific error
..So explicitly failing the meson build is a significant improvement.
We could have
- Meson build is forced to fail out of the box - An option "force_incomplete_build" to turn off the fail - When failing prints an error message
"This commit is part of the meson conversion and does not build a complete libvirt. If bisecting, use "git bisect skip" to continue, or "-Dforce_incomplete_build=true" to perform a partial build"
For unattended bisects, it would be nice to return 125 which is the magic value meaning 'skip' to 'git bisect run'.
I don't think its possible to force the ninja/meson exit status upon failure. I think at best uou could have a wrapper script "mymeson" that looks for this error message and returns 125. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On a Tuesday in 2020, Daniel P. Berrangé wrote:
On Tue, Jul 28, 2020 at 12:24:56PM +0200, Ján Tomko wrote:
For unattended bisects, it would be nice to return 125 which is the magic value meaning 'skip' to 'git bisect run'.
I don't think its possible to force the ninja/meson exit status upon failure. I think at best uou could have a wrapper script "mymeson" that looks for this error message and returns 125.
meson test returns 125 on a build failure, that might be helpful. Jano

On Thu, Jul 16, 2020 at 11:53:56AM +0200, Pavel Hrdina wrote:
Patches are available in my Gitlab repo as well:
git clone -b meson https://gitlab.com/phrdina/libvirt.git
and link to Giltab pipeline:
https://gitlab.com/phrdina/libvirt/-/pipelines/167276632
The pipeline is not for the latest version is I tweaked some commit messages.
BTW, assuming we do positively review this, we need to consider when is a good time to merge. Having positive CI builds is good, but that only tells us that a build succeeded, it doesn't tell us that all the right features are enabled. I think it is inevitable that we are going to break stuff and miss it in review. So the prudent approach would be to merge this series immediately after a release, so that we have as much of a full month available as possible for debugging post-merge. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Thu, Jul 16, 2020 at 02:01:34PM +0100, Daniel P. Berrangé wrote:
On Thu, Jul 16, 2020 at 11:53:56AM +0200, Pavel Hrdina wrote:
Patches are available in my Gitlab repo as well:
git clone -b meson https://gitlab.com/phrdina/libvirt.git
and link to Giltab pipeline:
https://gitlab.com/phrdina/libvirt/-/pipelines/167276632
The pipeline is not for the latest version is I tweaked some commit messages.
BTW, assuming we do positively review this, we need to consider when is a good time to merge. Having positive CI builds is good, but that only tells us that a build succeeded, it doesn't tell us that all the right features are enabled. I think it is inevitable that we are going to break stuff and miss it in review. So the prudent approach would be to merge this series immediately after a release, so that we have as much of a full month available as possible for debugging post-merge.
Completely agree here. I wanted to post the patches with some time before next release so the review can catch the main and obvious issues or suggest different approach to some parts of the new build system. There were also privet suggestions to push it even without review right after release is done and deal with the issues before next release. All of the above works for me and would be probably the most reasonable thing to do. Pavel

On Thu, Jul 16, 2020 at 15:47:48 +0200, Pavel Hrdina wrote:
On Thu, Jul 16, 2020 at 02:01:34PM +0100, Daniel P. Berrangé wrote:
On Thu, Jul 16, 2020 at 11:53:56AM +0200, Pavel Hrdina wrote:
Patches are available in my Gitlab repo as well:
git clone -b meson https://gitlab.com/phrdina/libvirt.git
and link to Giltab pipeline:
https://gitlab.com/phrdina/libvirt/-/pipelines/167276632
The pipeline is not for the latest version is I tweaked some commit messages.
BTW, assuming we do positively review this, we need to consider when is a good time to merge. Having positive CI builds is good, but that only tells us that a build succeeded, it doesn't tell us that all the right features are enabled. I think it is inevitable that we are going to break stuff and miss it in review. So the prudent approach would be to merge this series immediately after a release, so that we have as much of a full month available as possible for debugging post-merge.
Completely agree here. I wanted to post the patches with some time before next release so the review can catch the main and obvious issues or suggest different approach to some parts of the new build system.
There were also privet suggestions to push it even without review right after release is done and deal with the issues before next release.
This was more a joke than a serious suggestion. But I basically wanted to express what Daniel said already. We will face bugs that won't be caught by any review and it will take time to find and fix them. I agree with the plan to push this after the release. Jirka

On Thu, Jul 16, 2020 at 08:36:42PM +0200, Jiri Denemark wrote:
On Thu, Jul 16, 2020 at 15:47:48 +0200, Pavel Hrdina wrote:
On Thu, Jul 16, 2020 at 02:01:34PM +0100, Daniel P. Berrangé wrote:
On Thu, Jul 16, 2020 at 11:53:56AM +0200, Pavel Hrdina wrote:
Patches are available in my Gitlab repo as well:
git clone -b meson https://gitlab.com/phrdina/libvirt.git
and link to Giltab pipeline:
https://gitlab.com/phrdina/libvirt/-/pipelines/167276632
The pipeline is not for the latest version is I tweaked some commit messages.
BTW, assuming we do positively review this, we need to consider when is a good time to merge. Having positive CI builds is good, but that only tells us that a build succeeded, it doesn't tell us that all the right features are enabled. I think it is inevitable that we are going to break stuff and miss it in review. So the prudent approach would be to merge this series immediately after a release, so that we have as much of a full month available as possible for debugging post-merge.
Completely agree here. I wanted to post the patches with some time before next release so the review can catch the main and obvious issues or suggest different approach to some parts of the new build system.
There were also privet suggestions to push it even without review right after release is done and deal with the issues before next release.
This was more a joke than a serious suggestion. But I basically wanted to express what Daniel said already. We will face bugs that won't be caught by any review and it will take time to find and fix them. I agree with the plan to push this after the release.
You were not the only one :) obviously it was a joke. There should be review at least of the main constructs and design of the patches to make sure we are on the same page. But doing review of every single line would take ages. Pavel

On Thu, Jul 16, 2020 at 11:53:56 +0200, Pavel Hrdina wrote: [...] Tests fail when building with clang: built as: CC=clang meson clang ~/libvirt cd clang ninja ninja test Looking at the test output (pasted below) you didn't faithfully reproduce the skipping of symbol file tests which have different ordering when the code is compiled with clang. Test output: [0/1] Running all tests. 1/154 check-aclperms OK 0.06s 2/154 check-symfile OK 0.08s 3/154 check-admin-symfile OK 0.04s 4/154 check-symsorting OK 0.04s 5/154 check-admin-symsorting OK 0.03s 6/154 check-drivername OK 0.04s 7/154 check-admin-drivername OK 0.06s 8/154 check-driverimpls OK 0.22s 9/154 check-aclrules OK 0.24s 10/154 check-augeas OK 0.08s 11/154 check-virnetprotocol FAIL 0.05s (exit status 1) 12/154 check-virkeepaliveprotocol OK 0.05s 13/154 check-remote_protocol FAIL 0.10s (exit status 1) 14/154 check-qemu_protocol FAIL 0.05s (exit status 1) 15/154 check-lxc_protocol FAIL 0.05s (exit status 1) 16/154 check-admin_protocol FAIL 0.05s (exit status 1) 17/154 check-lock_protocol FAIL 0.04s (exit status 1) 18/154 check-lxc_monitor_protocol FAIL 0.04s (exit status 1) 19/154 commandtest OK 0.42s 20/154 cputest OK 0.77s 21/154 domaincapstest OK 0.32s 22/154 domainconftest OK 0.05s 23/154 genericxml2xmltest OK 0.11s 24/154 interfacexml2xmltest OK 0.04s 25/154 metadatatest OK 0.03s 26/154 networkxml2xmlupdatetest OK 0.04s 27/154 nodedevxml2xmltest OK 0.02s 28/154 nwfilterxml2xmltest OK 0.03s 29/154 objecteventtest OK 0.04s 30/154 seclabeltest OK 0.02s 31/154 secretxml2xmltest OK 0.02s 32/154 shunloadtest OK 0.02s 33/154 sockettest OK 0.03s 34/154 storagevolxml2xmltest OK 0.02s 35/154 sysinfotest OK 0.03s 36/154 utiltest OK 0.05s 37/154 viralloctest OK 0.02s 38/154 virauthconfigtest OK 0.02s 39/154 virbitmaptest OK 0.02s 40/154 virbuftest OK 0.02s 41/154 vircapstest OK 0.02s 42/154 vircgrouptest OK 0.05s 43/154 virconftest OK 0.04s 44/154 vircryptotest OK 0.03s 45/154 virendiantest OK 0.03s 46/154 virerrortest OK 0.03s 47/154 virfilecachetest OK 0.04s 48/154 virfiletest OK 0.03s 49/154 virfirewalltest OK 0.04s 50/154 virhashtest OK 0.02s 51/154 virhostcputest OK 0.05s 52/154 virhostdevtest OK 0.11s 53/154 viriscsitest OK 0.03s 54/154 virkeycodetest OK 0.02s 55/154 virkmodtest OK 0.03s 56/154 virlockspacetest OK 0.02s 57/154 virlogtest OK 0.03s 58/154 virnetdevtest OK 0.03s 59/154 virnetworkportxml2xmltest OK 0.03s 60/154 virnwfilterbindingxml2xmltest OK 0.02s 61/154 virpcitest OK 0.04s 62/154 virportallocatortest OK 0.04s 63/154 virrotatingfiletest OK 0.04s 64/154 virschematest OK 1.05s 65/154 virshtest OK 1.10s 66/154 virstringtest OK 0.02s 67/154 virtimetest OK 0.02s 68/154 virtypedparamtest OK 0.03s 69/154 viruritest OK 0.03s 70/154 vshtabletest OK 0.01s 71/154 fchosttest OK 0.04s 72/154 scsihosttest OK 0.02s 73/154 vircaps2xmltest OK 0.03s 74/154 virnetdevbandwidthtest OK 0.03s 75/154 virresctrltest OK 0.03s 76/154 virscsitest OK 0.03s 77/154 virusbtest OK 0.04s 78/154 virdbustest OK 0.02s 79/154 virsystemdtest OK 0.03s 80/154 virpolkittest OK 0.03s 81/154 esxutilstest OK 0.01s 82/154 eventtest OK 0.44s 83/154 fdstreamtest OK 0.02s 84/154 virdriverconnvalidatetest OK 0.02s 85/154 virdrivermoduletest OK 0.05s 86/154 libxlxml2domconfigtest OK 0.05s 87/154 xlconfigtest OK 0.06s 88/154 xmconfigtest OK 0.05s 89/154 lxcconf2xmltest OK 0.02s 90/154 lxcxml2xmltest OK 0.03s 91/154 networkxml2conftest OK 0.03s 92/154 networkxml2firewalltest OK 0.03s 93/154 networkxml2xmltest OK 0.03s 94/154 nodedevmdevctltest OK 0.02s 95/154 nsstest OK 0.05s 96/154 nssguesttest OK 0.03s 97/154 nwfilterebiptablestest OK 0.02s 98/154 nwfilterxml2firewalltest OK 0.03s 99/154 openvzutilstest OK 0.03s 100/154 qemuagenttest OK 0.03s 101/154 qemublocktest OK 0.13s 102/154 qemucapabilitiestest OK 1.28s 103/154 qemucaps2xmltest OK 0.13s 104/154 qemucommandutiltest OK 0.02s 105/154 qemudomaincheckpointxml2xmltest OK 0.24s 106/154 qemudomainsnapshotxml2xmltest OK 0.02s 107/154 qemufirmwaretest OK 0.02s 108/154 qemuhotplugtest OK 0.38s 109/154 qemumemlocktest OK 0.08s 110/154 qemumigparamstest OK 0.05s 111/154 qemumonitorjsontest OK 0.38s 112/154 qemusecuritytest OK 0.88s 113/154 qemuvhostusertest OK 0.03s 114/154 qemuxml2argvtest OK 4.69s 115/154 qemuxml2xmltest OK 1.78s 116/154 virnetdaemontest OK 0.08s 117/154 virnetmessagetest OK 0.02s 118/154 virnetserverclienttest OK 0.05s 119/154 virnetsockettest OK 0.13s 120/154 virnettlscontexttest OK 0.33s 121/154 virnettlssessiontest OK 0.48s 122/154 storagepoolcapstest OK 0.04s 123/154 storagepoolxml2argvtest OK 0.07s 124/154 storagepoolxml2xmltest OK 0.07s 125/154 storagevolxml2argvtest OK 0.04s 126/154 virstorageutiltest OK 0.02s 127/154 virstoragetest OK 0.93s 128/154 storagebackendsheepdogtest OK 0.03s 129/154 vboxsnapshotxmltest OK 0.04s 130/154 vmwarevertest OK 0.02s 131/154 vmx2xmltest OK 0.04s 132/154 xml2vmxtest OK 0.04s 133/154 virjsontest OK 0.02s 134/154 virmacmaptest OK 0.04s 135/154 virnetdevopenvswitchtest OK 0.02s 136/154 libvirtd-fail OK 0.04s 137/154 libvirtd-pool OK 0.07s 138/154 virsh-auth OK 0.07s 139/154 virsh-checkpoint OK 0.33s 140/154 virsh-cpuset OK 0.07s 141/154 virsh-define-dev-segfault OK 0.07s 142/154 virsh-int-overflow OK 0.04s 143/154 virsh-optparse SKIP 0.03s 144/154 virsh-read-bufsiz OK 0.12s 145/154 virsh-read-non-seekable OK 0.07s 146/154 virsh-schedinfo OK 0.04s 147/154 virsh-self-test OK 0.07s 148/154 virsh-snapshot OK 0.37s 149/154 virsh-start OK 0.08s 150/154 virsh-undefine OK 0.12s 151/154 virsh-uriprecedence OK 0.23s 152/154 virsh-vcpupin OK 0.22s 153/154 virt-admin-self-test OK 0.07s 154/154 check-html OK 0.07s Ok: 146 Expected Fail: 0 Fail: 7 Unexpected Pass: 0 Skipped: 1 Timeout: 0 The output from the failed tests: 11/154 check-virnetprotocol FAIL 0.05s (exit status 1) --- command --- 09:18:24 LANG='C' LC_CTYPE='en_US.UTF-8' LC_ALL='' /bin/python3 /home/pipo/libvirt/scripts/check-remote-protocol.py virnetprotocol virt_net_rpc /home/pipo/build/libvirt/meson/clang/src/rpc /bin/pdwtags /home/pipo/build/libvirt/meson/clang/../../../../libvirt/src/virnetprotocol-structs --- stdout --- --- /home/pipo/build/libvirt/meson/clang/../../../../libvirt/src/virnetprotocol-structs 2020-01-29 15:18:11.000000000 +0100 +++ - 2020-07-17 11:18:24.972477362 +0200 @@ -13,14 +13,6 @@ VIR_NET_ERROR = 1, VIR_NET_CONTINUE = 2, }; -struct virNetMessageHeader { - u_int prog; - u_int vers; - int proc; - virNetMessageType type; - u_int serial; - virNetMessageStatus status; -}; struct virNetMessageNonnullDomain { virNetMessageNonnullString name; virNetMessageUUID uuid; @@ -30,6 +22,14 @@ virNetMessageNonnullString name; virNetMessageUUID uuid; }; +struct virNetMessageHeader { + u_int prog; + u_int vers; + int proc; + virNetMessageType type; + u_int serial; + virNetMessageStatus status; +}; struct virNetMessageError { int code; int domain; ------- 13/154 check-remote_protocol FAIL 0.10s (exit status 1) --- command --- 09:18:24 LANG='C' LC_CTYPE='en_US.UTF-8' LC_ALL='' /bin/python3 /home/pipo/libvirt/scripts/check-remote-protocol.py remote_protocol virt_remote_driver /home/pipo/build/libvirt/meson/clang/src/remote /bin/pdwtags /home/pipo/build/libvirt/meson/clang/../../../../libvirt/src/remote_protocol-structs --- Listing only the last 100 lines from a long log. --- - REMOTE_PROC_DOMAIN_EVENT_CALLBACK_BLOCK_JOB = 326, - REMOTE_PROC_DOMAIN_EVENT_CALLBACK_DISK_CHANGE = 327, - REMOTE_PROC_DOMAIN_EVENT_CALLBACK_TRAY_CHANGE = 328, - REMOTE_PROC_DOMAIN_EVENT_CALLBACK_PMWAKEUP = 329, - REMOTE_PROC_DOMAIN_EVENT_CALLBACK_PMSUSPEND = 330, - REMOTE_PROC_DOMAIN_EVENT_CALLBACK_BALLOON_CHANGE = 331, - REMOTE_PROC_DOMAIN_EVENT_CALLBACK_PMSUSPEND_DISK = 332, - REMOTE_PROC_DOMAIN_EVENT_CALLBACK_DEVICE_REMOVED = 333, - REMOTE_PROC_DOMAIN_CORE_DUMP_WITH_FORMAT = 334, - REMOTE_PROC_DOMAIN_FSFREEZE = 335, - REMOTE_PROC_DOMAIN_FSTHAW = 336, - REMOTE_PROC_DOMAIN_GET_TIME = 337, - REMOTE_PROC_DOMAIN_SET_TIME = 338, - REMOTE_PROC_DOMAIN_EVENT_BLOCK_JOB_2 = 339, - REMOTE_PROC_NODE_GET_FREE_PAGES = 340, - REMOTE_PROC_NETWORK_GET_DHCP_LEASES = 341, - REMOTE_PROC_CONNECT_GET_DOMAIN_CAPABILITIES = 342, - REMOTE_PROC_DOMAIN_OPEN_GRAPHICS_FD = 343, - REMOTE_PROC_CONNECT_GET_ALL_DOMAIN_STATS = 344, - REMOTE_PROC_DOMAIN_BLOCK_COPY = 345, - REMOTE_PROC_DOMAIN_EVENT_CALLBACK_TUNABLE = 346, - REMOTE_PROC_NODE_ALLOC_PAGES = 347, - REMOTE_PROC_DOMAIN_EVENT_CALLBACK_AGENT_LIFECYCLE = 348, - REMOTE_PROC_DOMAIN_GET_FSINFO = 349, - REMOTE_PROC_DOMAIN_DEFINE_XML_FLAGS = 350, - REMOTE_PROC_DOMAIN_GET_IOTHREAD_INFO = 351, - REMOTE_PROC_DOMAIN_PIN_IOTHREAD = 352, - REMOTE_PROC_DOMAIN_INTERFACE_ADDRESSES = 353, - REMOTE_PROC_DOMAIN_EVENT_CALLBACK_DEVICE_ADDED = 354, - REMOTE_PROC_DOMAIN_ADD_IOTHREAD = 355, - REMOTE_PROC_DOMAIN_DEL_IOTHREAD = 356, - REMOTE_PROC_DOMAIN_SET_USER_PASSWORD = 357, - REMOTE_PROC_DOMAIN_RENAME = 358, - REMOTE_PROC_DOMAIN_EVENT_CALLBACK_MIGRATION_ITERATION = 359, - REMOTE_PROC_CONNECT_REGISTER_CLOSE_CALLBACK = 360, - REMOTE_PROC_CONNECT_UNREGISTER_CLOSE_CALLBACK = 361, - REMOTE_PROC_CONNECT_EVENT_CONNECTION_CLOSED = 362, - REMOTE_PROC_DOMAIN_EVENT_CALLBACK_JOB_COMPLETED = 363, - REMOTE_PROC_DOMAIN_MIGRATE_START_POST_COPY = 364, - REMOTE_PROC_DOMAIN_GET_PERF_EVENTS = 365, - REMOTE_PROC_DOMAIN_SET_PERF_EVENTS = 366, - REMOTE_PROC_DOMAIN_EVENT_CALLBACK_DEVICE_REMOVAL_FAILED = 367, - REMOTE_PROC_CONNECT_STORAGE_POOL_EVENT_REGISTER_ANY = 368, - REMOTE_PROC_CONNECT_STORAGE_POOL_EVENT_DEREGISTER_ANY = 369, - REMOTE_PROC_STORAGE_POOL_EVENT_LIFECYCLE = 370, - REMOTE_PROC_DOMAIN_GET_GUEST_VCPUS = 371, - REMOTE_PROC_DOMAIN_SET_GUEST_VCPUS = 372, - REMOTE_PROC_STORAGE_POOL_EVENT_REFRESH = 373, - REMOTE_PROC_CONNECT_NODE_DEVICE_EVENT_REGISTER_ANY = 374, - REMOTE_PROC_CONNECT_NODE_DEVICE_EVENT_DEREGISTER_ANY = 375, - REMOTE_PROC_NODE_DEVICE_EVENT_LIFECYCLE = 376, - REMOTE_PROC_NODE_DEVICE_EVENT_UPDATE = 377, - REMOTE_PROC_STORAGE_VOL_GET_INFO_FLAGS = 378, - REMOTE_PROC_DOMAIN_EVENT_CALLBACK_METADATA_CHANGE = 379, - REMOTE_PROC_CONNECT_SECRET_EVENT_REGISTER_ANY = 380, - REMOTE_PROC_CONNECT_SECRET_EVENT_DEREGISTER_ANY = 381, - REMOTE_PROC_SECRET_EVENT_LIFECYCLE = 382, - REMOTE_PROC_SECRET_EVENT_VALUE_CHANGED = 383, - REMOTE_PROC_DOMAIN_SET_VCPU = 384, - REMOTE_PROC_DOMAIN_EVENT_BLOCK_THRESHOLD = 385, - REMOTE_PROC_DOMAIN_SET_BLOCK_THRESHOLD = 386, - REMOTE_PROC_DOMAIN_MIGRATE_GET_MAX_DOWNTIME = 387, - REMOTE_PROC_DOMAIN_MANAGED_SAVE_GET_XML_DESC = 388, - REMOTE_PROC_DOMAIN_MANAGED_SAVE_DEFINE_XML = 389, - REMOTE_PROC_DOMAIN_SET_LIFECYCLE_ACTION = 390, - REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_TARGET_PATH = 391, - REMOTE_PROC_DOMAIN_DETACH_DEVICE_ALIAS = 392, - REMOTE_PROC_CONNECT_COMPARE_HYPERVISOR_CPU = 393, - REMOTE_PROC_CONNECT_BASELINE_HYPERVISOR_CPU = 394, - REMOTE_PROC_NODE_GET_SEV_INFO = 395, - REMOTE_PROC_DOMAIN_GET_LAUNCH_SECURITY_INFO = 396, - REMOTE_PROC_NWFILTER_BINDING_LOOKUP_BY_PORT_DEV = 397, - REMOTE_PROC_NWFILTER_BINDING_GET_XML_DESC = 398, - REMOTE_PROC_NWFILTER_BINDING_CREATE_XML = 399, - REMOTE_PROC_NWFILTER_BINDING_DELETE = 400, - REMOTE_PROC_CONNECT_LIST_ALL_NWFILTER_BINDINGS = 401, - REMOTE_PROC_DOMAIN_SET_IOTHREAD_PARAMS = 402, - REMOTE_PROC_CONNECT_GET_STORAGE_POOL_CAPABILITIES = 403, - REMOTE_PROC_NETWORK_LIST_ALL_PORTS = 404, - REMOTE_PROC_NETWORK_PORT_LOOKUP_BY_UUID = 405, - REMOTE_PROC_NETWORK_PORT_CREATE_XML = 406, - REMOTE_PROC_NETWORK_PORT_GET_PARAMETERS = 407, - REMOTE_PROC_NETWORK_PORT_SET_PARAMETERS = 408, - REMOTE_PROC_NETWORK_PORT_GET_XML_DESC = 409, - REMOTE_PROC_NETWORK_PORT_DELETE = 410, - REMOTE_PROC_DOMAIN_CHECKPOINT_CREATE_XML = 411, - REMOTE_PROC_DOMAIN_CHECKPOINT_GET_XML_DESC = 412, - REMOTE_PROC_DOMAIN_LIST_ALL_CHECKPOINTS = 413, - REMOTE_PROC_DOMAIN_CHECKPOINT_LIST_ALL_CHILDREN = 414, - REMOTE_PROC_DOMAIN_CHECKPOINT_LOOKUP_BY_NAME = 415, - REMOTE_PROC_DOMAIN_CHECKPOINT_GET_PARENT = 416, - REMOTE_PROC_DOMAIN_CHECKPOINT_DELETE = 417, - REMOTE_PROC_DOMAIN_GET_GUEST_INFO = 418, - REMOTE_PROC_CONNECT_SET_IDENTITY = 419, - REMOTE_PROC_DOMAIN_AGENT_SET_RESPONSE_TIMEOUT = 420, - REMOTE_PROC_DOMAIN_BACKUP_BEGIN = 421, - REMOTE_PROC_DOMAIN_BACKUP_GET_XML_DESC = 422, -}; ------- 14/154 check-qemu_protocol FAIL 0.05s (exit status 1) --- command --- 09:18:24 LANG='C' LC_CTYPE='en_US.UTF-8' LC_ALL='' /bin/python3 /home/pipo/libvirt/scripts/check-remote-protocol.py qemu_protocol virt_remote_driver /home/pipo/build/libvirt/meson/clang/src/remote /bin/pdwtags /home/pipo/build/libvirt/meson/clang/../../../../libvirt/src/qemu_protocol-structs --- stdout --- --- /home/pipo/build/libvirt/meson/clang/../../../../libvirt/src/qemu_protocol-structs 2020-01-29 15:18:11.000000000 +0100 +++ - 2020-07-17 11:18:24.996893209 +0200 @@ -4,6 +4,14 @@ remote_uuid uuid; int id; }; +enum qemu_procedure { + QEMU_PROC_DOMAIN_MONITOR_COMMAND = 1, + QEMU_PROC_DOMAIN_ATTACH = 2, + QEMU_PROC_DOMAIN_AGENT_COMMAND = 3, + QEMU_PROC_CONNECT_DOMAIN_MONITOR_EVENT_REGISTER = 4, + QEMU_PROC_CONNECT_DOMAIN_MONITOR_EVENT_DEREGISTER = 5, + QEMU_PROC_DOMAIN_MONITOR_EVENT = 6, +}; struct qemu_domain_monitor_command_args { remote_nonnull_domain dom; remote_nonnull_string cmd; @@ -47,11 +55,3 @@ u_int micros; remote_string details; }; -enum qemu_procedure { - QEMU_PROC_DOMAIN_MONITOR_COMMAND = 1, - QEMU_PROC_DOMAIN_ATTACH = 2, - QEMU_PROC_DOMAIN_AGENT_COMMAND = 3, - QEMU_PROC_CONNECT_DOMAIN_MONITOR_EVENT_REGISTER = 4, - QEMU_PROC_CONNECT_DOMAIN_MONITOR_EVENT_DEREGISTER = 5, - QEMU_PROC_DOMAIN_MONITOR_EVENT = 6, -}; ------- 15/154 check-lxc_protocol FAIL 0.05s (exit status 1) --- command --- 09:18:24 LANG='C' LC_CTYPE='en_US.UTF-8' LC_ALL='' /bin/python3 /home/pipo/libvirt/scripts/check-remote-protocol.py lxc_protocol virt_remote_driver /home/pipo/build/libvirt/meson/clang/src/remote /bin/pdwtags /home/pipo/build/libvirt/meson/clang/../../../../libvirt/src/lxc_protocol-structs --- stdout --- --- /home/pipo/build/libvirt/meson/clang/../../../../libvirt/src/lxc_protocol-structs 2020-01-29 15:18:11.000000000 +0100 +++ - 2020-07-17 11:18:24.996089241 +0200 @@ -4,10 +4,10 @@ remote_uuid uuid; int id; }; +enum lxc_procedure { + LXC_PROC_DOMAIN_OPEN_NAMESPACE = 1, +}; struct lxc_domain_open_namespace_args { remote_nonnull_domain dom; u_int flags; }; -enum lxc_procedure { - LXC_PROC_DOMAIN_OPEN_NAMESPACE = 1, -}; ------- 16/154 check-admin_protocol FAIL 0.05s (exit status 1) --- command --- 09:18:24 LANG='C' LC_CTYPE='en_US.UTF-8' LC_ALL='' /bin/python3 /home/pipo/libvirt/scripts/check-remote-protocol.py admin_protocol virt_admin_driver /home/pipo/build/libvirt/meson/clang/src/admin /bin/pdwtags /home/pipo/build/libvirt/meson/clang/../../../../libvirt/src/admin_protocol-structs --- Listing only the last 100 lines from a long log. --- struct admin_typed_param { admin_nonnull_string field; admin_typed_param_value value; }; -struct admin_nonnull_server { - admin_nonnull_string name; -}; -struct admin_nonnull_client { - admin_nonnull_server srv; - uint64_t id; - int64_t timestamp; - u_int transport; -}; struct admin_connect_open_args { u_int flags; }; @@ -39,8 +58,6 @@ u_int servers_len; admin_nonnull_server * servers_val; } servers; - u_int ret; -}; struct admin_connect_lookup_server_args { admin_nonnull_string name; u_int flags; @@ -57,15 +74,12 @@ u_int params_len; admin_typed_param * params_val; } params; -}; struct admin_server_set_threadpool_parameters_args { admin_nonnull_server srv; struct { u_int params_len; admin_typed_param * params_val; } params; - u_int flags; -}; struct admin_server_list_clients_args { admin_nonnull_server srv; u_int need_results; @@ -76,8 +90,6 @@ u_int clients_len; admin_nonnull_client * clients_val; } clients; - u_int ret; -}; struct admin_server_lookup_client_args { admin_nonnull_server srv; uint64_t id; @@ -95,7 +107,6 @@ u_int params_len; admin_typed_param * params_val; } params; -}; struct admin_client_close_args { admin_nonnull_client clnt; u_int flags; @@ -109,15 +120,12 @@ u_int params_len; admin_typed_param * params_val; } params; -}; struct admin_server_set_client_limits_args { admin_nonnull_server srv; struct { u_int params_len; admin_typed_param * params_val; } params; - u_int flags; -}; struct admin_server_update_tls_files_args { admin_nonnull_server srv; u_int flags; @@ -144,23 +152,3 @@ admin_string filters; u_int flags; }; -enum admin_procedure { - ADMIN_PROC_CONNECT_OPEN = 1, - ADMIN_PROC_CONNECT_CLOSE = 2, - ADMIN_PROC_CONNECT_GET_LIB_VERSION = 3, - ADMIN_PROC_CONNECT_LIST_SERVERS = 4, - ADMIN_PROC_CONNECT_LOOKUP_SERVER = 5, - ADMIN_PROC_SERVER_GET_THREADPOOL_PARAMETERS = 6, - ADMIN_PROC_SERVER_SET_THREADPOOL_PARAMETERS = 7, - ADMIN_PROC_SERVER_LIST_CLIENTS = 8, - ADMIN_PROC_SERVER_LOOKUP_CLIENT = 9, - ADMIN_PROC_CLIENT_GET_INFO = 10, - ADMIN_PROC_CLIENT_CLOSE = 11, - ADMIN_PROC_SERVER_GET_CLIENT_LIMITS = 12, - ADMIN_PROC_SERVER_SET_CLIENT_LIMITS = 13, - ADMIN_PROC_CONNECT_GET_LOGGING_OUTPUTS = 14, - ADMIN_PROC_CONNECT_GET_LOGGING_FILTERS = 15, - ADMIN_PROC_CONNECT_SET_LOGGING_OUTPUTS = 16, - ADMIN_PROC_CONNECT_SET_LOGGING_FILTERS = 17, - ADMIN_PROC_SERVER_UPDATE_TLS_FILES = 18, -}; ------- 17/154 check-lock_protocol FAIL 0.04s (exit status 1) --- command --- 09:18:24 LANG='C' LC_CTYPE='en_US.UTF-8' LC_ALL='' /bin/python3 /home/pipo/libvirt/scripts/check-remote-protocol.py lock_protocol lockd_impl /home/pipo/build/libvirt/meson/clang/src/locking /bin/pdwtags /home/pipo/build/libvirt/meson/clang/../../../../libvirt/src/lock_protocol-structs --- stdout --- --- /home/pipo/build/libvirt/meson/clang/../../../../libvirt/src/lock_protocol-structs 2020-01-29 15:18:11.000000000 +0100 +++ - 2020-07-17 11:18:25.001138489 +0200 @@ -1,4 +1,14 @@ /* -*- c -*- */ +enum virLockSpaceProtocolProcedure { + VIR_LOCK_SPACE_PROTOCOL_PROC_REGISTER = 1, + VIR_LOCK_SPACE_PROTOCOL_PROC_RESTRICT = 2, + VIR_LOCK_SPACE_PROTOCOL_PROC_NEW = 3, + VIR_LOCK_SPACE_PROTOCOL_PROC_CREATE_RESOURCE = 4, + VIR_LOCK_SPACE_PROTOCOL_PROC_DELETE_RESOURCE = 5, + VIR_LOCK_SPACE_PROTOCOL_PROC_ACQUIRE_RESOURCE = 6, + VIR_LOCK_SPACE_PROTOCOL_PROC_RELEASE_RESOURCE = 7, + VIR_LOCK_SPACE_PROTOCOL_PROC_CREATE_LOCKSPACE = 8, +}; struct virLockSpaceProtocolOwner { virLockSpaceProtocolUUID uuid; virLockSpaceProtocolNonNullString name; @@ -39,13 +49,3 @@ struct virLockSpaceProtocolCreateLockSpaceArgs { virLockSpaceProtocolNonNullString path; }; -enum virLockSpaceProtocolProcedure { - VIR_LOCK_SPACE_PROTOCOL_PROC_REGISTER = 1, - VIR_LOCK_SPACE_PROTOCOL_PROC_RESTRICT = 2, - VIR_LOCK_SPACE_PROTOCOL_PROC_NEW = 3, - VIR_LOCK_SPACE_PROTOCOL_PROC_CREATE_RESOURCE = 4, - VIR_LOCK_SPACE_PROTOCOL_PROC_DELETE_RESOURCE = 5, - VIR_LOCK_SPACE_PROTOCOL_PROC_ACQUIRE_RESOURCE = 6, - VIR_LOCK_SPACE_PROTOCOL_PROC_RELEASE_RESOURCE = 7, - VIR_LOCK_SPACE_PROTOCOL_PROC_CREATE_LOCKSPACE = 8, -}; ------- 18/154 check-lxc_monitor_protocol FAIL 0.04s (exit status 1) --- command --- 09:18:24 LANG='C' LC_CTYPE='en_US.UTF-8' LC_ALL='' /bin/python3 /home/pipo/libvirt/scripts/check-remote-protocol.py lxc_monitor_protocol virt_driver_lxc_impl /home/pipo/build/libvirt/meson/clang/src/lxc /bin/pdwtags /home/pipo/build/libvirt/meson/clang/../../../../libvirt/src/lxc_monitor_protocol-structs --- stdout --- --- /home/pipo/build/libvirt/meson/clang/../../../../libvirt/src/lxc_monitor_protocol-structs 2020-01-29 15:18:11.000000000 +0100 +++ - 2020-07-17 11:18:24.999930097 +0200 @@ -4,13 +4,13 @@ VIR_LXC_MONITOR_EXIT_STATUS_SHUTDOWN = 1, VIR_LXC_MONITOR_EXIT_STATUS_REBOOT = 2, }; +enum virLXCMonitorProcedure { + VIR_LXC_MONITOR_PROC_EXIT_EVENT = 1, + VIR_LXC_MONITOR_PROC_INIT_EVENT = 2, +}; struct virLXCMonitorExitEventMsg { virLXCMonitorExitStatus status; }; struct virLXCMonitorInitEventMsg { uint64_t initpid; }; -enum virLXCMonitorProcedure { - VIR_LXC_MONITOR_PROC_EXIT_EVENT = 1, - VIR_LXC_MONITOR_PROC_INIT_EVENT = 2, -}; -------

On Fri, Jul 17, 2020 at 11:21:56AM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:53:56 +0200, Pavel Hrdina wrote:
[...]
Tests fail when building with clang:
built as:
CC=clang meson clang ~/libvirt cd clang ninja ninja test
Looking at the test output (pasted below) you didn't faithfully reproduce the skipping of symbol file tests which have different ordering when the code is compiled with clang.
Nice catch, thanks. I tried building it with clang but did not try running tests. Should have tried running ninja dist. I'll fix it. Pavel

On a Friday in 2020, Pavel Hrdina wrote:
On Fri, Jul 17, 2020 at 11:21:56AM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:53:56 +0200, Pavel Hrdina wrote:
[...]
Tests fail when building with clang:
built as:
CC=clang meson clang ~/libvirt cd clang ninja ninja test
Looking at the test output (pasted below) you didn't faithfully reproduce the skipping of symbol file tests which have different ordering when the code is compiled with clang.
Nice catch, thanks. I tried building it with clang but did not try running tests.
Umm, how did the pipeline pass then, do we not run tests? Jano
Should have tried running ninja dist.
I'll fix it.
Pavel

On Fri, Jul 17, 2020 at 12:06:54PM +0200, Ján Tomko wrote:
On a Friday in 2020, Pavel Hrdina wrote:
On Fri, Jul 17, 2020 at 11:21:56AM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:53:56 +0200, Pavel Hrdina wrote:
[...]
Tests fail when building with clang:
built as:
CC=clang meson clang ~/libvirt cd clang ninja ninja test
Looking at the test output (pasted below) you didn't faithfully reproduce the skipping of symbol file tests which have different ordering when the code is compiled with clang.
Nice catch, thanks. I tried building it with clang but did not try running tests.
Umm, how did the pipeline pass then, do we not run tests?
We only use clang on FreeBSD & macOS and don't run unit tests on either. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Fri, Jul 17, 2020 at 11:39:15 +0200, Pavel Hrdina wrote:
On Fri, Jul 17, 2020 at 11:21:56AM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:53:56 +0200, Pavel Hrdina wrote:
[...]
Tests fail when building with clang:
built as:
CC=clang meson clang ~/libvirt cd clang ninja ninja test
Looking at the test output (pasted below) you didn't faithfully reproduce the skipping of symbol file tests which have different ordering when the code is compiled with clang.
Nice catch, thanks. I tried building it with clang but did not try running tests. Should have tried running ninja dist.
The fixed version on your branch now doesn't execute the tests when building with clang. After some learning curve (e.g. using -Dsystem=true to do the equivalent of ./autogen.sh --system, and the .libs/ directory stopping to exist I've successfully built both my normal workflows.

On Fri, Jul 17, 2020 at 03:45:36PM +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 11:39:15 +0200, Pavel Hrdina wrote:
On Fri, Jul 17, 2020 at 11:21:56AM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:53:56 +0200, Pavel Hrdina wrote:
[...]
Tests fail when building with clang:
built as:
CC=clang meson clang ~/libvirt cd clang ninja ninja test
Looking at the test output (pasted below) you didn't faithfully reproduce the skipping of symbol file tests which have different ordering when the code is compiled with clang.
Nice catch, thanks. I tried building it with clang but did not try running tests. Should have tried running ninja dist.
The fixed version on your branch now doesn't execute the tests when building with clang.
With autoconf they were silently skipped so I decided to not run them at all, but we can change it to show the as skipped.
After some learning curve (e.g. using -Dsystem=true to do the equivalent of ./autogen.sh --system, and the .libs/ directory stopping to exist I've successfully built both my normal workflows.
Glad to hear that it works for someone else as well. Thanks for testing and the feedback. Pavel

On Thu, Jul 16, 2020 at 11:53:56 +0200, Pavel Hrdina wrote: I've tried building RPMs both from the pre-patch tree state and after your patchset. I've then extracted all the RPMs toghether and compared the file lists (minus the 'build-id' directory which differs). I'm not sure whether it's due to the RPM or regular build process though. Here are differences which should be considered to be addressed: Specifically lines with '-' are MISSING from the RPMs obtained by building the meson-generated tarball: --- files-automake 2020-07-17 15:44:29.602038223 +0200 +++ files-meson 2020-07-17 15:44:38.204937457 +0200 @@ -1531,8 +1571,6 @@ .. backing_chains.html domainstatecapture.html -incrementalbackupinternals.html -kvm-realtime.html launch_security_sev.html locking.html locking-lockd.html @@ -1540,7 +1578,6 @@ migrationinternals.html qemu-passthrough-security.html rpm-deployment.html -s390_protected_virt.html secureusage.html virtiofs.html @@ -1564,6 +1601,8 @@ logo-square-powered-96.png logo-square-powered.svg logo-square.svg +logo-sticker-hexagon.svg +logo-sticker-square.svg unpack/usr/share/doc/libvirt-docs/html/manpages: . @@ -1636,7 +1675,6 @@ x86_Broadwell-noTSX-IBRS.xml x86_Broadwell-noTSX.xml x86_Broadwell.xml -x86_Cascadelake-Server-noTSX.xml x86_Cascadelake-Server.xml x86_Conroe.xml x86_Cooperlake.xml @@ -1644,7 +1682,6 @@ x86_coreduo.xml x86_cpu64-rhel5.xml x86_cpu64-rhel6.xml -x86_Dhyana.xml x86_EPYC-IBPB.xml x86_EPYC.xml x86_features.xml @@ -3274,10 +3311,10 @@ esx hyperv libvirt_probes.h -libvirt_qemu_probes.h locking logging lxc +qemu remote rpc util @@ -3340,6 +3377,11 @@ lxc_monitor_protocol.c lxc_monitor_protocol.h +unpack/usr/src/debug/libvirt-6.6.0-1.fc32.x86_64/x86_64-redhat-linux-gnu/src/qemu: +. +.. +libvirt_qemu_probes.h + unpack/usr/src/debug/libvirt-6.6.0-1.fc32.x86_64/x86_64-redhat-linux-gnu/src/remote: . .. I'm unsure about the 'probes' file location. The 'kbase' articles are unfortunate, but the cpu modes could pose real problems. The CPU xml files are from usr/share/libvirt/cpu_map

On Fri, Jul 17, 2020 at 16:04:16 +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:53:56 +0200, Pavel Hrdina wrote:
I've tried building RPMs both from the pre-patch tree state and after your patchset. I've then extracted all the RPMs toghether and compared the file lists (minus the 'build-id' directory which differs).
I'm not sure whether it's due to the RPM or regular build process though.
I've also started to verify file differences: config files which are installed in /etc/libvirt from said RPMs were not post-processed. E.g. virtnetworkd.conf: The meson-originated version has: # Set the name of the directory in which sockets will be found/created. # # This setting is not required or honoured if using systemd socket # activation with systemd version >= 227 # #unix_sock_dir = "@runstatedir@/libvirt" while automake: # Set the name of the directory in which sockets will be found/created. # # This setting is not required or honoured if using systemd socket # activation with systemd version >= 227 # #unix_sock_dir = "/run/libvirt" A non-exhaustive list of differences that I can see: automakerpm/unpack/etc/libvirt/virtinterfaced.conf automakerpm/unpack/etc/libvirt/virtlxcd.conf automakerpm/unpack/etc/libvirt/virtnetworkd.conf automakerpm/unpack/etc/libvirt/virtnodedevd.conf automakerpm/unpack/etc/libvirt/virtnwfilterd.conf automakerpm/unpack/etc/libvirt/virtqemud.conf automakerpm/unpack/etc/libvirt/virtsecretd.conf automakerpm/unpack/etc/libvirt/virtstoraged.conf automakerpm/unpack/etc/libvirt/virtvboxd.conf automakerpm/unpack/etc/libvirt/virtxend.conf

On Fri, Jul 17, 2020 at 16:18:52 +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 16:04:16 +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:53:56 +0200, Pavel Hrdina wrote:
I've tried building RPMs both from the pre-patch tree state and after your patchset. I've then extracted all the RPMs toghether and compared the file lists (minus the 'build-id' directory which differs).
I'm not sure whether it's due to the RPM or regular build process though.
Another difference is paths to shared objects: e.g virsh: automakerpm/unpack/usr/bin/virsh: linux-vdso.so.1 (0x00007ffccb1ea000) libvirt-lxc.so.0 => /lib64/libvirt-lxc.so.0 (0x00007f51f7082000) libvirt-qemu.so.0 => /lib64/libvirt-qemu.so.0 (0x00007f51f707d000) libvirt.so.0 => /lib64/libvirt.so.0 (0x00007f51f6bbd000) libxml2.so.2 => /lib64/libxml2.so.2 (0x00007f51f6a4d000) libreadline.so.8 => /lib64/libreadline.so.8 (0x00007f51f69f7000) libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007f51f68cc000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f51f68a8000) mesonrpm/unpack/usr/bin/virsh: linux-vdso.so.1 (0x00007ffcb4b8d000) libvirt-lxc.so.0 => /usr/lib64/libvirt-lxc.so.0 (0x00007fc2b9596000) libvirt-qemu.so.0 => /usr/lib64/libvirt-qemu.so.0 (0x00007fc2b9591000) libvirt.so.0 => /usr/lib64/libvirt.so.0 (0x00007fc2b90d1000) libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00007fc2b8f61000) libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007fc2b8e36000) libreadline.so.8 => /usr/lib64/libreadline.so.8 (0x00007fc2b8de0000) libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007fc2b8dc3000) This one is probably safe and also possibly considered modern, but I wanted to point it out. One mistake though is that usr/bin/virt-xml-validate is not installed as executalbe with meson!

On Fri, Jul 17, 2020 at 04:31:05PM +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 16:18:52 +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 16:04:16 +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:53:56 +0200, Pavel Hrdina wrote:
I've tried building RPMs both from the pre-patch tree state and after your patchset. I've then extracted all the RPMs toghether and compared the file lists (minus the 'build-id' directory which differs).
I'm not sure whether it's due to the RPM or regular build process though.
Another difference is paths to shared objects:
e.g virsh:
automakerpm/unpack/usr/bin/virsh: linux-vdso.so.1 (0x00007ffccb1ea000) libvirt-lxc.so.0 => /lib64/libvirt-lxc.so.0 (0x00007f51f7082000) libvirt-qemu.so.0 => /lib64/libvirt-qemu.so.0 (0x00007f51f707d000) libvirt.so.0 => /lib64/libvirt.so.0 (0x00007f51f6bbd000) libxml2.so.2 => /lib64/libxml2.so.2 (0x00007f51f6a4d000) libreadline.so.8 => /lib64/libreadline.so.8 (0x00007f51f69f7000) libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007f51f68cc000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f51f68a8000)
mesonrpm/unpack/usr/bin/virsh: linux-vdso.so.1 (0x00007ffcb4b8d000) libvirt-lxc.so.0 => /usr/lib64/libvirt-lxc.so.0 (0x00007fc2b9596000) libvirt-qemu.so.0 => /usr/lib64/libvirt-qemu.so.0 (0x00007fc2b9591000) libvirt.so.0 => /usr/lib64/libvirt.so.0 (0x00007fc2b90d1000) libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00007fc2b8f61000) libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007fc2b8e36000) libreadline.so.8 => /usr/lib64/libreadline.so.8 (0x00007fc2b8de0000) libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007fc2b8dc3000)
This one is probably safe and also possibly considered modern, but I wanted to point it out.
This should not be an issue.
One mistake though is that usr/bin/virt-xml-validate is not installed as executalbe with meson!
I'll fix it, thanks. Pavel

On Fri, Jul 17, 2020 at 16:31:05 +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 16:18:52 +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 16:04:16 +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:53:56 +0200, Pavel Hrdina wrote:
I've tried building RPMs both from the pre-patch tree state and after your patchset. I've then extracted all the RPMs toghether and compared the file lists (minus the 'build-id' directory which differs).
I'm not sure whether it's due to the RPM or regular build process though.
Another difference is paths to shared objects:
e.g virsh:
automakerpm/unpack/usr/bin/virsh: linux-vdso.so.1 (0x00007ffccb1ea000) libvirt-lxc.so.0 => /lib64/libvirt-lxc.so.0 (0x00007f51f7082000) libvirt-qemu.so.0 => /lib64/libvirt-qemu.so.0 (0x00007f51f707d000) libvirt.so.0 => /lib64/libvirt.so.0 (0x00007f51f6bbd000) libxml2.so.2 => /lib64/libxml2.so.2 (0x00007f51f6a4d000) libreadline.so.8 => /lib64/libreadline.so.8 (0x00007f51f69f7000) libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007f51f68cc000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f51f68a8000)
mesonrpm/unpack/usr/bin/virsh: linux-vdso.so.1 (0x00007ffcb4b8d000) libvirt-lxc.so.0 => /usr/lib64/libvirt-lxc.so.0 (0x00007fc2b9596000) libvirt-qemu.so.0 => /usr/lib64/libvirt-qemu.so.0 (0x00007fc2b9591000) libvirt.so.0 => /usr/lib64/libvirt.so.0 (0x00007fc2b90d1000) libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00007fc2b8f61000) libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007fc2b8e36000) libreadline.so.8 => /usr/lib64/libreadline.so.8 (0x00007fc2b8de0000) libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007fc2b8dc3000)
This one is probably safe and also possibly considered modern, but I wanted to point it out.
One mistake though is that usr/bin/virt-xml-validate is not installed as executalbe with meson!
Also virt-pki-validate

On Fri, Jul 17, 2020 at 16:37:45 +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 16:31:05 +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 16:18:52 +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 16:04:16 +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:53:56 +0200, Pavel Hrdina wrote:
I've tried building RPMs both from the pre-patch tree state and after your patchset. I've then extracted all the RPMs toghether and compared the file lists (minus the 'build-id' directory which differs).
I'm not sure whether it's due to the RPM or regular build process though.
Another difference is paths to shared objects:
e.g virsh:
automakerpm/unpack/usr/bin/virsh: linux-vdso.so.1 (0x00007ffccb1ea000) libvirt-lxc.so.0 => /lib64/libvirt-lxc.so.0 (0x00007f51f7082000) libvirt-qemu.so.0 => /lib64/libvirt-qemu.so.0 (0x00007f51f707d000) libvirt.so.0 => /lib64/libvirt.so.0 (0x00007f51f6bbd000) libxml2.so.2 => /lib64/libxml2.so.2 (0x00007f51f6a4d000) libreadline.so.8 => /lib64/libreadline.so.8 (0x00007f51f69f7000) libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007f51f68cc000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f51f68a8000)
mesonrpm/unpack/usr/bin/virsh: linux-vdso.so.1 (0x00007ffcb4b8d000) libvirt-lxc.so.0 => /usr/lib64/libvirt-lxc.so.0 (0x00007fc2b9596000) libvirt-qemu.so.0 => /usr/lib64/libvirt-qemu.so.0 (0x00007fc2b9591000) libvirt.so.0 => /usr/lib64/libvirt.so.0 (0x00007fc2b90d1000) libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00007fc2b8f61000) libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007fc2b8e36000) libreadline.so.8 => /usr/lib64/libreadline.so.8 (0x00007fc2b8de0000) libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007fc2b8dc3000)
This one is probably safe and also possibly considered modern, but I wanted to point it out.
One mistake though is that usr/bin/virt-xml-validate is not installed as executalbe with meson!
Also virt-pki-validate
And virt-sanlock-cleanup in usr/sbin/ usr/share/doc/libvirt-docs/README is a symlink with meson ... the automake version doesn't differ. Is it even worth having them? then usr/share/doc/libvirt-docs/AUTHORS '#contributorslist#' is not expanded with meson . I obviously could not verify binaries, but the files are at least present :)

On Fri, Jul 17, 2020 at 04:53:28PM +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 16:37:45 +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 16:31:05 +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 16:18:52 +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 16:04:16 +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:53:56 +0200, Pavel Hrdina wrote:
I've tried building RPMs both from the pre-patch tree state and after your patchset. I've then extracted all the RPMs toghether and compared the file lists (minus the 'build-id' directory which differs).
I'm not sure whether it's due to the RPM or regular build process though.
Another difference is paths to shared objects:
e.g virsh:
automakerpm/unpack/usr/bin/virsh: linux-vdso.so.1 (0x00007ffccb1ea000) libvirt-lxc.so.0 => /lib64/libvirt-lxc.so.0 (0x00007f51f7082000) libvirt-qemu.so.0 => /lib64/libvirt-qemu.so.0 (0x00007f51f707d000) libvirt.so.0 => /lib64/libvirt.so.0 (0x00007f51f6bbd000) libxml2.so.2 => /lib64/libxml2.so.2 (0x00007f51f6a4d000) libreadline.so.8 => /lib64/libreadline.so.8 (0x00007f51f69f7000) libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007f51f68cc000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f51f68a8000)
mesonrpm/unpack/usr/bin/virsh: linux-vdso.so.1 (0x00007ffcb4b8d000) libvirt-lxc.so.0 => /usr/lib64/libvirt-lxc.so.0 (0x00007fc2b9596000) libvirt-qemu.so.0 => /usr/lib64/libvirt-qemu.so.0 (0x00007fc2b9591000) libvirt.so.0 => /usr/lib64/libvirt.so.0 (0x00007fc2b90d1000) libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00007fc2b8f61000) libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007fc2b8e36000) libreadline.so.8 => /usr/lib64/libreadline.so.8 (0x00007fc2b8de0000) libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007fc2b8dc3000)
This one is probably safe and also possibly considered modern, but I wanted to point it out.
One mistake though is that usr/bin/virt-xml-validate is not installed as executalbe with meson!
Also virt-pki-validate
And virt-sanlock-cleanup in usr/sbin/
Already fixed, thanks.
usr/share/doc/libvirt-docs/README is a symlink with meson ... the automake version doesn't differ. Is it even worth having them?
The symlink is also in our repository, I was not able to find any rule in autoconf that would do anything with it. The difference exists in the tarballs so it's some autotools magic that I'm not willing to investigate.
then
usr/share/doc/libvirt-docs/AUTHORS '#contributorslist#' is not expanded with meson
Fixed, thanks, it has to be '@contributorslist@' to expand it with meson.
I obviously could not verify binaries, but the files are at least present :)
Thanks for the feedback. Pavel

On Fri, Jul 17, 2020 at 05:49:42PM +0200, Pavel Hrdina wrote:
On Fri, Jul 17, 2020 at 04:53:28PM +0200, Peter Krempa wrote:
usr/share/doc/libvirt-docs/README is a symlink with meson ... the automake version doesn't differ. Is it even worth having them?
The symlink is also in our repository, I was not able to find any rule in autoconf that would do anything with it. The difference exists in the tarballs so it's some autotools magic that I'm not willing to investigate.
IIRC, the README -> README.md symlink just exists because automake really wants a file exactly called README. I say we just drop this symlink. Anyone is clever enough to find README.md. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Fri, Jul 17, 2020 at 05:03:31PM +0100, Daniel P. Berrangé wrote:
On Fri, Jul 17, 2020 at 05:49:42PM +0200, Pavel Hrdina wrote:
On Fri, Jul 17, 2020 at 04:53:28PM +0200, Peter Krempa wrote:
usr/share/doc/libvirt-docs/README is a symlink with meson ... the automake version doesn't differ. Is it even worth having them?
The symlink is also in our repository, I was not able to find any rule in autoconf that would do anything with it. The difference exists in the tarballs so it's some autotools magic that I'm not willing to investigate.
IIRC, the README -> README.md symlink just exists because automake really wants a file exactly called README. I say we just drop this symlink. Anyone is clever enough to find README.md.
Agreed, but I would like to do it in different series to not complicate the Meson rewrite. Pavel

On Fri, Jul 17, 2020 at 04:37:45PM +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 16:31:05 +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 16:18:52 +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 16:04:16 +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:53:56 +0200, Pavel Hrdina wrote:
I've tried building RPMs both from the pre-patch tree state and after your patchset. I've then extracted all the RPMs toghether and compared the file lists (minus the 'build-id' directory which differs).
I'm not sure whether it's due to the RPM or regular build process though.
Another difference is paths to shared objects:
e.g virsh:
automakerpm/unpack/usr/bin/virsh: linux-vdso.so.1 (0x00007ffccb1ea000) libvirt-lxc.so.0 => /lib64/libvirt-lxc.so.0 (0x00007f51f7082000) libvirt-qemu.so.0 => /lib64/libvirt-qemu.so.0 (0x00007f51f707d000) libvirt.so.0 => /lib64/libvirt.so.0 (0x00007f51f6bbd000) libxml2.so.2 => /lib64/libxml2.so.2 (0x00007f51f6a4d000) libreadline.so.8 => /lib64/libreadline.so.8 (0x00007f51f69f7000) libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007f51f68cc000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f51f68a8000)
mesonrpm/unpack/usr/bin/virsh: linux-vdso.so.1 (0x00007ffcb4b8d000) libvirt-lxc.so.0 => /usr/lib64/libvirt-lxc.so.0 (0x00007fc2b9596000) libvirt-qemu.so.0 => /usr/lib64/libvirt-qemu.so.0 (0x00007fc2b9591000) libvirt.so.0 => /usr/lib64/libvirt.so.0 (0x00007fc2b90d1000) libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00007fc2b8f61000) libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007fc2b8e36000) libreadline.so.8 => /usr/lib64/libreadline.so.8 (0x00007fc2b8de0000) libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007fc2b8dc3000)
This one is probably safe and also possibly considered modern, but I wanted to point it out.
One mistake though is that usr/bin/virt-xml-validate is not installed as executalbe with meson!
Also virt-pki-validate
And virt-sanlock-cleanup and libvirt-guests.sh. Fixing all of these as I checked everything that's installed. Thanks

On Fri, Jul 17, 2020 at 04:18:52PM +0200, Peter Krempa wrote:
On Fri, Jul 17, 2020 at 16:04:16 +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:53:56 +0200, Pavel Hrdina wrote:
I've tried building RPMs both from the pre-patch tree state and after your patchset. I've then extracted all the RPMs toghether and compared the file lists (minus the 'build-id' directory which differs).
I'm not sure whether it's due to the RPM or regular build process though.
I've also started to verify file differences:
config files which are installed in /etc/libvirt from said RPMs were not post-processed.
E.g. virtnetworkd.conf:
The meson-originated version has:
# Set the name of the directory in which sockets will be found/created. # # This setting is not required or honoured if using systemd socket # activation with systemd version >= 227 # #unix_sock_dir = "@runstatedir@/libvirt"
while automake:
# Set the name of the directory in which sockets will be found/created. # # This setting is not required or honoured if using systemd socket # activation with systemd version >= 227 # #unix_sock_dir = "/run/libvirt"
So it's actually the other way around. I just checked it and with meson it is expanded correctly. With autotools we have @runstatedir@ and others in the config files. I also checked the installed files in my fedora system and they also contain not-expanded strings. So the meson rewrite fixes the issue that we have with autotools. So I guess no need to do anything here. Pavel

On Fri, Jul 17, 2020 at 04:04:16PM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:53:56 +0200, Pavel Hrdina wrote:
I've tried building RPMs both from the pre-patch tree state and after your patchset. I've then extracted all the RPMs toghether and compared the file lists (minus the 'build-id' directory which differs).
I'm not sure whether it's due to the RPM or regular build process though.
It's because we don't track these files with autotools so there is no conflict when rebasing this series. I tried to make sure nothing like this happens by going through all the new commits since the last rebase but it's easy to miss something. It the missing HTML docs files and XML CPU files have to be fixed (I'll do it right now and update gitlab). The qemu probes file location was moved because it is generated in qemu directory with meson, I will check if we need to update our spec file. Thanks for the comparison. Pavel
Here are differences which should be considered to be addressed:
Specifically lines with '-' are MISSING from the RPMs obtained by building the meson-generated tarball:
--- files-automake 2020-07-17 15:44:29.602038223 +0200 +++ files-meson 2020-07-17 15:44:38.204937457 +0200 @@ -1531,8 +1571,6 @@ .. backing_chains.html domainstatecapture.html -incrementalbackupinternals.html -kvm-realtime.html launch_security_sev.html locking.html locking-lockd.html @@ -1540,7 +1578,6 @@ migrationinternals.html qemu-passthrough-security.html rpm-deployment.html -s390_protected_virt.html secureusage.html virtiofs.html
@@ -1564,6 +1601,8 @@ logo-square-powered-96.png logo-square-powered.svg logo-square.svg +logo-sticker-hexagon.svg +logo-sticker-square.svg
unpack/usr/share/doc/libvirt-docs/html/manpages: . @@ -1636,7 +1675,6 @@ x86_Broadwell-noTSX-IBRS.xml x86_Broadwell-noTSX.xml x86_Broadwell.xml -x86_Cascadelake-Server-noTSX.xml x86_Cascadelake-Server.xml x86_Conroe.xml x86_Cooperlake.xml @@ -1644,7 +1682,6 @@ x86_coreduo.xml x86_cpu64-rhel5.xml x86_cpu64-rhel6.xml -x86_Dhyana.xml x86_EPYC-IBPB.xml x86_EPYC.xml x86_features.xml @@ -3274,10 +3311,10 @@ esx hyperv libvirt_probes.h -libvirt_qemu_probes.h locking logging lxc +qemu remote rpc util @@ -3340,6 +3377,11 @@ lxc_monitor_protocol.c lxc_monitor_protocol.h
+unpack/usr/src/debug/libvirt-6.6.0-1.fc32.x86_64/x86_64-redhat-linux-gnu/src/qemu: +. +.. +libvirt_qemu_probes.h + unpack/usr/src/debug/libvirt-6.6.0-1.fc32.x86_64/x86_64-redhat-linux-gnu/src/remote: . ..
I'm unsure about the 'probes' file location. The 'kbase' articles are unfortunate, but the cpu modes could pose real problems.
The CPU xml files are from usr/share/libvirt/cpu_map

On Thu, Jul 16, 2020 at 11:53:56AM +0200, Pavel Hrdina wrote:
So I was finally able to produce the patches to port libvirt to Meson. Obviously, it is a lot of changes. It might look that some of the patches could be squashed together but I would rather have it as separated as possible to make the review not that difficult.
Some things I noticed, building on Fedora 31, with meson 0.55 from pip A bunch of warnings from meson: WARNING: custom_target 'virtesxgen' has more than one output! Using the first one. WARNING: custom_target 'virthypervgen' has more than one output! Using the first one. WARNING: custom_target 'protocol.h' has more than one output! Using the first one. WARNING: custom_target 'generate-api' has more than one output! Using the first one. WARNING: custom_target 'index-api' has more than one output! Using the first one. WARNING: custom_target 'index-admin-api' has more than one output! Using the first one. WARNING: custom_target 'index-lxc-api' has more than one output! Using the first one. WARNING: custom_target 'index-qemu-api' has more than one output! Using the first one. During build, a bunch of bogus automake style progress messages: Generating virtesxgen with a custom command GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.typedef GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.typeenum GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.typetostring GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.typefromstring GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.h GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.c GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_methods.generated.h GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_methods.generated.c GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_methods.generated.macro GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi.generated.h GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi.generated.c Generating virthypervgen with a custom command GEN /home/berrange/src/virt/libvirt/build/src/hyperv/hyperv_wmi_classes.generated.typedef GEN /home/berrange/src/virt/libvirt/build/src/hyperv/hyperv_wmi_classes.generated.h GEN /home/berrange/src/virt/libvirt/build/src/hyperv/hyperv_wmi_classes.generated.c And one problem I think is unrelated / pre-existing, but lost in the noise of automake: ../tests/qemuxml2xmltest.c: In function ‘mymain’: ../tests/qemuxml2xmltest.c:132:1: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without 132 | mymain(void) | ^~~~~~ The conversion has introduced 9 new shell scripts in scripts/. IMHO, all of these need to be python scripts instead to follow out intent to standardize on python. I dream of a world with zero shell scripts. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Fri, Jul 17, 2020 at 03:24:38PM +0100, Daniel P. Berrangé wrote:
On Thu, Jul 16, 2020 at 11:53:56AM +0200, Pavel Hrdina wrote:
So I was finally able to produce the patches to port libvirt to Meson. Obviously, it is a lot of changes. It might look that some of the patches could be squashed together but I would rather have it as separated as possible to make the review not that difficult.
Some things I noticed, building on Fedora 31, with meson 0.55 from pip
A bunch of warnings from meson:
WARNING: custom_target 'virtesxgen' has more than one output! Using the first one. WARNING: custom_target 'virthypervgen' has more than one output! Using the first one. WARNING: custom_target 'protocol.h' has more than one output! Using the first one. WARNING: custom_target 'generate-api' has more than one output! Using the first one. WARNING: custom_target 'index-api' has more than one output! Using the first one. WARNING: custom_target 'index-admin-api' has more than one output! Using the first one. WARNING: custom_target 'index-lxc-api' has more than one output! Using the first one. WARNING: custom_target 'index-qemu-api' has more than one output! Using the first one.
So it fails with meson 0.55.0 on my Fedora 32 as well. I bisected Meson repository and this commit <b4b1a2c5a145c1459fc4563a289e164e23bd6a02> breaks the behavior so I believe it's a bug in Meson. The warning is generated by any custom_target that has multiple output files which is obviously incorrect as documentation [1] states that: * output: list of output files I created an issue on github for this warning [2].
During build, a bunch of bogus automake style progress messages:
Generating virtesxgen with a custom command GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.typedef GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.typeenum GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.typetostring GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.typefromstring GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.h GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.c GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_methods.generated.h GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_methods.generated.c GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_methods.generated.macro GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi.generated.h GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi.generated.c
Generating virthypervgen with a custom command GEN /home/berrange/src/virt/libvirt/build/src/hyperv/hyperv_wmi_classes.generated.typedef GEN /home/berrange/src/virt/libvirt/build/src/hyperv/hyperv_wmi_classes.generated.h GEN /home/berrange/src/virt/libvirt/build/src/hyperv/hyperv_wmi_classes.generated.c
These are generated by scripts: scripts/esx_vi_generator.py scripts/hyperv_wmi_generator.py I was ignoring these outputs but I agree that it would be probably nice to remote it. I'll fix it and push fixed version into gitlab.
And one problem I think is unrelated / pre-existing, but lost in the noise of automake:
../tests/qemuxml2xmltest.c: In function ‘mymain’: ../tests/qemuxml2xmltest.c:132:1: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without 132 | mymain(void) | ^~~~~~
It is pre-existing so not addressing it right now as it's unrelated.
The conversion has introduced 9 new shell scripts in scripts/.
IMHO, all of these need to be python scripts instead to follow out intent to standardize on python. I dream of a world with zero shell scripts.
Sure, works for me. My idea was that these scripts are super simple and python would be overkill but I'm OK with using python. I'll rewrite it and push into gitlab. Thanks for the review. Pavel [1] <https://mesonbuild.com/Reference-manual.html#custom_target> [2] <https://github.com/mesonbuild/meson/issues/7466>

On Fri, Jul 17, 2020 at 07:00:44PM +0200, Pavel Hrdina wrote:
On Fri, Jul 17, 2020 at 03:24:38PM +0100, Daniel P. Berrangé wrote:
On Thu, Jul 16, 2020 at 11:53:56AM +0200, Pavel Hrdina wrote:
So I was finally able to produce the patches to port libvirt to Meson. Obviously, it is a lot of changes. It might look that some of the patches could be squashed together but I would rather have it as separated as possible to make the review not that difficult.
Some things I noticed, building on Fedora 31, with meson 0.55 from pip
A bunch of warnings from meson:
WARNING: custom_target 'virtesxgen' has more than one output! Using the first one. WARNING: custom_target 'virthypervgen' has more than one output! Using the first one. WARNING: custom_target 'protocol.h' has more than one output! Using the first one. WARNING: custom_target 'generate-api' has more than one output! Using the first one. WARNING: custom_target 'index-api' has more than one output! Using the first one. WARNING: custom_target 'index-admin-api' has more than one output! Using the first one. WARNING: custom_target 'index-lxc-api' has more than one output! Using the first one. WARNING: custom_target 'index-qemu-api' has more than one output! Using the first one.
So it fails with meson 0.55.0 on my Fedora 32 as well. I bisected Meson repository and this commit <b4b1a2c5a145c1459fc4563a289e164e23bd6a02> breaks the behavior so I believe it's a bug in Meson.
The warning is generated by any custom_target that has multiple output files which is obviously incorrect as documentation [1] states that:
* output: list of output files
I created an issue on github for this warning [2].
During build, a bunch of bogus automake style progress messages:
Generating virtesxgen with a custom command GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.typedef GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.typeenum GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.typetostring GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.typefromstring GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.h GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.c GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_methods.generated.h GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_methods.generated.c GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_methods.generated.macro GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi.generated.h GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi.generated.c
Generating virthypervgen with a custom command GEN /home/berrange/src/virt/libvirt/build/src/hyperv/hyperv_wmi_classes.generated.typedef GEN /home/berrange/src/virt/libvirt/build/src/hyperv/hyperv_wmi_classes.generated.h GEN /home/berrange/src/virt/libvirt/build/src/hyperv/hyperv_wmi_classes.generated.c
These are generated by scripts:
scripts/esx_vi_generator.py scripts/hyperv_wmi_generator.py
I was ignoring these outputs but I agree that it would be probably nice to remote it. I'll fix it and push fixed version into gitlab.
And one problem I think is unrelated / pre-existing, but lost in the noise of automake:
../tests/qemuxml2xmltest.c: In function ‘mymain’: ../tests/qemuxml2xmltest.c:132:1: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without 132 | mymain(void) | ^~~~~~
It is pre-existing so not addressing it right now as it's unrelated.
The conversion has introduced 9 new shell scripts in scripts/.
IMHO, all of these need to be python scripts instead to follow out intent to standardize on python. I dream of a world with zero shell scripts.
Sure, works for me. My idea was that these scripts are super simple and python would be overkill but I'm OK with using python. I'll rewrite it and push into gitlab.
Even though they are simple, we always have the trapdoor of bash vs non-bash, people always mess up == vs = for example. So using python gives us stronger portability. It would in fact let us build natively on Windows (except for all the other stuff that would break in the actual code if we didn't use mingw :-) Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Fri, Jul 17, 2020 at 06:14:13PM +0100, Daniel P. Berrangé wrote:
On Fri, Jul 17, 2020 at 07:00:44PM +0200, Pavel Hrdina wrote:
On Fri, Jul 17, 2020 at 03:24:38PM +0100, Daniel P. Berrangé wrote:
On Thu, Jul 16, 2020 at 11:53:56AM +0200, Pavel Hrdina wrote:
So I was finally able to produce the patches to port libvirt to Meson. Obviously, it is a lot of changes. It might look that some of the patches could be squashed together but I would rather have it as separated as possible to make the review not that difficult.
Some things I noticed, building on Fedora 31, with meson 0.55 from pip
A bunch of warnings from meson:
WARNING: custom_target 'virtesxgen' has more than one output! Using the first one. WARNING: custom_target 'virthypervgen' has more than one output! Using the first one. WARNING: custom_target 'protocol.h' has more than one output! Using the first one. WARNING: custom_target 'generate-api' has more than one output! Using the first one. WARNING: custom_target 'index-api' has more than one output! Using the first one. WARNING: custom_target 'index-admin-api' has more than one output! Using the first one. WARNING: custom_target 'index-lxc-api' has more than one output! Using the first one. WARNING: custom_target 'index-qemu-api' has more than one output! Using the first one.
So it fails with meson 0.55.0 on my Fedora 32 as well. I bisected Meson repository and this commit <b4b1a2c5a145c1459fc4563a289e164e23bd6a02> breaks the behavior so I believe it's a bug in Meson.
The warning is generated by any custom_target that has multiple output files which is obviously incorrect as documentation [1] states that:
* output: list of output files
I created an issue on github for this warning [2].
During build, a bunch of bogus automake style progress messages:
Generating virtesxgen with a custom command GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.typedef GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.typeenum GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.typetostring GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.typefromstring GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.h GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_types.generated.c GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_methods.generated.h GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_methods.generated.c GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi_methods.generated.macro GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi.generated.h GEN /home/berrange/src/virt/libvirt/build/src/esx/esx_vi.generated.c
Generating virthypervgen with a custom command GEN /home/berrange/src/virt/libvirt/build/src/hyperv/hyperv_wmi_classes.generated.typedef GEN /home/berrange/src/virt/libvirt/build/src/hyperv/hyperv_wmi_classes.generated.h GEN /home/berrange/src/virt/libvirt/build/src/hyperv/hyperv_wmi_classes.generated.c
These are generated by scripts:
scripts/esx_vi_generator.py scripts/hyperv_wmi_generator.py
I was ignoring these outputs but I agree that it would be probably nice to remote it. I'll fix it and push fixed version into gitlab.
And one problem I think is unrelated / pre-existing, but lost in the noise of automake:
../tests/qemuxml2xmltest.c: In function ‘mymain’: ../tests/qemuxml2xmltest.c:132:1: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without 132 | mymain(void) | ^~~~~~
It is pre-existing so not addressing it right now as it's unrelated.
The conversion has introduced 9 new shell scripts in scripts/.
IMHO, all of these need to be python scripts instead to follow out intent to standardize on python. I dream of a world with zero shell scripts.
Sure, works for me. My idea was that these scripts are super simple and python would be overkill but I'm OK with using python. I'll rewrite it and push into gitlab.
Even though they are simple, we always have the trapdoor of bash vs non-bash, people always mess up == vs = for example. So using python gives us stronger portability.
It would in fact let us build natively on Windows (except for all the other stuff that would break in the actual code if we didn't use mingw :-)
Make sense, the only one that will be tricky is probably the current workaround to run python scripts with correct LC_* configuration: scripts/meson-python.sh But I'll see once I start converting them into python. Pavel

On Thu, Jul 16, 2020 at 11:53:56AM +0200, Pavel Hrdina wrote:
So I was finally able to produce the patches to port libvirt to Meson. Obviously, it is a lot of changes. It might look that some of the patches could be squashed together but I would rather have it as separated as possible to make the review not that difficult.
Once we are done with review I suggest to squash all patches to single patch as it doesn't make sense to keep them separated as it will not be possible to build complete libvirt code by any of the build systems. Trying to achieve that would be even more challenging and the review would me more difficult.
The reasoning behind taking this approach is to have 1:1 conversion from autotools to Meson where each patch removes that part from autotools. It serves as a check that nothing is skipped and to make sure that the conversion is complete.
As probably most of us know Meson is completely different build system and one of the most challenging things was to deal with the fact that meson doesn't allow user functions and that everything has to be defined before it is used.
Patches are available in my Gitlab repo as well:
git clone -b meson https://gitlab.com/phrdina/libvirt.git
and link to Giltab pipeline:
FWIW, some unit tests fail for me - Fedora 31, with pip installed meson 0.55 11/154 check-virnetprotocol FAIL 0.09s (exit status 1) --- command --- 14:26:24 LC_CTYPE='en_US.UTF-8' LC_ALL='' LANG='C' /usr/bin/python3 /home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py virnetprotocol virt_net_rpc /home/berrange/src/virt/libvirt/build/src/rpc /usr/bin/pdwtags /home/berrange/src/virt/libvirt/build/../src/virnetprotocol-structs --- stderr --- Traceback (most recent call last): File "/home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py", line 55, in <module> objectdir = get_subdir(builddir, r'.*@{0}@.*'.format(libname)) File "/home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py", line 50, in get_subdir raise Exception("Failed to find '{0}' in '{1}'".format(subdir, dirname)) Exception: Failed to find '.*@virt_net_rpc@.*' in '/home/berrange/src/virt/libvirt/build/src/rpc' ------- 12/154 check-virkeepaliveprotocol FAIL 0.11s (exit status 1) --- command --- 14:26:24 LC_CTYPE='en_US.UTF-8' LC_ALL='' LANG='C' /usr/bin/python3 /home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py virkeepaliveprotocol virt_net_rpc /home/berrange/src/virt/libvirt/build/src/rpc /usr/bin/pdwtags /home/berrange/src/virt/libvirt/build/../src/virkeepaliveprotocol-structs --- stderr --- Traceback (most recent call last): File "/home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py", line 55, in <module> objectdir = get_subdir(builddir, r'.*@{0}@.*'.format(libname)) File "/home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py", line 50, in get_subdir raise Exception("Failed to find '{0}' in '{1}'".format(subdir, dirname)) Exception: Failed to find '.*@virt_net_rpc@.*' in '/home/berrange/src/virt/libvirt/build/src/rpc' ------- 13/154 check-remote_protocol FAIL 0.09s (exit status 1) --- command --- 14:26:24 LC_CTYPE='en_US.UTF-8' LC_ALL='' LANG='C' /usr/bin/python3 /home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py remote_protocol virt_remote_driver /home/berrange/src/virt/libvirt/build/src/remote /usr/bin/pdwtags /home/berrange/src/virt/libvirt/build/../src/remote_protocol-structs --- stderr --- Traceback (most recent call last): File "/home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py", line 55, in <module> objectdir = get_subdir(builddir, r'.*@{0}@.*'.format(libname)) File "/home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py", line 50, in get_subdir raise Exception("Failed to find '{0}' in '{1}'".format(subdir, dirname)) Exception: Failed to find '.*@virt_remote_driver@.*' in '/home/berrange/src/virt/libvirt/build/src/remote' ------- 14/154 check-qemu_protocol FAIL 0.11s (exit status 1) --- command --- 14:26:24 LC_CTYPE='en_US.UTF-8' LC_ALL='' LANG='C' /usr/bin/python3 /home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py qemu_protocol virt_remote_driver /home/berrange/src/virt/libvirt/build/src/remote /usr/bin/pdwtags /home/berrange/src/virt/libvirt/build/../src/qemu_protocol-structs --- stderr --- Traceback (most recent call last): File "/home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py", line 55, in <module> objectdir = get_subdir(builddir, r'.*@{0}@.*'.format(libname)) File "/home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py", line 50, in get_subdir raise Exception("Failed to find '{0}' in '{1}'".format(subdir, dirname)) Exception: Failed to find '.*@virt_remote_driver@.*' in '/home/berrange/src/virt/libvirt/build/src/remote' ------- 15/154 check-lxc_protocol FAIL 0.10s (exit status 1) --- command --- 14:26:24 LC_CTYPE='en_US.UTF-8' LC_ALL='' LANG='C' /usr/bin/python3 /home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py lxc_protocol virt_remote_driver /home/berrange/src/virt/libvirt/build/src/remote /usr/bin/pdwtags /home/berrange/src/virt/libvirt/build/../src/lxc_protocol-structs --- stderr --- Traceback (most recent call last): File "/home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py", line 55, in <module> objectdir = get_subdir(builddir, r'.*@{0}@.*'.format(libname)) File "/home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py", line 50, in get_subdir raise Exception("Failed to find '{0}' in '{1}'".format(subdir, dirname)) Exception: Failed to find '.*@virt_remote_driver@.*' in '/home/berrange/src/virt/libvirt/build/src/remote' ------- 16/154 check-admin_protocol FAIL 0.08s (exit status 1) --- command --- 14:26:24 LC_CTYPE='en_US.UTF-8' LC_ALL='' LANG='C' /usr/bin/python3 /home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py admin_protocol virt_admin_driver /home/berrange/src/virt/libvirt/build/src/admin /usr/bin/pdwtags /home/berrange/src/virt/libvirt/build/../src/admin_protocol-structs --- stderr --- Traceback (most recent call last): File "/home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py", line 55, in <module> objectdir = get_subdir(builddir, r'.*@{0}@.*'.format(libname)) File "/home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py", line 50, in get_subdir raise Exception("Failed to find '{0}' in '{1}'".format(subdir, dirname)) Exception: Failed to find '.*@virt_admin_driver@.*' in '/home/berrange/src/virt/libvirt/build/src/admin' ------- 17/154 check-lock_protocol FAIL 0.08s (exit status 1) --- command --- 14:26:24 LC_CTYPE='en_US.UTF-8' LC_ALL='' LANG='C' /usr/bin/python3 /home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py lock_protocol lockd_impl /home/berrange/src/virt/libvirt/build/src/locking /usr/bin/pdwtags /home/berrange/src/virt/libvirt/build/../src/lock_protocol-structs --- stderr --- Traceback (most recent call last): File "/home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py", line 55, in <module> objectdir = get_subdir(builddir, r'.*@{0}@.*'.format(libname)) File "/home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py", line 50, in get_subdir raise Exception("Failed to find '{0}' in '{1}'".format(subdir, dirname)) Exception: Failed to find '.*@lockd_impl@.*' in '/home/berrange/src/virt/libvirt/build/src/locking' ------- 18/154 check-lxc_monitor_protocol FAIL 0.08s (exit status 1) --- command --- 14:26:24 LC_CTYPE='en_US.UTF-8' LC_ALL='' LANG='C' /usr/bin/python3 /home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py lxc_monitor_protocol virt_driver_lxc_impl /home/berrange/src/virt/libvirt/build/src/lxc /usr/bin/pdwtags /home/berrange/src/virt/libvirt/build/../src/lxc_monitor_protocol-structs --- stderr --- Traceback (most recent call last): File "/home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py", line 55, in <module> objectdir = get_subdir(builddir, r'.*@{0}@.*'.format(libname)) File "/home/berrange/src/virt/libvirt/scripts/check-remote-protocol.py", line 50, in get_subdir raise Exception("Failed to find '{0}' in '{1}'".format(subdir, dirname)) Exception: Failed to find '.*@virt_driver_lxc_impl@.*' in '/home/berrange/src/virt/libvirt/build/src/lxc' ------- Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Fri, Jul 17, 2020 at 03:28:52PM +0100, Daniel P. Berrangé wrote:
On Thu, Jul 16, 2020 at 11:53:56AM +0200, Pavel Hrdina wrote:
So I was finally able to produce the patches to port libvirt to Meson. Obviously, it is a lot of changes. It might look that some of the patches could be squashed together but I would rather have it as separated as possible to make the review not that difficult.
Once we are done with review I suggest to squash all patches to single patch as it doesn't make sense to keep them separated as it will not be possible to build complete libvirt code by any of the build systems. Trying to achieve that would be even more challenging and the review would me more difficult.
The reasoning behind taking this approach is to have 1:1 conversion from autotools to Meson where each patch removes that part from autotools. It serves as a check that nothing is skipped and to make sure that the conversion is complete.
As probably most of us know Meson is completely different build system and one of the most challenging things was to deal with the fact that meson doesn't allow user functions and that everything has to be defined before it is used.
Patches are available in my Gitlab repo as well:
git clone -b meson https://gitlab.com/phrdina/libvirt.git
and link to Giltab pipeline:
FWIW, some unit tests fail for me - Fedora 31, with pip installed meson 0.55
11/154 check-virnetprotocol FAIL 0.09s (exit status 1)
Right, they changed the name of internal temporary directories where the object files are stored. They are required for pdwtags so I need to figure out a better way how to get the object file path. I knew that it was not that robust, sigh. Thanks Pavel

On Thu, Jul 16, 2020 at 11:53:56AM +0200, Pavel Hrdina wrote:
So I was finally able to produce the patches to port libvirt to Meson. Obviously, it is a lot of changes. It might look that some of the patches could be squashed together but I would rather have it as separated as possible to make the review not that difficult.
Once we are done with review I suggest to squash all patches to single patch as it doesn't make sense to keep them separated as it will not be possible to build complete libvirt code by any of the build systems. Trying to achieve that would be even more challenging and the review would me more difficult.
The reasoning behind taking this approach is to have 1:1 conversion from autotools to Meson where each patch removes that part from autotools. It serves as a check that nothing is skipped and to make sure that the conversion is complete.
As probably most of us know Meson is completely different build system and one of the most challenging things was to deal with the fact that meson doesn't allow user functions and that everything has to be defined before it is used.
Patches are available in my Gitlab repo as well:
git clone -b meson https://gitlab.com/phrdina/libvirt.git
I compared the contents of config.h and meson-config.h for the before and after state, looking at wha "#define" are present. I couple of problems appear HAVE_DECL_SEEK_HOLE, HAVE_LIBATTR, and HAVE_LIBUTIL, WITH_PM_UTILS were not set in meson-config.h Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Fri, Jul 17, 2020 at 03:51:21PM +0100, Daniel P. Berrangé wrote:
On Thu, Jul 16, 2020 at 11:53:56AM +0200, Pavel Hrdina wrote:
So I was finally able to produce the patches to port libvirt to Meson. Obviously, it is a lot of changes. It might look that some of the patches could be squashed together but I would rather have it as separated as possible to make the review not that difficult.
Once we are done with review I suggest to squash all patches to single patch as it doesn't make sense to keep them separated as it will not be possible to build complete libvirt code by any of the build systems. Trying to achieve that would be even more challenging and the review would me more difficult.
The reasoning behind taking this approach is to have 1:1 conversion from autotools to Meson where each patch removes that part from autotools. It serves as a check that nothing is skipped and to make sure that the conversion is complete.
As probably most of us know Meson is completely different build system and one of the most challenging things was to deal with the fact that meson doesn't allow user functions and that everything has to be defined before it is used.
Patches are available in my Gitlab repo as well:
git clone -b meson https://gitlab.com/phrdina/libvirt.git
I compared the contents of config.h and meson-config.h for the before and after state, looking at wha "#define" are present. I couple of problems appear
HAVE_DECL_SEEK_HOLE, HAVE_LIBATTR, and HAVE_LIBUTIL, WITH_PM_UTILS were not set in meson-config.h
I have also compared symbols in the libvirt.so file Run: nm -a libvirt.so.0.6006.0 | cut -c18- | sort > a and then diff the autotools vs meson build, and we get 1a2,4
a admin_protocol.c a admin_server.c a admin_server_dispatch.c
Dunno why these file names are listed as symbols now 738a742,743
d adminNProcs d adminProcs 1436a1442 d virLogSelf
Also dunno why we have a couple of new data symbols 6715a6763,6794
t adminClientClose t adminClientGetInfo t adminClientGetInfo.cold t adminConnectListServers t adminConnectLookupServer t adminDispatchClientCloseHelper t adminDispatchClientGetInfoHelper t adminDispatchConnectCloseHelper t adminDispatchConnectGetLibVersionHelper t adminDispatchConnectGetLoggingFiltersHelper t adminDispatchConnectGetLoggingOutputsHelper t adminDispatchConnectListServersHelper t adminDispatchConnectLookupServerHelper t adminDispatchConnectOpenHelper t adminDispatchConnectSetLoggingFiltersHelper t adminDispatchConnectSetLoggingOutputsHelper t adminDispatchServerGetClientLimitsHelper t adminDispatchServerGetThreadpoolParametersHelper t adminDispatchServerListClientsHelper t adminDispatchServerLookupClientHelper t adminDispatchServerSetClientLimitsHelper t adminDispatchServerSetThreadpoolParametersHelper t adminDispatchServerUpdateTlsFilesHelper t adminServerGetClientLimits t adminServerGetClientLimits.cold t adminServerGetThreadPoolParameters t adminServerGetThreadPoolParameters.cold t adminServerListClients t adminServerLookupClient t adminServerSetClientLimits t adminServerSetThreadPoolParameters t adminServerUpdateTlsFiles 8392a8472 t make_nonnull_client 8525a8606,8609 t remoteAdmClientFree t remoteAdmClientNew t remoteAdmClientNewPostExecRestart t remoteAdmClientPreExecRestart
These are strange, as the admin stuff should be in libvirt-admin.so instead. Did some files get built into the wrong binary ? 12218a12303
t virFileActivateDirOverrideForProg.cold
I guess this is new ? 14125,14126d14209 < t virNodeSuspendSupportsTarget < t virNodeSuspendSupportsTarget.cold I think this is might be because meson failed to detect pm-utils which I already reported. 16108a16192,16224
T xdr_admin_client_close_args T xdr_admin_client_get_info_args T xdr_admin_client_get_info_ret T xdr_admin_connect_get_lib_version_ret T xdr_admin_connect_get_logging_filters_args T xdr_admin_connect_get_logging_filters_ret T xdr_admin_connect_get_logging_outputs_args T xdr_admin_connect_get_logging_outputs_ret T xdr_admin_connect_list_servers_args T xdr_admin_connect_list_servers_ret T xdr_admin_connect_lookup_server_args T xdr_admin_connect_lookup_server_ret T xdr_admin_connect_open_args T xdr_admin_connect_set_logging_filters_args T xdr_admin_connect_set_logging_outputs_args T xdr_admin_nonnull_client T xdr_admin_nonnull_server T xdr_admin_nonnull_string T xdr_admin_procedure T xdr_admin_server_get_client_limits_args T xdr_admin_server_get_client_limits_ret T xdr_admin_server_get_threadpool_parameters_args T xdr_admin_server_get_threadpool_parameters_ret T xdr_admin_server_list_clients_args T xdr_admin_server_list_clients_ret T xdr_admin_server_lookup_client_args T xdr_admin_server_lookup_client_ret T xdr_admin_server_set_client_limits_args T xdr_admin_server_set_threadpool_parameters_args T xdr_admin_server_update_tls_files_args T xdr_admin_string T xdr_admin_typed_param T xdr_admin_typed_param_value
Again more admin stuff which looks like it probably should be in the separate libvirt-admin.so 17039a17155
U g_getenv
Seems due to a code change 16961c17077 < U fcntl@@GLIBC_2.2.5 ---
U fcntl64@@GLIBC_2.28 16971c17087 < U fopen@@GLIBC_2.2.5
U fopen64@@GLIBC_2.2.5 16980,16981c17096,17097 < U ftruncate@@GLIBC_2.2.5 < U __fxstat@@GLIBC_2.2.5
U ftruncate64@@GLIBC_2.2.5 U __fxstat64@@GLIBC_2.2.5 17030c17146 < U getrlimit@@GLIBC_2.2.5
U getrlimit64@@GLIBC_2.2.5 17035d17150 < U getxattr@@GLIBC_2.3 17236,17237c17352,17353 < U lseek@@GLIBC_2.2.5 < U __lxstat@@GLIBC_2.2.5
U lseek64@@GLIBC_2.2.5 U __lxstat64@@GLIBC_2.2.5 17292c17408,17409 < U __open_2@@GLIBC_2.7
U __open64_2@@GLIBC_2.7 U open64@@GLIBC_2.2.5 17294d17410 < U open@@GLIBC_2.2.5 17300c17416 < U posix_fallocate@@GLIBC_2.2.5
U posix_fallocate64@@GLIBC_2.2.5 17302,17303c17418,17419 < U pread@@GLIBC_2.2.5 < U prlimit@@GLIBC_2.13
U pread64@@GLIBC_2.2.5 U prlimit64@@GLIBC_2.13 17337c17453 < U readdir@@GLIBC_2.2.5
U readdir64@@GLIBC_2.2.5 17341d17456 < U removexattr@@GLIBC_2.3 17385c17500 < U setrlimit@@GLIBC_2.2.5
U setrlimit64@@GLIBC_2.2.5 17389d17503 < U setxattr@@GLIBC_2.3 17443c17557 < U statfs@@GLIBC_2.2.5
U statfs64@@GLIBC_2.2.5 17589c17703 < U __xstat@@GLIBC_2.2.5
U __xstat64@@GLIBC_2.2.5
These ones are pretty interesting. It appears we're setting -D_FILE_OFFSET_BITS=64 in meson, even though we're on a 64-bit platform already. IIUC, in autoconf we only set this in 32-bit platforms. I think this is probably harmless, as on 64-bit the "64" suffixed symbols should be identical to the non-"64" suffixed symbols. Just mention it in case it is a sign of a bug somewhere. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Fri, Jul 17, 2020 at 05:16:00PM +0100, Daniel P. Berrangé wrote:
On Fri, Jul 17, 2020 at 03:51:21PM +0100, Daniel P. Berrangé wrote:
On Thu, Jul 16, 2020 at 11:53:56AM +0200, Pavel Hrdina wrote:
So I was finally able to produce the patches to port libvirt to Meson. Obviously, it is a lot of changes. It might look that some of the patches could be squashed together but I would rather have it as separated as possible to make the review not that difficult.
Once we are done with review I suggest to squash all patches to single patch as it doesn't make sense to keep them separated as it will not be possible to build complete libvirt code by any of the build systems. Trying to achieve that would be even more challenging and the review would me more difficult.
The reasoning behind taking this approach is to have 1:1 conversion from autotools to Meson where each patch removes that part from autotools. It serves as a check that nothing is skipped and to make sure that the conversion is complete.
As probably most of us know Meson is completely different build system and one of the most challenging things was to deal with the fact that meson doesn't allow user functions and that everything has to be defined before it is used.
Patches are available in my Gitlab repo as well:
git clone -b meson https://gitlab.com/phrdina/libvirt.git
I compared the contents of config.h and meson-config.h for the before and after state, looking at wha "#define" are present. I couple of problems appear
HAVE_DECL_SEEK_HOLE, HAVE_LIBATTR, and HAVE_LIBUTIL, WITH_PM_UTILS were not set in meson-config.h
I have also compared symbols in the libvirt.so file
Run:
nm -a libvirt.so.0.6006.0 | cut -c18- | sort > a
and then diff the autotools vs meson build, and we get
1a2,4
a admin_protocol.c a admin_server.c a admin_server_dispatch.c
Dunno why these file names are listed as symbols now
Related to the admin symbols, I incorrectly added libvirt_admin_driver.a static library into libvirt.so
738a742,743
d adminNProcs d adminProcs 1436a1442 d virLogSelf
Also dunno why we have a couple of new data symbols
All of them related to the admin issue.
6715a6763,6794
t adminClientClose t adminClientGetInfo t adminClientGetInfo.cold t adminConnectListServers t adminConnectLookupServer t adminDispatchClientCloseHelper t adminDispatchClientGetInfoHelper t adminDispatchConnectCloseHelper t adminDispatchConnectGetLibVersionHelper t adminDispatchConnectGetLoggingFiltersHelper t adminDispatchConnectGetLoggingOutputsHelper t adminDispatchConnectListServersHelper t adminDispatchConnectLookupServerHelper t adminDispatchConnectOpenHelper t adminDispatchConnectSetLoggingFiltersHelper t adminDispatchConnectSetLoggingOutputsHelper t adminDispatchServerGetClientLimitsHelper t adminDispatchServerGetThreadpoolParametersHelper t adminDispatchServerListClientsHelper t adminDispatchServerLookupClientHelper t adminDispatchServerSetClientLimitsHelper t adminDispatchServerSetThreadpoolParametersHelper t adminDispatchServerUpdateTlsFilesHelper t adminServerGetClientLimits t adminServerGetClientLimits.cold t adminServerGetThreadPoolParameters t adminServerGetThreadPoolParameters.cold t adminServerListClients t adminServerLookupClient t adminServerSetClientLimits t adminServerSetThreadPoolParameters t adminServerUpdateTlsFiles 8392a8472 t make_nonnull_client 8525a8606,8609 t remoteAdmClientFree t remoteAdmClientNew t remoteAdmClientNewPostExecRestart t remoteAdmClientPreExecRestart
These are strange, as the admin stuff should be in libvirt-admin.so instead. Did some files get built into the wrong binary ?
As explained above, incorrect static library was linked into libvirt.so. I'll fix it and push into gitlab.
12218a12303
t virFileActivateDirOverrideForProg.cold
I guess this is new ?
No, my guess is that this is related to the rewrite by patch: meson: src/util/virfile: rewrite virFileActivateDirOverrideForProg
14125,14126d14209 < t virNodeSuspendSupportsTarget < t virNodeSuspendSupportsTarget.cold
I think this is might be because meson failed to detect pm-utils which I already reported.
Already solved in different thread. [...]
17039a17155
U g_getenv
Seems due to a code change
Correct, patch changed the code of virFileActivateDirOverrideForProg: meson: src/util/virfile: rewrite virFileActivateDirOverrideForProg
16961c17077 < U fcntl@@GLIBC_2.2.5 ---
U fcntl64@@GLIBC_2.28 16971c17087 < U fopen@@GLIBC_2.2.5
U fopen64@@GLIBC_2.2.5 16980,16981c17096,17097 < U ftruncate@@GLIBC_2.2.5 < U __fxstat@@GLIBC_2.2.5
U ftruncate64@@GLIBC_2.2.5 U __fxstat64@@GLIBC_2.2.5 17030c17146 < U getrlimit@@GLIBC_2.2.5
U getrlimit64@@GLIBC_2.2.5 17035d17150 < U getxattr@@GLIBC_2.3 17236,17237c17352,17353 < U lseek@@GLIBC_2.2.5 < U __lxstat@@GLIBC_2.2.5
U lseek64@@GLIBC_2.2.5 U __lxstat64@@GLIBC_2.2.5 17292c17408,17409 < U __open_2@@GLIBC_2.7
U __open64_2@@GLIBC_2.7 U open64@@GLIBC_2.2.5 17294d17410 < U open@@GLIBC_2.2.5 17300c17416 < U posix_fallocate@@GLIBC_2.2.5
U posix_fallocate64@@GLIBC_2.2.5 17302,17303c17418,17419 < U pread@@GLIBC_2.2.5 < U prlimit@@GLIBC_2.13
U pread64@@GLIBC_2.2.5 U prlimit64@@GLIBC_2.13 17337c17453 < U readdir@@GLIBC_2.2.5
U readdir64@@GLIBC_2.2.5 17341d17456 < U removexattr@@GLIBC_2.3 17385c17500 < U setrlimit@@GLIBC_2.2.5
U setrlimit64@@GLIBC_2.2.5 17389d17503 < U setxattr@@GLIBC_2.3 17443c17557 < U statfs@@GLIBC_2.2.5
U statfs64@@GLIBC_2.2.5 17589c17703 < U __xstat@@GLIBC_2.2.5
U __xstat64@@GLIBC_2.2.5
These ones are pretty interesting.
It appears we're setting -D_FILE_OFFSET_BITS=64 in meson, even though we're on a 64-bit platform already.
IIUC, in autoconf we only set this in 32-bit platforms.
I think this is probably harmless, as on 64-bit the "64" suffixed symbols should be identical to the non-"64" suffixed symbols. Just mention it in case it is a sign of a bug somewhere.
Meson adds the -D_FILE_OFFSET_BITS=64 regardless of 32-bit or 64-bit platform [1]. So it's not a bug but intentional decision. Thanks for the review. Pavel [1] <https://github.com/mesonbuild/meson/commit/853634a48da025c59eef70161dba0d150833f60d>

On Fri, Jul 17, 2020 at 03:51:21PM +0100, Daniel P. Berrangé wrote:
On Thu, Jul 16, 2020 at 11:53:56AM +0200, Pavel Hrdina wrote:
So I was finally able to produce the patches to port libvirt to Meson. Obviously, it is a lot of changes. It might look that some of the patches could be squashed together but I would rather have it as separated as possible to make the review not that difficult.
Once we are done with review I suggest to squash all patches to single patch as it doesn't make sense to keep them separated as it will not be possible to build complete libvirt code by any of the build systems. Trying to achieve that would be even more challenging and the review would me more difficult.
The reasoning behind taking this approach is to have 1:1 conversion from autotools to Meson where each patch removes that part from autotools. It serves as a check that nothing is skipped and to make sure that the conversion is complete.
As probably most of us know Meson is completely different build system and one of the most challenging things was to deal with the fact that meson doesn't allow user functions and that everything has to be defined before it is used.
Patches are available in my Gitlab repo as well:
git clone -b meson https://gitlab.com/phrdina/libvirt.git
I compared the contents of config.h and meson-config.h for the before and after state, looking at wha "#define" are present. I couple of problems appear
HAVE_DECL_SEEK_HOLE, HAVE_LIBATTR, and HAVE_LIBUTIL, WITH_PM_UTILS were not set in meson-config.h
Nice catch, I actually had a code to define HAVE_DECL_SEEK_HOLE but it requires -D_GNU_SOURCE to detect it. For some reason I missed HAVE_LIBATTR. We don't use HAVE_LIBUTIL anywhere in the code, only HAVE_LIBUTIL_H which is in meson-config.h. WITH_PM_UTILS is actually broken in autotools and it should not be there. If you check m4/virt-pm-utils.m4 we don't use pm-utils if building on host with D-Bus and systemd. Digging into the history commit <cf6b65a19eeb026cbf653b76e93e56383bf52da6> removed init_systemd but forgot to update m4/virt-pm-utils.m4 to use "$with_init_script" = "systemd" instead of "$init_systemd" = "yes". I'll fix the first two defines but the other two are correct unless I should add the not-used HAVE_LIBUTIL. Thanks for the review. Pavel

On Fri, Jul 17, 2020 at 07:50:35PM +0200, Pavel Hrdina wrote:
On Fri, Jul 17, 2020 at 03:51:21PM +0100, Daniel P. Berrangé wrote:
On Thu, Jul 16, 2020 at 11:53:56AM +0200, Pavel Hrdina wrote:
So I was finally able to produce the patches to port libvirt to Meson. Obviously, it is a lot of changes. It might look that some of the patches could be squashed together but I would rather have it as separated as possible to make the review not that difficult.
Once we are done with review I suggest to squash all patches to single patch as it doesn't make sense to keep them separated as it will not be possible to build complete libvirt code by any of the build systems. Trying to achieve that would be even more challenging and the review would me more difficult.
The reasoning behind taking this approach is to have 1:1 conversion from autotools to Meson where each patch removes that part from autotools. It serves as a check that nothing is skipped and to make sure that the conversion is complete.
As probably most of us know Meson is completely different build system and one of the most challenging things was to deal with the fact that meson doesn't allow user functions and that everything has to be defined before it is used.
Patches are available in my Gitlab repo as well:
git clone -b meson https://gitlab.com/phrdina/libvirt.git
I compared the contents of config.h and meson-config.h for the before and after state, looking at wha "#define" are present. I couple of problems appear
HAVE_DECL_SEEK_HOLE, HAVE_LIBATTR, and HAVE_LIBUTIL, WITH_PM_UTILS were not set in meson-config.h
Nice catch, I actually had a code to define HAVE_DECL_SEEK_HOLE but it requires -D_GNU_SOURCE to detect it.
For some reason I missed HAVE_LIBATTR.
We don't use HAVE_LIBUTIL anywhere in the code, only HAVE_LIBUTIL_H which is in meson-config.h.
We do AC_CHECK_LIB([util],[openpty],[]) which I think auto-adds "-lutil" to the global $LIBS, only if needed. So yeah, the HAVE_LIBUTIL in meson-config.h is not required, as long as we're adding -lutil when needed in $LIBS. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On Fri, Jul 17, 2020 at 07:00:07PM +0100, Daniel P. Berrangé wrote:
On Fri, Jul 17, 2020 at 07:50:35PM +0200, Pavel Hrdina wrote:
On Fri, Jul 17, 2020 at 03:51:21PM +0100, Daniel P. Berrangé wrote:
On Thu, Jul 16, 2020 at 11:53:56AM +0200, Pavel Hrdina wrote:
So I was finally able to produce the patches to port libvirt to Meson. Obviously, it is a lot of changes. It might look that some of the patches could be squashed together but I would rather have it as separated as possible to make the review not that difficult.
Once we are done with review I suggest to squash all patches to single patch as it doesn't make sense to keep them separated as it will not be possible to build complete libvirt code by any of the build systems. Trying to achieve that would be even more challenging and the review would me more difficult.
The reasoning behind taking this approach is to have 1:1 conversion from autotools to Meson where each patch removes that part from autotools. It serves as a check that nothing is skipped and to make sure that the conversion is complete.
As probably most of us know Meson is completely different build system and one of the most challenging things was to deal with the fact that meson doesn't allow user functions and that everything has to be defined before it is used.
Patches are available in my Gitlab repo as well:
git clone -b meson https://gitlab.com/phrdina/libvirt.git
I compared the contents of config.h and meson-config.h for the before and after state, looking at wha "#define" are present. I couple of problems appear
HAVE_DECL_SEEK_HOLE, HAVE_LIBATTR, and HAVE_LIBUTIL, WITH_PM_UTILS were not set in meson-config.h
Nice catch, I actually had a code to define HAVE_DECL_SEEK_HOLE but it requires -D_GNU_SOURCE to detect it.
For some reason I missed HAVE_LIBATTR.
We don't use HAVE_LIBUTIL anywhere in the code, only HAVE_LIBUTIL_H which is in meson-config.h.
We do AC_CHECK_LIB([util],[openpty],[]) which I think auto-adds "-lutil" to the global $LIBS, only if needed. So yeah, the HAVE_LIBUTIL in meson-config.h is not required, as long as we're adding -lutil when needed in $LIBS.
meson.build:1377 is where we check for -lutil and if the library exists it's added to link arguments so it is covered. Pavel

On Thu, Jul 16, 2020 at 11:53:56 +0200, Pavel Hrdina wrote: With the most recent version I've fetched from your repository I'm seeing the following test failure when building with 'gcc'. 'clang' builds fine. The output from the failed tests: 11/154 check-virnetprotocol FAIL 0.09s (exit status 1) --- command --- 09:13:39 LC_CTYPE='en_US.UTF-8' LC_ALL='' LANG='C' /bin/python3 /home/pipo/libvirt/scripts/check-remote-protocol.py virnetprotocol virt_net_rpc /home/pipo/build/libvirt/gcc/src/rpc /bin/pdwtags /home/pipo/build/libvirt/gcc/../../../libvirt/src/virnetprotocol-structs --- stderr --- Traceback (most recent call last): File "/home/pipo/libvirt/scripts/check-remote-protocol.py", line 55, in <module> objectdir = get_subdir(builddir, r'.*@{0}@.*'.format(libname)) File "/home/pipo/libvirt/scripts/check-remote-protocol.py", line 50, in get_subdir raise Exception("Failed to find '{0}' in '{1}'".format(subdir, dirname)) Exception: Failed to find '.*@virt_net_rpc@.*' in '/home/pipo/build/libvirt/gcc/src/rpc' ------- 12/154 check-virkeepaliveprotocol FAIL 0.09s (exit status 1) --- command --- 09:13:39 LC_CTYPE='en_US.UTF-8' LC_ALL='' LANG='C' /bin/python3 /home/pipo/libvirt/scripts/check-remote-protocol.py virkeepaliveprotocol virt_net_rpc /home/pipo/build/libvirt/gcc/src/rpc /bin/pdwtags /home/pipo/build/libvirt/gcc/../../../libvirt/src/virkeepaliveprotocol-structs --- stderr --- Traceback (most recent call last): File "/home/pipo/libvirt/scripts/check-remote-protocol.py", line 55, in <module> objectdir = get_subdir(builddir, r'.*@{0}@.*'.format(libname)) File "/home/pipo/libvirt/scripts/check-remote-protocol.py", line 50, in get_subdir raise Exception("Failed to find '{0}' in '{1}'".format(subdir, dirname)) Exception: Failed to find '.*@virt_net_rpc@.*' in '/home/pipo/build/libvirt/gcc/src/rpc' ------- 13/154 check-remote_protocol FAIL 0.09s (exit status 1) --- command --- 09:13:39 LC_CTYPE='en_US.UTF-8' LC_ALL='' LANG='C' /bin/python3 /home/pipo/libvirt/scripts/check-remote-protocol.py remote_protocol virt_remote_driver /home/pipo/build/libvirt/gcc/src/remote /bin/pdwtags /home/pipo/build/libvirt/gcc/../../../libvirt/src/remote_protocol-structs --- stderr --- Traceback (most recent call last): File "/home/pipo/libvirt/scripts/check-remote-protocol.py", line 55, in <module> objectdir = get_subdir(builddir, r'.*@{0}@.*'.format(libname)) File "/home/pipo/libvirt/scripts/check-remote-protocol.py", line 50, in get_subdir raise Exception("Failed to find '{0}' in '{1}'".format(subdir, dirname)) Exception: Failed to find '.*@virt_remote_driver@.*' in '/home/pipo/build/libvirt/gcc/src/remote' ------- 14/154 check-qemu_protocol FAIL 0.09s (exit status 1) --- command --- 09:13:39 LC_CTYPE='en_US.UTF-8' LC_ALL='' LANG='C' /bin/python3 /home/pipo/libvirt/scripts/check-remote-protocol.py qemu_protocol virt_remote_driver /home/pipo/build/libvirt/gcc/src/remote /bin/pdwtags /home/pipo/build/libvirt/gcc/../../../libvirt/src/qemu_protocol-structs --- stderr --- Traceback (most recent call last): File "/home/pipo/libvirt/scripts/check-remote-protocol.py", line 55, in <module> objectdir = get_subdir(builddir, r'.*@{0}@.*'.format(libname)) File "/home/pipo/libvirt/scripts/check-remote-protocol.py", line 50, in get_subdir raise Exception("Failed to find '{0}' in '{1}'".format(subdir, dirname)) Exception: Failed to find '.*@virt_remote_driver@.*' in '/home/pipo/build/libvirt/gcc/src/remote' ------- 15/154 check-lxc_protocol FAIL 0.09s (exit status 1) --- command --- 09:13:39 LC_CTYPE='en_US.UTF-8' LC_ALL='' LANG='C' /bin/python3 /home/pipo/libvirt/scripts/check-remote-protocol.py lxc_protocol virt_remote_driver /home/pipo/build/libvirt/gcc/src/remote /bin/pdwtags /home/pipo/build/libvirt/gcc/../../../libvirt/src/lxc_protocol-structs --- stderr --- Traceback (most recent call last): File "/home/pipo/libvirt/scripts/check-remote-protocol.py", line 55, in <module> objectdir = get_subdir(builddir, r'.*@{0}@.*'.format(libname)) File "/home/pipo/libvirt/scripts/check-remote-protocol.py", line 50, in get_subdir raise Exception("Failed to find '{0}' in '{1}'".format(subdir, dirname)) Exception: Failed to find '.*@virt_remote_driver@.*' in '/home/pipo/build/libvirt/gcc/src/remote' ------- 16/154 check-admin_protocol FAIL 0.09s (exit status 1) --- command --- 09:13:39 LC_CTYPE='en_US.UTF-8' LC_ALL='' LANG='C' /bin/python3 /home/pipo/libvirt/scripts/check-remote-protocol.py admin_protocol virt_admin_driver /home/pipo/build/libvirt/gcc/src/admin /bin/pdwtags /home/pipo/build/libvirt/gcc/../../../libvirt/src/admin_protocol-structs --- stderr --- Traceback (most recent call last): File "/home/pipo/libvirt/scripts/check-remote-protocol.py", line 55, in <module> objectdir = get_subdir(builddir, r'.*@{0}@.*'.format(libname)) File "/home/pipo/libvirt/scripts/check-remote-protocol.py", line 50, in get_subdir raise Exception("Failed to find '{0}' in '{1}'".format(subdir, dirname)) Exception: Failed to find '.*@virt_admin_driver@.*' in '/home/pipo/build/libvirt/gcc/src/admin' ------- 17/154 check-lock_protocol FAIL 0.09s (exit status 1) --- command --- 09:13:39 LC_CTYPE='en_US.UTF-8' LC_ALL='' LANG='C' /bin/python3 /home/pipo/libvirt/scripts/check-remote-protocol.py lock_protocol lockd_impl /home/pipo/build/libvirt/gcc/src/locking /bin/pdwtags /home/pipo/build/libvirt/gcc/../../../libvirt/src/lock_protocol-structs --- stderr --- Traceback (most recent call last): File "/home/pipo/libvirt/scripts/check-remote-protocol.py", line 55, in <module> objectdir = get_subdir(builddir, r'.*@{0}@.*'.format(libname)) File "/home/pipo/libvirt/scripts/check-remote-protocol.py", line 50, in get_subdir raise Exception("Failed to find '{0}' in '{1}'".format(subdir, dirname)) Exception: Failed to find '.*@lockd_impl@.*' in '/home/pipo/build/libvirt/gcc/src/locking' ------- 18/154 check-lxc_monitor_protocol FAIL 0.07s (exit status 1) --- command --- 09:13:39 LC_CTYPE='en_US.UTF-8' LC_ALL='' LANG='C' /bin/python3 /home/pipo/libvirt/scripts/check-remote-protocol.py lxc_monitor_protocol virt_driver_lxc_impl /home/pipo/build/libvirt/gcc/src/lxc /bin/pdwtags /home/pipo/build/libvirt/gcc/../../../libvirt/src/lxc_monitor_protocol-structs --- stderr --- Traceback (most recent call last): File "/home/pipo/libvirt/scripts/check-remote-protocol.py", line 55, in <module> objectdir = get_subdir(builddir, r'.*@{0}@.*'.format(libname)) File "/home/pipo/libvirt/scripts/check-remote-protocol.py", line 50, in get_subdir raise Exception("Failed to find '{0}' in '{1}'".format(subdir, dirname)) Exception: Failed to find '.*@virt_driver_lxc_impl@.*' in '/home/pipo/build/libvirt/gcc/src/lxc' -------

On Thu, Jul 23, 2020 at 11:15:49AM +0200, Peter Krempa wrote:
On Thu, Jul 16, 2020 at 11:53:56 +0200, Pavel Hrdina wrote:
With the most recent version I've fetched from your repository I'm seeing the following test failure when building with 'gcc'. 'clang' builds fine.
Dan already reported this issue. It happens with new meson 0.55.0. They changed the name of private target directory where object file are created which we need for the protocol tests. Unfortunately there is no way how to get this directory using meson functions so it is hard-coded in the check-remote-protocol.py. I've already fixed it locally by changing the code to detect both name of the private directories, but I'll create an RFE in meson to provide a way to get the correct path to the private directory. Pavel
participants (11)
-
Andrea Bolognani
-
Daniel P. Berrangé
-
Erik Skultety
-
Jiri Denemark
-
Ján Tomko
-
Martin Kletzander
-
Michal Privoznik
-
Neal Gompa
-
Pavel Hrdina
-
Peter Krempa
-
Pino Toscano