From nobody Tue Feb 10 05:39:51 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1611412557; cv=none; d=zohomail.com; s=zohoarc; b=D/WVcsUs9sVyS/L8dqRQjSOQh0DXORQZNCFF8DMCIPo8d7pgrfqZ9cIN40NivBngGnIo4RkzSmjigKQCQBYTZyhCgk2kbg7xhAAj6TGZUl77xjnUZ1YbVKo4zKZVl0pG/KbElmYeCAJ3bJjd0NmxgXHijVupmqVFQr1LHllrn90= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611412557; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5JzEjrGDu5ACPuC4O5nwB5bLh4ysrzqhSgrkqN+kLKI=; b=NKtZ3e0Q0m3Dq7agc778Y9UGvuRjaOISPrB0NvjvRq4iGr0Marja0KMh+aglTtuWTpVf8En0pQb3SnuoNbGFJzdcNIydejCw2JoVulHjBX2jEtyULLiXTTW1GQ3Gtmpsm1/Rl2p2UGokGec3trA0fRzA01EfO65NHx+7v0x/cvA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1611412557589831.9832970270987; Sat, 23 Jan 2021 06:35:57 -0800 (PST) Received: from localhost ([::1]:36280 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3K16-0000W8-EP for importer@patchew.org; Sat, 23 Jan 2021 09:35:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3JxE-0003Wk-7c for qemu-devel@nongnu.org; Sat, 23 Jan 2021 09:31:56 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:57911) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l3Jx7-0005pu-3b for qemu-devel@nongnu.org; Sat, 23 Jan 2021 09:31:55 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-452-7EEQUyNoOjqpGDVuE9OzGw-1; Sat, 23 Jan 2021 09:31:45 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D9925806663 for ; Sat, 23 Jan 2021 14:31:44 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id A392719486 for ; Sat, 23 Jan 2021 14:31:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611412307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5JzEjrGDu5ACPuC4O5nwB5bLh4ysrzqhSgrkqN+kLKI=; b=LwUqEj3pBG3BPnjMX+IXIKBP7lw1qr52jMTavqMxJfGK58SmCnhcFY24kJPewwhnSV8JTE Qm/K1sh5rjfg+jmAqVHC57ViDzflyMJteNcJ3vAiCXtEts/V2tzD3Q1/c4HCo+xAsMbMXM oefTmR3ftMVKR7iLxLTmrrI08MPM7K0= X-MC-Unique: 7EEQUyNoOjqpGDVuE9OzGw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 14/31] meson: convert wixl detection to Meson Date: Sat, 23 Jan 2021 09:31:11 -0500 Message-Id: <20210123143128.1167797-15-pbonzini@redhat.com> In-Reply-To: <20210123143128.1167797-1-pbonzini@redhat.com> References: <20210123143128.1167797-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.165, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- Makefile | 2 -- configure | 84 ++++++++++------------------------------------- meson.build | 10 ++++-- meson_options.txt | 2 ++ qga/meson.build | 55 +++++++++++++++++++------------ 5 files changed, 61 insertions(+), 92 deletions(-) diff --git a/Makefile b/Makefile index 2a926aaeb0..a380bbfa12 100644 --- a/Makefile +++ b/Makefile @@ -335,9 +335,7 @@ endif ifdef CONFIG_WIN32 @echo 'Windows targets:' $(call print-help,installer,Build NSIS-based installer for QEMU) -ifdef CONFIG_QGA_MSI $(call print-help,msi,Build MSI-based installer for qemu-ga) -endif @echo '' endif $(call print-help,$(MAKE) [targets],(quiet build, default)) diff --git a/configure b/configure index 753d0dd18e..6c98552452 100755 --- a/configure +++ b/configure @@ -404,7 +404,7 @@ zstd=3D"auto" guest_agent=3D"$default_feature" guest_agent_with_vss=3D"no" guest_agent_ntddscsi=3D"no" -guest_agent_msi=3D"$default_feature" +guest_agent_msi=3D"auto" vss_win32_sdk=3D"$default_feature" win_sdk=3D"no" want_tools=3D"$default_feature" @@ -1334,9 +1334,9 @@ for opt do ;; --disable-guest-agent) guest_agent=3D"no" ;; - --enable-guest-agent-msi) guest_agent_msi=3D"yes" + --enable-guest-agent-msi) guest_agent_msi=3D"enabled" ;; - --disable-guest-agent-msi) guest_agent_msi=3D"no" + --disable-guest-agent-msi) guest_agent_msi=3D"disabled" ;; --with-vss-sdk) vss_win32_sdk=3D"" ;; @@ -5341,62 +5341,19 @@ if [ "$guest_agent" !=3D "no" ]; then fi fi =20 -# Guest agent Window MSI package +# Guest agent Windows MSI package =20 -if test "$guest_agent" !=3D yes; then - if test "$guest_agent_msi" =3D yes; then - error_exit "MSI guest agent package requires guest agent enabled" - fi - guest_agent_msi=3Dno -elif test "$mingw32" !=3D "yes"; then - if test "$guest_agent_msi" =3D "yes"; then - error_exit "MSI guest agent package is available only for MinGW Window= s cross-compilation" - fi - guest_agent_msi=3Dno -elif ! has wixl; then - if test "$guest_agent_msi" =3D "yes"; then - error_exit "MSI guest agent package requires wixl tool installed ( usu= ally from msitools package )" - fi - guest_agent_msi=3Dno -else - # we support qemu-ga, mingw32, and wixl: default to MSI enabled if it wa= sn't - # disabled explicitly - if test "$guest_agent_msi" !=3D "no"; then - guest_agent_msi=3Dyes - fi +if test "$QEMU_GA_MANUFACTURER" =3D ""; then + QEMU_GA_MANUFACTURER=3DQEMU fi - -if test "$guest_agent_msi" =3D "yes"; then - if test "$guest_agent_with_vss" =3D "yes"; then - QEMU_GA_MSI_WITH_VSS=3D"-D InstallVss" - fi - - if test "$QEMU_GA_MANUFACTURER" =3D ""; then - QEMU_GA_MANUFACTURER=3DQEMU - fi - - if test "$QEMU_GA_DISTRO" =3D ""; then - QEMU_GA_DISTRO=3DLinux - fi - - if test "$QEMU_GA_VERSION" =3D ""; then - QEMU_GA_VERSION=3D$(cat $source_path/VERSION) - fi - - QEMU_GA_MSI_MINGW_DLL_PATH=3D"-D Mingw_dlls=3D$($pkg_config --variable= =3Dprefix glib-2.0)/bin" - - case "$cpu" in - x86_64) - QEMU_GA_MSI_ARCH=3D"-a x64 -D Arch=3D64" - ;; - i386) - QEMU_GA_MSI_ARCH=3D"-D Arch=3D32" - ;; - *) - error_exit "CPU $cpu not supported for building installation package" - ;; - esac +if test "$QEMU_GA_DISTRO" =3D ""; then + QEMU_GA_DISTRO=3DLinux fi +if test "$QEMU_GA_VERSION" =3D ""; then + QEMU_GA_VERSION=3D$(cat $source_path/VERSION) +fi + +QEMU_GA_MSI_MINGW_DLL_PATH=3D"$($pkg_config --variable=3Dprefix glib-2.0)/= bin" =20 # Mac OS X ships with a broken assembler roms=3D @@ -5495,15 +5452,10 @@ if test "$mingw32" =3D "yes" ; then if test "$guest_agent_ntddscsi" =3D "yes" ; then echo "CONFIG_QGA_NTDDSCSI=3Dy" >> $config_host_mak fi - if test "$guest_agent_msi" =3D "yes"; then - echo "CONFIG_QGA_MSI=3Dy" >> $config_host_mak - echo "QEMU_GA_MSI_MINGW_DLL_PATH=3D${QEMU_GA_MSI_MINGW_DLL_PATH}" >> $= config_host_mak - echo "QEMU_GA_MSI_WITH_VSS=3D${QEMU_GA_MSI_WITH_VSS}" >> $config_host_= mak - echo "QEMU_GA_MSI_ARCH=3D${QEMU_GA_MSI_ARCH}" >> $config_host_mak - echo "QEMU_GA_MANUFACTURER=3D${QEMU_GA_MANUFACTURER}" >> $config_host_= mak - echo "QEMU_GA_DISTRO=3D${QEMU_GA_DISTRO}" >> $config_host_mak - echo "QEMU_GA_VERSION=3D${QEMU_GA_VERSION}" >> $config_host_mak - fi + echo "QEMU_GA_MSI_MINGW_DLL_PATH=3D${QEMU_GA_MSI_MINGW_DLL_PATH}" >> $co= nfig_host_mak + echo "QEMU_GA_MANUFACTURER=3D${QEMU_GA_MANUFACTURER}" >> $config_host_mak + echo "QEMU_GA_DISTRO=3D${QEMU_GA_DISTRO}" >> $config_host_mak + echo "QEMU_GA_VERSION=3D${QEMU_GA_VERSION}" >> $config_host_mak else echo "CONFIG_POSIX=3Dy" >> $config_host_mak fi @@ -6420,7 +6372,7 @@ NINJA=3D$ninja $meson setup \ -Dattr=3D$attr -Ddefault_devices=3D$default_devices \ -Ddocs=3D$docs -Dsphinx_build=3D$sphinx_build -Dinstall_blobs=3D$b= lobs \ -Dvhost_user_blk_server=3D$vhost_user_blk_server \ - -Dfuse=3D$fuse -Dfuse_lseek=3D$fuse_lseek \ + -Dfuse=3D$fuse -Dfuse_lseek=3D$fuse_lseek -Dguest_agent_msi=3D$gue= st_agent_msi \ $(if test "$default_features" =3D no; then echo "-Dauto_features= =3Ddisabled"; fi) \ $cross_arg \ "$PWD" "$source_path" diff --git a/meson.build b/meson.build index 4a5f265bd0..49dd0c185f 100644 --- a/meson.build +++ b/meson.build @@ -2142,6 +2142,8 @@ 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 =20 # Don't build qemu-keymap if xkbcommon is not explicitly enabled @@ -2406,9 +2408,11 @@ if targetos =3D=3D 'windows' if 'WIN_SDK' in config_host summary_info +=3D {'Windows SDK': config_host['WIN_SDK']} endif - summary_info +=3D {'QGA VSS support': config_host.has_key('CONFIG_QGA_= VSS')} - summary_info +=3D {'QGA w32 disk info': config_host.has_key('CONFIG_QGA_= NTDDSCSI')} - summary_info +=3D {'QGA MSI support': config_host.has_key('CONFIG_QGA_= MSI')} + if config_host.has_key('CONFIG_GUEST_AGENT') + 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')} + summary_info +=3D {'QGA MSI support': wixl.found()} + endif endif summary_info +=3D {'seccomp support': seccomp.found()} summary_info +=3D {'CFI support': get_option('cfi')} diff --git a/meson_options.txt b/meson_options.txt index 7dcd81c06a..95f1079829 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -17,6 +17,8 @@ option('install_blobs', type : 'boolean', value : true, description: 'install provided firmware blobs') option('sparse', type : 'feature', value : 'auto', description: 'sparse checker') +option('guest_agent_msi', type : 'feature', value : 'auto', + description: 'Build MSI package for the QEMU Guest Agent') =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 520af6ce9b..cfb1fbc085 100644 --- a/qga/meson.build +++ b/qga/meson.build @@ -55,33 +55,46 @@ if targetos =3D=3D 'windows' gen_tlb =3D [] endif =20 - wixl =3D find_program('wixl', required: false) + qemu_ga_msi_arch =3D { + 'x86': ['-D', 'Arch=3D32'], + 'x86_64': ['-a', 'x64', '-D', 'Arch=3D64'] + } + wixl =3D not_found + if cpu in qemu_ga_msi_arch + wixl =3D find_program('wixl', required: get_option('guest_agent_msi')) + elif get_option('guest_agent_msi').enabled() + error('CPU not supported for building guest agent installation package= ') + endif + if wixl.found() deps =3D [gen_tlb, qga] - if 'CONFIG_QGA_VSS' in config_host and 'QEMU_GA_MSI_WITH_VSS' in confi= g_host + qemu_ga_msi_vss =3D [] + if 'CONFIG_QGA_VSS' in config_host + qemu_ga_msi_vss =3D ['-D', 'InstallVss'] deps +=3D qga_vss endif - if 'CONFIG_QGA_MSI' in config_host - qga_msi =3D custom_target('QGA MSI', - input: files('installer/qemu-ga.wxs'), - output: 'qemu-ga-@0@.msi'.format(config_host= ['ARCH']), - depends: deps, - command: [ - find_program('env'), - 'QEMU_GA_VERSION=3D' + config_host['QEMU_G= A_VERSION'], - 'QEMU_GA_MANUFACTURER=3D' + config_host['Q= EMU_GA_MANUFACTURER'], - 'QEMU_GA_DISTRO=3D' + config_host['QEMU_GA= _DISTRO'], - 'BUILD_DIR=3D' + meson.build_root(), - wixl, '-o', '@OUTPUT0@', '@INPUT0@', - config_host['QEMU_GA_MSI_ARCH'].split(), - config_host['QEMU_GA_MSI_WITH_VSS'].split(= ), - config_host['QEMU_GA_MSI_MINGW_DLL_PATH'].= split(), - ]) - all_qga +=3D [qga_msi] - alias_target('msi', qga_msi) - endif + qga_msi =3D custom_target('QGA MSI', + input: files('installer/qemu-ga.wxs'), + output: 'qemu-ga-@0@.msi'.format(config_host['= ARCH']), + depends: deps, + command: [ + find_program('env'), + 'QEMU_GA_VERSION=3D' + config_host['QEMU_GA_= VERSION'], + 'QEMU_GA_MANUFACTURER=3D' + config_host['QEM= U_GA_MANUFACTURER'], + 'QEMU_GA_DISTRO=3D' + config_host['QEMU_GA_D= ISTRO'], + 'BUILD_DIR=3D' + meson.build_root(), + wixl, '-o', '@OUTPUT0@', '@INPUT0@', + qemu_ga_msi_arch[cpu], + qemu_ga_msi_vss, + '-D', 'Mingw_dlls=3D' + config_host['QEMU_GA= _MSI_MINGW_DLL_PATH'], + ]) + all_qga +=3D [qga_msi] + alias_target('msi', qga_msi) endif else + if get_option('guest_agent_msi').enabled() + error('MSI guest agent package is available only for MinGW Windows cro= ss-compilation') + endif install_subdir('run', install_dir: get_option('localstatedir')) endif =20 --=20 2.26.2