From patchwork Sun Dec 16 14:08:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 10732479 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ADDE514E2 for ; Sun, 16 Dec 2018 14:10:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90A7C29BC3 for ; Sun, 16 Dec 2018 14:10:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A32829BC5; Sun, 16 Dec 2018 14:10:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D117A29BC3 for ; Sun, 16 Dec 2018 14:10:28 +0000 (UTC) Received: from localhost ([::1]:42582 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYX7j-00012u-2W for patchwork-qemu-devel@patchwork.kernel.org; Sun, 16 Dec 2018 09:10:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYX6W-00012j-E7 for qemu-devel@nongnu.org; Sun, 16 Dec 2018 09:09:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gYX6S-0004hZ-3v for qemu-devel@nongnu.org; Sun, 16 Dec 2018 09:09:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34084) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gYX6R-0004gq-SC for qemu-devel@nongnu.org; Sun, 16 Dec 2018 09:09:08 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5C1A43DEEB for ; Sun, 16 Dec 2018 14:09:06 +0000 (UTC) Received: from localhost (ovpn-112-19.ams2.redhat.com [10.36.112.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 74D365DA2A; Sun, 16 Dec 2018 14:09:04 +0000 (UTC) From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= To: qemu-devel@nongnu.org Date: Sun, 16 Dec 2018 18:08:49 +0400 Message-Id: <20181216140902.23986-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sun, 16 Dec 2018 14:09:06 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 00/13] qapi: add #if pre-processor conditions to generated code (part 3) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: armbru@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi, The thrid and last part (of "[PATCH v2 00/54] qapi: add #if pre-processor conditions to generated code") is about adding schema conditions based on the target. For now, the qapi code is compiled in common objects (common to all targets). This makes it impossible to add #if TARGET_ARM for example. The patch "RFC: qapi: learn to split the schema by 'top-unit'" proposes to split the schema by "top-unit", so that generated code can be built either in common objects or per-target. That patch is a bit rough, I would like to get some feedback about the approach before trying to improve it. The following patches demonstrate usage of target-based #if conditions, and getting rid of the qmp_unregister_command() hack. Marc-André Lureau (13): build-sys: move qmp-introspect per target qapi-commands: don't initialize command list in qmp_init_marshall() qapi-commands: rename init_marshal() to register_commands() RFC: qapi: learn to split the schema by 'top-unit' qapi: add a top-unit 'target' schema qapi: make rtc-reset-reinjection and SEV depend on TARGET_I386 qapi: make s390 commands depend on TARGET_S390X target.json: add a note about query-cpu* not being s390x-specific qapi: make query-gic-capabilities depend on TARGET_ARM qapi: make query-cpu-model-expansion depend on s390 or x86 qapi: make query-cpu-definitions depend on specific targets qapi: remove qmp_unregister_command() qapi: move RTC_CHANGE to the target schema qapi/misc.json | 478 ---------------------- qapi/qapi-schema.json | 1 + qapi/target.json | 516 ++++++++++++++++++++++++ scripts/qapi/commands.py | 28 +- scripts/qapi/common.py | 105 ++++- scripts/qapi/events.py | 37 +- scripts/qapi/types.py | 8 +- scripts/qapi/visit.py | 8 +- include/qapi/qmp-event.h | 4 + include/qapi/qmp/dispatch.h | 1 - include/sysemu/arch_init.h | 11 - target/i386/sev_i386.h | 2 +- hw/ppc/spapr_rtc.c | 2 +- hw/s390x/s390-skeys.c | 2 +- hw/timer/mc146818rtc.c | 4 +- monitor.c | 306 +++++++------- qapi/qmp-event.c | 11 + qapi/qmp-registry.c | 8 - qga/main.c | 3 +- qmp.c | 26 -- stubs/arch-query-cpu-def.c | 11 - stubs/arch-query-cpu-model-baseline.c | 13 - stubs/arch-query-cpu-model-comparison.c | 13 - stubs/arch-query-cpu-model-expansion.c | 13 - target/arm/helper.c | 3 +- target/arm/monitor.c | 2 +- target/i386/cpu.c | 6 +- target/ppc/translate_init.inc.c | 3 +- target/s390x/cpu_models.c | 9 +- tests/test-qmp-cmds.c | 3 +- tests/test-qobject-input-visitor.c | 1 - Makefile | 7 +- Makefile.objs | 2 - Makefile.target | 4 + docs/devel/qapi-code-gen.txt | 6 +- stubs/Makefile.objs | 4 - 36 files changed, 851 insertions(+), 810 deletions(-) create mode 100644 qapi/target.json delete mode 100644 stubs/arch-query-cpu-def.c delete mode 100644 stubs/arch-query-cpu-model-baseline.c delete mode 100644 stubs/arch-query-cpu-model-comparison.c delete mode 100644 stubs/arch-query-cpu-model-expansion.c