From nobody Tue Feb 10 02:00:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16449185789041004.4234633254728; Tue, 15 Feb 2022 01:49:38 -0800 (PST) Received: from localhost ([::1]:43370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJuSn-0001Wv-RC for importer@patchew.org; Tue, 15 Feb 2022 04:49:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJuCP-0004Ju-15 for qemu-devel@nongnu.org; Tue, 15 Feb 2022 04:32:41 -0500 Received: from [2a00:1450:4864:20::631] (port=44922 helo=mail-ej1-x631.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJuCM-0008SJ-IV for qemu-devel@nongnu.org; Tue, 15 Feb 2022 04:32:40 -0500 Received: by mail-ej1-x631.google.com with SMTP id p14so18652682ejf.11 for ; Tue, 15 Feb 2022 01:32:38 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id m4sm6634308ejl.45.2022.02.15.01.32.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 01:32:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=deO2F0ErgO8GDflMKY+3HW/h9IN8YSSqPFluAnL4JQw=; b=T/aSRDmlCK6yR0d0sgaB/lm5BC7FsJHWb6AN8qSpWMx8wD7GhwJS9sKr9GYFPUcNwa X0Lj0w2SIQSbo3zuccTW5QTeCrOso4ylEQLoP7htC3ZuKX2r33BlsM465+++r0nkmOyv zGkkkXr7McgskVKDIPEHVSV/htQo/245qQ9rrInWyA/w0OFOgAc/6wTFq6R//A6r7mmw /4FTD1Gm3lMSUvFIUjkFuJ/WaKz1MDLYKjVbRLBNDaUE+SQno1j6AAS0s6mjzjKfLktH gVxgprRy8kCHeUSGoJhQHVUSXkob+TsqN7kPmQYsqs4YYNREbx4Qto1smLTFEF09cXKc 40rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=deO2F0ErgO8GDflMKY+3HW/h9IN8YSSqPFluAnL4JQw=; b=brOSQf/aQ5XylO1WXarXDzz3mm+IPIovBg91NPXv++aZkq5VewlU19RWk1CYILXTcv nGbuR0Dzx0Eikii6mjTG+ZZR+8JX1cC/LFjZB9SN/L7AjiAGOYsGl54NxuzpmU+Kpn8D YGNlW10W4/QqvZcXXsA9WNTwKqcNsQkW1+TGUcE7IuxgPz6HRJTcIxD7/81DThUjYusW W9QthAoQYLRfTJsMiLjI80m2DbqQ795kCWhT4cicC5XkrctrqPDIVBN6/z0ecjSs/jR3 vKPgS+UVwlw1oXxDmlJy0SoJk53yaFbjNH5KC+0TX3eTlCuHO6O5y3U9xf68WvcTyMpR 4SFw== X-Gm-Message-State: AOAM532H2MekJUDvOG8i/eMOUU6FhFtWRm+NbclE1CY1zimJJqiYG7Ia gpVYc3gY07xZrFgnFSwyWdshI8oe8bw= X-Google-Smtp-Source: ABdhPJyQfumNzCSZPGOXasNvj+lgnggWPk1kp+OC3U61oN1g8Dp6+pQ29FbyZBFYzqr/3ojBrofzaA== X-Received: by 2002:a17:906:6888:: with SMTP id n8mr2260321ejr.0.1644917557129; Tue, 15 Feb 2022 01:32:37 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 18/30] configure, meson: move guest-agent, tools to meson Date: Tue, 15 Feb 2022 10:32:11 +0100 Message-Id: <20220215093223.110827-19-pbonzini@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220215093223.110827-1-pbonzini@redhat.com> References: <20220215093223.110827-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::631 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x631.google.com X-Spam_score_int: 2 X-Spam_score: 0.2 X-Spam_bar: / X-Spam_report: (0.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, PDS_HP_HELO_NORDNS=0.904, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1644918579399100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- configure | 48 ++-------------------------- contrib/vhost-user-gpu/meson.build | 2 +- docs/meson.build | 2 -- meson.build | 50 ++++++++++++++++-------------- meson_options.txt | 4 +++ qga/meson.build | 7 +++++ scripts/meson-buildoptions.sh | 6 ++++ tests/Makefile.include | 2 +- tests/unit/meson.build | 4 +-- 9 files changed, 50 insertions(+), 75 deletions(-) diff --git a/configure b/configure index 9230ebd4a8..a66e2c0d71 100755 --- a/configure +++ b/configure @@ -317,10 +317,8 @@ pie=3D"" trace_backends=3D"log" trace_file=3D"trace" opengl=3D"$default_feature" -guest_agent=3D"$default_feature" vss_win32_sdk=3D"$default_feature" win_sdk=3D"no" -want_tools=3D"$default_feature" coroutine=3D"" tls_priority=3D"NORMAL" plugins=3D"$default_feature" @@ -960,10 +958,6 @@ for opt do ;; --disable-zlib-test) ;; - --enable-guest-agent) guest_agent=3D"yes" - ;; - --disable-guest-agent) guest_agent=3D"no" - ;; --with-vss-sdk) vss_win32_sdk=3D"" ;; --with-vss-sdk=3D*) vss_win32_sdk=3D"$optarg" @@ -976,10 +970,6 @@ for opt do ;; --without-win-sdk) win_sdk=3D"no" ;; - --enable-tools) want_tools=3D"yes" - ;; - --disable-tools) want_tools=3D"no" - ;; --disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane) echo "$0: $opt is obsolete, virtio-blk data-plane is always on" >&2 ;; @@ -1256,7 +1246,6 @@ cat << EOF user supported user emulation targets linux-user all linux usermode emulation targets bsd-user all BSD usermode emulation targets - guest-agent build the QEMU Guest Agent pie Position Independent Executables modules modules support (non-Windows) module-upgrades try to load modules from alternate paths for upgrades @@ -1275,7 +1264,6 @@ cat << EOF vhost-user vhost-user backend support vhost-vdpa vhost-vdpa kernel backend support opengl opengl support - tools build qemu-io, qemu-nbd and qemu-img tools gio libgio support =20 NOTE: The object files are built at the place where configure is launched @@ -1678,16 +1666,6 @@ else exit 1 fi =20 -########################################## -# system tools -if test -z "$want_tools"; then - if test "$softmmu" =3D "no"; then - want_tools=3Dno - else - want_tools=3Dyes - fi -fi - ######################################### # vhost interdependencies and host support =20 @@ -2344,7 +2322,7 @@ fi # check if we have VSS SDK headers for win =20 guest_agent_with_vss=3D"no" -if test "$mingw32" =3D "yes" && test "$guest_agent" !=3D "no" && \ +if test "$mingw32" =3D "yes" && \ test "$vss_win32_sdk" !=3D "no" ; then case "$vss_win32_sdk" in "") vss_win32_include=3D"-isystem $source_path" ;; @@ -2381,7 +2359,7 @@ fi # VSS provider from the source. It is usually unnecessary because the # pre-compiled .tlb file is included. =20 -if test "$mingw32" =3D "yes" && test "$guest_agent" !=3D "no" && \ +if test "$mingw32" =3D "yes" && \ test "$guest_agent_with_vss" =3D "yes" ; then if test -z "$win_sdk"; then programfiles=3D"$PROGRAMFILES" @@ -2399,7 +2377,7 @@ fi ########################################## # check if mingw environment provides a recent ntddscsi.h guest_agent_ntddscsi=3D"no" -if test "$mingw32" =3D "yes" && test "$guest_agent" !=3D "no"; then +if test "$mingw32" =3D "yes"; then cat > $TMPC << EOF #include #include @@ -2825,20 +2803,6 @@ if test "$mingw32" =3D "yes" ; then done fi =20 -# Probe for guest agent support/options - -if [ "$guest_agent" !=3D "no" ]; then - if [ "$softmmu" =3D no -a "$want_tools" =3D no ] ; then - guest_agent=3Dno - elif [ "$linux" =3D "yes" -o "$bsd" =3D "yes" -o "$solaris" =3D "yes" -o= "$mingw32" =3D "yes" ] ; then - guest_agent=3Dyes - elif [ "$guest_agent" !=3D yes ]; then - guest_agent=3Dno - else - error_exit "Guest agent is not supported on this platform" - fi -fi - # Guest agent Windows MSI package =20 if test "$QEMU_GA_MANUFACTURER" =3D ""; then @@ -2968,12 +2932,6 @@ fi if test "$static" =3D "yes" ; then echo "CONFIG_STATIC=3Dy" >> $config_host_mak fi -if test "$want_tools" =3D "yes" ; then - echo "CONFIG_TOOLS=3Dy" >> $config_host_mak -fi -if test "$guest_agent" =3D "yes" ; then - echo "CONFIG_GUEST_AGENT=3Dy" >> $config_host_mak -fi echo "CONFIG_BDRV_RW_WHITELIST=3D$block_drv_rw_whitelist" >> $config_host_= mak echo "CONFIG_BDRV_RO_WHITELIST=3D$block_drv_ro_whitelist" >> $config_host_= mak qemu_version=3D$(head $source_path/VERSION) diff --git a/contrib/vhost-user-gpu/meson.build b/contrib/vhost-user-gpu/me= son.build index 92c8f3a86a..b4e26045da 100644 --- a/contrib/vhost-user-gpu/meson.build +++ b/contrib/vhost-user-gpu/meson.build @@ -1,4 +1,4 @@ -if 'CONFIG_TOOLS' in config_host and virgl.found() and gbm.found() \ +if have_tools and virgl.found() and gbm.found() \ and 'CONFIG_LINUX' in config_host and pixman.found() executable('vhost-user-gpu', files('vhost-user-gpu.c', 'virgl.c', 'vugbm= .c'), dependencies: [qemuutil, pixman, gbm, virgl, vhost_user, open= gl], diff --git a/docs/meson.build b/docs/meson.build index 57b28a3146..831d4aea2b 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -37,8 +37,6 @@ endif if build_docs SPHINX_ARGS +=3D ['-Dversion=3D' + meson.project_version(), '-Drelease= =3D' + config_host['PKGVERSION']] =20 - have_ga =3D have_tools and config_host.has_key('CONFIG_GUEST_AGENT') - man_pages =3D { 'qemu-ga.8': (have_ga ? 'man8' : ''), 'qemu-ga-ref.7': (have_ga ? 'man7' : ''), diff --git a/meson.build b/meson.build index 7b3cfb6316..b9bedf928a 100644 --- a/meson.build +++ b/meson.build @@ -44,21 +44,7 @@ config_host_data =3D configuration_data() genh =3D [] qapi_trace_events =3D [] =20 -target_dirs =3D config_host['TARGET_DIRS'].split() -have_linux_user =3D false -have_bsd_user =3D false -have_system =3D false -foreach target : target_dirs - have_linux_user =3D have_linux_user or target.endswith('linux-user') - have_bsd_user =3D have_bsd_user or target.endswith('bsd-user') - have_system =3D have_system or target.endswith('-softmmu') -endforeach -have_user =3D have_linux_user or have_bsd_user -have_tools =3D 'CONFIG_TOOLS' in config_host -have_block =3D have_system or have_tools - -python =3D import('python').find_installation() - +bsd_oses =3D ['gnu/kfreebsd', 'freebsd', 'netbsd', 'openbsd', 'dragonfly',= 'darwin'] supported_oses =3D ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', '= sunos', 'linux'] supported_cpus =3D ['ppc', 'ppc64', 's390x', 'riscv', 'x86', 'x86_64', 'arm', 'aarch64', 'loongarch64', 'mips', 'mips64', 'sparc', 'sparc64'] @@ -72,6 +58,28 @@ endif =20 targetos =3D host_machine.system() =20 +target_dirs =3D config_host['TARGET_DIRS'].split() +have_linux_user =3D false +have_bsd_user =3D false +have_system =3D false +foreach target : target_dirs + have_linux_user =3D have_linux_user or target.endswith('linux-user') + have_bsd_user =3D have_bsd_user or target.endswith('bsd-user') + have_system =3D have_system or target.endswith('-softmmu') +endforeach +have_user =3D have_linux_user or have_bsd_user +have_tools =3D get_option('tools') \ + .disable_auto_if(not have_system) \ + .allowed() +have_ga =3D get_option('guest_agent') \ + .disable_auto_if(not have_system and not have_tools) \ + .require(targetos in ['sunos', 'linux', 'windows'], + error_message: 'unsupported OS for QEMU guest agent') \ + .allowed() +have_block =3D have_system or have_tools + +python =3D import('python').find_installation() + if cpu not in supported_cpus host_arch =3D 'unknown' elif cpu =3D=3D 'x86' @@ -3214,11 +3222,7 @@ if 'CONFIG_PLUGIN' in config_host install_headers('include/qemu/qemu-plugin.h') endif =20 -if 'CONFIG_GUEST_AGENT' in config_host - subdir('qga') -elif get_option('guest_agent_msi').enabled() - error('Guest agent MSI requested, but the guest agent is not being built= ') -endif +subdir('qga') =20 # Don't build qemu-keymap if xkbcommon is not explicitly enabled # when we don't build tools or system @@ -3341,7 +3345,7 @@ if config_host.has_key('HAVE_GDB_BIN') summary_info +=3D {'gdb': config_host['HAVE_GDB_BIN']} endif summary_info +=3D {'genisoimage': config_host['GENISOIMAGE']} -if targetos =3D=3D 'windows' and config_host.has_key('CONFIG_GUEST_AGENT') +if targetos =3D=3D 'windows' and have_ga summary_info +=3D {'wixl': wixl} endif if slirp_opt !=3D 'disabled' and have_system @@ -3379,7 +3383,7 @@ summary_info +=3D {'vhost-user support': config_host.= has_key('CONFIG_VHOST_USER')} summary_info +=3D {'vhost-user-blk server support': have_vhost_user_blk_se= rver} summary_info +=3D {'vhost-user-fs support': config_host.has_key('CONFIG_VH= OST_USER_FS')} summary_info +=3D {'vhost-vdpa support': config_host.has_key('CONFIG_VHOST= _VDPA')} -summary_info +=3D {'build guest agent': config_host.has_key('CONFIG_GUEST_= AGENT')} +summary_info +=3D {'build guest agent': have_ga} summary(summary_info, bool_yn: true, section: 'Configurable features') =20 # Compilation information @@ -3589,7 +3593,7 @@ summary_info +=3D {'GBM': gbm} summary_info +=3D {'libiscsi support': libiscsi} summary_info +=3D {'libnfs support': libnfs} if targetos =3D=3D 'windows' - if config_host.has_key('CONFIG_GUEST_AGENT') + if have_ga summary_info +=3D {'QGA VSS support': config_host.has_key('CONFIG_QG= A_VSS')} summary_info +=3D {'QGA w32 disk info': config_host.has_key('CONFIG_QG= A_NTDDSCSI')} endif diff --git a/meson_options.txt b/meson_options.txt index 59220b52c8..589d242439 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -36,8 +36,12 @@ option('install_blobs', type : 'boolean', value : true, description: 'install provided firmware blobs') option('sparse', type : 'feature', value : 'auto', description: 'sparse checker') +option('guest_agent', type : 'feature', value : 'auto', + description: 'Build QEMU Guest Agent') option('guest_agent_msi', type : 'feature', value : 'auto', description: 'Build MSI package for the QEMU Guest Agent') +option('tools', type : 'feature', value : 'auto', + description: 'build support utilities that come with QEMU') =20 option('malloc_trim', type : 'feature', value : 'auto', description: 'enable libc malloc_trim() for memory optimization') diff --git a/qga/meson.build b/qga/meson.build index 56fb6539e5..97cc391fe1 100644 --- a/qga/meson.build +++ b/qga/meson.build @@ -1,3 +1,10 @@ +if not have_ga + if get_option('guest_agent_msi').enabled() + error('Guest agent MSI requested, but the guest agent is not being bui= lt') + endif + subdir_done() +endif + all_qga =3D [] =20 qga_qapi_outputs =3D [ diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index fb8812693c..4edc611273 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -62,6 +62,7 @@ meson_options_help() { printf "%s\n" ' glusterfs Glusterfs block device driver' printf "%s\n" ' gnutls GNUTLS cryptography support' printf "%s\n" ' gtk GTK+ user interface' + printf "%s\n" ' guest-agent Build QEMU Guest Agent' printf "%s\n" ' guest-agent-msi Build MSI package for the QEMU Guest Ag= ent' printf "%s\n" ' hax HAX acceleration support' printf "%s\n" ' hvf HVF acceleration support' @@ -108,6 +109,7 @@ meson_options_help() { printf "%s\n" ' spice Spice server support' printf "%s\n" ' spice-protocol Spice protocol support' printf "%s\n" ' tcg TCG support' + printf "%s\n" ' tools build support utilities that come with = QEMU' printf "%s\n" ' tpm TPM support' printf "%s\n" ' u2f U2F emulation support' printf "%s\n" ' usb-redir libusbredir support' @@ -209,6 +211,8 @@ _meson_option_parse() { --disable-gprof) printf "%s" -Dgprof=3Dfalse ;; --enable-gtk) printf "%s" -Dgtk=3Denabled ;; --disable-gtk) printf "%s" -Dgtk=3Ddisabled ;; + --enable-guest-agent) printf "%s" -Dguest_agent=3Denabled ;; + --disable-guest-agent) printf "%s" -Dguest_agent=3Ddisabled ;; --enable-guest-agent-msi) printf "%s" -Dguest_agent_msi=3Denabled ;; --disable-guest-agent-msi) printf "%s" -Dguest_agent_msi=3Ddisabled ;; --enable-hax) printf "%s" -Dhax=3Denabled ;; @@ -315,6 +319,8 @@ _meson_option_parse() { --disable-tcg) printf "%s" -Dtcg=3Ddisabled ;; --enable-tcg-interpreter) printf "%s" -Dtcg_interpreter=3Dtrue ;; --disable-tcg-interpreter) printf "%s" -Dtcg_interpreter=3Dfalse ;; + --enable-tools) printf "%s" -Dtools=3Denabled ;; + --disable-tools) printf "%s" -Dtools=3Ddisabled ;; --enable-tpm) printf "%s" -Dtpm=3Denabled ;; --disable-tpm) printf "%s" -Dtpm=3Ddisabled ;; --enable-trace-backends=3D*) quote_sh "-Dtrace_backends=3D$2" ;; diff --git a/tests/Makefile.include b/tests/Makefile.include index 646c8b1334..e7153c8e91 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -150,7 +150,7 @@ check-acceptance: check-acceptance-deprecated-warning |= check-avocado .PHONY: check-block check check-clean get-vm-images check: =20 -ifeq ($(CONFIG_TOOLS)$(CONFIG_POSIX),yy) +ifneq ($(.check-block.deps),) check: check-block check-block: run-ninja $(if $(MAKE.n),,+)$(MESON) test $(MTESTARGS) $(.mtestargs) --verbose \ diff --git a/tests/unit/meson.build b/tests/unit/meson.build index 0959061faf..3a51759ebc 100644 --- a/tests/unit/meson.build +++ b/tests/unit/meson.build @@ -149,9 +149,7 @@ if have_system endif endif =20 -if 'CONFIG_TSAN' not in config_host and \ - 'CONFIG_GUEST_AGENT' in config_host and \ - 'CONFIG_LINUX' in config_host +if have_ga and targetos =3D=3D 'linux' and 'CONFIG_TSAN' not in config_host tests +=3D {'test-qga': ['../qtest/libqtest.c']} test_deps +=3D {'test-qga': qga} endif --=20 2.34.1