From nobody Thu Nov 13 23:24:13 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583253373; cv=none; d=zohomail.com; s=zohoarc; b=i5uoyTXM5OyQRNVm/dqctwTBYPsn8DI5GrnbcmIJsEMPxsUUENNSgRjdamVSsfjQwORILAGP2XN+FDRRqVb3k5bs6Val5EsYhSewMY9upbCjtnr1uDTuG0MhOw7XYlB4GlkUWyihEo/7li4nvj1pblnI/KOVAJ8r7oonSLn4FJI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583253373; h=Content-Type: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=WoIdsE0RIv5QLHQTPQ68t8HQ4FzsBgYcB5RaRipKZQI=; b=Zt91kXhI8yccKNbb9ZvEXzDeVz6Ttanzc1QMXDj3fdLQQXKgQT0BJ/HqDcujr/E6ucP0mul51Gl2+dXvloFrafkme/QEXcOcsMz9tDPujyViXVTl+sWNiQjwfirwFKDhUq08K6H+PeMxlqC7EUnHF7nenNCvWrn0vZoNKk26QzU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 158325337327936.086471822706926; Tue, 3 Mar 2020 08:36:13 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-473-r_-JRHWrNT6e8J-on894oQ-1; Tue, 03 Mar 2020 11:36:02 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id E52441005512; Tue, 3 Mar 2020 16:35:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B0C405DA60; Tue, 3 Mar 2020 16:35:54 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4CAAA86A1B; Tue, 3 Mar 2020 16:35:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 023GZEtn001263 for ; Tue, 3 Mar 2020 11:35:14 -0500 Received: by smtp.corp.redhat.com (Postfix) id B631E73879; Tue, 3 Mar 2020 16:35:14 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-129.ams2.redhat.com [10.36.116.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C3F5A73883; Tue, 3 Mar 2020 16:35:13 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id EE3D211329C0; Tue, 3 Mar 2020 17:35:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583253372; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=WoIdsE0RIv5QLHQTPQ68t8HQ4FzsBgYcB5RaRipKZQI=; b=OCWcoedwXexf3EePyf8L9q8OUnPhRoOKKDgmH2pLedXmQRcaG8mFt26+YfvPZneOyusIUF 60fdISlmGztl0LvyDxj3HM8/NZPnw6v8Nqx6F/HPV6hjzq4aYoc+lXJ7aid6T9xVIll9jE b5zCaGfE+HZ+4GjrNYLBWFuyyIlV0EM= X-MC-Unique: r_-JRHWrNT6e8J-on894oQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 19/30] qapi/schema: Call QAPIDoc.connect_member() in just one place Date: Tue, 3 Mar 2020 17:34:54 +0100 Message-Id: <20200303163505.32041-20-armbru@redhat.com> In-Reply-To: <20200303163505.32041-1-armbru@redhat.com> References: <20200303163505.32041-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The .connect_doc() of classes that have QAPISchemaMember connect them to their documentation. Change them to delegate the actual work to new QAPISchemaMember.connect_doc(). Matches the .connect_doc() that already exist. Signed-off-by: Markus Armbruster --- scripts/qapi/schema.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py index 3065f8e14d..8368745a3e 100644 --- a/scripts/qapi/schema.py +++ b/scripts/qapi/schema.py @@ -252,9 +252,8 @@ class QAPISchemaEnumType(QAPISchemaType): def connect_doc(self, doc=3DNone): super().connect_doc(doc) doc =3D doc or self.doc - if doc: - for m in self.members: - doc.connect_member(m) + for m in self.members: + m.connect_doc(doc) =20 def is_implicit(self): # See QAPISchema._make_implicit_enum_type() and ._def_predefineds() @@ -396,11 +395,10 @@ class QAPISchemaObjectType(QAPISchemaType): def connect_doc(self, doc=3DNone): super().connect_doc(doc) doc =3D doc or self.doc - if doc: - if self.base and self.base.is_implicit(): - self.base.connect_doc(doc) - for m in self.local_members: - doc.connect_member(m) + if self.base and self.base.is_implicit(): + self.base.connect_doc(doc) + for m in self.local_members: + m.connect_doc(doc) =20 @property def ifcond(self): @@ -496,9 +494,8 @@ class QAPISchemaAlternateType(QAPISchemaType): def connect_doc(self, doc=3DNone): super().connect_doc(doc) doc =3D doc or self.doc - if doc: - for v in self.variants.variants: - doc.connect_member(v) + for v in self.variants.variants: + v.connect_doc(doc) =20 def c_type(self): return c_name(self.name) + pointer_suffix @@ -627,6 +624,10 @@ class QAPISchemaMember: % (self.describe(info), seen[cname].describe(info))) seen[cname] =3D self =20 + def connect_doc(self, doc): + if doc: + doc.connect_member(self) + def describe(self, info): role =3D self.role defined_in =3D self.defined_in --=20 2.21.1