From nobody Mon Feb 9 09:34:21 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 ARC-Seal: i=1; a=rsa-sha256; t=1608199069; cv=none; d=zohomail.com; s=zohoarc; b=lVtrQmUOLIi/ONqKrcVa5dg0bx/jz7qc+WcHmaSGTA0AmGEput00ewX2sDSdU/glRiHld1eS0xKowAsEAWM7tro3zubXW8aGlumha0nq1bl2pmuvZTPUSL+hfSvuySifMppkGuSuWIcefWpVFUNznUEaZcSijXKDGJmo3oMLqNg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608199069; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vUEGmeFPHcUwApgJAGGVOl2ZiRp6LKFQ+cuO5XM1h3A=; b=H1KV3OObcridHudn1iqHYVTtGHB3+dR0rcts31Kz+kybs+YODbIqjKjxDPMVCkx9PuxsoVaOiwB57lS1YCzOfruycCbPAtVi+AXWDx9FYrLCzKtapg0jdO9pAMN9+0FQ5nnz2+m8D/B3CpIYcAz863kVZf45YK38Wi5jxMMR5pw= ARC-Authentication-Results: i=1; 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 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 1608199069205990.9748845197967; Thu, 17 Dec 2020 01:57:49 -0800 (PST) Received: from localhost ([::1]:58640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpq2e-0004uR-59 for importer@patchew.org; Thu, 17 Dec 2020 04:57:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kppmZ-0004xp-6J for qemu-devel@nongnu.org; Thu, 17 Dec 2020 04:41:12 -0500 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:35490) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kppmO-0007lz-9O for qemu-devel@nongnu.org; Thu, 17 Dec 2020 04:41:10 -0500 Received: by mail-ed1-x529.google.com with SMTP id u19so27970860edx.2 for ; Thu, 17 Dec 2020 01:40:59 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id rs27sm3463677ejb.21.2020.12.17.01.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 01:40:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vUEGmeFPHcUwApgJAGGVOl2ZiRp6LKFQ+cuO5XM1h3A=; b=QT0sAwsLm8D72z1rfPVe/OujjYpt3IrICOlaWgE7LrWJI38YOy4ZhTKbq6EpRhGefr ZOM+ow/JKwcBGsaOwPMp6c4AHT84z6ZX765OHGiRAT5aZw/6eEbJk4rSrL1+oTrItwVo cLYHsqz47BcSENOZZMuUbnFGMemTdeiEuVq3KkQi0CCeroXULWTstNFs9BQkL7tMqFvs j/zI0A9uM2Ur+rf/Y8c2T48uUKEJLaHnhRsoJMnKsdrwVVTg/+ZXnZR1ih2xUTfrNdaR zWtmdg4tPUVVpv8S0v9Zk9Lp/BF4mkHMHYk0xO+KdphxNbIHRPUCNCarxClKgwr3zjL5 su0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=vUEGmeFPHcUwApgJAGGVOl2ZiRp6LKFQ+cuO5XM1h3A=; b=nd4odI0qlZ2r4ySwc46ZWp5wdcMtnW2p8NvBJoKrYB6ie/QQTihDcbrNQTyScxM0Tq PRrw7k2WOI2KNngKvOAF0I7M6YjUKyu/Ctgnk909vLlrmbmx/zs2NM3x3ta05hciTbmP w1s3hSt/2SMBMCSHA1O27cpk8iMXjq2v6Ce+Ym4a7lX7TE6rpmSSnv/fCjD+rah5N9rz +vOVf6l0cUM+PzHjovftuOV/Z8Dlr/UuskT88FQ6YQuiggXuWonMlK5WVwO23l3ycFOl mBDTzyANFC0Cd8LvzVhiFwAz8XUYm0hobmq8Ez2FOBVqZkuKZcdIRSmIINuhocgsV+EB H8hA== X-Gm-Message-State: AOAM531JPi+f2y9DS0hmfZAf7KOG/vcjDfyKNdNXpyENHNXuzRrDkjKe 7qtgbl+Uj16EPzN0BLQUTTl9+P4z5NI= X-Google-Smtp-Source: ABdhPJw4ztnqBQnOiDDIDCvaK0ZcUrN7biIYMJAFJR1xYG1d2JS9vgaZr32XEkAKXD9ImPqylJXmkw== X-Received: by 2002:a50:fc8b:: with SMTP id f11mr37869388edq.11.1608198059079; Thu, 17 Dec 2020 01:40:59 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 14/18] seccomp: convert to meson Date: Thu, 17 Dec 2020 10:40:40 +0100 Message-Id: <20201217094044.46462-15-pbonzini@redhat.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201217094044.46462-1-pbonzini@redhat.com> References: <20201217094044.46462-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::529; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x529.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: =?UTF-8?q?Marc-Andr=C3=83=C2=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini Reviewed-by: Marc-Andr=C3=A9 Lureau --- configure | 32 ++++---------------------------- meson.build | 10 ++++++---- meson_options.txt | 2 ++ softmmu/meson.build | 2 +- softmmu/qemu-seccomp.c | 2 -- tools/meson.build | 4 ++-- 6 files changed, 15 insertions(+), 37 deletions(-) diff --git a/configure b/configure index 649da881a2..00c2d61a96 100755 --- a/configure +++ b/configure @@ -414,7 +414,7 @@ debug_stack_usage=3D"no" crypto_afalg=3D"no" cfi=3D"false" cfi_debug=3D"false" -seccomp=3D"$default_feature" +seccomp=3D"auto" glusterfs=3D"auto" gtk=3D"$default_feature" gtk_gl=3D"no" @@ -1356,9 +1356,9 @@ for opt do ;; --disable-tools) want_tools=3D"no" ;; - --enable-seccomp) seccomp=3D"yes" + --enable-seccomp) seccomp=3D"enabled" ;; - --disable-seccomp) seccomp=3D"no" + --disable-seccomp) seccomp=3D"disabled" ;; --disable-glusterfs) glusterfs=3D"disabled" ;; @@ -2458,24 +2458,6 @@ EOF fi fi =20 -########################################## -# libseccomp check - -if test "$seccomp" !=3D "no" ; then - libseccomp_minver=3D"2.3.0" - if $pkg_config --atleast-version=3D$libseccomp_minver libseccomp ; then - seccomp_cflags=3D"$($pkg_config --cflags libseccomp)" - seccomp_libs=3D"$($pkg_config --libs libseccomp)" - seccomp=3D"yes" - else - if test "$seccomp" =3D "yes" ; then - feature_not_found "libseccomp" \ - "Install libseccomp devel >=3D $libseccomp_minver" - fi - seccomp=3D"no" - fi -fi - ########################################## # xen probe =20 @@ -6053,12 +6035,6 @@ if test "$avx512f_opt" =3D "yes" ; then echo "CONFIG_AVX512F_OPT=3Dy" >> $config_host_mak fi =20 -if test "$seccomp" =3D "yes"; then - echo "CONFIG_SECCOMP=3Dy" >> $config_host_mak - echo "SECCOMP_CFLAGS=3D$seccomp_cflags" >> $config_host_mak - echo "SECCOMP_LIBS=3D$seccomp_libs" >> $config_host_mak -fi - # XXX: suppress that if [ "$bsd" =3D "yes" ] ; then echo "CONFIG_BSD=3Dy" >> $config_host_mak @@ -6606,7 +6582,7 @@ NINJA=3D$ninja $meson setup \ -Dcurl=3D$curl -Dglusterfs=3D$glusterfs -Dbzip2=3D$bzip2 -Dlibiscs= i=3D$libiscsi \ -Dlibnfs=3D$libnfs -Diconv=3D$iconv -Dcurses=3D$curses -Dlibudev= =3D$libudev\ -Dlibssh=3D$libssh -Drbd=3D$rbd -Dlzo=3D$lzo -Dsnappy=3D$snappy -D= lzfse=3D$lzfse \ - -Dzstd=3D$zstd \ + -Dzstd=3D$zstd -Dseccomp=3D$seccomp \ -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 \ diff --git a/meson.build b/meson.build index 93a95d7a7f..a0132730d7 100644 --- a/meson.build +++ b/meson.build @@ -329,9 +329,10 @@ if 'CONFIG_ATTR' in config_host libattr =3D declare_dependency(link_args: config_host['LIBATTR_LIBS'].sp= lit()) endif seccomp =3D not_found -if 'CONFIG_SECCOMP' in config_host - seccomp =3D declare_dependency(compile_args: config_host['SECCOMP_CFLAGS= '].split(), - link_args: config_host['SECCOMP_LIBS'].spli= t()) +if not get_option('libiscsi').auto() or have_system or have_tools + seccomp =3D dependency('libseccomp', version: '>=3D2.3.0', + required: get_option('seccomp'), + method: 'pkg-config', static: enable_static) endif libcap_ng =3D not_found if 'CONFIG_LIBCAP_NG' in config_host @@ -993,6 +994,7 @@ config_host_data.set('HAVE_LIBSSH_0_8', have_libssh_0_8) config_host_data.set('CONFIG_RBD', rbd.found()) config_host_data.set('CONFIG_SDL', sdl.found()) config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) +config_host_data.set('CONFIG_SECCOMP', seccomp.found()) config_host_data.set('CONFIG_SNAPPY', snappy.found()) config_host_data.set('CONFIG_VHOST_USER_BLK_SERVER', have_vhost_user_blk_s= erver) config_host_data.set('CONFIG_VNC', vnc.found()) @@ -2361,7 +2363,7 @@ if targetos =3D=3D 'windows' 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')} endif -summary_info +=3D {'seccomp support': config_host.has_key('CONFIG_SECCOM= P')} +summary_info +=3D {'seccomp support': seccomp.found()} summary_info +=3D {'CFI support': get_option('cfi')} summary_info +=3D {'CFI debug support': get_option('cfi_debug')} summary_info +=3D {'coroutine backend': config_host['CONFIG_COROUTINE_BACK= END']} diff --git a/meson_options.txt b/meson_options.txt index 5a1de9b1fe..1854a9639f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -74,6 +74,8 @@ option('sdl', type : 'feature', value : 'auto', description: 'SDL user interface') option('sdl_image', type : 'feature', value : 'auto', description: 'SDL Image support for icons') +option('seccomp', type : 'feature', value : 'auto', + description: 'seccomp support') option('snappy', type : 'feature', value : 'auto', description: 'snappy compression support') option('u2f', type : 'feature', value : 'auto', diff --git a/softmmu/meson.build b/softmmu/meson.build index 2dab6c7eb6..d8e03018ab 100644 --- a/softmmu/meson.build +++ b/softmmu/meson.build @@ -28,5 +28,5 @@ softmmu_ss.add(files( ), sdl, libpmem, libdaxctl) =20 softmmu_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c')) -softmmu_ss.add(when: 'CONFIG_SECCOMP', if_true: [files('qemu-seccomp.c'), = seccomp]) +softmmu_ss.add(when: seccomp, if_true: files('qemu-seccomp.c')) softmmu_ss.add(when: fdt, if_true: files('device_tree.c')) diff --git a/softmmu/qemu-seccomp.c b/softmmu/qemu-seccomp.c index 8325ecb766..377ef6937c 100644 --- a/softmmu/qemu-seccomp.c +++ b/softmmu/qemu-seccomp.c @@ -202,7 +202,6 @@ static int seccomp_start(uint32_t seccomp_opts, Error *= *errp) return rc < 0 ? -1 : 0; } =20 -#ifdef CONFIG_SECCOMP int parse_sandbox(void *opaque, QemuOpts *opts, Error **errp) { if (qemu_opt_get_bool(opts, "enable", false)) { @@ -328,4 +327,3 @@ static void seccomp_register(void) } } opts_init(seccomp_register); -#endif diff --git a/tools/meson.build b/tools/meson.build index 76bf84df52..5c52d79fe4 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -1,6 +1,6 @@ have_virtiofsd =3D (targetos =3D=3D 'linux' and have_tools and - 'CONFIG_SECCOMP' in config_host and + seccomp.found() and 'CONFIG_LIBCAP_NG' in config_host and 'CONFIG_VHOST_USER' in config_host) =20 @@ -8,7 +8,7 @@ if get_option('virtiofsd').enabled() if not have_virtiofsd if targetos !=3D 'linux' error('virtiofsd requires Linux') - elif 'CONFIG_SECCOMP' not in config_host or 'CONFIG_LIBCAP_NG' not in = config_host + elif not seccomp.found() or 'CONFIG_LIBCAP_NG' not in config_host error('virtiofsd requires libcap-ng-devel and seccomp-devel') elif not have_tools or 'CONFIG_VHOST_USER' not in config_host error('virtiofsd needs tools and vhost-user support') --=20 2.29.2