From nobody Mon Feb 9 20:35:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1632552994; cv=none; d=zohomail.com; s=zohoarc; b=TkdmfjpMgoYas3VvLofdhYG1HA4WXuaUHEyjed3EOgnNG/KxSBxKkD25xfaVExcwa1QYGw08UcxPJGbnJQ6b2mQfQwcYVk+8gVIBWGFlJmhO9681VIkLBHMv/kBvmESf/Fz2HjunHw+KVywxkMO/z/p3fpaX/oUKv9iQwAhKdPc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632552994; 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=weyYZfucGiF64O4W9klgiTmYJQUzYM1zB2uRvK+hDwc=; b=ivb8SzPy7YMc9OgEcBtBjaGWh8FDDcE1/AzI9jOjY3Su938zMbVHNo3Da6ylDoD74KYl2cY0O+jDYSg8h6DeC19j5anEO4JpxYuoYLk4Um1JexY5Z19IKFIktmCet2tyAohd59iXnwKE0Yd7+h0tqzvyE4IvYtnNnZ7/bzWIwX0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1632552994656376.8828175310107; Fri, 24 Sep 2021 23:56:34 -0700 (PDT) Received: from localhost ([::1]:36034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU1bt-0007gW-JF for importer@patchew.org; Sat, 25 Sep 2021 02:56:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU18C-0007k0-KR for qemu-devel@nongnu.org; Sat, 25 Sep 2021 02:25:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:42549) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU183-0007Lq-77 for qemu-devel@nongnu.org; Sat, 25 Sep 2021 02:25:52 -0400 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-471-_WzeMmRvMK-pTTYke80spQ-1; Sat, 25 Sep 2021 02:25:36 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6C60E362FD; Sat, 25 Sep 2021 06:25:35 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-14.ams2.redhat.com [10.36.112.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1C2DB5FC25; Sat, 25 Sep 2021 06:25:35 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5914311380CC; Sat, 25 Sep 2021 08:25:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632551140; 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=weyYZfucGiF64O4W9klgiTmYJQUzYM1zB2uRvK+hDwc=; b=hRN5h9ulywzjgSjCVoCpv0iDMUy1VX6VPHgsUw2ZZRUDkAC7ihjXt1Y7SF0jdB0K9C+Yfo xJ5gozlvE+o2Vugnys34mTKP2vm/7422KJgi+J/MszRNRof/jaKbxF9QWrCvAHpwYmv1Le ltgzVxJoQCT9gnTDNL8wra7hed1hnZM= X-MC-Unique: _WzeMmRvMK-pTTYke80spQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 19/25] tests/qapi-schema: Drop simple union __org.qemu_x-Union1 Date: Sat, 25 Sep 2021 08:25:19 +0200 Message-Id: <20210925062525.988405-20-armbru@redhat.com> In-Reply-To: <20210925062525.988405-1-armbru@redhat.com> References: <20210925062525.988405-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@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=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.473, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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: peter.maydell@linaro.org, Eric Blake Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1632552995869100001 Content-Type: text/plain; charset="utf-8" Replace simple union __org.qemu_x-Union1 with flat union __org.qemu_x-Union2, except drop it from __org.qemu_x-command, because there it's only used to pull it into QMP. Now drop the unused -Union1, and rename -Union2 to -Union. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20210917143134.412106-20-armbru@redhat.com> --- tests/unit/test-qmp-cmds.c | 16 +++++----------- tests/qapi-schema/qapi-schema-test.json | 8 +++----- tests/qapi-schema/qapi-schema-test.out | 18 +++++------------- 3 files changed, 13 insertions(+), 29 deletions(-) diff --git a/tests/unit/test-qmp-cmds.c b/tests/unit/test-qmp-cmds.c index 83c9ef5b7c..faa858624a 100644 --- a/tests/unit/test-qmp-cmds.c +++ b/tests/unit/test-qmp-cmds.c @@ -127,22 +127,16 @@ void qmp_boxed_empty(Empty1 *arg, Error **errp) { } =20 -__org_qemu_x_Union1 *qmp___org_qemu_x_command(__org_qemu_x_EnumList *a, - __org_qemu_x_StructList *b, - __org_qemu_x_Union2 *c, - __org_qemu_x_Alt *d, - Error **errp) +void qmp___org_qemu_x_command(__org_qemu_x_EnumList *a, + __org_qemu_x_StructList *b, + __org_qemu_x_Union *c, + __org_qemu_x_Alt *d, + Error **errp) { - __org_qemu_x_Union1 *ret =3D g_new0(__org_qemu_x_Union1, 1); - - ret->type =3D ORG_QEMU_X_UNION1_KIND___ORG_QEMU_X_BRANCH; - ret->u.__org_qemu_x_branch.data =3D strdup("blah1"); - /* Also test that 'wchar-t' was munged to 'q_wchar_t' */ if (b && b->value && !b->value->has_q_wchar_t) { b->value->q_wchar_t =3D 1; } - return ret; } =20 =20 diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/qa= pi-schema-test.json index ef17ab1aae..20f4cc0cfa 100644 --- a/tests/qapi-schema/qapi-schema-test.json +++ b/tests/qapi-schema/qapi-schema-test.json @@ -202,11 +202,10 @@ 'data': { '__org.qemu_x-member1': '__org.qemu_x-Enum' } } { 'struct': '__org.qemu_x-Struct', 'base': '__org.qemu_x-Base', 'data': { '__org.qemu_x-member2': 'str', '*wchar-t': 'int' } } -{ 'union': '__org.qemu_x-Union1', 'data': { '__org.qemu_x-branch': 'str' }= } { 'alternate': '__org.qemu_x-Alt1', 'data': { '__org.qemu_x-branch': 'str'= } } { 'struct': '__org.qemu_x-Struct2', - 'data': { 'array': ['__org.qemu_x-Union1'] } } -{ 'union': '__org.qemu_x-Union2', 'base': '__org.qemu_x-Base', + 'data': { 'array': ['__org.qemu_x-Union'] } } +{ 'union': '__org.qemu_x-Union', 'base': '__org.qemu_x-Base', 'discriminator': '__org.qemu_x-member1', 'data': { '__org.qemu_x-value': '__org.qemu_x-Struct2' } } { 'alternate': '__org.qemu_x-Alt', @@ -214,8 +213,7 @@ { 'event': '__ORG.QEMU_X-EVENT', 'data': '__org.qemu_x-Struct' } { 'command': '__org.qemu_x-command', 'data': { 'a': ['__org.qemu_x-Enum'], 'b': ['__org.qemu_x-Struct'], - 'c': '__org.qemu_x-Union2', 'd': '__org.qemu_x-Alt' }, - 'returns': '__org.qemu_x-Union1' } + 'c': '__org.qemu_x-Union', 'd': '__org.qemu_x-Alt' } } =20 # test 'if' condition handling =20 diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/qap= i-schema-test.out index 07e4161331..9337adc9ea 100644 --- a/tests/qapi-schema/qapi-schema-test.out +++ b/tests/qapi-schema/qapi-schema-test.out @@ -215,21 +215,13 @@ object __org.qemu_x-Struct base __org.qemu_x-Base member __org.qemu_x-member2: str optional=3DFalse member wchar-t: int optional=3DTrue -object q_obj_str-wrapper - member data: str optional=3DFalse -enum __org.qemu_x-Union1Kind - member __org.qemu_x-branch -object __org.qemu_x-Union1 - member type: __org.qemu_x-Union1Kind optional=3DFalse - tag type - case __org.qemu_x-branch: q_obj_str-wrapper alternate __org.qemu_x-Alt1 tag type case __org.qemu_x-branch: str -array __org.qemu_x-Union1List __org.qemu_x-Union1 +array __org.qemu_x-UnionList __org.qemu_x-Union object __org.qemu_x-Struct2 - member array: __org.qemu_x-Union1List optional=3DFalse -object __org.qemu_x-Union2 + member array: __org.qemu_x-UnionList optional=3DFalse +object __org.qemu_x-Union base __org.qemu_x-Base tag __org.qemu_x-member1 case __org.qemu_x-value: __org.qemu_x-Struct2 @@ -243,9 +235,9 @@ array __org.qemu_x-StructList __org.qemu_x-Struct object q_obj___org.qemu_x-command-arg member a: __org.qemu_x-EnumList optional=3DFalse member b: __org.qemu_x-StructList optional=3DFalse - member c: __org.qemu_x-Union2 optional=3DFalse + member c: __org.qemu_x-Union optional=3DFalse member d: __org.qemu_x-Alt optional=3DFalse -command __org.qemu_x-command q_obj___org.qemu_x-command-arg -> __org.qemu_= x-Union1 +command __org.qemu_x-command q_obj___org.qemu_x-command-arg -> None gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse object TestIfStruct member foo: int optional=3DFalse --=20 2.31.1