From nobody Tue Nov 18 07:20:14 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608170163; cv=none; d=zohomail.com; s=zohoarc; b=k/0W4F0iwbY1DAn5caDYJDgNshjj8ZgAOLaozOyfZLP4Wn9EHqLeKyFL3dkKjac0lh8VjtHxh3j+qyK5zODushveUKOG72Xtxv2piTn5v1VlIO2btUZiXwKBuJnUQcxos7G/dwh9OSlNHt9v/5U7KsrB555H3zsaflZUex0+pgQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608170163; 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=xWHrqcMBEOU3yRruC4x1dukbTB5q97mV7cjAg3LUICI=; b=nzWqP4KzSrmcEBhqtnTu+dzlCEp8gGrVCgZHmZQD42/lW//7T2udahM3ypMfskQYD3nPohQZAvPehxpVuUZlh6WqAo+t6ktjlw5dXwrrC86ox6eRHGJtK0DDT/n+sgDMx8XrZ5+wbh4tmwGRYFga7myu81wOn6e5brw5mcDG+Rs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16081701636951019.1333223885232; Wed, 16 Dec 2020 17:56:03 -0800 (PST) Received: from localhost ([::1]:57786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpiWQ-0005Tc-IF for importer@patchew.org; Wed, 16 Dec 2020 20:56:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpiUK-0003rR-Tu for qemu-devel@nongnu.org; Wed, 16 Dec 2020 20:53:52 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54862) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kpiUI-0006I5-98 for qemu-devel@nongnu.org; Wed, 16 Dec 2020 20:53:52 -0500 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-47-pfCUZ9_hM0arisbLAZOKrQ-1; Wed, 16 Dec 2020 20:53:46 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B674D1005513 for ; Thu, 17 Dec 2020 01:53:45 +0000 (UTC) Received: from scv.redhat.com (ovpn-112-131.rdu2.redhat.com [10.10.112.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18CA260CC4; Thu, 17 Dec 2020 01:53:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608170028; 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=xWHrqcMBEOU3yRruC4x1dukbTB5q97mV7cjAg3LUICI=; b=dKkQLdvlTXBKdUVQjfPUvP5GkW62m0wXN9BjHKMb9LsdFP4Y99V/Kr56dNNLIwcXiekN8l PP1/qX3td5zwjC9gLDj4m6QB5ut3PtBzQ8J7mzAyYQVPCykQNyPHe5O3kRC8U2WdQ5E85Z LZZpc3CDOkPXUoPY2LalsOG7PC2TYbA= X-MC-Unique: pfCUZ9_hM0arisbLAZOKrQ-1 From: John Snow To: Markus Armbruster , qemu-devel@nongnu.org Subject: [PATCH v3 01/13] qapi/introspect.py: assert schema is not None Date: Wed, 16 Dec 2020 20:53:31 -0500 Message-Id: <20201217015343.196279-2-jsnow@redhat.com> In-Reply-To: <20201217015343.196279-1-jsnow@redhat.com> References: <20201217015343.196279-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.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, 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_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Snow , Eduardo Habkost , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The introspect visitor is stateful, but expects that it will have a schema to refer to. Add assertions that state this. Signed-off-by: John Snow --- scripts/qapi/introspect.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index fafec94e022..43ab4be1f77 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -147,6 +147,8 @@ def _name(self, name): return self._name_map[name] =20 def _use_type(self, typ): + assert self._schema is not None + # Map the various integer types to plain int if typ.json_type() =3D=3D 'int': typ =3D self._schema.lookup_type('int') @@ -225,6 +227,8 @@ def visit_alternate_type(self, name, info, ifcond, feat= ures, variants): def visit_command(self, name, info, ifcond, features, arg_type, ret_type, gen, success_response, boxed, allow_oob, allow_preconfig, coroutine): + assert self._schema is not None + arg_type =3D arg_type or self._schema.the_empty_object_type ret_type =3D ret_type or self._schema.the_empty_object_type obj =3D {'arg-type': self._use_type(arg_type), @@ -234,6 +238,7 @@ def visit_command(self, name, info, ifcond, features, self._gen_tree(name, 'command', obj, ifcond, features) =20 def visit_event(self, name, info, ifcond, features, arg_type, boxed): + assert self._schema is not None arg_type =3D arg_type or self._schema.the_empty_object_type self._gen_tree(name, 'event', {'arg-type': self._use_type(arg_type= )}, ifcond, features) --=20 2.26.2