From nobody Mon Feb 9 04:45:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1770402869; cv=none; d=zohomail.com; s=zohoarc; b=ajPmUiyhgUGAJHB744fXbnyoc8j+erd6yB6UrJC2hyLNX2UwPFdKANf1OVg7clU5tnfj5BC7tfUuZs44LG8/disXVyZJOWbse1Nqd/qPxi/tc9jm53JUH7Bo0RJg/U4681/Y1Bp8rQITAgkE+YMcla76S3AHJVKYfKuUkeBFBIo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770402869; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=0WP1hDN2GiBQQCENMDIU9gE1WXcimiqfj8rnfWDEsbg=; b=iC4pwATvzM2MEx3AkpBipQzgAhnFM3klmKiM3Jktcvtf+rRr6Mfl84o4pGAum2+x19gTeHL/3x+41Dgmu16V7Np0Ani2vKhkGQdW8U5aGnDboe24SfnHyPcgnPu196EQCkfnNg1Gj0BJ2v9TP68FMZcMph/KKO1W7W0aB78Gdpk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1770402869616630.3074546749203; Fri, 6 Feb 2026 10:34:29 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 0A63341B41; Fri, 6 Feb 2026 13:34:29 -0500 (EST) Received: from [172.19.199.6] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id B4A9641B71; Fri, 6 Feb 2026 13:33:36 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 3196E4180E; Fri, 6 Feb 2026 13:33:30 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 8D8F341AEE for ; Fri, 6 Feb 2026 13:28:13 -0500 (EST) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-611-gx-iypPzMD2Xb5NQGPQO5w-1; Fri, 06 Feb 2026 13:28:11 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B5405180057E for ; Fri, 6 Feb 2026 18:28:10 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.3]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 050AE18003F6 for ; Fri, 6 Feb 2026 18:28:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770402493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0WP1hDN2GiBQQCENMDIU9gE1WXcimiqfj8rnfWDEsbg=; b=hg1meFNUv6XMEVt/lwvI0EQdqtYwXCtCz9rkO6tqNug6wnvu/93wUaaXkxFCSM2fHzCU7N R1QBHxU/kiemGkDsm/7E/GotomERhm4N+8Y8B8rHs6g1Tge3tsrgtnWalPSDrNLx+7Zz+W IKFdlp/CANqwVV/+Dck9RMede5bENJw= X-MC-Unique: gx-iypPzMD2Xb5NQGPQO5w-1 X-Mimecast-MFC-AGG-ID: gx-iypPzMD2Xb5NQGPQO5w_1770402490 To: devel@lists.libvirt.org Subject: [PATCH 1/5] virQEMUQAPISchemaTraverseObject: Consider features also on current members Date: Fri, 6 Feb 2026 19:28:03 +0100 Message-ID: <44db690de97f07332ecb52acf9779d82b19e1390.1770397360.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: f4OhsEA992xCcdyxCD0x_puiRqCxRp8VMz9w0aCOZ08_1770402490 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: LN7ONEXFHJQDUKU2HZFWWJBTTHQ6JORG X-Message-ID-Hash: LN7ONEXFHJQDUKU2HZFWWJBTTHQ6JORG X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1770402872855154100 Content-Type: text/plain; charset="utf-8" From: Peter Krempa The 'features' to check can be also on the entry in the 'members' array of an object type. We wouldn't check that because we'd only check if the type of the member has any features. While the query language is flawed in the way that the user can't specify if they want to check features of the member rather than the type we work it around by checking both and returing if either of them matches. Signed-off-by: Peter Krempa --- src/qemu/qemu_qapi.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/qemu/qemu_qapi.c b/src/qemu/qemu_qapi.c index a2fef55019..e2b1904bf5 100644 --- a/src/qemu/qemu_qapi.c +++ b/src/qemu/qemu_qapi.c @@ -107,6 +107,24 @@ virQEMUQAPISchemaTraverseContextNextQuery(struct virQE= MUQAPISchemaTraverseContex } +/** + * virQEMUQAPISchemaTraverseContextHasNextQueryFeatures: + * @ctxt: query context + * + * If the next query is a feature query returns it without advancing the q= uery + * state in the context. + */ +static const char * +virQEMUQAPISchemaTraverseContextHasNextQueryFeatures(struct virQEMUQAPISch= emaTraverseContext *ctxt) +{ + if (!ctxt->queries[0] || + *ctxt->queries[0] !=3D '$') + return NULL; + + return ctxt->queries[0] + 1; +} + + static bool virQEMUQAPISchemaTraverseContextHasNextQuery(struct virQEMUQAPISchemaTrave= rseContext *ctxt) { @@ -178,11 +196,19 @@ virQEMUQAPISchemaTraverseObject(virJSONValue *cur, if (modifier =3D=3D '+') { obj =3D virQEMUQAPISchemaObjectGet("variants", query, "case", cur); } else { + const char *featuresquery; + obj =3D virQEMUQAPISchemaObjectGet("members", query, "name", cur); if (modifier =3D=3D '*' && obj && !virJSONValueObjectHasKey(obj, "default")) return 0; + + /* checks if the member itself has features, because if not we also + * need to check the subsequent object */ + if ((featuresquery =3D virQEMUQAPISchemaTraverseContextHasNextQuer= yFeatures(ctxt)) && + virQEMUQAPISchemaTraverseHasObjectFeature(featuresquery, obj) = =3D=3D 1) + return 1; } if (!obj) --=20 2.53.0