diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 623bbc82ac2..bceb1b82ba0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ variables: - GIT_DEPTH: 1000 + GIT_DEPTH: 100 stages: - sanity_checks @@ -453,7 +453,8 @@ codestyle: - *script_variables script: - meson build || (cat build/meson-logs/meson-log.txt && exit 1) - - ninja -C build syntax-check + - ninja -C build libvirt-pot-dep + - meson test -C build --suite syntax-check --no-rebuild || (cat build/meson-logs/testlog.txt && exit 1) # This artifact published by this job is downloaded to push to Weblate @@ -492,3 +493,5 @@ check-dco: except: variables: - $CI_PROJECT_NAMESPACE == 'libvirt' + variables: + GIT_DEPTH: 1000 diff --git a/AUTHORS.in b/AUTHORS.in index 443006640ff..f4ab42ea9f5 100644 --- a/AUTHORS.in +++ b/AUTHORS.in @@ -93,7 +93,7 @@ Stefan de Konink Takahashi Tomohiro Tatsuro Enokura -#contributorslist# +@contributorslist@ The libvirt logo was designed by Diana Fong diff --git a/build-aux/meson.build b/build-aux/meson.build index de916793cad..1dd85b889b9 100644 --- a/build-aux/meson.build +++ b/build-aux/meson.build @@ -15,16 +15,34 @@ configure_file( configuration: syntax_check_conf, ) -make_prog = find_program('make') +if host_machine.system() == 'freebsd' + make_prog = find_program('gmake') +else + make_prog = find_program('make') +endif -# 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, - ], +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() + + +# Skip syntax-check if not building from git because we get the list of files +# to check using git commands and it fails if we are not in git repository. +if git + foreach target : sc_tests + test( + target, + make_prog, + args: [ '-C', meson.current_build_dir(), target ], + depends: [ + potfiles_dep, + ], + suite: 'syntax-check', + ) + endforeach +endif diff --git a/ci/aarch64-linux-gnu.meson b/ci/aarch64-linux-gnu.meson deleted file mode 100644 index 1da8d6025c0..00000000000 --- a/ci/aarch64-linux-gnu.meson +++ /dev/null @@ -1,11 +0,0 @@ -[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 deleted file mode 100644 index 9e5e06b84dc..00000000000 --- a/ci/arm-linux-gnueabi.meson +++ /dev/null @@ -1,11 +0,0 @@ -[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 deleted file mode 100644 index c761707d495..00000000000 --- a/ci/arm-linux-gnueabihf.meson +++ /dev/null @@ -1,11 +0,0 @@ -[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 6e9d2d72c48..912284b9062 100644 --- a/ci/cirrus/build.yml +++ b/ci/cirrus/build.yml @@ -15,7 +15,7 @@ build_task: - @INSTALL_COMMAND@ @PKGS@ - @PIP@ install @PYPI_PKGS@ clone_script: - - git clone --depth 1000 "$CI_REPOSITORY_URL" . + - git clone --depth 100 "$CI_REPOSITORY_URL" . - git fetch origin "$CI_COMMIT_REF_NAME" - git reset --hard "$CI_COMMIT_SHA" build_script: diff --git a/ci/containers/libvirt-debian-10-cross-aarch64.Dockerfile b/ci/containers/libvirt-debian-10-cross-aarch64.Dockerfile index d9437bbd4dd..5e1d8c66293 100644 --- a/ci/containers/libvirt-debian-10-cross-aarch64.Dockerfile +++ b/ci/containers/libvirt-debian-10-cross-aarch64.Dockerfile @@ -109,7 +109,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libyajl-dev:arm64 \ xfslibs-dev:arm64 && \ apt-get autoremove -y && \ - apt-get autoclean -y + apt-get autoclean -y && \ + mkdir -p /usr/local/share/meson/cross && \ + echo "[binaries]\nc = '/usr/bin/aarch64-linux-gnu-gcc'\nar = '/usr/bin/aarch64-linux-gnu-gcc-ar'\nstrip = '/usr/bin/aarch64-linux-gnu-strip'\npkgconfig = '/usr/bin/aarch64-linux-gnu-pkg-config'\n\n[host_machine]\nsystem = 'linux'\ncpu_family = 'aarch64'\ncpu = 'aarch64'\nendian = 'little'" > /usr/local/share/meson/cross/aarch64-linux-gnu RUN pip3 install \ meson==0.54.0 @@ -124,4 +126,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" +ENV MESON_OPTS "--cross-file=aarch64-linux-gnu" diff --git a/ci/containers/libvirt-debian-10-cross-armv6l.Dockerfile b/ci/containers/libvirt-debian-10-cross-armv6l.Dockerfile index 98c550ded57..1e2d518979f 100644 --- a/ci/containers/libvirt-debian-10-cross-armv6l.Dockerfile +++ b/ci/containers/libvirt-debian-10-cross-armv6l.Dockerfile @@ -108,7 +108,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libyajl-dev:armel \ xfslibs-dev:armel && \ apt-get autoremove -y && \ - apt-get autoclean -y + apt-get autoclean -y && \ + mkdir -p /usr/local/share/meson/cross && \ + echo "[binaries]\nc = '/usr/bin/arm-linux-gnueabi-gcc'\nar = '/usr/bin/arm-linux-gnueabi-gcc-ar'\nstrip = '/usr/bin/arm-linux-gnueabi-strip'\npkgconfig = '/usr/bin/arm-linux-gnueabi-pkg-config'\n\n[host_machine]\nsystem = 'linux'\ncpu_family = 'arm'\ncpu = 'arm'\nendian = 'little'" > /usr/local/share/meson/cross/arm-linux-gnueabi RUN pip3 install \ meson==0.54.0 @@ -123,4 +125,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" +ENV MESON_OPTS "--cross-file=arm-linux-gnueabi" diff --git a/ci/containers/libvirt-debian-10-cross-armv7l.Dockerfile b/ci/containers/libvirt-debian-10-cross-armv7l.Dockerfile index ff2c48d278c..b7d38aec25c 100644 --- a/ci/containers/libvirt-debian-10-cross-armv7l.Dockerfile +++ b/ci/containers/libvirt-debian-10-cross-armv7l.Dockerfile @@ -109,7 +109,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libyajl-dev:armhf \ xfslibs-dev:armhf && \ apt-get autoremove -y && \ - apt-get autoclean -y + apt-get autoclean -y && \ + mkdir -p /usr/local/share/meson/cross && \ + echo "[binaries]\nc = '/usr/bin/arm-linux-gnueabihf-gcc'\nar = '/usr/bin/arm-linux-gnueabihf-gcc-ar'\nstrip = '/usr/bin/arm-linux-gnueabihf-strip'\npkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config'\n\n[host_machine]\nsystem = 'linux'\ncpu_family = 'arm'\ncpu = 'armhf'\nendian = 'little'" > /usr/local/share/meson/cross/arm-linux-gnueabihf RUN pip3 install \ meson==0.54.0 @@ -124,4 +126,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" +ENV MESON_OPTS "--cross-file=arm-linux-gnueabihf" diff --git a/ci/containers/libvirt-debian-10-cross-i686.Dockerfile b/ci/containers/libvirt-debian-10-cross-i686.Dockerfile index 758c81176b8..7da851b1188 100644 --- a/ci/containers/libvirt-debian-10-cross-i686.Dockerfile +++ b/ci/containers/libvirt-debian-10-cross-i686.Dockerfile @@ -108,7 +108,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libyajl-dev:i386 \ xfslibs-dev:i386 && \ apt-get autoremove -y && \ - apt-get autoclean -y + apt-get autoclean -y && \ + mkdir -p /usr/local/share/meson/cross && \ + echo "[binaries]\nc = '/usr/bin/i686-linux-gnu-gcc'\nar = '/usr/bin/i686-linux-gnu-gcc-ar'\nstrip = '/usr/bin/i686-linux-gnu-strip'\npkgconfig = '/usr/bin/i686-linux-gnu-pkg-config'\n\n[host_machine]\nsystem = 'linux'\ncpu_family = 'x86'\ncpu = 'i686'\nendian = 'little'" > /usr/local/share/meson/cross/i686-linux-gnu RUN pip3 install \ meson==0.54.0 @@ -123,4 +125,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" +ENV MESON_OPTS "--cross-file=i686-linux-gnu" diff --git a/ci/containers/libvirt-debian-10-cross-mips.Dockerfile b/ci/containers/libvirt-debian-10-cross-mips.Dockerfile index 8cb3ca64da2..29af178dba8 100644 --- a/ci/containers/libvirt-debian-10-cross-mips.Dockerfile +++ b/ci/containers/libvirt-debian-10-cross-mips.Dockerfile @@ -108,7 +108,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libyajl-dev:mips \ xfslibs-dev:mips && \ apt-get autoremove -y && \ - apt-get autoclean -y + apt-get autoclean -y && \ + mkdir -p /usr/local/share/meson/cross && \ + echo "[binaries]\nc = '/usr/bin/mips-linux-gnu-gcc'\nar = '/usr/bin/mips-linux-gnu-gcc-ar'\nstrip = '/usr/bin/mips-linux-gnu-strip'\npkgconfig = '/usr/bin/mips-linux-gnu-pkg-config'\n\n[host_machine]\nsystem = 'linux'\ncpu_family = 'mips'\ncpu = 'mips'\nendian = 'little'" > /usr/local/share/meson/cross/mips-linux-gnu RUN pip3 install \ meson==0.54.0 @@ -123,4 +125,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" +ENV MESON_OPTS "--cross-file=mips-linux-gnu" diff --git a/ci/containers/libvirt-debian-10-cross-mips64el.Dockerfile b/ci/containers/libvirt-debian-10-cross-mips64el.Dockerfile index 9921f65116c..b291a48f062 100644 --- a/ci/containers/libvirt-debian-10-cross-mips64el.Dockerfile +++ b/ci/containers/libvirt-debian-10-cross-mips64el.Dockerfile @@ -108,7 +108,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libyajl-dev:mips64el \ xfslibs-dev:mips64el && \ apt-get autoremove -y && \ - apt-get autoclean -y + apt-get autoclean -y && \ + mkdir -p /usr/local/share/meson/cross && \ + echo "[binaries]\nc = '/usr/bin/mips64el-linux-gnuabi64-gcc'\nar = '/usr/bin/mips64el-linux-gnuabi64-gcc-ar'\nstrip = '/usr/bin/mips64el-linux-gnuabi64-strip'\npkgconfig = '/usr/bin/mips64el-linux-gnuabi64-pkg-config'\n\n[host_machine]\nsystem = 'linux'\ncpu_family = 'mips64'\ncpu = 'mips64el'\nendian = 'little'" > /usr/local/share/meson/cross/mips64el-linux-gnuabi64 RUN pip3 install \ meson==0.54.0 @@ -123,4 +125,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" +ENV MESON_OPTS "--cross-file=mips64el-linux-gnuabi64" diff --git a/ci/containers/libvirt-debian-10-cross-mipsel.Dockerfile b/ci/containers/libvirt-debian-10-cross-mipsel.Dockerfile index 3f9910f63e9..a63af12213d 100644 --- a/ci/containers/libvirt-debian-10-cross-mipsel.Dockerfile +++ b/ci/containers/libvirt-debian-10-cross-mipsel.Dockerfile @@ -108,7 +108,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libyajl-dev:mipsel \ xfslibs-dev:mipsel && \ apt-get autoremove -y && \ - apt-get autoclean -y + apt-get autoclean -y && \ + mkdir -p /usr/local/share/meson/cross && \ + echo "[binaries]\nc = '/usr/bin/mipsel-linux-gnu-gcc'\nar = '/usr/bin/mipsel-linux-gnu-gcc-ar'\nstrip = '/usr/bin/mipsel-linux-gnu-strip'\npkgconfig = '/usr/bin/mipsel-linux-gnu-pkg-config'\n\n[host_machine]\nsystem = 'linux'\ncpu_family = 'mips'\ncpu = 'mipsel'\nendian = 'little'" > /usr/local/share/meson/cross/mipsel-linux-gnu RUN pip3 install \ meson==0.54.0 @@ -123,4 +125,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" +ENV MESON_OPTS "--cross-file=mipsel-linux-gnu" diff --git a/ci/containers/libvirt-debian-10-cross-ppc64le.Dockerfile b/ci/containers/libvirt-debian-10-cross-ppc64le.Dockerfile index 3aef1e711e4..09477cdc0e5 100644 --- a/ci/containers/libvirt-debian-10-cross-ppc64le.Dockerfile +++ b/ci/containers/libvirt-debian-10-cross-ppc64le.Dockerfile @@ -108,7 +108,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libyajl-dev:ppc64el \ xfslibs-dev:ppc64el && \ apt-get autoremove -y && \ - apt-get autoclean -y + apt-get autoclean -y && \ + mkdir -p /usr/local/share/meson/cross && \ + echo "[binaries]\nc = '/usr/bin/powerpc64le-linux-gnu-gcc'\nar = '/usr/bin/powerpc64le-linux-gnu-gcc-ar'\nstrip = '/usr/bin/powerpc64le-linux-gnu-strip'\npkgconfig = '/usr/bin/powerpc64le-linux-gnu-pkg-config'\n\n[host_machine]\nsystem = 'linux'\ncpu_family = 'ppc64'\ncpu = 'powerpc64le'\nendian = 'little'" > /usr/local/share/meson/cross/powerpc64le-linux-gnu RUN pip3 install \ meson==0.54.0 @@ -123,4 +125,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" +ENV MESON_OPTS "--cross-file=powerpc64le-linux-gnu" diff --git a/ci/containers/libvirt-debian-10-cross-s390x.Dockerfile b/ci/containers/libvirt-debian-10-cross-s390x.Dockerfile index dc2e345767a..4a688374fae 100644 --- a/ci/containers/libvirt-debian-10-cross-s390x.Dockerfile +++ b/ci/containers/libvirt-debian-10-cross-s390x.Dockerfile @@ -108,7 +108,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libyajl-dev:s390x \ xfslibs-dev:s390x && \ apt-get autoremove -y && \ - apt-get autoclean -y + apt-get autoclean -y && \ + mkdir -p /usr/local/share/meson/cross && \ + echo "[binaries]\nc = '/usr/bin/s390x-linux-gnu-gcc'\nar = '/usr/bin/s390x-linux-gnu-gcc-ar'\nstrip = '/usr/bin/s390x-linux-gnu-strip'\npkgconfig = '/usr/bin/s390x-linux-gnu-pkg-config'\n\n[host_machine]\nsystem = 'linux'\ncpu_family = 's390x'\ncpu = 's390x'\nendian = 'little'" > /usr/local/share/meson/cross/s390x-linux-gnu RUN pip3 install \ meson==0.54.0 @@ -123,4 +125,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" +ENV MESON_OPTS "--cross-file=s390x-linux-gnu" diff --git a/ci/containers/libvirt-debian-sid-cross-aarch64.Dockerfile b/ci/containers/libvirt-debian-sid-cross-aarch64.Dockerfile index 77f1e6e44fb..90350750522 100644 --- a/ci/containers/libvirt-debian-sid-cross-aarch64.Dockerfile +++ b/ci/containers/libvirt-debian-sid-cross-aarch64.Dockerfile @@ -109,7 +109,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libyajl-dev:arm64 \ xfslibs-dev:arm64 && \ apt-get autoremove -y && \ - apt-get autoclean -y + apt-get autoclean -y && \ + mkdir -p /usr/local/share/meson/cross && \ + echo "[binaries]\nc = '/usr/bin/aarch64-linux-gnu-gcc'\nar = '/usr/bin/aarch64-linux-gnu-gcc-ar'\nstrip = '/usr/bin/aarch64-linux-gnu-strip'\npkgconfig = '/usr/bin/aarch64-linux-gnu-pkg-config'\n\n[host_machine]\nsystem = 'linux'\ncpu_family = 'aarch64'\ncpu = 'aarch64'\nendian = 'little'" > /usr/local/share/meson/cross/aarch64-linux-gnu RUN pip3 install \ meson==0.54.0 @@ -124,4 +126,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" +ENV MESON_OPTS "--cross-file=aarch64-linux-gnu" diff --git a/ci/containers/libvirt-debian-sid-cross-armv6l.Dockerfile b/ci/containers/libvirt-debian-sid-cross-armv6l.Dockerfile index ee09125fffd..7de3084662f 100644 --- a/ci/containers/libvirt-debian-sid-cross-armv6l.Dockerfile +++ b/ci/containers/libvirt-debian-sid-cross-armv6l.Dockerfile @@ -108,7 +108,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libyajl-dev:armel \ xfslibs-dev:armel && \ apt-get autoremove -y && \ - apt-get autoclean -y + apt-get autoclean -y && \ + mkdir -p /usr/local/share/meson/cross && \ + echo "[binaries]\nc = '/usr/bin/arm-linux-gnueabi-gcc'\nar = '/usr/bin/arm-linux-gnueabi-gcc-ar'\nstrip = '/usr/bin/arm-linux-gnueabi-strip'\npkgconfig = '/usr/bin/arm-linux-gnueabi-pkg-config'\n\n[host_machine]\nsystem = 'linux'\ncpu_family = 'arm'\ncpu = 'arm'\nendian = 'little'" > /usr/local/share/meson/cross/arm-linux-gnueabi RUN pip3 install \ meson==0.54.0 @@ -123,4 +125,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" +ENV MESON_OPTS "--cross-file=arm-linux-gnueabi" diff --git a/ci/containers/libvirt-debian-sid-cross-armv7l.Dockerfile b/ci/containers/libvirt-debian-sid-cross-armv7l.Dockerfile index fbcf73fe7f9..e868b07c51a 100644 --- a/ci/containers/libvirt-debian-sid-cross-armv7l.Dockerfile +++ b/ci/containers/libvirt-debian-sid-cross-armv7l.Dockerfile @@ -109,7 +109,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libyajl-dev:armhf \ xfslibs-dev:armhf && \ apt-get autoremove -y && \ - apt-get autoclean -y + apt-get autoclean -y && \ + mkdir -p /usr/local/share/meson/cross && \ + echo "[binaries]\nc = '/usr/bin/arm-linux-gnueabihf-gcc'\nar = '/usr/bin/arm-linux-gnueabihf-gcc-ar'\nstrip = '/usr/bin/arm-linux-gnueabihf-strip'\npkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config'\n\n[host_machine]\nsystem = 'linux'\ncpu_family = 'arm'\ncpu = 'armhf'\nendian = 'little'" > /usr/local/share/meson/cross/arm-linux-gnueabihf RUN pip3 install \ meson==0.54.0 @@ -124,4 +126,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" +ENV MESON_OPTS "--cross-file=arm-linux-gnueabihf" diff --git a/ci/containers/libvirt-debian-sid-cross-i686.Dockerfile b/ci/containers/libvirt-debian-sid-cross-i686.Dockerfile index 5d94848a3af..bdc37608085 100644 --- a/ci/containers/libvirt-debian-sid-cross-i686.Dockerfile +++ b/ci/containers/libvirt-debian-sid-cross-i686.Dockerfile @@ -108,7 +108,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libyajl-dev:i386 \ xfslibs-dev:i386 && \ apt-get autoremove -y && \ - apt-get autoclean -y + apt-get autoclean -y && \ + mkdir -p /usr/local/share/meson/cross && \ + echo "[binaries]\nc = '/usr/bin/i686-linux-gnu-gcc'\nar = '/usr/bin/i686-linux-gnu-gcc-ar'\nstrip = '/usr/bin/i686-linux-gnu-strip'\npkgconfig = '/usr/bin/i686-linux-gnu-pkg-config'\n\n[host_machine]\nsystem = 'linux'\ncpu_family = 'x86'\ncpu = 'i686'\nendian = 'little'" > /usr/local/share/meson/cross/i686-linux-gnu RUN pip3 install \ meson==0.54.0 @@ -123,4 +125,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" +ENV MESON_OPTS "--cross-file=i686-linux-gnu" diff --git a/ci/containers/libvirt-debian-sid-cross-mips64el.Dockerfile b/ci/containers/libvirt-debian-sid-cross-mips64el.Dockerfile index b42c599cb46..0ed85cd5755 100644 --- a/ci/containers/libvirt-debian-sid-cross-mips64el.Dockerfile +++ b/ci/containers/libvirt-debian-sid-cross-mips64el.Dockerfile @@ -108,7 +108,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libyajl-dev:mips64el \ xfslibs-dev:mips64el && \ apt-get autoremove -y && \ - apt-get autoclean -y + apt-get autoclean -y && \ + mkdir -p /usr/local/share/meson/cross && \ + echo "[binaries]\nc = '/usr/bin/mips64el-linux-gnuabi64-gcc'\nar = '/usr/bin/mips64el-linux-gnuabi64-gcc-ar'\nstrip = '/usr/bin/mips64el-linux-gnuabi64-strip'\npkgconfig = '/usr/bin/mips64el-linux-gnuabi64-pkg-config'\n\n[host_machine]\nsystem = 'linux'\ncpu_family = 'mips64'\ncpu = 'mips64el'\nendian = 'little'" > /usr/local/share/meson/cross/mips64el-linux-gnuabi64 RUN pip3 install \ meson==0.54.0 @@ -123,4 +125,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" +ENV MESON_OPTS "--cross-file=mips64el-linux-gnuabi64" diff --git a/ci/containers/libvirt-debian-sid-cross-mipsel.Dockerfile b/ci/containers/libvirt-debian-sid-cross-mipsel.Dockerfile index b076c7d2cd2..580d3170e73 100644 --- a/ci/containers/libvirt-debian-sid-cross-mipsel.Dockerfile +++ b/ci/containers/libvirt-debian-sid-cross-mipsel.Dockerfile @@ -108,7 +108,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libyajl-dev:mipsel \ xfslibs-dev:mipsel && \ apt-get autoremove -y && \ - apt-get autoclean -y + apt-get autoclean -y && \ + mkdir -p /usr/local/share/meson/cross && \ + echo "[binaries]\nc = '/usr/bin/mipsel-linux-gnu-gcc'\nar = '/usr/bin/mipsel-linux-gnu-gcc-ar'\nstrip = '/usr/bin/mipsel-linux-gnu-strip'\npkgconfig = '/usr/bin/mipsel-linux-gnu-pkg-config'\n\n[host_machine]\nsystem = 'linux'\ncpu_family = 'mips'\ncpu = 'mipsel'\nendian = 'little'" > /usr/local/share/meson/cross/mipsel-linux-gnu RUN pip3 install \ meson==0.54.0 @@ -123,4 +125,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" +ENV MESON_OPTS "--cross-file=mipsel-linux-gnu" diff --git a/ci/containers/libvirt-debian-sid-cross-ppc64le.Dockerfile b/ci/containers/libvirt-debian-sid-cross-ppc64le.Dockerfile index aece53541b7..d1d401c8eb4 100644 --- a/ci/containers/libvirt-debian-sid-cross-ppc64le.Dockerfile +++ b/ci/containers/libvirt-debian-sid-cross-ppc64le.Dockerfile @@ -108,7 +108,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libyajl-dev:ppc64el \ xfslibs-dev:ppc64el && \ apt-get autoremove -y && \ - apt-get autoclean -y + apt-get autoclean -y && \ + mkdir -p /usr/local/share/meson/cross && \ + echo "[binaries]\nc = '/usr/bin/powerpc64le-linux-gnu-gcc'\nar = '/usr/bin/powerpc64le-linux-gnu-gcc-ar'\nstrip = '/usr/bin/powerpc64le-linux-gnu-strip'\npkgconfig = '/usr/bin/powerpc64le-linux-gnu-pkg-config'\n\n[host_machine]\nsystem = 'linux'\ncpu_family = 'ppc64'\ncpu = 'powerpc64le'\nendian = 'little'" > /usr/local/share/meson/cross/powerpc64le-linux-gnu RUN pip3 install \ meson==0.54.0 @@ -123,4 +125,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" +ENV MESON_OPTS "--cross-file=powerpc64le-linux-gnu" diff --git a/ci/containers/libvirt-debian-sid-cross-s390x.Dockerfile b/ci/containers/libvirt-debian-sid-cross-s390x.Dockerfile index 9cf7081aaa0..6bd7eb6a4c3 100644 --- a/ci/containers/libvirt-debian-sid-cross-s390x.Dockerfile +++ b/ci/containers/libvirt-debian-sid-cross-s390x.Dockerfile @@ -108,7 +108,9 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libyajl-dev:s390x \ xfslibs-dev:s390x && \ apt-get autoremove -y && \ - apt-get autoclean -y + apt-get autoclean -y && \ + mkdir -p /usr/local/share/meson/cross && \ + echo "[binaries]\nc = '/usr/bin/s390x-linux-gnu-gcc'\nar = '/usr/bin/s390x-linux-gnu-gcc-ar'\nstrip = '/usr/bin/s390x-linux-gnu-strip'\npkgconfig = '/usr/bin/s390x-linux-gnu-pkg-config'\n\n[host_machine]\nsystem = 'linux'\ncpu_family = 's390x'\ncpu = 's390x'\nendian = 'little'" > /usr/local/share/meson/cross/s390x-linux-gnu RUN pip3 install \ meson==0.54.0 @@ -123,4 +125,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" +ENV MESON_OPTS "--cross-file=s390x-linux-gnu" diff --git a/ci/i686-linux-gnu.meson b/ci/i686-linux-gnu.meson deleted file mode 100644 index 638113e1d21..00000000000 --- a/ci/i686-linux-gnu.meson +++ /dev/null @@ -1,11 +0,0 @@ -[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 deleted file mode 100644 index 2c4c21c1e02..00000000000 --- a/ci/mips-linux-gnu.meson +++ /dev/null @@ -1,11 +0,0 @@ -[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 deleted file mode 100644 index 459c8154d7b..00000000000 --- a/ci/mips64el-linux-gnuabi64.meson +++ /dev/null @@ -1,11 +0,0 @@ -[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 deleted file mode 100644 index 308bda511ee..00000000000 --- a/ci/mipsel-linux-gnu.meson +++ /dev/null @@ -1,11 +0,0 @@ -[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 deleted file mode 100644 index 9a151e2c12f..00000000000 --- a/ci/powerpc64le-linux-gnu.meson +++ /dev/null @@ -1,11 +0,0 @@ -[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 deleted file mode 100644 index 28a292c7203..00000000000 --- a/ci/s390x-linux-gnu.meson +++ /dev/null @@ -1,11 +0,0 @@ -[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' diff --git a/docs/advanced-tests.rst b/docs/advanced-tests.rst index c8c02eabe06..bc20bbf4d9e 100644 --- a/docs/advanced-tests.rst +++ b/docs/advanced-tests.rst @@ -7,7 +7,6 @@ The basic requirement before submitting changes to libvirt is that :: $ ninja test - $ ninja syntax-check succeed after each commit. diff --git a/docs/best-practices.rst b/docs/best-practices.rst index b2572c81100..8283f627cea 100644 --- a/docs/best-practices.rst +++ b/docs/best-practices.rst @@ -25,9 +25,8 @@ with minimal back-and-forth. self-contained if possible, with an explanation of each patch 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** - ``ninja test`` and ``ninja syntax-check``) after each - patch. A feature does not have to work until the end of a + be able to compile cleanly (**including** ``ninja test``) 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 ``git bisect``, among other things). diff --git a/docs/committer-guidelines.rst b/docs/committer-guidelines.rst index 1f879ddf934..d2c530d8952 100644 --- a/docs/committer-guidelines.rst +++ b/docs/committer-guidelines.rst @@ -12,8 +12,8 @@ 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 'ninja test -syntax-check', and make sure you don't raise errors. +Before committing, please also rebuild locally, run 'ninja test', +and make sure you don't raise errors. An exception to 'review and approval on the list first' is fixing failures to build: @@ -21,11 +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 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 'ninja test syntax-check' should pass too, before - committing anything +- if ninja test 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 'ninja test' 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. - (ir)regular pulls from other repositories or automated updates, diff --git a/docs/hacking.rst b/docs/hacking.rst index 4a9a1e19565..3fc5888a712 100644 --- a/docs/hacking.rst +++ b/docs/hacking.rst @@ -31,7 +31,6 @@ changes. That is: :: $ 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/internals/meson.build b/docs/internals/meson.build index e600c84af60..18fd6620d49 100644 --- a/docs/internals/meson.build +++ b/docs/internals/meson.build @@ -15,7 +15,8 @@ foreach name : internals_in_files output: html_file, command: [ meson_python_prog, - meson_html_gen_prog, + python3_prog.path(), + meson_html_gen_prog.path(), xsltproc_prog.path(), xmllint_prog.path(), meson.build_root(), diff --git a/docs/kbase/meson.build b/docs/kbase/meson.build index d46289245b2..a964e999f7d 100644 --- a/docs/kbase/meson.build +++ b/docs/kbase/meson.build @@ -1,6 +1,8 @@ docs_kbase_files = [ 'backing_chains', 'domainstatecapture', + 'incrementalbackupinternals', + 'kvm-realtime', 'launch_security_sev', 'locking-lockd', 'locking', @@ -8,6 +10,7 @@ docs_kbase_files = [ 'migrationinternals', 'qemu-passthrough-security', 'rpm-deployment', + 's390_protected_virt', 'secureusage', 'virtiofs', ] @@ -24,7 +27,8 @@ foreach name : docs_kbase_files output: html_file, command: [ meson_python_prog, - meson_html_gen_prog, + python3_prog.path(), + meson_html_gen_prog.path(), xsltproc_prog.path(), xmllint_prog.path(), meson.build_root(), diff --git a/docs/logging.html.in b/docs/logging.html.in index b4e7d0c3864..3ff0dd3eb67 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 PATH=/usr/lib64/ccache:/usr/local/sbin:" \ + "/src/virt/libvirt/src/.libs 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/docs/manpages/index.rst.in b/docs/manpages/index.rst similarity index 100% rename from docs/manpages/index.rst.in rename to docs/manpages/index.rst diff --git a/docs/manpages/libvirtd.rst.in b/docs/manpages/libvirtd.rst similarity index 93% rename from docs/manpages/libvirtd.rst.in rename to docs/manpages/libvirtd.rst index 4125604f9ad..c88e2dd7e17 100644 --- a/docs/manpages/libvirtd.rst.in +++ b/docs/manpages/libvirtd.rst @@ -131,29 +131,29 @@ FILES When run as *root* ------------------ -* ``SYSCONFDIR/libvirt/libvirtd.conf`` +* ``@SYSCONFDIR@/libvirt/libvirtd.conf`` The default configuration file used by libvirtd, unless overridden on the command line using the ``-f`` | ``--config`` option. -* ``RUNSTATEDIR/libvirt/libvirt-sock`` -* ``RUNSTATEDIR/libvirt/libvirt-sock-ro`` +* ``@RUNSTATEDIR@/libvirt/libvirt-sock`` +* ``@RUNSTATEDIR@/libvirt/libvirt-sock-ro`` The sockets libvirtd will use. -* ``SYSCONFDIR/pki/CA/cacert.pem`` +* ``@SYSCONFDIR@/pki/CA/cacert.pem`` The TLS **Certificate Authority** certificate libvirtd will use. -* ``SYSCONFDIR/pki/libvirt/servercert.pem`` +* ``@SYSCONFDIR@/pki/libvirt/servercert.pem`` The TLS **Server** certificate libvirtd will use. -* ``SYSCONFDIR/pki/libvirt/private/serverkey.pem`` +* ``@SYSCONFDIR@/pki/libvirt/private/serverkey.pem`` The TLS **Server** private key libvirtd will use. -* ``RUNSTATEDIR/libvirtd.pid`` +* ``@RUNSTATEDIR@/libvirtd.pid`` The PID file to use, unless overridden by the ``-p`` | ``--pid-file`` option. @@ -210,8 +210,8 @@ To start libvirtd, instructing it to daemonize and create a PID file: .. code-block:: # libvirtd -d - # ls -la RUNSTATEDIR/libvirtd.pid - -rw-r--r-- 1 root root 6 Jul 9 02:40 RUNSTATEDIR/libvirtd.pid + # ls -la @RUNSTATEDIR@/libvirtd.pid + -rw-r--r-- 1 root root 6 Jul 9 02:40 @RUNSTATEDIR@/libvirtd.pid BUGS diff --git a/docs/manpages/meson.build b/docs/manpages/meson.build index c53109c8d29..d07af810e6e 100644 --- a/docs/manpages/meson.build +++ b/docs/manpages/meson.build @@ -28,7 +28,7 @@ foreach name : keycode_list input: keymap_src_file, output: 'virkeycode-@0@.rst'.format(name), command: [ - meson_python_prog, python3_prog, keymap_gen_prog, 'code-docs', + meson_python_prog, python3_prog.path(), keymap_gen_prog.path(), 'code-docs', '--lang', 'rst', '--title', 'virkeycode-@0@'.format(name), '--subtitle', 'Key code values for @0@'.format(name), @@ -49,7 +49,7 @@ foreach name : keyname_list input: keymap_src_file, output: 'virkeyname-@0@.rst'.format(name), command: [ - meson_python_prog, python3_prog, keymap_gen_prog, 'name-docs', + meson_python_prog, python3_prog.path(), keymap_gen_prog.path(), 'name-docs', '--lang', 'rst', '--title', 'virkeyname-@0@'.format(name), '--subtitle', 'Key name values for @0@'.format(name), @@ -69,7 +69,7 @@ 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']) + rst_in_file = '@0@.rst'.format(data['name']) html_in_file = '@0@.html.in'.format(data['name']) html_file = '@0@.html'.format(data['name']) @@ -109,7 +109,8 @@ foreach data : docs_man_files output: html_file, command: [ meson_python_prog, - meson_html_gen_prog, + python3_prog.path(), + meson_html_gen_prog.path(), xsltproc_prog.path(), xmllint_prog.path(), meson.build_root(), diff --git a/docs/manpages/virsh.rst.in b/docs/manpages/virsh.rst similarity index 100% rename from docs/manpages/virsh.rst.in rename to docs/manpages/virsh.rst diff --git a/docs/manpages/virt-admin.rst.in b/docs/manpages/virt-admin.rst similarity index 100% rename from docs/manpages/virt-admin.rst.in rename to docs/manpages/virt-admin.rst diff --git a/docs/manpages/virt-host-validate.rst.in b/docs/manpages/virt-host-validate.rst similarity index 100% rename from docs/manpages/virt-host-validate.rst.in rename to docs/manpages/virt-host-validate.rst diff --git a/docs/manpages/virt-login-shell.rst.in b/docs/manpages/virt-login-shell.rst similarity index 100% rename from docs/manpages/virt-login-shell.rst.in rename to docs/manpages/virt-login-shell.rst diff --git a/docs/manpages/virt-pki-validate.rst.in b/docs/manpages/virt-pki-validate.rst similarity index 100% rename from docs/manpages/virt-pki-validate.rst.in rename to docs/manpages/virt-pki-validate.rst diff --git a/docs/manpages/virt-qemu-run.rst.in b/docs/manpages/virt-qemu-run.rst similarity index 100% rename from docs/manpages/virt-qemu-run.rst.in rename to docs/manpages/virt-qemu-run.rst diff --git a/docs/manpages/virt-sanlock-cleanup.rst.in b/docs/manpages/virt-sanlock-cleanup.rst similarity index 100% rename from docs/manpages/virt-sanlock-cleanup.rst.in rename to docs/manpages/virt-sanlock-cleanup.rst diff --git a/docs/manpages/virt-xml-validate.rst.in b/docs/manpages/virt-xml-validate.rst similarity index 100% rename from docs/manpages/virt-xml-validate.rst.in rename to docs/manpages/virt-xml-validate.rst diff --git a/docs/manpages/virtlockd.rst.in b/docs/manpages/virtlockd.rst similarity index 94% rename from docs/manpages/virtlockd.rst.in rename to docs/manpages/virtlockd.rst index 1dc106d6fca..ea37b25d05d 100644 --- a/docs/manpages/virtlockd.rst.in +++ b/docs/manpages/virtlockd.rst @@ -79,16 +79,16 @@ FILES When run as *root* ------------------ -* ``SYSCONFDIR/libvirt/virtlockd.conf`` +* ``@SYSCONFDIR@/libvirt/virtlockd.conf`` The default configuration file used by ``virtlockd``, unless overridden on the command line using the ``-f`` | ``--config`` option. -* ``RUNSTATEDIR/libvirt/virtlockd-sock`` +* ``@RUNSTATEDIR@/libvirt/virtlockd-sock`` The sockets ``virtlockd`` will use. -* ``RUNSTATEDIR/virtlockd.pid`` +* ``@RUNSTATEDIR@/virtlockd.pid`` The PID file to use, unless overridden by the ``-p`` | ``--pid-file`` option. @@ -130,8 +130,8 @@ To start ``virtlockd``, instructing it to daemonize and create a PID file: .. code-block:: # virtlockd -d - # ls -la RUNSTATEDIR/virtlockd.pid - -rw-r--r-- 1 root root 6 Jul 9 02:40 RUNSTATEDIR/virtlockd.pid + # ls -la @RUNSTATEDIR@/virtlockd.pid + -rw-r--r-- 1 root root 6 Jul 9 02:40 @RUNSTATEDIR@/virtlockd.pid BUGS ==== diff --git a/docs/manpages/virtlogd.rst.in b/docs/manpages/virtlogd.rst similarity index 94% rename from docs/manpages/virtlogd.rst.in rename to docs/manpages/virtlogd.rst index c84ab2e6219..edf8288230e 100644 --- a/docs/manpages/virtlogd.rst.in +++ b/docs/manpages/virtlogd.rst @@ -80,16 +80,16 @@ FILES When run as *root* ------------------ -* ``SYSCONFDIR/libvirt/virtlogd.conf`` +* ``@SYSCONFDIR@/libvirt/virtlogd.conf`` The default configuration file used by ``virtlogd``, unless overridden on the command line using the ``-f`` | ``--config`` option. -* ``RUNSTATEDIR/libvirt/virtlogd-sock`` +* ``@RUNSTATEDIR@/libvirt/virtlogd-sock`` The sockets ``virtlogd`` will use. -* ``RUNSTATEDIR/virtlogd.pid`` +* ``@RUNSTATEDIR@/virtlogd.pid`` The PID file to use, unless overridden by the ``-p`` | ``--pid-file`` option. @@ -131,8 +131,8 @@ To start ``virtlogd``, instructing it to daemonize and create a PID file: .. code-block:: # virtlogd -d - # ls -la RUNSTATEDIR/virtlogd.pid - -rw-r--r-- 1 root root 6 Jul 9 02:40 RUNSTATEDIR/virtlogd.pid + # ls -la @RUNSTATEDIR@/virtlogd.pid + -rw-r--r-- 1 root root 6 Jul 9 02:40 @RUNSTATEDIR@/virtlogd.pid BUGS diff --git a/docs/meson.build b/docs/meson.build index 773e127ca74..1d24f2a9e2c 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -140,12 +140,14 @@ aclperms_gen = custom_target( input: access_perm_h, output: 'aclperms.htmlinc', command: [ - meson_python_prog, genaclperms_prog, '@INPUT@', + meson_python_prog, python3_prog.path(), genaclperms_prog.path(), '@INPUT@', ], capture: true, ) -docs_timestamp = run_command(meson_timestamp_prog).stdout() +docs_timestamp = run_command( + python3_prog, meson_timestamp_prog.path(), env: runutf8 +).stdout().strip() site_xsl = files('site.xsl') subsite_xsl = files('subsite.xsl') @@ -161,8 +163,7 @@ docs_api_generated = custom_target( 'libvirt-admin-api.xml', ], command: [ - meson_python_prog, - apibuild_prog, + meson_python_prog, python3_prog.path(), apibuild_prog.path(), meson.current_source_dir(), meson.current_build_dir(), ], @@ -201,7 +202,8 @@ foreach name : docs_html_in_files output: html_file, command: [ meson_python_prog, - meson_html_gen_prog, + python3_prog.path(), + meson_html_gen_prog.path(), xsltproc_prog.path(), xmllint_prog.path(), meson.build_root(), @@ -240,7 +242,8 @@ hvsupport_html_in = custom_target( output: 'hvsupport.html.in', command: [ meson_python_prog, - hvsupport_prog, + python3_prog.path(), + hvsupport_prog.path(), meson.source_root(), meson.build_root(), ], @@ -275,7 +278,8 @@ foreach data : docs_html_in_gen output: html_file, command: [ meson_python_prog, - meson_html_gen_prog, + python3_prog.path(), + meson_html_gen_prog.path(), xsltproc_prog.path(), xmllint_prog.path(), meson.build_root(), @@ -314,6 +318,9 @@ endforeach run_target( 'install-web', - command: [ meson_python_prog, meson_install_web_prog.path(), install_web_files ], + command: [ + meson_python_prog, python3_prog.path(), meson_install_web_prog.path(), + install_web_files, + ], depends: install_web_deps, ) diff --git a/libvirt.spec.in b/libvirt.spec.in index d7450acc399..e64cfdb561e 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -259,6 +259,8 @@ BuildRequires: python36-docutils BuildRequires: python3-docutils %endif BuildRequires: gcc +BuildRequires: meson >= 0.54.0 +BuildRequires: ninja-build BuildRequires: make BuildRequires: git %if 0%{?fedora} || 0%{?rhel} > 7 @@ -1279,7 +1281,7 @@ mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes.stp \ %endif %check -VIR_TEST_DEBUG=1 %meson_test +VIR_TEST_DEBUG=1 %meson_test --no-suite syntax-check %post libs %if 0%{?rhel} == 7 diff --git a/meson.build b/meson.build index 4e43a526cc6..772708946b1 100644 --- a/meson.build +++ b/meson.build @@ -16,7 +16,7 @@ project( git = run_command('test', '-d', '.git').returncode() == 0 -if git and not get_option('no-git') +if git and not get_option('no_git') run_command('git', 'submodule', 'update', '--init') endif @@ -127,8 +127,6 @@ endif # test options -use_test_suite = get_option('test_suite') - if get_option('expensive_tests').auto() use_expensive_tests = not git else @@ -144,7 +142,8 @@ if get_option('test_coverage') endif -# Detect when running under the +# Detect when running under the clang static analyzer's scan-build driver +# or Coverity-prevent's cov-build. Define STATIC_ANALYSIS accordingly. rc = run_command( 'sh', '-c', @@ -205,8 +204,14 @@ libvirt_lib_version = '@0@.@1@.@2@'.format(libvirt_so_version, libvirt_age, libv # check compile flags cc = meson.get_compiler('c') +cc_flags = [] -cc_flags = [ +git_werror = get_option('git_werror') +if git_werror.enabled() or git_werror.auto() and git + cc_flags += [ '-Werror' ] +endif + +cc_flags += [ '-fno-common', '-W', '-Wabsolute-value', @@ -360,7 +365,7 @@ size_max = cc.sizeof('size_t', prefix: '#include ') # 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), + 'print(min(2**(@0@ * 8 - 1) - 1, 2**(@1@ * 8) - 1))'.format(ptrdiff_max, size_max), ) cc_flags += [ '-Walloc-size-larger-than=@0@'.format(alloc_max.stdout().strip()), @@ -390,7 +395,8 @@ cc_flags += [ # We don't use -Wc++-compat so we have to enable it explicitly '-Wjump-misses-init', - # TODO comment + # -Wswitch is enabled but that doesn't report missing enums if a default: + # is present '-Wswitch-enum', # -Wformat=2 implies -Wformat-nonliteral so we need to manually exclude it @@ -419,13 +425,9 @@ cc_flags += [ '-Wno-suggest-attribute=const', ] -if git - cc_flags += [ '-Werror' ] -endif - # on aarch64 error: -fstack-protector not supported for this target if host_machine.cpu_family() != 'aarch64' - if host_machine.system() in [ 'linux', 'freebsd' ] + if host_machine.system() in [ 'linux', 'freebsd', 'windows' ] # we prefer -fstack-protector-strong but fallback to -fstack-protector-all fstack_cflags = cc.first_supported_argument([ '-fstack-protector-strong', @@ -623,7 +625,7 @@ libvirt_export_dynamic = cc.first_supported_link_argument([ ]) -# check availability of various common functions (non-fatal i missing) +# check availability of various common functions (non-fatal if missing) functions = [ '__lxstat', @@ -789,7 +791,7 @@ if host_machine.system() == 'linux' endif foreach symbol : symbols - if cc.has_header_symbol(symbol[0], symbol[1]) + if cc.has_header_symbol(symbol[0], symbol[1], args: '-D_GNU_SOURCE') conf.set('HAVE_DECL_@0@'.format(symbol[1].to_upper()), 1) endif endforeach @@ -958,7 +960,7 @@ else acl_dep = dependency('', required: false) endif -apparmor_dep = cc.find_library('AppArmor', required: get_option('apparmor')) +apparmor_dep = dependency('libapparmor', required: get_option('apparmor')) if apparmor_dep.found() conf.set('WITH_APPARMOR', 1) conf.set_quoted('APPARMOR_DIR', '/etc/apparmor.d') @@ -966,6 +968,9 @@ if apparmor_dep.found() endif attr_dep = cc.find_library('attr', required: get_option('attr')) +if attr_dep.found() + conf.set('HAVE_LIBATTR', 1) +endif audit_dep = cc.find_library('audit', required: get_option('audit')) if audit_dep.found() @@ -1124,6 +1129,8 @@ if get_option('driver_remote').enabled() if libssh_dep.found() conf.set('WITH_LIBSSH', 1) + # Check if new functions exists, if not redefine them with old deprecated ones. + # List of [ new_function, deprecated_function ]. functions = [ [ 'ssh_get_server_publickey', 'ssh_get_publickey' ], [ 'ssh_session_is_known_server', 'ssh_is_server_known' ], @@ -2066,12 +2073,6 @@ 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 - -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() @@ -2107,6 +2108,14 @@ else init_script = get_option('init_script') endif +loader_nvram = get_option('loader_nvram') +if loader_nvram != '' + if (loader_nvram.split(':').length() % 2) != 0 + error('Malformed loader_nvram option') + endif + conf.set_quoted('DEFAULT_LOADER_NVRAM', loader_nvram) +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() @@ -2271,7 +2280,7 @@ if git ) endforeach - authors = run_command(meson_gen_authors_prog) + authors = run_command(python3_prog, meson_gen_authors_prog.path(), env: runutf8) authors_file = 'AUTHORS.in' authors_conf = configuration_data() @@ -2290,7 +2299,10 @@ if git ] foreach file : dist_files - meson.add_dist_script(meson_dist_prog.path(), meson.build_root(), file) + meson.add_dist_script( + meson_python_prog.path(), python3_prog.path(), meson_dist_prog.path(), + meson.build_root(), file + ) endforeach endif @@ -2307,7 +2319,7 @@ configure_file( output: 'run', configuration: run_conf, ) -run_command('scripts/meson-change-perms.sh', 'a+x', 'run') +run_command('chmod', 'a+x', meson.current_build_dir() / 'run') # generate developer tooling files @@ -2435,15 +2447,19 @@ test_summary = { } summary(test_summary, section: 'Test suite', bool_yn: true) +if conf.has('DEFAULT_LOADER_NVRAM') + loader_res = '@0@ !!! Using this configure option is strongly discouraged !!!'.format(conf.get_unquoted('DEFAULT_LOADER_NVRAM')) +else + loader_res = '' +endif misc_summary = { - 'Debug': conf.has('ENABLE_DEBUG'), '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'), + 'Loader/NVRAM': loader_res, 'virt-login-shell': conf.has('WITH_LOGIN_SHELL'), 'virt-host-validate': conf.has('WITH_HOST_VALIDATE'), 'TLS priority': conf.get_unquoted('TLS_PRIORITY'), diff --git a/meson_options.txt b/meson_options.txt index dbbacf7e8ff..a1bb6505b8c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,11 +1,11 @@ -option('no-git', type: 'boolean', value: false, description: 'Disable git submodule update') +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') -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') +option('git_werror', type: 'feature', value: 'auto', description: 'use -Werror if building from GIT') # build dependencies options @@ -47,7 +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_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') @@ -91,11 +91,10 @@ 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') 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('loader_nvram', type: 'string', value: '', description: 'Pass list of pairs of : paths. Both pairs and list items are separated by a colon.') 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') diff --git a/scripts/check-augeas.sh b/scripts/check-augeas.sh deleted file mode 100644 index 68609d555a7..00000000000 --- a/scripts/check-augeas.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/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/check-file-access.py b/scripts/check-file-access.py index f0e98f4b652..2636eb4f96d 100755 --- a/scripts/check-file-access.py +++ b/scripts/check-file-access.py @@ -22,16 +22,16 @@ # import os -import random import re -import string import sys +import tempfile abs_builddir = os.environ.get('abs_builddir', '') abs_srcdir = os.environ.get('abs_srcdir', '') -filename = ''.join(random.choice(string.ascii_letters) for _ in range(16)) -access_file = os.path.join(abs_builddir, 'file-access-{0}.txt'.format(filename)) +access_fd, access_file = tempfile.mkstemp(dir=abs_builddir, + prefix='file-access-', + suffix='.txt') permitted_file = os.path.join(abs_srcdir, 'permitted_file_access.txt') os.environ['VIR_TEST_FILE_ACCESS_OUTPUT'] = access_file @@ -40,7 +40,9 @@ test = ' '.join(sys.argv[1:]) ret = os.system(test) -if ret != 0 or not os.is_file(access_file): +if ret != 0 or os.read(access_fd, 10) == b'': + os.close(access_fd) + os.remove(access_file) sys.exit(ret) known_actions = ["open", "fopen", "access", "stat", "lstat", "connect"] @@ -48,7 +50,7 @@ known_actions = ["open", "fopen", "access", "stat", "lstat", "connect"] files = [] permitted = [] -with open(access_file, "r") as fh: +with os.fdopen(access_fd, "r") as fh: for line in fh: line = line.rstrip("\n") diff --git a/scripts/check-remote-protocol.py b/scripts/check-remote-protocol.py index 00b8570f9bb..0a6135376e6 100644 --- a/scripts/check-remote-protocol.py +++ b/scripts/check-remote-protocol.py @@ -32,11 +32,14 @@ import subprocess import sys name = sys.argv[1] -libname = sys.argv[2] -builddir = sys.argv[3] +targetname = sys.argv[2] +libpath = sys.argv[3] pdwtags = sys.argv[4] expected = sys.argv[5] +builddir = os.path.dirname(libpath) +libname = os.path.basename(libpath) + def get_subdir(dirname, subdir): objectdir = "" @@ -52,7 +55,18 @@ def get_subdir(dirname, subdir): return os.path.join(dirname, objectdir) -objectdir = get_subdir(builddir, r'.*@{0}@.*'.format(libname)) +# Figure out where is the meson target private directory that contains +# generated object files. +# With meson version < 0.55.0 the directory pattern is: +# +# `hash_string@@target_name@bin_type` for example `25a6634@@vir_net_rpc@sta` +# +# but this was changed in meson 0.55.0 to a new pattern: +# +# `output_file_name.p` for example `libvirt_net_rpc.a.p` +objectdir = get_subdir( + builddir, + r'(.*@{0}@.*|{1}\.p)'.format(targetname, re.escape(libname))) proto_o = get_subdir(objectdir, r'.*{0}\.c\.o'.format(name)) diff --git a/scripts/esx_vi_generator.py b/scripts/esx_vi_generator.py index 048f5dde9ee..863c8af9640 100755 --- a/scripts/esx_vi_generator.py +++ b/scripts/esx_vi_generator.py @@ -1250,12 +1250,7 @@ def is_known_type(type): type in enums_by_name) -def open_and_print(filename): - if filename.startswith("./"): - print(" GEN " + filename[2:]) - else: - print(" GEN " + filename) - +def open_file(filename): return open(filename, "wt") @@ -1327,17 +1322,17 @@ input_filename = os.path.join(sys.argv[1], "esx/esx_vi_generator.input") output_dirname = os.path.join(sys.argv[2], "esx") -types_typedef = open_and_print(os.path.join(output_dirname, "esx_vi_types.generated.typedef")) -types_typeenum = open_and_print(os.path.join(output_dirname, "esx_vi_types.generated.typeenum")) -types_typetostring = open_and_print(os.path.join(output_dirname, "esx_vi_types.generated.typetostring")) -types_typefromstring = open_and_print(os.path.join(output_dirname, "esx_vi_types.generated.typefromstring")) -types_header = open_and_print(os.path.join(output_dirname, "esx_vi_types.generated.h")) -types_source = open_and_print(os.path.join(output_dirname, "esx_vi_types.generated.c")) -methods_header = open_and_print(os.path.join(output_dirname, "esx_vi_methods.generated.h")) -methods_source = open_and_print(os.path.join(output_dirname, "esx_vi_methods.generated.c")) -methods_macro = open_and_print(os.path.join(output_dirname, "esx_vi_methods.generated.macro")) -helpers_header = open_and_print(os.path.join(output_dirname, "esx_vi.generated.h")) -helpers_source = open_and_print(os.path.join(output_dirname, "esx_vi.generated.c")) +types_typedef = open_file(os.path.join(output_dirname, "esx_vi_types.generated.typedef")) +types_typeenum = open_file(os.path.join(output_dirname, "esx_vi_types.generated.typeenum")) +types_typetostring = open_file(os.path.join(output_dirname, "esx_vi_types.generated.typetostring")) +types_typefromstring = open_file(os.path.join(output_dirname, "esx_vi_types.generated.typefromstring")) +types_header = open_file(os.path.join(output_dirname, "esx_vi_types.generated.h")) +types_source = open_file(os.path.join(output_dirname, "esx_vi_types.generated.c")) +methods_header = open_file(os.path.join(output_dirname, "esx_vi_methods.generated.h")) +methods_source = open_file(os.path.join(output_dirname, "esx_vi_methods.generated.c")) +methods_macro = open_file(os.path.join(output_dirname, "esx_vi_methods.generated.macro")) +helpers_header = open_file(os.path.join(output_dirname, "esx_vi.generated.h")) +helpers_source = open_file(os.path.join(output_dirname, "esx_vi.generated.c")) number = 0 diff --git a/scripts/gen-def-files.sh b/scripts/gen-def-files.sh deleted file mode 100755 index 1ec7b083802..00000000000 --- a/scripts/gen-def-files.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -printf 'EXPORTS\n' -sed -e '/^$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d' \ - -e 's/[ ]*\(.*\)\;/ \1/g' $1 diff --git a/scripts/gen-sym-files.sh b/scripts/gen-sym-files.sh deleted file mode 100755 index 913a684d064..00000000000 --- a/scripts/gen-sym-files.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/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/hyperv_wmi_generator.py b/scripts/hyperv_wmi_generator.py index 736eabd598c..ac03cf526f5 100755 --- a/scripts/hyperv_wmi_generator.py +++ b/scripts/hyperv_wmi_generator.py @@ -372,12 +372,7 @@ class Property: return ' { "%s", "%s", %s },\n' % (self.name, self.type.lower(), str(self.is_array).lower()) -def open_and_print(filename): - if filename.startswith("./"): - print(" GEN " + filename[2:]) - else: - print(" GEN " + filename) - +def open_file(filename): return open(filename, "wt") @@ -438,9 +433,9 @@ def main(): input_filename = os.path.join(sys.argv[1], "hyperv", "hyperv_wmi_generator.input") output_dirname = os.path.join(sys.argv[2], "hyperv") - classes_typedef = open_and_print(os.path.join(output_dirname, "hyperv_wmi_classes.generated.typedef")) - classes_header = open_and_print(os.path.join(output_dirname, "hyperv_wmi_classes.generated.h")) - classes_source = open_and_print(os.path.join(output_dirname, "hyperv_wmi_classes.generated.c")) + classes_typedef = open_file(os.path.join(output_dirname, "hyperv_wmi_classes.generated.typedef")) + classes_header = open_file(os.path.join(output_dirname, "hyperv_wmi_classes.generated.h")) + classes_source = open_file(os.path.join(output_dirname, "hyperv_wmi_classes.generated.c")) # parse input file number = 0 diff --git a/scripts/install-dirs.sh b/scripts/install-dirs.sh deleted file mode 100644 index 27558d53fe9..00000000000 --- a/scripts/install-dirs.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -for dir in "$@"; do - mkdir -p $DESTDIR/$dir -done diff --git a/scripts/install-symlink.sh b/scripts/install-symlink.sh deleted file mode 100644 index bfd1f5ad37d..00000000000 --- a/scripts/install-symlink.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -mkdir -p $DESTDIR/$1 - -cd $DESTDIR/$1 - -ln -f -s $2 $3 diff --git a/scripts/meson-change-perms.sh b/scripts/meson-change-perms.sh deleted file mode 100644 index b366d80077e..00000000000 --- a/scripts/meson-change-perms.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -perms=$1 -file=$2 - -chmod $perms $MESON_BUILD_ROOT/$file diff --git a/scripts/meson-dist.py b/scripts/meson-dist.py new file mode 100755 index 00000000000..a1d36c2533d --- /dev/null +++ b/scripts/meson-dist.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 + +import os +import sys + +meson_build_root = sys.argv[1] +file_name = sys.argv[2] + +meson_dist_root = os.environ['MESON_DIST_ROOT'] + +os.system('cp {0} {1}'.format( + os.path.join(meson_build_root, file_name), + os.path.join(meson_dist_root, file_name) +)) diff --git a/scripts/meson-dist.sh b/scripts/meson-dist.sh deleted file mode 100755 index fdcc0154e02..00000000000 --- a/scripts/meson-dist.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -MESON_BUILD_ROOT=$1 -FILE=$2 - -cp $MESON_BUILD_ROOT/$FILE $MESON_DIST_ROOT/$FILE diff --git a/scripts/meson-gen-authors.py b/scripts/meson-gen-authors.py new file mode 100755 index 00000000000..f58bf6383bf --- /dev/null +++ b/scripts/meson-gen-authors.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 + +import os + +meson_source_root = os.environ['MESON_SOURCE_ROOT'] + +os.chdir(meson_source_root) +os.system('git log --pretty=format:"%aN <%aE>" | sort -u') diff --git a/scripts/meson-gen-authors.sh b/scripts/meson-gen-authors.sh deleted file mode 100755 index bf0a3b63886..00000000000 --- a/scripts/meson-gen-authors.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -cd $MESON_SOURCE_ROOT -git log --pretty=format:'* %aN <%aE>' | sort -u diff --git a/scripts/meson-gen-def.py b/scripts/meson-gen-def.py new file mode 100755 index 00000000000..06c9bdf66ab --- /dev/null +++ b/scripts/meson-gen-def.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 + +import re +import sys + +if len(sys.argv) != 3: + print('invalid arguments') + print('usage: {0} INPUT OUTPUT'.format(sys.argv[0])) + sys.exit(1) + +infilepath = sys.argv[1] +outfilepath = sys.argv[2] + +with open(infilepath) as f: + text = f.read() + +text = re.sub(r'^(|.*[#:}*].*|LIBVIRT_.*)\n?', '', text, flags=re.M) +text = re.sub(r'\n$', '', text) +text = re.sub(r'^[ ]*(.*);', r' \1', text, flags=re.M) + +with open(outfilepath, 'w') as f: + f.write('EXPORTS\n') + f.write(text) diff --git a/scripts/meson-gen-sym.py b/scripts/meson-gen-sym.py new file mode 100755 index 00000000000..65a13e550a1 --- /dev/null +++ b/scripts/meson-gen-sym.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 + +import sys + +if len(sys.argv) < 5: + print('invalid arguments') + print('usage: {0} OUTPUT VERSION PUBLIC PRIVATE ...') + sys.exit(1) + +outfilepath = sys.argv[1] +version = sys.argv[2] +public = sys.argv[3] +private = sys.argv[4:] + +with open(outfilepath, 'w') as out: + out.write('# WARNING: generated from the following files:\n\n') + + with open(public) as tmp: + out.write(tmp.read()) + + out.write('\n\n# Private symbols\n\n') + out.write('{0} {{\n\n'.format(version)) + out.write('global:\n\n') + + for priv in private: + with open(priv) as tmp: + out.write(tmp.read()) + + out.write('\n\nlocal:\n*;\n\n};') diff --git a/scripts/meson-html-gen.py b/scripts/meson-html-gen.py index 9ac649a9ef7..26de64dc788 100755 --- a/scripts/meson-html-gen.py +++ b/scripts/meson-html-gen.py @@ -21,9 +21,6 @@ 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, @@ -31,9 +28,8 @@ html_tmp = subprocess.run( '--stringparam', 'pagesrc', pagesrc, '--stringparam', 'builddir', args.builddir, '--stringparam', 'timestamp', args.timestamp, - '--nonet', args.style, '-', + '--nonet', args.style, args.infile, ], - input=html_in_data, stdout=subprocess.PIPE, stderr=subprocess.PIPE, ) diff --git a/scripts/meson-install-dirs.py b/scripts/meson-install-dirs.py new file mode 100644 index 00000000000..14ec6b93e85 --- /dev/null +++ b/scripts/meson-install-dirs.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 + +import os +import sys + +destdir = os.environ.get('DESTDIR', os.sep) + +for dirname in sys.argv[1:]: + os.makedirs(os.path.join(destdir, dirname.strip(os.sep)), exist_ok=True) diff --git a/scripts/meson-install-symlink.py b/scripts/meson-install-symlink.py new file mode 100644 index 00000000000..e38507072d9 --- /dev/null +++ b/scripts/meson-install-symlink.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +import os +import sys + +destdir = os.environ.get('DESTDIR', os.sep) +dirname = sys.argv[1] +target = sys.argv[2] +link = sys.argv[3] + +workdir = os.path.join(destdir, dirname.strip(os.sep)) + +os.makedirs(workdir, exist_ok=True) +os.chdir(workdir) +os.symlink(target, link) diff --git a/scripts/meson-timestamp.py b/scripts/meson-timestamp.py new file mode 100755 index 00000000000..f109cad66e8 --- /dev/null +++ b/scripts/meson-timestamp.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 + +import os + +from datetime import datetime, timezone + +timestamp = os.environ.get('SOURCE_DATE_EPOCH', None) +timeformat = '%c %Z' + +if timestamp: + print(datetime.fromtimestamp(int(timestamp), tz=timezone.utc).strftime(timeformat)) +else: + print(datetime.now(tz=timezone.utc).strftime(timeformat)) diff --git a/scripts/meson-timestamp.sh b/scripts/meson-timestamp.sh deleted file mode 100755 index e68be1926cf..00000000000 --- a/scripts/meson-timestamp.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/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 2f46ece59fb..59b3c9bacda 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -3,7 +3,6 @@ scripts = [ 'augeas-gentest.py', 'check-aclperms.py', 'check-aclrules.py', - 'check-augeas.sh', 'check-driverimpls.py', 'check-drivername.py', 'check-file-access.py', @@ -12,8 +11,6 @@ scripts = [ 'check-symsorting.py', 'dtrace2systemtap.py', 'esx_vi_generator.py', - 'gen-def-files.sh', - 'gen-sym-files.sh', 'genaclperms.py', 'genpolkit.py', 'gensystemtap.py', @@ -21,14 +18,16 @@ scripts = [ 'header-ifdef.py', 'hvsupport.py', 'hyperv_wmi_generator.py', - 'install-dirs.sh', - 'install-symlink.sh', - 'meson-dist.sh', - 'meson-gen-authors.sh', + 'meson-dist.py', + 'meson-gen-authors.py', + 'meson-gen-def.py', + 'meson-gen-sym.py', 'meson-html-gen.py', + 'meson-install-dirs.py', + 'meson-install-symlink.py', 'meson-install-web.py', 'meson-python.sh', - 'meson-timestamp.sh', + 'meson-timestamp.py', 'mock-noinline.py', 'prohibit-duplicate-header.py', 'test-wrap-argv.py', diff --git a/src/access/meson.build b/src/access/meson.build index beb61eddaf5..b23838a7762 100644 --- a/src/access/meson.build +++ b/src/access/meson.build @@ -78,7 +78,7 @@ if conf.has('WITH_POLKIT') 'org.libvirt.api.policy', input: access_perm_h, output: 'org.libvirt.api.policy', - command: [ meson_python_prog, genpolkit_prog, '@INPUT@' ], + command: [ meson_python_prog, python3_prog.path(), genpolkit_prog.path(), '@INPUT@' ], capture: true, install: true, install_dir: datadir / 'polkit-1' / 'actions', diff --git a/src/admin/meson.build b/src/admin/meson.build index 394ac2b04ad..215767f02af 100644 --- a/src/admin/meson.build +++ b/src/admin/meson.build @@ -66,8 +66,10 @@ libvirt_admin_syms = custom_target( libvirt_admin_private_syms, ], output: 'libvirt_admin.syms', - command: [ gen_sym_files_prog, 'LIBVIRT_ADMIN_PRIVATE_' + meson.project_version(), '@INPUT@' ], - capture: true, + command: [ + meson_python_prog, python3_prog.path(), meson_gen_sym_prog.path(), + '@OUTPUT@', 'LIBVIRT_ADMIN_PRIVATE_' + meson.project_version(), '@INPUT@', + ], ) libvirt_admin_syms_file = libvirt_admin_syms if host_machine.system() == 'windows' @@ -75,8 +77,10 @@ if host_machine.system() == 'windows' 'libvirt_admin.def', input: libvirt_admin_syms, output: 'libvirt_admin.def', - command: [ gen_def_files_prog, '@INPUT@' ], - capture: true, + command: [ + meson_python_prog, python3_prog.path(), meson_gen_def_prog.path(), + '@INPUT@', '@OUTPUT@', + ], ) libvirt_admin_syms_file = libvirt_admin_def endif @@ -100,13 +104,9 @@ 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, + 'lib': admin_driver_lib, } virt_conf_files += files('libvirt-admin.conf') diff --git a/src/bhyve/meson.build b/src/bhyve/meson.build index 6dc8b7d29ff..643e72680ed 100644 --- a/src/bhyve/meson.build +++ b/src/bhyve/meson.build @@ -57,6 +57,5 @@ if conf.has('WITH_BHYVE') virt_daemon_confs += { 'name': 'virtbhyved', - 'name_uc': 'Virtbhyved', } endif diff --git a/src/cpu_map/meson.build b/src/cpu_map/meson.build index d89106dfcbd..19daa7157bb 100644 --- a/src/cpu_map/meson.build +++ b/src/cpu_map/meson.build @@ -21,6 +21,7 @@ cpumap_data = [ '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', @@ -28,6 +29,7 @@ cpumap_data = [ 'x86_coreduo.xml', 'x86_cpu64-rhel5.xml', 'x86_cpu64-rhel6.xml', + 'x86_Dhyana.xml', 'x86_EPYC-IBPB.xml', 'x86_EPYC.xml', 'x86_features.xml', diff --git a/src/esx/meson.build b/src/esx/meson.build index 469c2044c63..f2d59462feb 100644 --- a/src/esx/meson.build +++ b/src/esx/meson.build @@ -31,8 +31,7 @@ esx_gen_sources = custom_target( 'esx_vi_types.generated.typetostring', ], command: [ - meson_python_prog, - esx_vi_generator_prog, + meson_python_prog, python3_prog.path(), esx_vi_generator_prog.path(), meson.source_root() / 'src', meson.build_root() / 'src', ], diff --git a/src/hyperv/meson.build b/src/hyperv/meson.build index d499889b01b..84fcedce38f 100644 --- a/src/hyperv/meson.build +++ b/src/hyperv/meson.build @@ -16,8 +16,7 @@ hyperv_gen_sources = custom_target( 'hyperv_wmi_classes.generated.typedef', ], command: [ - meson_python_prog, - hyperv_wmi_generator_prog, + meson_python_prog, python3_prog.path(), hyperv_wmi_generator_prog.path(), meson.source_root() / 'src', meson.build_root() / 'src', ], diff --git a/src/interface/meson.build b/src/interface/meson.build index bf9d649282e..1092c5a2673 100644 --- a/src/interface/meson.build +++ b/src/interface/meson.build @@ -40,7 +40,6 @@ if conf.has('WITH_INTERFACE') virt_daemon_confs += { 'name': 'virtinterfaced', - 'name_uc': 'Virtinterfaced', } virt_daemon_units += { diff --git a/src/libxl/meson.build b/src/libxl/meson.build index b2e9ca07d4a..7afde2f81f0 100644 --- a/src/libxl/meson.build +++ b/src/libxl/meson.build @@ -58,7 +58,6 @@ if conf.has('WITH_LIBXL') virt_daemon_confs += { 'name': 'virtxend', - 'name_uc': 'Virtxend', } virt_daemon_units += { diff --git a/src/locking/meson.build b/src/locking/meson.build index 4c30acb2eb9..a67a41298b1 100644 --- a/src/locking/meson.build +++ b/src/locking/meson.build @@ -92,9 +92,7 @@ if conf.has('WITH_LIBVIRTD') check_protocols += { 'name': 'lock_protocol', - 'libname': 'lockd_impl', - 'builddir': meson.current_build_dir(), - 'depends': lockd_lib_impl, + 'lib': lockd_lib_impl, } lockdriver_dir = libdir / 'libvirt' / 'lock-driver' diff --git a/src/logging/meson.build b/src/logging/meson.build index 8e913fb352f..1f06a51e935 100644 --- a/src/logging/meson.build +++ b/src/logging/meson.build @@ -6,7 +6,7 @@ log_protocol = 'log_protocol.x' log_protocol_generated = [] -log_protocol_generated += custom_target( +log_protocol_header_generated = custom_target( 'log_protocol.h', input: log_protocol, output: 'log_protocol.h', @@ -14,6 +14,7 @@ log_protocol_generated += custom_target( genprotocol_prog, rpcgen_prog, '-h', '@INPUT@', '@OUTPUT@' ], ) +log_protocol_generated += log_protocol_header_generated log_protocol_generated += custom_target( 'log_protocol.c', @@ -98,3 +99,10 @@ if conf.has('WITH_LIBVIRTD') 'file': files('virtlogd.sysconf'), } endif + +log_inc_dir = include_directories('.') + +log_dep = declare_dependency( + include_directories: log_inc_dir, + sources: log_protocol_header_generated, +) diff --git a/src/lxc/meson.build b/src/lxc/meson.build index 093ad809029..11526b637b2 100644 --- a/src/lxc/meson.build +++ b/src/lxc/meson.build @@ -101,9 +101,7 @@ 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, + 'lib': lxc_driver_impl_lib, } virt_modules += { @@ -160,7 +158,6 @@ if conf.has('WITH_LXC') virt_daemon_confs += { 'name': 'virtlxcd', - 'name_uc': 'Virtlxcd', } virt_daemon_units += { diff --git a/src/meson.build b/src/meson.build index 66aa6201550..59370744161 100644 --- a/src/meson.build +++ b/src/meson.build @@ -15,7 +15,13 @@ src_dep = declare_dependency( src_inc_dir, top_inc_dir, ], - link_args: libvirt_relro + libvirt_no_indirect + coverage_flags + driver_modules_flags + win32_link_flags, + link_args: ( + libvirt_relro + + libvirt_no_indirect + + coverage_flags + + driver_modules_flags + + win32_link_flags + ), ) @@ -68,7 +74,10 @@ if conf.has('WITH_DTRACE_PROBES') out_stp, input: infile, output: out_stp, - command: [ meson_python_prog, dtrace2systemtap_prog, bindir, sbindir, libdir, '@INPUT@' ], + command: [ + meson_python_prog, python3_prog.path(), dtrace2systemtap_prog.path(), + bindir, sbindir, libdir, '@INPUT@' + ], capture: true, install: true, install_dir: systemtap_dir, @@ -135,7 +144,7 @@ virt_modules = [] # virt_daemons: # each entry is a dictionary with following items: -# * name - binary name (rquired) +# * name - binary name (required) # * sources - binary sources (optional, default remote_daemon_sources) # * c_args - compile arguments (optional, default []) # * include = include_directories (optional, default []) @@ -170,7 +179,6 @@ virt_test_aug_files = [] # 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 = [] @@ -220,9 +228,7 @@ 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) +# lib - library that this test depends on (required) check_protocols = [] @@ -345,8 +351,10 @@ 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, + command: [ + meson_python_prog, python3_prog.path(), meson_gen_sym_prog.path(), + '@OUTPUT@', 'LIBVIRT_PRIVATE_' + meson.project_version(), '@INPUT@', + ], ) libvirt_syms_file = libvirt_syms if host_machine.system() == 'windows' @@ -354,8 +362,10 @@ if host_machine.system() == 'windows' 'libvirt.def', input: libvirt_syms, output: 'libvirt.def', - command: [ gen_def_files_prog, '@INPUT@' ], - capture: true, + command: [ + meson_python_prog, python3_prog.path(), meson_gen_def_prog.path(), + '@INPUT@', '@OUTPUT@', + ], ) libvirt_syms_file = libvirt_def endif @@ -402,8 +412,10 @@ if host_machine.system() == 'windows' 'libvirt_qemu.def', input: libvirt_qemu_syms, output: 'libvirt_qemu.def', - command: [ gen_def_files_prog, '@INPUT@' ], - capture: true, + command: [ + meson_python_prog, python3_prog.path(), meson_gen_def_prog.path(), + '@INPUT@', '@OUTPUT@', + ], ) libvirt_qemu_syms_file = libvirt_qemu_def libvirt_qemu_syms_path = libvirt_qemu_def.full_path() @@ -454,8 +466,10 @@ if host_machine.system() == 'windows' 'libvirt_lxc.def', input: libvirt_lxc_syms, output: 'libvirt_lxc.def', - command: [ gen_def_files_prog, '@INPUT@' ], - capture: true, + command: [ + meson_python_prog, python3_prog.path(), meson_gen_def_prog.path(), + '@INPUT@', '@OUTPUT@', + ], ) libvirt_lxc_syms_file = libvirt_lxc_def libvirt_lxc_syms_path = libvirt_lxc_def.full_path() @@ -659,22 +673,31 @@ foreach data : virt_test_aug_files data['name'], input: [ data['conf'], data['aug'] ], output: data['name'], - command: [ meson_python_prog, augeas_gentest_prog, '@INPUT@' ], + command: [ + meson_python_prog, python3_prog.path(), augeas_gentest_prog.path(), + '@INPUT@', + ], capture: true, install: true, install_dir: virt_test_aug_dir, ) endforeach +# augeas_test_data: +# each entry is a dictionary with following items: +# * name: daemon name to run the test for (required) +# * file: test file to use (required) augeas_test_data = [] foreach data : virt_daemon_confs + capitalize_args = [ '-c', 'print("@0@".capitalize())'.format(data['name']) ] + name_uc = run_command(python3_prog, capitalize_args, check: true).stdout().strip() 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']) + daemon_conf.set('DAEMON_NAME_UC', name_uc) # to silence meson warning about missing 'CONFIG' in the configuration_data daemon_conf.set('CONFIG', '@CONFIG@') @@ -720,12 +743,15 @@ foreach data : virt_daemon_confs test_aug_out, input: [ conf_out, test_aug_tmp ], output: test_aug_out, - command: [ meson_python_prog, augeas_gentest_prog, '@INPUT@' ], + command: [ + meson_python_prog, python3_prog.path(), augeas_gentest_prog.path(), + '@INPUT@', + ], capture: true, install: true, install_dir: virt_test_aug_dir, ) - augeas_test_data += augeas_test_file + augeas_test_data += { 'name': data['name'], 'file': augeas_test_file } endforeach @@ -827,7 +853,10 @@ if conf.has('WITH_DTRACE_PROBES') 'libvirt_functions.stp', input: rpc_probe_files, output: 'libvirt_functions.stp', - command: [ meson_python_prog, gensystemtap_prog, '@INPUT@' ], + command: [ + meson_python_prog, python3_prog.path(), gensystemtap_prog.path(), + '@INPUT@', + ], capture: true, install: true, install_dir: systemtap_dir, @@ -844,7 +873,10 @@ virt_install_dirs += [ localstatedir / 'lib' / 'libvirt' / 'boot', ] -meson.add_install_script(install_dirs_prog.path(), virt_install_dirs) +meson.add_install_script( + meson_python_prog.path(), python3_prog.path(), meson_install_dirs_prog.path(), + virt_install_dirs, +) # Check driver files @@ -921,29 +953,35 @@ test( ) 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, - ], - ) + foreach data : augeas_test_data + test( + 'check-augeas-@0@'.format(data['name']), + augparse_prog, + args: [ + '-I', meson.current_source_dir(), + '-I', meson.current_build_dir(), + data['file'].full_path(), + ], + ) + endforeach endif -if pdwtags_prog.found() +if pdwtags_prog.found() and cc.get_id() != 'clang' foreach proto : check_protocols + lib = proto['lib'] 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'])), + check_remote_protocol_prog.path(), + proto['name'], + lib.name(), + lib.full_path(), + pdwtags_prog.path(), + files('@0@-structs'.format(proto['name'])), ], env: runutf8, - depends: proto['depends'], + depends: [ lib ], ) endforeach endif diff --git a/src/network/meson.build b/src/network/meson.build index a3836bb12be..2e031e811fc 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -51,7 +51,6 @@ if conf.has('WITH_NETWORK') virt_daemon_confs += { 'name': 'virtnetworkd', - 'name_uc': 'Virtnetworkd', } virt_helpers += { @@ -114,7 +113,7 @@ if conf.has('WITH_NETWORK') endif meson.add_install_script( - install_symlink_prog.path(), + meson_python_prog.path(), python3_prog.path(), meson_install_symlink_prog.path(), confdir / 'qemu' / 'networks' / 'autostart', '../default.xml', 'default.xml', ) diff --git a/src/node_device/meson.build b/src/node_device/meson.build index d833b329da4..5953c6b8ed6 100644 --- a/src/node_device/meson.build +++ b/src/node_device/meson.build @@ -53,7 +53,6 @@ if conf.has('WITH_NODE_DEVICES') virt_daemon_confs += { 'name': 'virtnodedevd', - 'name_uc': 'Virtnodedevd', } virt_daemon_units += { diff --git a/src/nwfilter/meson.build b/src/nwfilter/meson.build index 6e9734e6a26..dcdc30f3731 100644 --- a/src/nwfilter/meson.build +++ b/src/nwfilter/meson.build @@ -47,7 +47,6 @@ if conf.has('WITH_NWFILTER') virt_daemon_confs += { 'name': 'virtnwfilterd', - 'name_uc': 'Virtnwfilterd', } virt_daemon_units += { diff --git a/src/qemu/meson.build b/src/qemu/meson.build index 640ef273ca8..644d74479b2 100644 --- a/src/qemu/meson.build +++ b/src/qemu/meson.build @@ -67,7 +67,10 @@ if conf.has('WITH_DTRACE_PROBES') out_stp, input: infile, output: out_stp, - command: [ meson_python_prog, dtrace2systemtap_prog, bindir, sbindir, libdir, '@INPUT@' ], + command: [ + meson_python_prog, python3_prog.path(), dtrace2systemtap_prog.path(), + bindir, sbindir, libdir, '@INPUT@', + ], capture: true, install: conf.has('WITH_QEMU'), install_dir: systemtap_dir, @@ -90,6 +93,7 @@ if conf.has('WITH_QEMU') capng_dep, gnutls_dep, libnl_dep, + log_dep, selinux_dep, src_dep, xdr_dep, @@ -139,7 +143,6 @@ if conf.has('WITH_QEMU') virt_daemon_confs += { 'name': 'virtqemud', - 'name_uc': 'Virtqemud', } virt_daemon_units += { diff --git a/src/remote/meson.build b/src/remote/meson.build index 130d246fcec..25712c943b7 100644 --- a/src/remote/meson.build +++ b/src/remote/meson.build @@ -65,30 +65,49 @@ foreach name : [ 'remote', 'qemu', 'lxc' ] ) endforeach +# libvirt_conf_files: +# Generate libvirtd and virtd template files that are used to generate +# daemon configuration files. +# Each entry is a dictionary with following items: +# * input: source config file (required) +# * libvirtd: libvirtd config output template file (required) +# * virtd: virtd config output template file (required) 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' ], + { + 'input':'libvirtd.conf.in', + 'libvirtd':'libvirtd.conf.tmp', + 'virtd':'virtd.conf.tmp', + }, + { + 'input':'libvirtd.aug.in', + 'libvirtd':'libvirtd.aug.tmp', + 'virtd':'virtd.aug.tmp', + }, + { + 'input':'test_libvirtd.aug.in', + 'libvirtd':'test_libvirtd.aug.tmp', + 'virtd':'test_virtd.aug.tmp', + }, ] foreach name : libvirt_conf_files tmp = configure_file( - input: name[0], - output: name[1], + input: name['input'], + output: name['libvirtd'], command: [ 'sed', '-e', '/[@]CUT_ENABLE_IP[@]/d', '-e', '/[@]END[@]/d', '@INPUT@' ], capture: true, ) - set_variable(name[1].underscorify(), tmp) + set_variable(name['libvirtd'].underscorify(), tmp) endforeach foreach name : libvirt_conf_files tmp = configure_file( - input: name[0], - output: name[2], + input: name['input'], + output: name['virtd'], command: [ 'sed', '-e', '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d', '@INPUT@' ], capture: true, ) - set_variable(name[2].underscorify(), tmp) + set_variable(name['virtd'].underscorify(), tmp) endforeach libvirtd_socket_unit_files = [ @@ -128,23 +147,17 @@ if conf.has('WITH_REMOTE') check_protocols += { 'name': 'remote_protocol', - 'libname': 'virt_remote_driver', - 'builddir': meson.current_build_dir(), - 'depends': remote_driver_lib, + 'lib': remote_driver_lib, } check_protocols += { 'name': 'qemu_protocol', - 'libname': 'virt_remote_driver', - 'builddir': meson.current_build_dir(), - 'depends': remote_driver_lib, + 'lib': remote_driver_lib, } check_protocols += { 'name': 'lxc_protocol', - 'libname': 'virt_remote_driver', - 'builddir': meson.current_build_dir(), - 'depends': remote_driver_lib, + 'lib': remote_driver_lib, } libvirt_libs += remote_driver_lib @@ -164,7 +177,6 @@ if conf.has('WITH_REMOTE') virt_daemon_confs += { 'name': 'libvirtd', - 'name_uc': 'Libvirtd', 'with_ip': true, } @@ -199,7 +211,6 @@ if conf.has('WITH_REMOTE') virt_daemon_confs += { 'name': 'virtproxyd', - 'name_uc': 'Virtproxyd', 'with_ip': true, } diff --git a/src/rpc/meson.build b/src/rpc/meson.build index 18ea0602602..e249b9d534b 100644 --- a/src/rpc/meson.build +++ b/src/rpc/meson.build @@ -83,16 +83,12 @@ virt_rpc_lib = static_library( check_protocols += { 'name': 'virnetprotocol', - 'libname': 'virt_net_rpc', - 'builddir': meson.current_build_dir(), - 'depends': virt_rpc_lib, + 'lib': virt_rpc_lib, } check_protocols += { 'name': 'virkeepaliveprotocol', - 'libname': 'virt_net_rpc', - 'builddir': meson.current_build_dir(), - 'depends': virt_rpc_lib, + 'lib': virt_rpc_lib, } virt_rpc_server_lib = static_library( diff --git a/src/secret/meson.build b/src/secret/meson.build index 1605729f49b..d576d3218eb 100644 --- a/src/secret/meson.build +++ b/src/secret/meson.build @@ -29,7 +29,6 @@ if conf.has('WITH_SECRETS') virt_daemon_confs += { 'name': 'virtsecretd', - 'name_uc': 'Virtsecretd', } virt_daemon_units += { diff --git a/src/storage/meson.build b/src/storage/meson.build index 86abfedbdde..18ea0f3fb51 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -127,7 +127,6 @@ if conf.has('WITH_STORAGE') virt_daemon_confs += { 'name': 'virtstoraged', - 'name_uc': 'Virtstoraged', } virt_daemon_units += { diff --git a/src/util/meson.build b/src/util/meson.build index af60283cbc7..a7017f459f6 100644 --- a/src/util/meson.build +++ b/src/util/meson.build @@ -144,7 +144,7 @@ foreach name : keycode_list input: keymap_src_file, output: 'virkeycodetable_@0@.h'.format(name), command: [ - meson_python_prog, python3_prog, keymap_gen_prog, 'code-table', + meson_python_prog, python3_prog.path(), keymap_gen_prog.path(), 'code-table', '--lang', 'stdc', '--varname', 'virKeyCodeTable_@0@'.format(name), '@INPUT@', name, @@ -159,7 +159,7 @@ foreach name : keyname_list input: keymap_src_file, output: 'virkeynametable_@0@.h'.format(name), command: [ - meson_python_prog, python3_prog, keymap_gen_prog, 'name-table', + meson_python_prog, python3_prog.path(), keymap_gen_prog.path(), 'name-table', '--lang', 'stdc', '--varname', 'virKeyNameTable_@0@'.format(name), '@INPUT@', name, diff --git a/src/util/virfile.c b/src/util/virfile.c index 5ec43832461..c6f4a18a7a8 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -1782,32 +1782,17 @@ virFileFindResource(const char *filename, * virFileActivateDirOverrideForProg: * @argv0: argv[0] of the calling program * - * Combine $PWD and @argv0, canonicalize it and check if abs_top_builddir + * Canonicalize current process path from argv0 and check if abs_top_builddir * matches as prefix in the path. */ void virFileActivateDirOverrideForProg(const char *argv0) { - const char *pwd = g_getenv("PWD"); - g_autofree char *fullPath = NULL; - g_autofree char *canonPath = NULL; - const char *path = NULL; + g_autofree char *path = virFileCanonicalizePath(argv0); - if (!pwd) + if (!path) { + VIR_DEBUG("Failed to get canonicalized path errno=%d", errno); return; - - 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)) { diff --git a/src/util/virlog.h b/src/util/virlog.h index feb2f859041..716fb9a3783 100644 --- a/src/util/virlog.h +++ b/src/util/virlog.h @@ -78,29 +78,8 @@ struct _virLogSource { .serial = 0, \ } -/* - * If configured with --enable-debug=yes then library calls - * are printed to stderr for debugging or to an appropriate channel - * defined at runtime from the libvirt daemon configuration file - */ -#ifdef ENABLE_DEBUG -# define VIR_DEBUG_INT(src, filename, linenr, funcname, ...) \ +#define VIR_DEBUG_INT(src, filename, linenr, funcname, ...) \ virLogMessage(src, VIR_LOG_DEBUG, filename, linenr, funcname, NULL, __VA_ARGS__) -#else -/** - * virLogEatParams: - * - * Do nothing but eat parameters. - */ -static inline void virLogEatParams(virLogSourcePtr unused, ...) -{ - /* Silence gcc */ - unused = unused; -} -# define VIR_DEBUG_INT(src, filename, linenr, funcname, ...) \ - virLogEatParams(src, filename, linenr, funcname, __VA_ARGS__) -#endif /* !ENABLE_DEBUG */ - #define VIR_INFO_INT(src, filename, linenr, funcname, ...) \ virLogMessage(src, VIR_LOG_INFO, filename, linenr, funcname, NULL, __VA_ARGS__) #define VIR_WARN_INT(src, filename, linenr, funcname, ...) \ diff --git a/src/vbox/meson.build b/src/vbox/meson.build index 8451e3018be..3e608fa1018 100644 --- a/src/vbox/meson.build +++ b/src/vbox/meson.build @@ -54,7 +54,6 @@ if conf.has('WITH_VBOX') virt_daemon_confs += { 'name': 'virtvboxd', - 'name_uc': 'Virtvboxd', } virt_daemon_units += { diff --git a/src/vz/meson.build b/src/vz/meson.build index 0ab83731071..2859dc79793 100644 --- a/src/vz/meson.build +++ b/src/vz/meson.build @@ -44,7 +44,6 @@ if conf.has('WITH_VZ') virt_daemon_confs += { 'name': 'virtvzd', - 'name_uc': 'Virtvzd', } virt_daemon_units += { diff --git a/tests/meson.build b/tests/meson.build index 1510d6ef3f3..b5f6e2267aa 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -240,38 +240,48 @@ executable( # * deps - additional dependencies (optional, default []) # * include - include_directories (optional, default []) # * link_with - compiled libraries to link with (optional, default []) +# * link_whole - compiled libraries to link whole (optional, default []) + tests = [] cputest_link_with = [] +cputest_link_whole = [] if conf.has('WITH_QEMU') - cputest_link_with += [ test_utils_qemu_lib, test_utils_qemu_monitor_lib, test_qemu_driver_lib ] + cputest_link_with += [ test_utils_qemu_monitor_lib, test_qemu_driver_lib ] + cputest_link_whole += [ test_utils_qemu_lib ] endif -domaincapstest_link_with = [ test_file_wrapper_lib ] +domaincapstest_link_with = [] +domaincapstest_link_whole = [ 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 ] + domaincapstest_link_with += [ test_xen_driver_lib ] + domaincapstest_link_whole += [ test_utils_xen_lib ] endif if conf.has('WITH_QEMU') - domaincapstest_link_with += [ test_utils_qemu_lib, test_qemu_driver_lib ] + domaincapstest_link_with += [ test_qemu_driver_lib ] + domaincapstest_link_whole += [ test_utils_qemu_lib ] endif vircapstest_link_with = [] +vircapstest_link_whole = [] vircapstest_sources = [ 'vircapstest.c' ] if conf.has('WITH_LXC') - vircapstest_link_with += [ test_utils_lxc_lib, lxc_driver_impl_lib ] + vircapstest_link_with += [ lxc_driver_impl_lib ] + vircapstest_link_whole += [ test_utils_lxc_lib ] endif if conf.has('WITH_QEMU') - vircapstest_link_with += [ test_utils_qemu_lib, qemu_driver_impl ] + vircapstest_link_with += [ qemu_driver_impl ] + vircapstest_link_whole += [ test_utils_qemu_lib ] 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': 'cputest', 'link_with': cputest_link_with, 'link_whole': cputest_link_whole }, + { 'name': 'domaincapstest', 'link_with': domaincapstest_link_with, 'link_whole': domaincapstest_link_whole }, { 'name': 'domainconftest' }, { 'name': 'genericxml2xmltest' }, { 'name': 'interfacexml2xmltest' }, @@ -291,7 +301,7 @@ tests += [ { 'name': 'virauthconfigtest' }, { 'name': 'virbitmaptest' }, { 'name': 'virbuftest' }, - { 'name': 'vircapstest', 'sources': vircapstest_sources, 'link_with': vircapstest_link_with }, + { 'name': 'vircapstest', 'sources': vircapstest_sources, 'link_with': vircapstest_link_with, 'link_whole': vircapstest_link_whole }, { 'name': 'vircgrouptest' }, { 'name': 'virconftest' }, { 'name': 'vircryptotest' }, @@ -301,7 +311,7 @@ tests += [ { 'name': 'virfiletest' }, { 'name': 'virfirewalltest', 'deps': [ dbus_dep ] }, { 'name': 'virhashtest' }, - { 'name': 'virhostcputest', 'link_with': [ test_file_wrapper_lib ] }, + { 'name': 'virhostcputest', 'link_whole': [ test_file_wrapper_lib ] }, { 'name': 'virhostdevtest' }, { 'name': 'viriscsitest' }, { 'name': 'virkeycodetest' }, @@ -327,9 +337,9 @@ if host_machine.system() == 'linux' tests += [ { 'name': 'fchosttest' }, { 'name': 'scsihosttest' }, - { 'name': 'vircaps2xmltest', 'link_with': [ test_file_wrapper_lib ] }, + { 'name': 'vircaps2xmltest', 'link_whole': [ test_file_wrapper_lib ] }, { 'name': 'virnetdevbandwidthtest' }, - { 'name': 'virresctrltest', 'link_with': [ test_file_wrapper_lib ] }, + { 'name': 'virresctrltest', 'link_whole': [ test_file_wrapper_lib ] }, { 'name': 'virscsitest' }, { 'name': 'virusbtest' }, ] @@ -358,7 +368,7 @@ endif if conf.has('WITH_ESX') tests += [ - { 'name': 'esxutilstest', 'include': [ esx_inc_dir ], 'deps': [ dbus_dep ] }, + { 'name': 'esxutilstest', 'include': [ esx_inc_dir ] }, ] endif @@ -373,16 +383,16 @@ 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 ] }, + { 'name': 'libxlxml2domconfigtest', 'link_with': [ test_xen_driver_lib ], 'link_whole': [ test_utils_xen_lib ], 'deps': [ libxl_dep ] }, + { 'name': 'xlconfigtest', 'link_with': [ test_xen_driver_lib ], 'link_whole': [ test_utils_xen_lib ] }, + { 'name': 'xmconfigtest', 'link_with': [ test_xen_driver_lib ], 'link_whole': [ test_utils_xen_lib ] }, ] 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 ] }, + { 'name': 'lxcconf2xmltest', 'link_with': [ lxc_driver_impl_lib ], 'link_whole': [ test_utils_lxc_lib ] }, + { 'name': 'lxcxml2xmltest', 'link_with': [ lxc_driver_impl_lib ], 'link_whole': [ test_utils_lxc_lib ] }, ] endif @@ -432,22 +442,22 @@ 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 ] }, + { 'name': 'qemuagenttest', 'link_with': [ test_qemu_driver_lib, test_utils_qemu_monitor_lib ], 'link_whole': [ test_utils_qemu_lib ] }, + { 'name': 'qemublocktest', 'link_with': [ test_qemu_driver_lib, test_utils_qemu_monitor_lib ], 'link_whole': [ test_utils_qemu_lib ] }, + { 'name': 'qemucapabilitiestest', 'link_with': [ test_qemu_driver_lib, test_utils_qemu_monitor_lib ], 'link_whole': [ test_utils_qemu_lib ] }, + { 'name': 'qemucaps2xmltest', 'link_with': [ test_qemu_driver_lib ], 'link_whole': [ test_utils_qemu_lib ] }, + { 'name': 'qemucommandutiltest', 'link_with': [ test_qemu_driver_lib, test_utils_qemu_monitor_lib ], 'link_whole': [ test_utils_qemu_lib ] }, + { 'name': 'qemudomaincheckpointxml2xmltest', 'link_with': [ test_qemu_driver_lib ], 'link_whole': [ test_utils_qemu_lib ] }, + { 'name': 'qemudomainsnapshotxml2xmltest', 'link_with': [ test_qemu_driver_lib ], 'link_whole': [ test_utils_qemu_lib ] }, + { 'name': 'qemufirmwaretest', 'link_with': [ test_qemu_driver_lib ], 'link_whole': [ test_file_wrapper_lib ] }, + { 'name': 'qemuhotplugtest', 'link_with': [ test_qemu_driver_lib, test_utils_qemu_monitor_lib ], 'link_whole': [ test_utils_qemu_lib ] }, + { 'name': 'qemumemlocktest', 'link_with': [ test_qemu_driver_lib ], 'link_whole': [ test_utils_qemu_lib ] }, + { 'name': 'qemumigparamstest', 'link_with': [ test_qemu_driver_lib, test_utils_qemu_monitor_lib ], 'link_whole': [ test_utils_qemu_lib ] }, + { 'name': 'qemumonitorjsontest', 'link_with': [ test_qemu_driver_lib, test_utils_qemu_monitor_lib ], 'link_whole': [ test_utils_qemu_lib ] }, + { 'name': 'qemusecuritytest', 'sources': [ 'qemusecuritytest.c', 'qemusecuritymock.c' ], 'link_with': [ test_qemu_driver_lib ], 'link_whole': [ test_utils_qemu_lib ] }, + { 'name': 'qemuvhostusertest', 'link_with': [ test_qemu_driver_lib ], 'link_whole': [ test_file_wrapper_lib ] }, + { 'name': 'qemuxml2argvtest', 'link_with': [ test_qemu_driver_lib, test_utils_qemu_monitor_lib ], 'link_whole': [ test_utils_qemu_lib, test_file_wrapper_lib ] }, + { 'name': 'qemuxml2xmltest', 'link_with': [ test_qemu_driver_lib ], 'link_whole': [ test_utils_qemu_lib, test_file_wrapper_lib ] }, ] endif @@ -481,7 +491,7 @@ if conf.has('WITH_SECDRIVER_SELINUX') if conf.has('WITH_QEMU') tests += [ - { 'name': 'securityselinuxlabeltest', 'link_with': [ test_utils_qemu_lib ] }, + { 'name': 'securityselinuxlabeltest', 'link_whole': [ test_utils_qemu_lib ] }, ] endif endif @@ -559,9 +569,12 @@ foreach data : tests ], link_with: [ libvirt_lib, - test_utils_lib, data.get('link_with', []), ], + link_whole: [ + test_utils_lib, + data.get('link_whole', []), + ], export_dynamic: true, ) test(data['name'], test_bin, env: tests_env) @@ -670,8 +683,9 @@ add_test_setup( 'access', env: [ 'VIR_TEST_FILE_ACCESS=1', + runutf8, ], - exe_wrapper: [ meson_python_prog, check_file_access_prog ], + exe_wrapper: [ python3_prog, check_file_access_prog.path() ], ) add_test_setup( @@ -682,5 +696,6 @@ add_test_setup( '--suppressions=@0@'.format(meson.current_source_dir() / '.valgrind.supp'), '--error-exitcode=1', ], + # default timeout in meson is 30s timeout_multiplier: 4, ) diff --git a/tests/virmockstathelpers.c b/tests/virmockstathelpers.c index ba26e7bd455..2c3715ae0cc 100644 --- a/tests/virmockstathelpers.c +++ b/tests/virmockstathelpers.c @@ -38,12 +38,13 @@ * * On 32-bit hosts they refer to the 32-bit & 64-bit ABIs respectively. * - * Libvirt uses _FILE_OFFSET_BITS=64 on 32-bit hosts, which causes the - * C library to transparently rewrite stat() calls to be stat64() calls. - * Libvirt will never see the 32-bit ABI from the traditional stat() - * call. We cannot assume this rewriting is done using a macro. It might - * be, but on GLibC it is done with a magic __asm__ statement to apply - * the rewrite at link time instead of at preprocessing. + * With meson libvirt will have _FILE_OFFSET_BITS=64 always defined. + * On 32-bit hosts it causes the C library to transparently rewrite + * stat() calls to be stat64() calls. Libvirt will never see the 32-bit + * ABI from the traditional stat() call. We cannot assume this rewriting + * is done using a macro. It might be, but on GLibC it is done with a + * magic __asm__ statement to apply the rewrite at link time instead of + * at preprocessing. * * In GLibC there may be two additional functions exposed by the headers, * __xstat() and __xstat64(). When these exist, stat() and stat64() are @@ -57,14 +58,7 @@ * With all this in mind the list of functions we have to mock will depend * on several factors * - * - If _FILE_OFFSET_BITS is set, then we are on a 32-bit host, and we - * only need to mock stat64 and __xstat64. The other stat / __xstat - * functions exist, but we'll never call them so they can be ignored - * for mocking. - * - * - If _FILE_OFFSET_BITS is not set, then we are on a 64-bit host and - * we should mock stat, stat64, __xstat & __xstat64. Either may be - * called by app code. + * - If the stat or __xstat but there is no 64-bit version. * * - If __xstat & __xstat64 exist, then stat & stat64 will not exist * as symbols in the library, so the latter should not be mocked. @@ -74,25 +68,25 @@ -#if defined(HAVE_STAT) && !defined(HAVE___XSTAT) && !defined(_FILE_OFFSET_BITS) +#if defined(HAVE_STAT) && !defined(HAVE___XSTAT) && !defined(HAVE_STAT64) # define MOCK_STAT #endif #if defined(HAVE_STAT64) && !defined(HAVE___XSTAT64) # define MOCK_STAT64 #endif -#if defined(HAVE___XSTAT) && !defined(_FILE_OFFSET_BITS) +#if defined(HAVE___XSTAT) && !defined(HAVE___XSTAT64) # define MOCK___XSTAT #endif #if defined(HAVE___XSTAT64) # define MOCK___XSTAT64 #endif -#if defined(HAVE_LSTAT) && !defined(HAVE___LXSTAT) && !defined(_FILE_OFFSET_BITS) +#if defined(HAVE_LSTAT) && !defined(HAVE___LXSTAT) && !defined(HAVE_LSTAT64) # define MOCK_LSTAT #endif #if defined(HAVE_LSTAT64) && !defined(HAVE___LXSTAT64) # define MOCK_LSTAT64 #endif -#if defined(HAVE___LXSTAT) && !defined(_FILE_OFFSET_BITS) +#if defined(HAVE___LXSTAT) && !defined(HAVE___LXSTAT64) # define MOCK___LXSTAT #endif #if defined(HAVE___LXSTAT64) diff --git a/tests/virt-aa-helper-test b/tests/virt-aa-helper-test index 8dbe82a6b98..83f53acef61 100755 --- a/tests/virt-aa-helper-test +++ b/tests/virt-aa-helper-test @@ -15,13 +15,13 @@ fi output="/dev/null" use_valgrind="" -ld_library_path="../src/" +ld_library_path="$abs_top_builddir/src/" if [ ! -z "$1" ] && [ "$1" = "-d" ]; then output="/dev/stdout" shift fi -exe="../src/virt-aa-helper" +exe="$abs_top_builddir/src/virt-aa-helper" if [ ! -z "$1" ]; then if [ "$1" = "-v" ]; then use_valgrind="yes" diff --git a/tools/bash-completion/meson.build b/tools/bash-completion/meson.build index 4cc0892accf..8924c93adf5 100644 --- a/tools/bash-completion/meson.build +++ b/tools/bash-completion/meson.build @@ -1,13 +1,11 @@ install_data('vsh', install_dir: bash_completion_dir) meson.add_install_script( - install_symlink_prog.path(), - bash_completion_dir, - 'vsh', 'virsh', + meson_python_prog.path(), python3_prog.path(), meson_install_symlink_prog.path(), + bash_completion_dir, 'vsh', 'virsh', ) meson.add_install_script( - install_symlink_prog.path(), - bash_completion_dir, - 'vsh', 'virt-admin', + meson_python_prog.path(), python3_prog.path(), meson_install_symlink_prog.path(), + bash_completion_dir, 'vsh', 'virt-admin', ) diff --git a/tools/meson.build b/tools/meson.build index f2c2af764b7..090179470a5 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -12,7 +12,11 @@ tools_dep = declare_dependency( util_inc_dir, top_inc_dir, ], - link_args: libvirt_relro + libvirt_no_indirect + libvirt_no_undefined, + link_args: ( + libvirt_relro + + libvirt_no_indirect + + libvirt_no_undefined + ), ) libvirt_shell_lib = static_library( @@ -235,6 +239,7 @@ configure_file( configuration: tools_conf, install: true, install_dir: bindir, + install_mode: 'rwxrwxr-x', ) configure_file( @@ -243,6 +248,7 @@ configure_file( configuration: tools_conf, install: true, install_dir: bindir, + install_mode: 'rwxrwxr-x', ) if conf.has('WITH_SANLOCK') @@ -252,6 +258,7 @@ if conf.has('WITH_SANLOCK') configuration: tools_conf, install: true, install_dir: sbindir, + install_mode: 'rwxrwxr-x', ) endif @@ -261,6 +268,7 @@ configure_file( configuration: tools_conf, install: true, install_dir: libexecdir, + install_mode: 'rwxrwxr-x', ) if init_script == 'systemd' diff --git a/tools/virsh.c b/tools/virsh.c index 197a90636d3..06ff5e83365 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -614,9 +614,7 @@ virshShowVersion(vshControl *ctl G_GNUC_UNUSED) #ifdef WITH_SECRETS vshPrint(ctl, " Secrets"); #endif -#ifdef ENABLE_DEBUG vshPrint(ctl, " Debug"); -#endif #ifdef WITH_DTRACE_PROBES vshPrint(ctl, " DTrace"); #endif diff --git a/tools/virt-admin.c b/tools/virt-admin.c index fef0332a0d3..8a166e2c7f7 100644 --- a/tools/virt-admin.c +++ b/tools/virt-admin.c @@ -1277,9 +1277,7 @@ vshAdmShowVersion(vshControl *ctl G_GNUC_UNUSED) #ifdef WITH_LIBVIRTD vshPrint(ctl, " Daemon"); #endif -#ifdef ENABLE_DEBUG vshPrint(ctl, " Debug"); -#endif #if WITH_READLINE vshPrint(ctl, " Readline"); #endif diff --git a/tools/vsh.c b/tools/vsh.c index b65e99cbd20..9701613924b 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -2396,6 +2396,10 @@ vshEditWriteToTempFile(vshControl *ctl, const char *doc) #define ACCEPTED_CHARS \ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-/_.:@" +/* Hard-code default editor used as a fallback if not configured by + * VISUAL or EDITOR environment variables. */ +#define DEFAULT_EDITOR "vi" + int vshEditFile(vshControl *ctl, const char *filename) {