From patchwork Wed Mar 15 11:28:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 663359 Delivered-To: patch@linaro.org Received: by 2002:a5d:5602:0:0:0:0:0 with SMTP id l2csp1527783wrv; Wed, 15 Mar 2023 04:29:03 -0700 (PDT) X-Google-Smtp-Source: AK7set/Xhdakyrd6NARl7UYp75x/tMWU9ix9UxRn7qfXQApWyofIphulDUSQlhJgpgSPaeGgM9J4 X-Received: by 2002:a05:6214:2aae:b0:570:bf43:47a with SMTP id js14-20020a0562142aae00b00570bf43047amr26281533qvb.1.1678879743562; Wed, 15 Mar 2023 04:29:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678879743; cv=none; d=google.com; s=arc-20160816; b=FjrM+DgzjiA1OoN5LYOhiBwJWsLAWyAj4cPg1RXlPGiCCkdlnH6L8hwIyDTE3VYD3a 1jRKyFo1mx/9ob8hsExqMxGcP9zzEg3F1U0qQdOVNj0GgdngSauisiS3zxZ89oc40U/Y QVM8RKyx5ZaPYRgTNCTWmEaPSwC/eRmlU3Gk/WukXs8v27wNkFvARakZ6n8g9APrGPA2 JLnPAovu8F7O0jH+/fLYno7cLezC04W8fKOwNhd2YbDXxRrnAjtX0qYEz+sVG2eIo0LY YYAID5ld19n2sIlHBcIm0LMF6Z5UxYHHcVvzVfacWOcbvaM1uAWiy5VL1l5hQRhN6XZi ODkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=oX+4WVRTZ/A60BsfczwaSyEZb6MFjgWYIiyhESBHbIM=; b=xn4PM2h1RP2HkMXgPGOebraxYYsV2/sA8xeorfw8wTVLtAf5UJTNjmTlShKbAQLd7B +URKhGC0RNQNpqr4RUBtPGp5QLFe8spzxN/MWw5moQ+LYMgNDZQ/n2+37bhLsijvaTQG nO1LJ4TLq5gacu5vErcNwSdpeH8z8HXY4Su5ofasHqPZng572bIDb1il3eLlpLdhyJ+w I1Zfjg5Fof/TZfwl3AHPmvYQjw1RQXAxrCNtv0We6fq7irwbokyYbL4ATBIRrLHvo6SH yYdVh8vyHAFRk+B2EGe5PqCFr7zyCnEFcmoO8why/W/flhaRAVZxZqcCEZcbq6hU4iWs M1dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ua1l5znL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k5-20020a0cb245000000b005a225f9142fsi4255305qve.39.2023.03.15.04.29.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Mar 2023 04:29:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ua1l5znL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcPIo-00047a-4x; Wed, 15 Mar 2023 07:28:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcPIn-00047N-Gl for qemu-devel@nongnu.org; Wed, 15 Mar 2023 07:28:17 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pcPIm-0000Jy-0S for qemu-devel@nongnu.org; Wed, 15 Mar 2023 07:28:17 -0400 Received: by mail-wm1-x329.google.com with SMTP id m18-20020a05600c3b1200b003ed2a3d635eso948685wms.4 for ; Wed, 15 Mar 2023 04:28:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678879694; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=oX+4WVRTZ/A60BsfczwaSyEZb6MFjgWYIiyhESBHbIM=; b=Ua1l5znLet+FBlokXXG9RXLNiMYrjdZROjrXYB8iCowjcwPzMcYop7VcTuwMGYqSZ1 Fmmo7e3Nb08TRpF4Ht+Z6cQbVmIacXDQYpO8kBi0nKBmDeEL5/yn0zK74sDNdS58rEaM u6j5WDd2iyi0G5I597F7zThZBuq3snsZlTEynOrTqZ4wdPCyP8VeXBYN7M4ga5DdJyTq 53ci3OafFq/F5SCmwBR9/CWqdyfqYpBjR1/EIcVm/bDdchiZ7o88JbgNhMYs4KcxLIWy eYo5HEtZfoEtX397KArf6PvJcGzTyuow+43NGYtYRW6JbixzzUjx0Qv5GA/2hw09uoWi bAZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678879694; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oX+4WVRTZ/A60BsfczwaSyEZb6MFjgWYIiyhESBHbIM=; b=cBSBk+dWFdZVYNPSqr9Lrliic14xPxkkP13atQ8PFD4D5ele6+/var3PpyIwvedqtk Sdlzxkm2Nl/rUtQW0TXweX+0NqpApwpO5ihh75qzeI6DDj+0OJdXwx5j+8g2bo/tVKms iyMJsppGz4qRFKHKQPUTtzzJiRaKmEfeI9N83cGjmCkjWas5h80fwcmr2Qeky8Hmn3e8 etjfnp0BBrEBXzc/5ZO94SrSivQB8dd0oVzyiDEzEc/Px8DdL0CiVvYzMEZ6v5bMPtUJ el4sTb3WF3PHNqOvhtQlj7AozqdkTBSq5SNAcAmavvSerADAooY/X++DxkaL7p0BkuZK G61Q== X-Gm-Message-State: AO0yUKVF0uorJCYOs6ZDSPb0N3hX/ajGRrGvkO1kBV6vJkv4o3yTyzLA gC9hKJPXVOL6aQqa16oRyr8k/nCikVbyI5C0a/kn1g== X-Received: by 2002:a05:600c:1912:b0:3ed:2217:4636 with SMTP id j18-20020a05600c191200b003ed22174636mr10275601wmq.19.1678879693990; Wed, 15 Mar 2023 04:28:13 -0700 (PDT) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id k3-20020a7bc403000000b003ed1f69c967sm1623017wmi.9.2023.03.15.04.28.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Mar 2023 04:28:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , Pavel Dovgalyuk , "Dr. David Alan Gilbert" , Michael Roth , Stefan Berger , Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Juan Quintela , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 0/3] qapi: Simplify enum generation Date: Wed, 15 Mar 2023 12:28:08 +0100 Message-Id: <20230315112811.22355-1-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org QAPI generating enum count as part of the enum forces handling impossible switch cases. Modify qapi/types.py to generate the enum count as a definition. Do not try to cover the unreachable 'default' case. Clean files covering unreachable foo__MAX case. Since v2: - Post correct branch generating empty foo-qapi-emit-events.h Since v1: - Update documentation (Markus) - Do not generate empty enums (Markus) - Collect R-b tags Philippe Mathieu-Daudé (3): scripts/git.orderfile: Display QAPI script changes before schema ones qapi: Do not generate empty enum qapi: Generate enum count as definition docs/devel/qapi-code-gen.rst | 10 +++++----- scripts/qapi/events.py | 2 ++ scripts/qapi/schema.py | 5 ++++- scripts/qapi/types.py | 13 +++++++++---- scripts/qapi/visit.py | 2 -- audio/audio_template.h | 3 --- audio/audio.c | 6 ------ migration/migration.c | 2 -- replay/replay-input.c | 12 ------------ softmmu/tpm-hmp-cmds.c | 2 -- ui/input-linux.c | 4 ---- ui/input.c | 6 ------ scripts/git.orderfile | 2 ++ 13 files changed, 22 insertions(+), 47 deletions(-)