From nobody Mon Feb 9 09:34:22 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601484656; cv=none; d=zohomail.com; s=zohoarc; b=kd3AqKTmyTmAfUR2SZIZSZNL13nIU0jdecHfmIS7IXDd5dS7Zot6H/gjxTKI1ZsF9eIirFWn1+FUF2n2GZ3N7QnMEcfZhbDZrYZ7Ozrl9WZoBibQQppFrx57M9OSjs8JHjDEHPJjO5adDIQjvAQYH6RGxBgId+erqeRObNjfA6s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601484656; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=p5T4b3uR4sPUBIFjdhNd72M+5jlOJeIdLDswdJQ0sTY=; b=Duk1E7iI5Rg8XbEGV7EbSJN8D+/kWZDgf4cPgcZhQQEsekHKku0MsiiTuxwpt4lLr6P9ov7RBjIMQI+nSw6iByl0NUxzYVt5RcSHNMBuyW12pSos3y5VHHsyZlqZluom9mAqViSChXvDd8bkKooSruFFZDGCZPjtBW11HJh20rA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1601484656420902.7400056744939; Wed, 30 Sep 2020 09:50:56 -0700 (PDT) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-479-5JplZResOha-VKsQw7smRQ-1; Wed, 30 Sep 2020 12:50:53 -0400 Received: by mail-wm1-f72.google.com with SMTP id b14so62998wmj.3 for ; Wed, 30 Sep 2020 09:50:52 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (74.red-83-53-161.dynamicip.rima-tde.net. [83.53.161.74]) by smtp.gmail.com with ESMTPSA id t4sm4250032wrr.26.2020.09.30.09.50.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Sep 2020 09:50:51 -0700 (PDT) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601484655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p5T4b3uR4sPUBIFjdhNd72M+5jlOJeIdLDswdJQ0sTY=; b=gu8CisHykX+emQxAml9sN63b2v25Fr0JzG5aGUS0AeQG/fWTovMhC4AefHYVCWKbcmwezA cNwvPchzVoQ/CZSaODQn53YU/HSLzf1xgzin30HvPDOVIEK8NUlHEaVXz2JbMmpU/squi2 t74oMfI5/U1OD+Sap9Pn23Tj3MwBZPc= X-MC-Unique: 5JplZResOha-VKsQw7smRQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=p5T4b3uR4sPUBIFjdhNd72M+5jlOJeIdLDswdJQ0sTY=; b=onAoueWta9BtW40IeBRbTGO5MUwTm+snJVWCL3u43/PutoXI4U/6oHDODuGYY/Mhzw NGLTpQ9G5vUYBAbN4nObF9lLU3PJRhDATNSBhM9ZGZ+ylNPhDi6QpVB0txZjFV9UwBnf SyGylkBVWareiws+QEJNvp2vTU0Nan87y6OxcI1yCI6lz1hQNhgaykH466gIdtMBc7Oj UYKAT0P/RsFs153OXVhHbheuD0tu7Fnd+WzLBTuQNf9eKTrupatNQ7Ftuu03vz6iKMjY z9khiGxEEBkJ4erehc300j0xgLj8gFNaaaRCec4iiQXjFY0hpmpW/7khdMbAPeOKsAdm mMkA== X-Gm-Message-State: AOAM531TSaplcviqO+7byL75M3sB5ffEl3yU34xtEqsqlefLdacC81dy O+KUv0nuOyL/gNxs36EWy16gwpLCVNxRxRmmQ2xqLKv2cWLl6cic9juTiEbx6+yN5lKwIFVuJxs JOMMQcsoome6cRg== X-Received: by 2002:adf:fd12:: with SMTP id e18mr4250009wrr.96.1601484651954; Wed, 30 Sep 2020 09:50:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuTX+OJeaabPNkTWh+q+FjuxodYFwPUOAG87v3IdLMLDqovciEEHHgoWcyYIPkOeVRu0X9fw== X-Received: by 2002:adf:fd12:: with SMTP id e18mr4249995wrr.96.1601484651786; Wed, 30 Sep 2020 09:50:51 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Laurent Vivier Cc: Ronnie Sahlberg , Eric Blake , Kevin Wolf , Marcel Apfelbaum , Richard Henderson , Michael Roth , Eduardo Habkost , Peter Lieven , Markus Armbruster , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , qemu-block@nongnu.org, Paolo Bonzini , Max Reitz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v3 11/11] qapi: Restrict code generated for user-mode Date: Wed, 30 Sep 2020 18:49:49 +0200 Message-Id: <20200930164949.1425294-12-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200930164949.1425294-1-philmd@redhat.com> References: <20200930164949.1425294-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) A lot of QAPI generated code is never used by user-mode. Split out qapi_system_modules and qapi_system_or_tools_modules from the qapi_all_modules array. We now have 3 groups: - always used - use by system-mode or tools (usually by the block layer) - only used by system-mode Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- Resetting due to Meson update: Reviewed-by: Richard Henderson --- qapi/meson.build | 51 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/qapi/meson.build b/qapi/meson.build index 7c4a89a882..ba9677ba97 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -14,39 +14,60 @@ util_ss.add(files( )) =20 qapi_all_modules =3D [ + 'common', + 'introspect', + 'misc', +] + +qapi_system_modules =3D [ 'acpi', 'audio', + 'dump', + 'machine-target', + 'machine', + 'migration', + 'misc-target', + 'net', + 'pci', + 'qdev', + 'rdma', + 'rocker', + 'tpm', + 'trace', +] + +# system or tools +qapi_block_modules =3D [ 'authz', 'block-core', 'block', 'char', - 'common', 'control', 'crypto', - 'dump', 'error', - 'introspect', 'job', - 'machine', - 'machine-target', - 'migration', - 'misc', - 'misc-target', - 'net', 'pragma', - 'qdev', - 'pci', 'qom', - 'rdma', - 'rocker', 'run-state', 'sockets', - 'tpm', - 'trace', 'transaction', 'ui', ] =20 +if have_system + qapi_all_modules +=3D qapi_system_modules +elif have_user + # Temporary kludge because X86CPUFeatureWordInfo is not + # restricted to system-mode. This should be removed (along + # with target/i386/feature-stub.c) once target/i386/cpu.c + # has been cleaned. + qapi_all_modules +=3D ['machine-target'] +endif + +if have_block + qapi_all_modules +=3D qapi_block_modules +endif + qapi_storage_daemon_modules =3D [ 'block-core', 'char', --=20 2.26.2