From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 99277ECAAA1 for ; Thu, 15 Sep 2022 20:55:24 +0000 (UTC) Received: from localhost ([::1]:48368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oYvtL-0001bw-MN for qemu-devel@archiver.kernel.org; Thu, 15 Sep 2022 16:55:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYvhp-0001si-Qd for qemu-devel@nongnu.org; Thu, 15 Sep 2022 16:43:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:52019) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYvhl-0000IE-PW for qemu-devel@nongnu.org; Thu, 15 Sep 2022 16:43:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663274605; 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=o5xlrULRUTTLntIsAm65ESEShAmX1Y2AoZZRUYgPyKM=; b=IXLzWbSMS6e2C3TNidDDwUXTsgMORm7T4hZmV+dQMsNQm1pSZGxZiFJJVmLgqZyvZ7HAHj 7OxgzAbdwnfMNeEaMgbg/UN8wLkcQNP7JqNo5wu9MznOgQNxUZiSZPjGzb9jVOLqUhDvT7 arIRJt31ByWD96et6pqqcYGS8K27TIs= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-474-D5YZ31yxNquFdg3jyh905g-1; Thu, 15 Sep 2022 16:43:23 -0400 X-MC-Unique: D5YZ31yxNquFdg3jyh905g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 998A63C0D866; Thu, 15 Sep 2022 20:43:23 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.163]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 731D140C2086; Thu, 15 Sep 2022 20:43:23 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id EEF0021E66CB; Thu, 15 Sep 2022 22:43:17 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: michael.roth@amd.com, jsnow@redhat.com, eblake@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 11/27] qapi dump: Elide redundant has_FOO in generated C Date: Thu, 15 Sep 2022 22:43:01 +0200 Message-Id: <20220915204317.3766007-12-armbru@redhat.com> In-Reply-To: <20220915204317.3766007-1-armbru@redhat.com> References: <20220915204317.3766007-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/dump.json. Said commit explains the transformation in more detail. The invariant violations mentioned there do not occur here. Cc: Marc-André Lureau Signed-off-by: Markus Armbruster --- dump/dump.c | 4 ++-- scripts/qapi/schema.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index 4d9658ffa2..326a9ae542 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -1845,8 +1845,8 @@ static void dump_process(DumpState *s, Error **errp) result = qmp_query_dump(NULL); /* should never fail */ assert(result); - qapi_event_send_dump_completed(result, !!*errp, (*errp ? - error_get_pretty(*errp) : NULL)); + qapi_event_send_dump_completed(result, + *errp ? error_get_pretty(*errp) : NULL); qapi_free_DumpQueryResult(result); dump_cleanup(s); diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py index e9550ff410..2cdea9b3b6 100644 --- a/scripts/qapi/schema.py +++ b/scripts/qapi/schema.py @@ -759,7 +759,6 @@ def need_has(self): assert self.type # Temporary hack to support dropping the has_FOO in reviewable chunks opt_out = [ - 'qapi/dump.json', 'qapi/job.json', 'qapi/machine.json', 'qapi/machine-target.json', -- 2.37.2