From nobody Sun Nov 29 02:11:46 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1795687425; cv=none; d=zohomail.com; s=zohoarc; b=ZZjFRrFWIM1OtWWA6vH3Uulx82StqHw2nxcjHdPlmuHvzv1tCV0LId0+If6StpA2FM1/Z3rqO0xwWmngpq91MwUv44cz060SRi6CnMPuPttz/rhZr3VQ3gGFHTsUoPhprbvn9xhM/lCyVrWKMs+xVVFhgF5OWEcwKIDD8jSGNpg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795687425; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Mnm9T/zEm0iir37/YCGp69BBGTlSTjr86ajA1Xx+e6s=; b=ggNfFLWNuMsmkQxw4WexpoOotbjVCVfI+AWFySSSQVTNy792wqVtVWwOSghyDyCZKQJEZZEIQ35cMkQH5zNJZgiKMSYHThAVFE79klsOLfhfXdU7mhjy4Pok3x692JvtsnBlGfO6MI2Bkl1Re+webXqVxgQWoegCOUvRBZebqkc= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1795687425487711.4139623270702; Thu, 26 Nov 2026 02:03:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xWWIz-0008Mz-DK; Thu, 26 Nov 2026 05:02:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xWWIX-00087z-VQ for qemu-devel@nongnu.org; Thu, 26 Nov 2026 05:01:51 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xWWIV-0006gS-Cw for qemu-devel@nongnu.org; Thu, 26 Nov 2026 05:01:48 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-648-38lMm_8YOiG4J4r64Qz8Ig-1; Thu, 26 Nov 2026 10:01:43 +0000 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9C154195606E; Thu, 26 Nov 2026 10:01:42 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 32AA5410; Thu, 26 Nov 2026 10:01:42 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id BBAB421E692D; Thu, 26 Nov 2026 11:01:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795687305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Mnm9T/zEm0iir37/YCGp69BBGTlSTjr86ajA1Xx+e6s=; b=fv9vlJLSxXgwyxvPOdjG364V1BKf7XfpPVIPbRkr0huwQ2/Dgqi6mFgDKw5xbyhRi14mPS CS1m8CS05sj7Qdn2X6/CmzhdzP1OQAJ+z4S1OiKqm2E0aPgNiesGffVwKmaVuwlDbA9eQR SoLtbNQSGHR6xCiwBt7jn7gXv2l178M= X-MC-Unique: 38lMm_8YOiG4J4r64Qz8Ig-1 X-Mimecast-MFC-AGG-ID: 38lMm_8YOiG4J4r64Qz8Ig_1795687302 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com, jsnow@redhat.com, crosa@redhat.com, eblake@redhat.com, devel@lists.libvirt.org Subject: [PATCH 01/16] util: Move QMP command query-command-line-options back to util/ Date: Thu, 26 Nov 2026 11:01:24 +0100 Message-ID: <20261126100139.3557890-2-armbru@redhat.com> In-Reply-To: <20261126100139.3557890-1-armbru@redhat.com> References: <20261126100139.3557890-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=lists1p.gnu.org; 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: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1795687427494158500 Content-Type: text/plain; charset="utf-8" Commit 3df4c28860e1 (util/qemu-config: Extract QMP commands to qemu-config-qmp.c) extracted it from util/qemu-config.c so we don't link it into user emulation binaries. Good. It also moved it from util/ to monitor/. Not good; it's not about the monitor. Move it back. Signed-off-by: Markus Armbruster --- monitor/qemu-config-qmp.c =3D> util/qemu-config-qmp-cmds.c | 0 monitor/meson.build | 1 - util/meson.build | 3 ++- 3 files changed, 2 insertions(+), 2 deletions(-) rename monitor/qemu-config-qmp.c =3D> util/qemu-config-qmp-cmds.c (100%) diff --git a/monitor/qemu-config-qmp.c b/util/qemu-config-qmp-cmds.c similarity index 100% rename from monitor/qemu-config-qmp.c rename to util/qemu-config-qmp-cmds.c diff --git a/monitor/meson.build b/monitor/meson.build index f67e0291a42..ea3600d78cf 100644 --- a/monitor/meson.build +++ b/monitor/meson.build @@ -2,7 +2,6 @@ qmp_ss.add(files('monitor.c', 'qmp.c', 'qmp-cmds-control.c'= )) =20 system_ss.add(files( 'fds.c', - 'qemu-config-qmp.c', 'qmp-cmds.c', )) =20 diff --git a/util/meson.build b/util/meson.build index fa174c07a57..e02b3a16221 100644 --- a/util/meson.build +++ b/util/meson.build @@ -42,7 +42,8 @@ util_ss.add(files('cacheflush.c')) util_ss.add(files('error.c', 'error-report.c')) util_ss.add(files('qemu-print.c')) util_ss.add(files('id.c')) -util_ss.add(files('qemu-config.c', 'notify.c')) +util_ss.add(files('qemu-config.c', 'qemu-config-qmp-cmds.c')) +util_ss.add(files('notify.c')) util_ss.add(files('qemu-option.c', 'qemu-progress.c')) util_ss.add(files('keyval.c')) util_ss.add(files('crc32.c')) --=20 2.55.0 From nobody Sun Nov 29 02:11:46 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1795687392; cv=none; d=zohomail.com; s=zohoarc; b=YNVAeyLi+/EBwLVifnyDrF6KOVFvS/sf7xBFZsGKRU4MqvAupZFSJKJrc/vz2/t7ZBZQp3K6YpN3+0bDey33ctBGS03pvc2YuQPA0qesYnH5u8Zxp/BGc8kzSRtp1si9ygFMAEqdFb3x4x0OEIVtCQ/HwNMaxQRNtrvMRWEOF7Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795687392; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TzyxYu8uVV1fpCrdtPKqxBSDBIi7L38YQ2ichJzx/20=; b=F4gFBGIAEMT+YxJd9BM9X8gneBiDewvatGWHmFJuB/m1exta0fdpMcyjDJ8HL1Y9ZR5oXvZuhARHcJvgaI/R95uvTVDslC33QwqstNm32cewpbpA/+imHLG7oaPFFx6cKsg193MhMx58+cRn5cnRZ1FGo+zC/bFbDldvBHmP4D4= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1795687392610881.1970195016669; Thu, 26 Nov 2026 02:03:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xWWIg-0008CN-H1; Thu, 26 Nov 2026 05:01:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xWWIZ-000883-IQ for qemu-devel@nongnu.org; Thu, 26 Nov 2026 05:01:51 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xWWIX-0006gn-MB for qemu-devel@nongnu.org; Thu, 26 Nov 2026 05:01:51 -0500 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-185-c0AyTD32Od-7ooBTUTWw5g-1; Thu, 26 Nov 2026 10:01:43 +0000 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 8ED5018004BB; Thu, 26 Nov 2026 10:01:42 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 365361956086; Thu, 26 Nov 2026 10:01:42 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id BFBE321E6880; Thu, 26 Nov 2026 11:01:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795687307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TzyxYu8uVV1fpCrdtPKqxBSDBIi7L38YQ2ichJzx/20=; b=LVMuNjUlcJh77N1KapdepEflCod2dwQBiCcUesShb2NegREuhDigaM7gHudQ5YuFvjq0ut P8kECl1bKAAgkShhFZUUPz5F5tAiautqZF2eyFrBbwk+7kjFo4c5JrjLIxBZTMOoGKmqUf moInoKrHie39wnz+T15OlOmG9THKrAM= X-MC-Unique: c0AyTD32Od-7ooBTUTWw5g-1 X-Mimecast-MFC-AGG-ID: c0AyTD32Od-7ooBTUTWw5g_1795687302 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com, jsnow@redhat.com, crosa@redhat.com, eblake@redhat.com, devel@lists.libvirt.org Subject: [PATCH 02/16] util: Wean query-command-line-options off ObjectProperty member @type Date: Thu, 26 Nov 2026 11:01:25 +0100 Message-ID: <20261126100139.3557890-3-armbru@redhat.com> In-Reply-To: <20261126100139.3557890-1-armbru@redhat.com> References: <20261126100139.3557890-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.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, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1795687393217158501 Content-Type: text/plain; charset="utf-8" ObjectProperty member @type comes from object_property_try_add() / object_class_property_add() parameter @type. The former's function comment calls it "pretty loosely defined". This lack of discipline has turned out to be problematic. I'm replacing it step by step. query-command-line-options derives CommandLineParameterInfo member @type from it for class properties of machine types. Derive from @qapi_type instead, which is rigorously defined. The type of qemu-system-ppc64 machine parameter "cap-hpt-max-page-size" changes from "number" to "size", because @type is "int", whereas @qapi_type is &size_type_info. Small improvement. Signed-off-by: Markus Armbruster --- util/qemu-config-qmp-cmds.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/util/qemu-config-qmp-cmds.c b/util/qemu-config-qmp-cmds.c index a680c9feca5..e0038628f97 100644 --- a/util/qemu-config-qmp-cmds.c +++ b/util/qemu-config-qmp-cmds.c @@ -98,16 +98,17 @@ static CommandLineParameterInfoList *get_drive_infolist= (void) =20 static CommandLineParameterInfo *objprop_to_cmdline_prop(ObjectProperty *p= rop) { + const QAPITypeInfo *qt =3D prop->qapi_type; CommandLineParameterInfo *info; =20 info =3D g_malloc0(sizeof(*info)); info->name =3D g_strdup(prop->name); =20 - if (g_str_equal(prop->type, "bool") || g_str_equal(prop->type, "OnOffA= uto")) { + if (g_str_equal(qt->name, "bool") || g_str_equal(qt->name, "OnOffAuto"= )) { info->type =3D COMMAND_LINE_PARAMETER_TYPE_BOOLEAN; - } else if (g_str_equal(prop->type, "int")) { + } else if (g_str_equal(qt->name, "int")) { info->type =3D COMMAND_LINE_PARAMETER_TYPE_NUMBER; - } else if (g_str_equal(prop->type, "size")) { + } else if (g_str_equal(qt->name, "size")) { info->type =3D COMMAND_LINE_PARAMETER_TYPE_SIZE; } else { info->type =3D COMMAND_LINE_PARAMETER_TYPE_STRING; --=20 2.55.0 From nobody Sun Nov 29 02:11:46 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1795687392; cv=none; d=zohomail.com; s=zohoarc; b=CJrbdH1yuvVDBehr7G5L7Tnz+VzbW4LdILRmi+50exIEpS69dJNP1jRyezpr5rCcsIQ4UU7uzlG3YihQ7EpCAM1rWjWuJyjCf+nz/lx06yn67is945Opo3Wo7byfjpoH6VWyMK287z7grWkLASN5d4djTJd3jDtDnS7l1OkvPLU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795687392; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DV/d15BZpUunzO7kVEd/L7J/IZu/UnsgC05Um/SXIHM=; b=lFODRukDL5rH2VzZ1/ZvSCBUS5VpDse9INLZYan/sLpnpGLwHKbqy23weJAtw5eu4ACD7kgOCBPi31PCbbwe/XlEUX4HNTSrVr55R76jrmG7V7pvwuZAjlfQdMTUHCOYcgTxAtMdTxg7SDDiEhnl6Pns3zioec1+pOaKr6G+3SU= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1795687392479719.6060182729279; Thu, 26 Nov 2026 02:03:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xWWIp-0008IV-Uk; Thu, 26 Nov 2026 05:02:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xWWIb-00088y-2L for qemu-devel@nongnu.org; Thu, 26 Nov 2026 05:01:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xWWIX-0006gp-O3 for qemu-devel@nongnu.org; Thu, 26 Nov 2026 05:01:52 -0500 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-498-80hbLoZENQ25X-wTt_1o8Q-1; Thu, 26 Nov 2026 10:01:43 +0000 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 92C3618005BE; Thu, 26 Nov 2026 10:01:42 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 278B71801976; Thu, 26 Nov 2026 10:01:42 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C3C2921E6882; Thu, 26 Nov 2026 11:01:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795687307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DV/d15BZpUunzO7kVEd/L7J/IZu/UnsgC05Um/SXIHM=; b=YaEBfhxOqr2py1W/v4dnla6llo/uRl6kyaOSTEUD2Xg+i14JjVZoX613NVKZBTXrIzTGlK DQ+mO4Ray9O70hKQ0KNH8FiBhU4PxrDaVZAbJpO9Md0AUpMh7SgNig34FK0vlQdDJ7DWpJ +fv7VhepTDPVwORqYxFyoRqduRTIDd0= X-MC-Unique: 80hbLoZENQ25X-wTt_1o8Q-1 X-Mimecast-MFC-AGG-ID: 80hbLoZENQ25X-wTt_1o8Q_1795687302 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com, jsnow@redhat.com, crosa@redhat.com, eblake@redhat.com, devel@lists.libvirt.org Subject: [PATCH 03/16] monitor: Fix query-command-line-options for -machine integer parameters Date: Thu, 26 Nov 2026 11:01:26 +0100 Message-ID: <20261126100139.3557890-4-armbru@redhat.com> In-Reply-To: <20261126100139.3557890-1-armbru@redhat.com> References: <20261126100139.3557890-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists1p.gnu.org; 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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1795687393217158500 Content-Type: text/plain; charset="utf-8" query-command-line-options derives the parameters of -machine from machine type class properties. The code maps property types "bool", "OnOffAuto", "int", and "size" to CommandLineParameterTypes "bool", "number", and "size". Any other property type becomes "string". This includes all the other integer types. The obvious fix would be code to map all the integer types to "number". But there's an easier one: all the integer types have the same masked name "int". So use that. This fixes the type of several parameters of -machine: * qemu-system-aarch64 and -arm: virtio-mmio-transports * qemu-system-hexagon: subsystem-base * qemu-system-x86_64 and -i386: pci-mmio-high-base pci-mmio-size pci-intx-irq-base pci-ecam-size pci-ecam-base pci-mmio-high-size ram-low-size ram-low-base pci-mmio-base ram-high-size ram-high-base bus-lock-ratelimit * qemu-system-riscv64 and -riscv32: signature-granularity * qemu-system-risc64: clint-timebase-frequency Signed-off-by: Markus Armbruster --- util/qemu-config-qmp-cmds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/qemu-config-qmp-cmds.c b/util/qemu-config-qmp-cmds.c index e0038628f97..f1a6cde56bd 100644 --- a/util/qemu-config-qmp-cmds.c +++ b/util/qemu-config-qmp-cmds.c @@ -106,10 +106,10 @@ static CommandLineParameterInfo *objprop_to_cmdline_p= rop(ObjectProperty *prop) =20 if (g_str_equal(qt->name, "bool") || g_str_equal(qt->name, "OnOffAuto"= )) { info->type =3D COMMAND_LINE_PARAMETER_TYPE_BOOLEAN; - } else if (g_str_equal(qt->name, "int")) { - info->type =3D COMMAND_LINE_PARAMETER_TYPE_NUMBER; } else if (g_str_equal(qt->name, "size")) { info->type =3D COMMAND_LINE_PARAMETER_TYPE_SIZE; + } else if (g_str_equal(qt->masked_name, "int")) { + info->type =3D COMMAND_LINE_PARAMETER_TYPE_NUMBER; } else { info->type =3D COMMAND_LINE_PARAMETER_TYPE_STRING; } --=20 2.55.0 From nobody Sun Nov 29 02:11:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; 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 38.145.34.151 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=1795687572; cv=none; d=zohomail.com; s=zohoarc; b=gWm80i9p7f+5vTX2ZcbQ73tdcWVrTfe6mHKKNhxrRtQ5qaWbFUIHYuHlzG1HadFpt/C9jCbnoi0grrmb2vaztqvxZYngRHD5vrWFS5wMjO3jT4HK2Cs/lsT3n+FFQR8lf0jy/UkoeCqpy78XQMqSJM7niLb+x9Zmgr3q8XSFmeg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795687572; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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:Subject:Subject:To:To:Message-Id; bh=RzXps0Qjiq+RYHERQ+HmU/uz4fv27Tb+Tqf6uDAG4N4=; b=YrSwKZ/c2lNGu7p4HBmYgyhQdz/NuROABea/8vnSOpXI2Y8ZnY9Hnu1ugiOjVouaHBYR6qP2KewJ7l0Daul9AvSo95xJEGjFppez13YoC261zAfGP5k7SNc+UVxHkNAxxCymL5KDJGoC/6ckdoRZQ9KXsxXqxS2Go0MrmW2ygl0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 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 [38.145.34.151]) by mx.zohomail.com with SMTPS id 1795687572424352.566195776163; Thu, 26 Nov 2026 02:06:12 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id D9F46419F3; Thu, 26 Nov 2026 05:06:10 -0500 (EST) Received: from [172.19.199.28] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 2AE3F418A4; Thu, 26 Nov 2026 05:02:16 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id DB56E417E6; Thu, 26 Nov 2026 05:01:49 -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 4E94141806 for ; Thu, 26 Nov 2026 05:01:46 -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-577-OWnFJ-GYN2SMtukLsUV-og-1; Thu, 26 Nov 2026 10:01:43 +0000 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 A23431800358; Thu, 26 Nov 2026 10:01:42 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 492B31800286; Thu, 26 Nov 2026 10:01:42 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C84F921E6883; Thu, 26 Nov 2026 11:01:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_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=1795687305; 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=RzXps0Qjiq+RYHERQ+HmU/uz4fv27Tb+Tqf6uDAG4N4=; b=Du+PoykctLRk++asydotDtc9zmCl/pVWU8YxTlLpwU0gjNmk3/hzkvioxRC/4AjNbNHx5F Xo2RpGaXHnAyik5e8mUaDKfL8/mpHF1ipIRDW/TDJLE3yOo/IQkxnbwPsJAFGQ3VOaeSei +N7jRNmjv+5UBr6be8CFYB/UZ4VrRiw= X-MC-Unique: OWnFJ-GYN2SMtukLsUV-og-1 X-Mimecast-MFC-AGG-ID: OWnFJ-GYN2SMtukLsUV-og_1795687302 To: qemu-devel@nongnu.org Subject: [PATCH 04/16] qom: New ObjectProperty member @qom_type Date: Thu, 26 Nov 2026 11:01:27 +0100 Message-ID: <20261126100139.3557890-5-armbru@redhat.com> In-Reply-To: <20261126100139.3557890-1-armbru@redhat.com> References: <20261126100139.3557890-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-MFC-PROC-ID: QNrT4SJoWsl83gWm7DVA3JInt9-vIlDh6LkcE147p_M_1795687302 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: PL3PFAMJDACLB3BO7FE7IGJS5GATDIRN X-Message-ID-Hash: PL3PFAMJDACLB3BO7FE7IGJS5GATDIRN X-MailFrom: armbru@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 CC: marcandre.lureau@redhat.com, pbonzini@redhat.com, jsnow@redhat.com, crosa@redhat.com, eblake@redhat.com, devel@lists.libvirt.org 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: Markus Armbruster via Devel Reply-To: Markus Armbruster X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1795687572822158500 Content-Type: text/plain; charset="utf-8"; x-default="true" ObjectProperty member @type is "child" for a child property of QOM type T, and "link" for a link property of QOM type T. We parse @type in various places to extract "is child?", "is link?", and "T". Undesirable. Add member @qom_type. It is is "T" when @type is "child" or "link", else null. The next commits will use it to get rid of the parsing. Signed-off-by: Markus Armbruster --- include/qom/object.h | 1 + qom/object.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/qom/object.h b/include/qom/object.h index 70d8ea3e299..c8cedfe0f89 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -93,6 +93,7 @@ struct ObjectProperty char *type; char *description; const QAPITypeInfo *qapi_type; + char *qom_type; ObjectPropertyAccessor *get; ObjectPropertyAccessor *set; ObjectPropertyResolve *resolve; diff --git a/qom/object.c b/qom/object.c index 9276b7a4351..3c5a8f49154 100644 --- a/qom/object.c +++ b/qom/object.c @@ -331,6 +331,7 @@ static void object_property_free(gpointer data) } g_free(prop->name); g_free(prop->type); + g_free(prop->qom_type); g_free(prop->description); g_free(prop); } @@ -1905,6 +1906,7 @@ ObjectProperty * object_property_try_add_child(Object *obj, const char *name, Object *child, Error **errp) { + const char *qom_type =3D object_get_typename(child); g_autofree char *type =3D NULL; ObjectProperty *op; =20 @@ -1912,7 +1914,7 @@ object_property_try_add_child(Object *obj, const char= *name, child, child->class->type->name); assert(!child->parent); =20 - type =3D g_strdup_printf("child<%s>", object_get_typename(child)); + type =3D g_strdup_printf("child<%s>", qom_type); =20 op =3D object_property_try_add(obj, name, type, &str_type_info, object_get_child_property, @@ -1921,6 +1923,7 @@ object_property_try_add_child(Object *obj, const char= *name, if (!op) { return NULL; } + op->qom_type =3D g_strdup(qom_type); op->resolve =3D object_resolve_child_property; object_ref(child); child->parent =3D obj; @@ -2114,6 +2117,7 @@ object_add_link_prop(Object *obj, const char *name, check ? object_set_link_property : NULL, object_release_link_property, prop); + op->qom_type =3D g_strdup(type); op->resolve =3D object_resolve_link_property; return op; } @@ -2152,6 +2156,7 @@ object_class_property_add_link(ObjectClass *oc, object_release_link_property, prop); =20 + op->qom_type =3D g_strdup(type); op->resolve =3D object_resolve_link_property; =20 g_free(full_type); @@ -3105,6 +3110,7 @@ object_property_add_alias(Object *obj, const char *na= me, property_set_alias, property_release_alias, prop); + op->qom_type =3D g_strdup(target_prop->qom_type); op->resolve =3D property_resolve_alias; if (target_prop->defval) { op->defval =3D qobject_ref(target_prop->defval); @@ -3150,6 +3156,7 @@ object_class_property_add_alias(ObjectClass *klass, c= onst char *name, property_set_alias, property_release_alias, prop); + op->qom_type =3D g_strdup(target_prop->qom_type); op->resolve =3D property_resolve_alias; if (target_prop->defval) { op->defval =3D qobject_ref(target_prop->defval); --=20 2.55.0 From nobody Sun Nov 29 02:11:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; 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 38.145.34.151 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=1795688578; cv=none; d=zohomail.com; s=zohoarc; b=Mw+UTBjRruJI/fV3nzbj1s76a8rwX6kI9Iw7uyw+7By1vRpB1jY9bExxtBnbUarjoto5tbcnjEh7R9b6L7eaA9zuWukrs7izL7pqoNaEJ29aMw4z7OlF/rIOo0C/qza8lgjq82gTBC0DMh2KqBgjmzotlJqiJPCfhP6sNsW+aS4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795688578; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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:Subject:Subject:To:To:Message-Id; bh=mQ5/lhRKF1dUF6GR87xfTGLG6v/MKuGoUF5eKUhmPXI=; b=J1l/nEE/viGPKx6JJMoI7f+/5WqspNlklZAb8p5nkTDhe0JiMGzsH5nfSs4fFPj0KxHfYtEYbXijA+HTY8C3zr/nTj2ol1XKfhxcBkhu7EPEtKc23NcoUQORl74xs8WrwvfwfxSbet9mT2AIf1Xn4B8I1v0Txd5znBkDH8/DGrc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 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 [38.145.34.151]) by mx.zohomail.com with SMTPS id 1795688578107263.25964808826313; Thu, 26 Nov 2026 02:22:58 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 836BE41AC6; Thu, 26 Nov 2026 05:22:56 -0500 (EST) Received: from [172.19.199.28] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 2AA914418E; Thu, 26 Nov 2026 05:03:42 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id E4E434183E; Thu, 26 Nov 2026 05:01:55 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 086DD3F88B for ; Thu, 26 Nov 2026 05:01:54 -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-48-b1RktcfmP0-YbEqI2YJjTw-1; Thu, 26 Nov 2026 10:01:46 +0000 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 71D5B180061C; Thu, 26 Nov 2026 10:01:45 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 280D71801971; Thu, 26 Nov 2026 10:01:45 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id CC90321E6884; Thu, 26 Nov 2026 11:01:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_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=1795687314; 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=mQ5/lhRKF1dUF6GR87xfTGLG6v/MKuGoUF5eKUhmPXI=; b=YkHq/2o0yCengZCIAqBmc/usjGuspwOmFnRMep297eWLN3QbRcnYszyCp8XkxnLu+7yu2M XOLyNy5rXxTYalDVuqNREUPRbzY1qSmIbIcGfczupMM6Tj+k3PNxdVbRJ/m+azcpGZQZ8/ GbSbJxrUIlnzSiqEjtbQ/Kwb7AU8LIk= X-MC-Unique: b1RktcfmP0-YbEqI2YJjTw-1 X-Mimecast-MFC-AGG-ID: b1RktcfmP0-YbEqI2YJjTw_1795687305 To: qemu-devel@nongnu.org Subject: [PATCH 05/16] qom: Inline object_property_get_type() into its only caller Date: Thu, 26 Nov 2026 11:01:28 +0100 Message-ID: <20261126100139.3557890-6-armbru@redhat.com> In-Reply-To: <20261126100139.3557890-1-armbru@redhat.com> References: <20261126100139.3557890-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-MFC-PROC-ID: i22aZ_jg1ceR-fpojUuARA5plZ8PZ1ehSTUb55BZlYU_1795687305 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: H2KPNRX35FV3VV6T4X7E45SBSPAFP7XF X-Message-ID-Hash: H2KPNRX35FV3VV6T4X7E45SBSPAFP7XF X-MailFrom: armbru@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 CC: marcandre.lureau@redhat.com, pbonzini@redhat.com, jsnow@redhat.com, crosa@redhat.com, eblake@redhat.com, devel@lists.libvirt.org 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: Markus Armbruster via Devel Reply-To: Markus Armbruster X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1795688579716158500 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Markus Armbruster --- include/qom/object.h | 11 ----------- qom/object.c | 13 ++----------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index c8cedfe0f89..dbfc29a2d6a 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1616,17 +1616,6 @@ bool object_property_parse(Object *obj, const char *= name, char *object_property_print(Object *obj, const char *name, bool human, Error **errp); =20 -/** - * object_property_get_type: - * @obj: the object - * @name: the name of the property - * @errp: returns an error if this function fails - * - * Returns: The type name of the property. - */ -const char *object_property_get_type(Object *obj, const char *name, - Error **errp); - /** * object_get_root: * diff --git a/qom/object.c b/qom/object.c index 3c5a8f49154..47e5979aa06 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1802,16 +1802,6 @@ out: return string; } =20 -const char *object_property_get_type(Object *obj, const char *name, Error = **errp) -{ - ObjectProperty *prop =3D object_property_find_err(obj, name, errp); - if (prop =3D=3D NULL) { - return NULL; - } - - return prop->type; -} - static const char *const root_containers[] =3D { "audiodevs", "chardevs", @@ -2024,7 +2014,8 @@ static Object *object_resolve_link(Object *obj, const= char *name, g_autofree char *target_type =3D NULL; =20 /* Go from link to FOO. */ - type =3D object_property_get_type(obj, name, NULL); + ObjectProperty *prop =3D object_property_find_err(obj, name, NULL); + type =3D prop ? prop->type : NULL; target_type =3D g_strndup(&type[5], strlen(type) - 6); return object_resolve_and_typecheck(path, name, target_type, errp); } --=20 2.55.0 From nobody Sun Nov 29 02:11:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; 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 38.145.34.151 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=1795687868; cv=none; d=zohomail.com; s=zohoarc; b=H7ubyr+LK6YwmIKzgdYfy54dS3Mucjx1yHhAH6zM4ENzNSaGw/EZlw0DOadjTsC2mhqLD6rfFQMK0rXiboLFZZm/TP8DPyyn0J45spUqM6uiqe9rwerlECHB1n6Br83IMyTwQMkusm/XHX6fSwt42zfwWz5v3DBzKfWaAZsT7M8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795687868; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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:Subject:Subject:To:To:Message-Id; bh=H8ZfPsTzlEywQxBFFKzUXoUyMAcXG+LYbi1mqOz0UqU=; b=IqfUMbTCfmBrsw0SLcNkxMFR9mwZLGDP7mDdONs3eQOP6ALHuX/Zry/7PCIV9kxeovHJL66YBStoXgjSW+dXQNmECpAvdxscxe3fs6zSs5YHWBpReQ4HuPWU2C/Sx4z4JrdGmhr3+cpcWCvvjjSITYksL3npRsbOo6KxSrwy4Ac= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 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 [38.145.34.151]) by mx.zohomail.com with SMTPS id 1795687868325426.42098528585734; Thu, 26 Nov 2026 02:11:08 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id BEE4B417CE; Thu, 26 Nov 2026 05:11:06 -0500 (EST) Received: from [172.19.199.28] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 8D12B41AC2; Thu, 26 Nov 2026 05:02:47 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id D953241808; Thu, 26 Nov 2026 05:01:50 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 1EF91417E6 for ; Thu, 26 Nov 2026 05:01:50 -0500 (EST) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-654-EykYhh2ePDqnOxsS9YR2yg-1; Thu, 26 Nov 2026 10:01:46 +0000 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7582F1955EBF; Thu, 26 Nov 2026 10:01:45 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2C2A018011D9; Thu, 26 Nov 2026 10:01:45 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D090C21E6885; Thu, 26 Nov 2026 11:01:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,SPF_HELO_PASS autolearn=no autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795687309; 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=H8ZfPsTzlEywQxBFFKzUXoUyMAcXG+LYbi1mqOz0UqU=; b=D58bjkXJwab6qcjVWK/Mv4g/RhG9ePGH39vlvtpsavXU3KHebfzUp8ZmYKRYkoDcCeyZTi kAR1IF6yI+gvJW/EiZk3G8GLmjDVLKVVIzRaNKd9bbBcaTV4JvwAxJuW/E2DaV+gE7NNGt M9OyYIE4GxXm1RQ8hwvTkPMtRGw3tYc= X-MC-Unique: EykYhh2ePDqnOxsS9YR2yg-1 X-Mimecast-MFC-AGG-ID: EykYhh2ePDqnOxsS9YR2yg_1795687305 To: qemu-devel@nongnu.org Subject: [PATCH 06/16] qom: Simplify object_resolve_link() Date: Thu, 26 Nov 2026 11:01:29 +0100 Message-ID: <20261126100139.3557890-7-armbru@redhat.com> In-Reply-To: <20261126100139.3557890-1-armbru@redhat.com> References: <20261126100139.3557890-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-MFC-PROC-ID: d2C1f8fdmbBXJhiJyzIdeNl9BqfHul7eG1cgNiqr3OU_1795687305 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: CBCQRO43TLCZWZISLIZSKY3VON24NXAE X-Message-ID-Hash: CBCQRO43TLCZWZISLIZSKY3VON24NXAE X-MailFrom: armbru@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 CC: marcandre.lureau@redhat.com, pbonzini@redhat.com, jsnow@redhat.com, crosa@redhat.com, eblake@redhat.com, devel@lists.libvirt.org 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: Markus Armbruster via Devel Reply-To: Markus Armbruster X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1795687869519158500 Content-Type: text/plain; charset="utf-8"; x-default="true" object_resolve_link() finds the property, then extracts the QOM type from its member @type. @type must be like "link", or else the extraction produces crap, and may read beyond the buffer. This is actually ensured by the users of object_set_link_property(). Simpler: use new member @qom_type instead. Signed-off-by: Markus Armbruster --- qom/object.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/qom/object.c b/qom/object.c index 47e5979aa06..14fd2f3d17e 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2010,14 +2010,10 @@ Object *object_resolve_and_typecheck(const char *pa= th, const char *name, static Object *object_resolve_link(Object *obj, const char *name, const char *path, Error **errp) { - const char *type; - g_autofree char *target_type =3D NULL; + ObjectProperty *prop =3D object_property_find(obj, name); =20 - /* Go from link to FOO. */ - ObjectProperty *prop =3D object_property_find_err(obj, name, NULL); - type =3D prop ? prop->type : NULL; - target_type =3D g_strndup(&type[5], strlen(type) - 6); - return object_resolve_and_typecheck(path, name, target_type, errp); + assert(prop->qom_type); + return object_resolve_and_typecheck(path, name, prop->qom_type, errp); } =20 static void object_set_link_property(Object *obj, Visitor *v, --=20 2.55.0 From nobody Sun Nov 29 02:11:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; 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 38.145.34.151 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=1795688028; cv=none; d=zohomail.com; s=zohoarc; b=Lcy6yK3ID/tu0ZIC1xSEpfOfMmSyctsY4Lc1NTHPLkqC07fR8PBSNt6A19i3JIt3qck7VFOf0mPQw8/yRfddfsYlTmJifft1mql9AYmKCBheub+kwRQMBeChAEgVnPlAhjrai5z9UZLijFe/0G12vqvGB2Q5JRZIgQd0i6d+UkI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795688028; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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:Subject:Subject:To:To:Message-Id; bh=ZUBHAV54AlQADW1hv60F+klj20fKlP5u49sNMJhN0Ts=; b=CgEme5VHwSq5Mb5t0YswMvA7EFsH50kWwSj1Mtufqf5NxsYIR6v2oWpNPFjpY/LkHjS3Ztxu9noq04c1JLBMRO8QM2Kl93ob1Vzj/9XD64We6Du+d0nV9mYhoMj7yaSRaC+8w/k6MZrZ9/1BYGyu9hrtwFxnFLcLDijSSpEzU64= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 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 [38.145.34.151]) by mx.zohomail.com with SMTPS id 1795688028685484.4195096889281; Thu, 26 Nov 2026 02:13:48 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id DB21D41B5D; Thu, 26 Nov 2026 05:13:46 -0500 (EST) Received: from [172.19.199.28] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id E89D541C9E; Thu, 26 Nov 2026 05:02:56 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 92C2041807; Thu, 26 Nov 2026 05:01:51 -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 C4CA941806 for ; Thu, 26 Nov 2026 05:01:50 -0500 (EST) Received: from mx-prod-mc-08.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-353-IiYwYf0kP5GNOVtl7qEmDA-1; Thu, 26 Nov 2026 10:01:46 +0000 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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B20931800679; Thu, 26 Nov 2026 10:01:45 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6F5F41801A67; Thu, 26 Nov 2026 10:01:45 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D48A621E6886; Thu, 26 Nov 2026 11:01:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_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=1795687310; 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=ZUBHAV54AlQADW1hv60F+klj20fKlP5u49sNMJhN0Ts=; b=hk5eQMvJ7CMAGjlB7hnyKQ8Au0c9LxWHDfoM1VbnSQNN3psvVotc1hipCQJztB6StWt64E 9rdYruiYTVksai9BGjuF9awPZbqQuWzFx7YwSWvbCktOr6CSYtuFayUAScOqECQEbOK3Ec SeGQH2MQo29MGEVPSzXIS1SNkE5S/zc= X-MC-Unique: IiYwYf0kP5GNOVtl7qEmDA-1 X-Mimecast-MFC-AGG-ID: IiYwYf0kP5GNOVtl7qEmDA_1795687305 To: qemu-devel@nongnu.org Subject: [PATCH 07/16] qom: Wean "is child?" checks off ObjectProperty member @type Date: Thu, 26 Nov 2026 11:01:30 +0100 Message-ID: <20261126100139.3557890-8-armbru@redhat.com> In-Reply-To: <20261126100139.3557890-1-armbru@redhat.com> References: <20261126100139.3557890-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-MFC-PROC-ID: l6HD1Jq7-hjAecBZWMpuzkUGFIZJAkX-8K1vtryoLyw_1795687305 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 36HKRN5LRDWIIKO5M4YPAEG7DNGDQU6R X-Message-ID-Hash: 36HKRN5LRDWIIKO5M4YPAEG7DNGDQU6R X-MailFrom: armbru@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 CC: marcandre.lureau@redhat.com, pbonzini@redhat.com, jsnow@redhat.com, crosa@redhat.com, eblake@redhat.com, devel@lists.libvirt.org 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: Markus Armbruster via Devel Reply-To: Markus Armbruster X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1795688031012158500 Content-Type: text/plain; charset="utf-8"; x-default="true" object_property_is_child() parses member @type to decide. Check the getter instead. Signed-off-by: Markus Armbruster --- include/qom/object.h | 1 + qom/object.c | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index dbfc29a2d6a..f43b13dfca7 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1886,6 +1886,7 @@ ObjectProperty *object_class_property_add_link(Object= Class *oc, Object *val, Error **errp), ObjectPropertyLinkFlags flags); =20 +bool object_property_is_child(ObjectProperty *prop); /** * object_resolve_and_typecheck: * @path: path to look up diff --git a/qom/object.c b/qom/object.c index 14fd2f3d17e..4a3c2a8f4a6 100644 --- a/qom/object.c +++ b/qom/object.c @@ -589,11 +589,6 @@ void object_initialize_child_internal(Object *parent, &error_abort, NULL); } =20 -static inline bool object_property_is_child(ObjectProperty *prop) -{ - return strstart(prop->type, "child<", NULL); -} - static void object_property_del_all(Object *obj) { g_autoptr(GHashTable) done =3D g_hash_table_new(NULL, NULL); @@ -2159,6 +2154,15 @@ object_property_add_const_link(Object *obj, const ch= ar *name, NULL, OBJ_PROP_LINK_DIRECT); } =20 +bool object_property_is_child(ObjectProperty *prop) +{ + if (prop->get =3D=3D object_get_child_property) { + assert(prop->qom_type); + return true; + } + return false; +} + const char *object_get_canonical_path_component(const Object *obj) { ObjectProperty *prop =3D NULL; --=20 2.55.0 From nobody Sun Nov 29 02:11:46 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1795687390; cv=none; d=zohomail.com; s=zohoarc; b=HagDOTsfwQ5xmNEWz1wXEV9dxgKJVKZnWc0xcEjOIWR9OnZWPlQcw0prU2wK/JzAwdlKfS/V0y2bxAHQ+iRNNk4DgfarXhLqE2YmgHe9iTQZP76i7x1jf3su0B6QgxleiFfTAkgHt8nDSUlQ/oVDWTt1KI5rpMdqbWcu84RCF8g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795687390; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XNi5QXtt2pW5bHpggkU/ytWiBk0ZG0e1pI8kBR7VKYA=; b=gLCMXaJEna2cn9qZW3cl5ThgVIyYUgKwlPH92zQcGe+N2uW3tZPCUWDiRVvfONt8g1D5p2BXtod2zpyCx7cm6hoLiwHKYE4bnDaS/GK6oTnDVRSxgPLBjekbTXXcJWS38/KrCcHq/rbhShHywGs7am0x2Hnb6yC6OZLEWGNj5Qo= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1795687390106303.8233635099691; Thu, 26 Nov 2026 02:03:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xWWIi-0008DO-ON; Thu, 26 Nov 2026 05:02:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xWWIZ-000884-K7 for qemu-devel@nongnu.org; Thu, 26 Nov 2026 05:01:51 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xWWIX-0006h6-MC for qemu-devel@nongnu.org; Thu, 26 Nov 2026 05:01:51 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-353-d-HprILPNi6MO-CkMqzRsw-1; Thu, 26 Nov 2026 10:01:46 +0000 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7A796195604F; Thu, 26 Nov 2026 10:01:45 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 379A23000229; Thu, 26 Nov 2026 10:01:45 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D8AB921E6887; Thu, 26 Nov 2026 11:01:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795687308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XNi5QXtt2pW5bHpggkU/ytWiBk0ZG0e1pI8kBR7VKYA=; b=MmojMnihs3EjsFholQ4Zc6QixDr218JZqAu+o4DlmaFI6PJtAerTcDmjUbNlawiU3sPQa6 cf9mc8Jqd/G+zow7Xfzpj72TgQbENvjlSSHUU7LLIg7tB4C8vJbPrMHz3BNZg9zOW/ctTs QVgf2rPqaZx8HYA8t1kg6fD+y4HUV+8= X-MC-Unique: d-HprILPNi6MO-CkMqzRsw-1 X-Mimecast-MFC-AGG-ID: d-HprILPNi6MO-CkMqzRsw_1795687305 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com, jsnow@redhat.com, crosa@redhat.com, eblake@redhat.com, devel@lists.libvirt.org Subject: [PATCH 08/16] qom: Wean "is link?" checks off ObjectProperty member @type Date: Thu, 26 Nov 2026 11:01:31 +0100 Message-ID: <20261126100139.3557890-9-armbru@redhat.com> In-Reply-To: <20261126100139.3557890-1-armbru@redhat.com> References: <20261126100139.3557890-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 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, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1795687391150158500 Content-Type: text/plain; charset="utf-8" Several functions parse member @type to decide whether it is a link. Use new object_property_is_link() instead. Signed-off-by: Markus Armbruster --- include/qom/object.h | 2 ++ hw/ppc/spapr_drc.c | 4 ++-- qom/object.c | 14 ++++++++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index f43b13dfca7..b394ec642d3 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1887,6 +1887,8 @@ ObjectProperty *object_class_property_add_link(Object= Class *oc, ObjectPropertyLinkFlags flags); =20 bool object_property_is_child(ObjectProperty *prop); +bool object_property_is_link(ObjectProperty *prop); + /** * object_resolve_and_typecheck: * @path: path to look up diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index 7663f232e05..a10410c8ec3 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -882,7 +882,7 @@ int spapr_dt_drc(void *fdt, int offset, Object *owner, = uint32_t drc_type_mask) g_autofree char *drc_name =3D NULL; uint32_t drc_index, drc_power_domain; =20 - if (!strstart(prop->type, "link<", NULL)) { + if (!object_property_is_link(prop)) { continue; } =20 @@ -971,7 +971,7 @@ restart: while ((prop =3D object_property_iter_next(&iter))) { SpaprDrc *drc; =20 - if (!strstart(prop->type, "link<", NULL)) { + if (!object_property_is_link(prop)) { continue; } drc =3D SPAPR_DR_CONNECTOR(object_property_get_link(drc_container, diff --git a/qom/object.c b/qom/object.c index 4a3c2a8f4a6..badc12fe4a8 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2163,6 +2163,14 @@ bool object_property_is_child(ObjectProperty *prop) return false; } =20 +bool object_property_is_link(ObjectProperty *prop) +{ + if (object_property_is_child(prop)) { + return false; + } + return prop->qom_type !=3D NULL; +} + const char *object_get_canonical_path_component(const Object *obj) { ObjectProperty *prop =3D NULL; @@ -3084,8 +3092,7 @@ object_property_add_alias(Object *obj, const char *na= me, &error_abort); =20 if (object_property_is_child(target_prop)) { - prop_type =3D g_strdup_printf("link%s", - target_prop->type + strlen("child")); + prop_type =3D g_strdup_printf("link<%s>", target_prop->qom_type); } else { prop_type =3D g_strdup(target_prop->type); } @@ -3130,8 +3137,7 @@ object_class_property_add_alias(ObjectClass *klass, c= onst char *name, assert(target_prop); =20 if (object_property_is_child(target_prop)) { - prop_type =3D g_strdup_printf("link%s", - target_prop->type + strlen("child")); + prop_type =3D g_strdup_printf("link<%s>", target_prop->qom_type); } else { prop_type =3D g_strdup(target_prop->type); } --=20 2.55.0 From nobody Sun Nov 29 02:11:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; 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 38.145.34.151 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=1795688369; cv=none; d=zohomail.com; s=zohoarc; b=ItLAUz97UwGg+t2zVw7fwD3ZZgMVX29pz6dvJZiUfGmy6IYE+MJv/Pzc4R5Q/m4oLOp5KyfDylkdY0dhXyggjzm1jqOqA85iVsLHMwwXzIAsVr4G/s0pFLSjG43wQgjbhahjKCqpZg2ritj6OjwnubyvoRLvKcEKpzJFoYc17W8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795688369; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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:Subject:Subject:To:To:Message-Id; bh=buEaE1cjDoa+mJGGTmRjCz3HBC/fQsWm0zKeeJBHy3Q=; b=Mc43bxoRZ8OPu4J9mivo+r3+4A48GOI78XXh/95VGhu9laPne1CQy9WSgxNyTkGw8b96ORQhd8arCTBcbd9JT/ds2rtWGO1pFMtGso/PEnuNkp+iE4qtLck6FDVmXVNwijrTAPYdFGKhkUmT/WzV5DVdPB8xkGrFakinkEANrns= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 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 [38.145.34.151]) by mx.zohomail.com with SMTPS id 1795688369686629.2722230499934; Thu, 26 Nov 2026 02:19:29 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id BAAC641BAE; Thu, 26 Nov 2026 05:19:27 -0500 (EST) Received: from [172.19.199.28] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 3DA1943F9E; Thu, 26 Nov 2026 05:03:25 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 772C041804; Thu, 26 Nov 2026 05:01:53 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 A2009417E6 for ; Thu, 26 Nov 2026 05:01:51 -0500 (EST) Received: from mx-prod-mc-08.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-48-_DXQkHRBOb--3GBf7UsiBg-1; Thu, 26 Nov 2026 10:01:46 +0000 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7DAF018007EB; Thu, 26 Nov 2026 10:01:45 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 27DD218004FF; Thu, 26 Nov 2026 10:01:45 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id DCAB621E6888; Thu, 26 Nov 2026 11:01:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_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=1795687310; 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=buEaE1cjDoa+mJGGTmRjCz3HBC/fQsWm0zKeeJBHy3Q=; b=IxuOX93QiPhnk/wKbLB9HulJZvbb9ZWiOtQeg0aBs44oh3qt7U2XRFt0UMBcHh8LgdIMn7 ZmNppyKX+lYl5/K6i9WtkBDG9RP2LX97bXa/Ge/vyl5vaGG+Op7WZfJUPKPBJN5juZA6qt SgsRbwn/9LiefrhhMYyTd7CiI9eFVgE= X-MC-Unique: _DXQkHRBOb--3GBf7UsiBg-1 X-Mimecast-MFC-AGG-ID: _DXQkHRBOb--3GBf7UsiBg_1795687305 To: qemu-devel@nongnu.org Subject: [PATCH 09/16] qom: Extend ObjectPropertyInfo so clients don't have to parse @type Date: Thu, 26 Nov 2026 11:01:32 +0100 Message-ID: <20261126100139.3557890-10-armbru@redhat.com> In-Reply-To: <20261126100139.3557890-1-armbru@redhat.com> References: <20261126100139.3557890-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-MFC-PROC-ID: aaPzGVhlnw954EU0WGzySmYkZMLefWxXTg_LqzayU4I_1795687305 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: MQ2HBSSOMAKPFKSV4UFQIX6P274ID4TV X-Message-ID-Hash: MQ2HBSSOMAKPFKSV4UFQIX6P274ID4TV X-MailFrom: armbru@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 CC: marcandre.lureau@redhat.com, pbonzini@redhat.com, jsnow@redhat.com, crosa@redhat.com, eblake@redhat.com, devel@lists.libvirt.org 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: Markus Armbruster via Devel Reply-To: Markus Armbruster X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1795688372015158500 Content-Type: text/plain; charset="utf-8"; x-default="true" ObjectPropertyInfo member @type is "child" for a child property of QOM type T, and "link" for a link property of QOM type T. Such encoding of information in strings should be avoided in QMP, because it requires clients to parse the strings in addition to parse JSON. Turn ObjectPropertyInfo into a union with discriminator @kind and a variant member @qom-type in branches "child" and "link". This provides the same information unencoded. A later commit will deprecate @type. Signed-off-by: Markus Armbruster --- qapi/qom.json | 48 +++++++++++++++++++++++++++++++++++++++------- qom/qom-qmp-cmds.c | 9 +++++++++ 2 files changed, 50 insertions(+), 7 deletions(-) diff --git a/qapi/qom.json b/qapi/qom.json index cc642c7ba97..ca74b652a0d 100644 --- a/qapi/qom.json +++ b/qapi/qom.json @@ -15,11 +15,33 @@ # *********************** ## =20 +## +# @ObjectPropertyKind: +# +# @child: TODO +# +# @link: TODO +# +# @other: TODO +## +{ 'enum': 'ObjectPropertyKind', + 'data': [ 'child', 'link', 'other' ] } + +## +# @ObjectPropertyQomType: +# +# @qom-type: TODO +## +{ 'struct': 'ObjectPropertyQomType', + 'data': { 'qom-type': 'str' } } + ## # @ObjectPropertyInfo: # # @name: the name of the property # +# @kind: TODO +# # @type: the type of the property. This will typically come in one of # four forms: # @@ -48,12 +70,16 @@ # # Since: 1.2 ## -{ 'struct': 'ObjectPropertyInfo', - 'data': { 'name': 'str', +{ 'union': 'ObjectPropertyInfo', + 'base': { 'name': 'str', + 'kind': 'ObjectPropertyKind', 'type': 'str', 'qapi-type': { 'type': 'str', 'features': [ 'unstable' ] }, '*description': 'str', - '*default-value': 'any' } } + '*default-value': 'any' }, + 'discriminator': 'kind', + 'data': { 'child': 'ObjectPropertyQomType', + 'link': 'ObjectPropertyQomType' } } =20 ## # @ObjectPropertyValue: @@ -106,10 +132,18 @@ # # -> { "execute": "qom-list", # "arguments": { "path": "/chardevs" } } -# <- { "return": [ { "name": "type", "type": "string" }, -# { "name": "parallel0", "type": "child" = }, -# { "name": "serial0", "type": "child" }, -# { "name": "mon0", "type": "child" } = ] } +# <- {"return": [ +# {"name": "type", "kind": "other", "qapi-type": "str", +# "type": "string"}, +# {"name": "parallel0", "kind": "child", "qapi-type": "str", +# "type": "child", +# "qom-type": "chardev-vc"}, +# {"name": "compat_monitor0", "kind": "child", "qapi-type": "st= r", +# "type": "child", +# "qom-type": "chardev-stdio"}, +# {"name": "serial0", "kind": "child", "qapi-type": "str", +# "type": "child", +# "qom-type": "chardev-vc"}]} ## { 'command': 'qom-list', 'data': { 'path': 'str' }, diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c index 84a29590514..2b491caaf7a 100644 --- a/qom/qom-qmp-cmds.c +++ b/qom/qom-qmp-cmds.c @@ -34,6 +34,15 @@ static ObjectPropertyInfo *qom_property_info(ObjectPrope= rty *prop) ObjectPropertyInfo *info =3D g_new0(ObjectPropertyInfo, 1); =20 info->name =3D g_strdup(prop->name); + if (object_property_is_child(prop)) { + info->kind =3D OBJECT_PROPERTY_KIND_CHILD; + info->u.child.qom_type =3D g_strdup(prop->qom_type); + } else if (object_property_is_link(prop)) { + info->kind =3D OBJECT_PROPERTY_KIND_LINK; + info->u.link.qom_type =3D g_strdup(prop->qom_type); + } else { + info->kind =3D OBJECT_PROPERTY_KIND_OTHER; + } info->type =3D g_strdup(prop->type); info->description =3D g_strdup(prop->description); info->default_value =3D qobject_ref(prop->defval); --=20 2.55.0 From nobody Sun Nov 29 02:11:46 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1795687481; cv=none; d=zohomail.com; s=zohoarc; b=C0LnaVJqEDQUB8QMYxGwZHMP98hbBfxojCkAMG/XjZRuL7zZnSk324SJfVB8MPZZfIZblMJh+HKjYM3EiLMYlji7iD7zaJEQVqSf9+W4rx7Edupl8oKdL5z2mZYKRt93e8O6krEjAbWTXsjYuqbHktUvmx4lytKVL3G+42by268= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795687481; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=o/Y9J+gY653yWm4khHHkM3GwOpppYEpcRELiTHXg72I=; b=i6LNJyaQGnxHf4VyT3twmdWw/7iMJem3dhDYM7nLQk1R+1OU5VmNAusCl76Ju/cRuqsFYSctDE3FdvIash+CsOmCnoLQhnNC5gj7ZgDUIir40Q2+K8qdH4eofUqqOU8LN+MioZzxm+/5uSHXJXz+DvPzJVfWTQKVE+bKKhNlQ0w= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1795687481770602.3527201968004; Thu, 26 Nov 2026 02:04:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xWWIi-0008DR-NG; Thu, 26 Nov 2026 05:02:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xWWIc-000899-GO for qemu-devel@nongnu.org; Thu, 26 Nov 2026 05:01:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xWWIZ-0006hV-AE for qemu-devel@nongnu.org; Thu, 26 Nov 2026 05:01:54 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-621-b_3w5KxvORiBFc8cvFiC3w-1; Thu, 26 Nov 2026 10:01:46 +0000 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 88C591955EA1; Thu, 26 Nov 2026 10:01:45 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 43CC730001BE; Thu, 26 Nov 2026 10:01:45 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E0C2621E688A; Thu, 26 Nov 2026 11:01:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795687310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o/Y9J+gY653yWm4khHHkM3GwOpppYEpcRELiTHXg72I=; b=Ls4ZrSsXv8N6ghNNOKl19bnCJzqIAT0xF+bkIVkR3osuXHQNgZzACCdTk8oGyh7do9aS+j KTb7EXZIdOUnWGBQv1usjpVKVAhui9ZuvP8fYxVwRQi51MgYwpsAU9cQqMCjO4fjXfQLAc xXGAqpDjUyI6du69zByY1loSb6rgxUA= X-MC-Unique: b_3w5KxvORiBFc8cvFiC3w-1 X-Mimecast-MFC-AGG-ID: b_3w5KxvORiBFc8cvFiC3w_1795687305 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com, jsnow@redhat.com, crosa@redhat.com, eblake@redhat.com, devel@lists.libvirt.org Subject: [PATCH 10/16] qom: Wean HMP commands off ObjectPropertyInfo member @type Date: Thu, 26 Nov 2026 11:01:33 +0100 Message-ID: <20261126100139.3557890-11-armbru@redhat.com> In-Reply-To: <20261126100139.3557890-1-armbru@redhat.com> References: <20261126100139.3557890-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 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, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1795687483978158500 Content-Type: text/plain; charset="utf-8" Use member @kind instead. Signed-off-by: Markus Armbruster --- qom/qom-hmp-cmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qom/qom-hmp-cmds.c b/qom/qom-hmp-cmds.c index bbf5980332a..52c08c7060b 100644 --- a/qom/qom-hmp-cmds.c +++ b/qom/qom-hmp-cmds.c @@ -211,7 +211,7 @@ void object_del_completion(ReadLineState *rs, int nb_ar= gs, const char *str) while (list) { ObjectPropertyInfo *info =3D list->value; =20 - if (!strncmp(info->type, "child<", 5)) { + if (info->kind =3D=3D OBJECT_PROPERTY_KIND_CHILD) { readline_add_completion_of(rs, str, info->name); } list =3D list->next; --=20 2.55.0 From nobody Sun Nov 29 02:11:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; 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 38.145.34.151 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=1795688107; cv=none; d=zohomail.com; s=zohoarc; b=KJwCd+zlZJMWcBkj4Qrq8ugjK2SzIqm8HAlAV6BZpMPnAq24HGUrRBiezwy/WX4EcgWOz8w+WI71Put2z7VxVvBtxtUM+XF7g7sMsaE2afqvqxbH7yLgEwdR6QATVJhenLmuA3aU9+HhP0dgs1pIZjaIVvBoPEk0QVlswTyyuOM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795688107; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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:Subject:Subject:To:To:Message-Id; bh=sgoE5hergT1p/ZNK1JULh8bOWlKP4+wYeuMAe1n/dZo=; b=ckky01qalWwb3AkHOflYRzHZV2sfQ9DXbmdd8MCXI99/LfLoDLTN7lFDHKHut2LiqAOle5Y8BiyeIP6VGv9SzyuIUB72tudpBChiMX6IN5sCgLq/9oQF/fEvGS35ulWqiz+EK4k+EI+6K6BkW6TGiAHwUNH+Ri+BIueLlt1HpXA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 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 [38.145.34.151]) by mx.zohomail.com with SMTPS id 1795688107285683.8569275758101; Thu, 26 Nov 2026 02:15:07 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 72E38418E0; Thu, 26 Nov 2026 05:15:05 -0500 (EST) Received: from [172.19.199.28] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 6F87641D5D; Thu, 26 Nov 2026 05:03:01 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 04D4141806; Thu, 26 Nov 2026 05:01:51 -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 16987417E7 for ; Thu, 26 Nov 2026 05:01:51 -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-621-C-2K1QWPP6q2pPJXBlDafw-1; Thu, 26 Nov 2026 10:01:46 +0000 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 80AC51800625; Thu, 26 Nov 2026 10:01:45 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3E42A1956086; Thu, 26 Nov 2026 10:01:45 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E4D7421E688B; Thu, 26 Nov 2026 11:01:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_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=1795687310; 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=sgoE5hergT1p/ZNK1JULh8bOWlKP4+wYeuMAe1n/dZo=; b=a1mDpNOXR6EsSfDmkTeJTwp9zYUR81vFPkCc86ebbGI5JKM/w1cEq83QsKjqFsrq8070di oNs5+BCoe50yJQMLhmsJKM7GjO3zmZljKhKsbTtEwGvJ6WkF0WvDrNTLBdjE0InmOc27sb xoBb95a9Te2slSPaC8xp/rHxqYJZjEw= X-MC-Unique: C-2K1QWPP6q2pPJXBlDafw-1 X-Mimecast-MFC-AGG-ID: C-2K1QWPP6q2pPJXBlDafw_1795687305 To: qemu-devel@nongnu.org Subject: [PATCH 11/16] tests: Wean off ObjectPropertyInfo member @type Date: Thu, 26 Nov 2026 11:01:34 +0100 Message-ID: <20261126100139.3557890-12-armbru@redhat.com> In-Reply-To: <20261126100139.3557890-1-armbru@redhat.com> References: <20261126100139.3557890-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-MFC-PROC-ID: KVWTy6KiiTBMJtKIv43ntzglj4qj0FZ9nDquI6nh_Pw_1795687305 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: NSOD6HJVEOYKQ74EDBAVFZVL6OEQNJF2 X-Message-ID-Hash: NSOD6HJVEOYKQ74EDBAVFZVL6OEQNJF2 X-MailFrom: armbru@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 CC: marcandre.lureau@redhat.com, pbonzini@redhat.com, jsnow@redhat.com, crosa@redhat.com, eblake@redhat.com, devel@lists.libvirt.org 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: Markus Armbruster via Devel Reply-To: Markus Armbruster X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1795688109791158500 Content-Type: text/plain; charset="utf-8"; x-default="true" Use members @kind and @qom-type instead. Signed-off-by: Markus Armbruster --- tests/qtest/device-introspect-test.c | 4 ++-- tests/qtest/qom-test.c | 4 ++-- tests/qtest/readconfig-test.c | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/qtest/device-introspect-test.c b/tests/qtest/device-intr= ospect-test.c index f6eca2c8eb7..60afdbbc9d0 100644 --- a/tests/qtest/device-introspect-test.c +++ b/tests/qtest/device-introspect-test.c @@ -120,8 +120,8 @@ static void qom_tree_walk(QTestState *qts, const char *= path, GString *result) =20 QLIST_FOREACH_ENTRY(list, e) { QDict *prop =3D qobject_to(QDict, qlist_entry_obj(e)); - const char *type =3D qdict_get_str(prop, "type"); - if (g_str_has_prefix(type, "child<")) { + const char *kind =3D qdict_get_str(prop, "kind"); + if (!strcmp(kind, "child")) { const char *name =3D qdict_get_str(prop, "name"); children =3D g_list_prepend(children, g_strdup(name)); } diff --git a/tests/qtest/qom-test.c b/tests/qtest/qom-test.c index cf4c6b5add5..6f1e9606c5e 100644 --- a/tests/qtest/qom-test.c +++ b/tests/qtest/qom-test.c @@ -148,8 +148,8 @@ static void test_properties(QTestState *qts, const char= *path, bool recurse) list =3D qobject_to(QList, qdict_get(response, "return")); QLIST_FOREACH_ENTRY(list, entry) { tuple =3D qobject_to(QDict, qlist_entry_obj(entry)); - bool is_child =3D strstart(qdict_get_str(tuple, "type"), "child<",= NULL); - bool is_link =3D strstart(qdict_get_str(tuple, "type"), "link<", N= ULL); + bool is_child =3D !strcmp(qdict_get_str(tuple, "kind"), "child"); + bool is_link =3D !strcmp(qdict_get_str(tuple, "kind"), "link"); =20 if (is_child || is_link) { child_path =3D g_strdup_printf("%s/%s", diff --git a/tests/qtest/readconfig-test.c b/tests/qtest/readconfig-test.c index c6f32a4e144..7e473f98ee0 100644 --- a/tests/qtest/readconfig-test.c +++ b/tests/qtest/readconfig-test.c @@ -132,7 +132,6 @@ static void test_object_available(QObject *res, const c= har *name, ObjectPropertyInfoList *tmp; ObjectPropertyInfo *obj; bool object_available =3D false; - g_autofree char *childtype =3D g_strdup_printf("child<%s>", type); =20 g_assert(res); v =3D qobject_input_visitor_new(res); @@ -144,7 +143,9 @@ static void test_object_available(QObject *res, const c= har *name, g_assert(tmp->value); =20 obj =3D tmp->value; - if (g_str_equal(obj->name, name) && g_str_equal(obj->type, childty= pe)) { + if (g_str_equal(obj->name, name) + && obj->kind =3D=3D OBJECT_PROPERTY_KIND_CHILD + && g_str_equal(obj->u.child.qom_type, type)) { object_available =3D true; break; } --=20 2.55.0 From nobody Sun Nov 29 02:11:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; 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 38.145.34.151 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=1795688253; cv=none; d=zohomail.com; s=zohoarc; b=ecsOFC83BZ06gCZfQPDbNHQ3AcPLVmZqJghwu9Nhg7ZjO4BPoo5kYqmh7QXachhTkQZFB0Beo0kHPImog4qHMARweG3wt7JrrSt5kknaXqQ9l+liyusNt5sD+f5dPuWtuyDtObrPLyeGw/Q+wO7MVGQ4pq2cJLdaD0iLZEzFOIE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795688253; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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:Subject:Subject:To:To:Message-Id; bh=yqzJh37WsjyxtVPYzjGqhYFsN/GVFqINLZr9izjXRjI=; b=N2XdAA37ikhQcSWCK6qX4y99Xm7OErWuWSAmghUFHvLPtNX8xYA5vssONtLprt64OCRd/MV4Rn1m6IrcbvfwHtBuIoxohcpnM22b8jVX971XCehJRpyGs6Zq1Bbt489Hc42qfQxAkZYqUyrCT41r4uGTPXax94j93aOJWlkrGdY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 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 [38.145.34.151]) by mx.zohomail.com with SMTPS id 1795688253041177.56807632730977; Thu, 26 Nov 2026 02:17:33 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 6AD4441B50; Thu, 26 Nov 2026 05:17:31 -0500 (EST) Received: from [172.19.199.28] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 8405B41BA8; Thu, 26 Nov 2026 05:03:16 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id F06BA41804; Thu, 26 Nov 2026 05:01:52 -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 1BA013F88B for ; Thu, 26 Nov 2026 05:01:52 -0500 (EST) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-59-WCNXnGrbPZCUwgMhZwjbTw-1; Thu, 26 Nov 2026 10:01:46 +0000 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8548B1955F7C; Thu, 26 Nov 2026 10:01:45 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3E6F91956087; Thu, 26 Nov 2026 10:01:45 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E8D0621E688D; Thu, 26 Nov 2026 11:01:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,SPF_HELO_PASS autolearn=no autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795687311; 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=yqzJh37WsjyxtVPYzjGqhYFsN/GVFqINLZr9izjXRjI=; b=Wz3LI3pEBsKtb/3yyTZgh80x4oprufxi3J92Dyi5fzC3xPcVhN/jPYu814J9an1aWSOV71 Bh15ng/SrJfFVJKk4nql0ltCmY4DGY2Edw32wK4ofsf1TsbdGQ8uw76Euu4E0nUHogFGsT V8SBHlJ2Q5lH3uAQTqivSvv7wP6yFbA= X-MC-Unique: WCNXnGrbPZCUwgMhZwjbTw-1 X-Mimecast-MFC-AGG-ID: WCNXnGrbPZCUwgMhZwjbTw_1795687305 To: qemu-devel@nongnu.org Subject: [PATCH 12/16] python/qemu: Wean off ObjectPropertyInfo member @type Date: Thu, 26 Nov 2026 11:01:35 +0100 Message-ID: <20261126100139.3557890-13-armbru@redhat.com> In-Reply-To: <20261126100139.3557890-1-armbru@redhat.com> References: <20261126100139.3557890-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-MFC-PROC-ID: Dmh90FpIonWOfJUH0b6x5lgj5EEH_kDx_8hbH5iFjNI_1795687305 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 7YW3XFJ36RDZM5BB6GRSD55YA2QYYJHH X-Message-ID-Hash: 7YW3XFJ36RDZM5BB6GRSD55YA2QYYJHH X-MailFrom: armbru@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 CC: marcandre.lureau@redhat.com, pbonzini@redhat.com, jsnow@redhat.com, crosa@redhat.com, eblake@redhat.com, devel@lists.libvirt.org 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: Markus Armbruster via Devel Reply-To: Markus Armbruster X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1795688255147158500 Content-Type: text/plain; charset="utf-8"; x-default="true" Use members @kind and @qom-type instead. Signed-off-by: Markus Armbruster --- python/qemu/utils/qom_common.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/python/qemu/utils/qom_common.py b/python/qemu/utils/qom_common= .py index e5bae1c7421..8d324f29cc3 100644 --- a/python/qemu/utils/qom_common.py +++ b/python/qemu/utils/qom_common.py @@ -35,11 +35,12 @@ class ObjectPropertyInfo: """ Represents the return type from e.g. qom-list. """ - def __init__(self, name: str, type_: str, + def __init__(self, name: str, kind: str, qom_type: Optional[str], description: Optional[str] =3D None, default_value: Optional[object] =3D None): self.name =3D name - self.type =3D type_ + self.kind =3D kind + self.qom_type =3D qom_type self.description =3D description self.default_value =3D default_value =20 @@ -48,20 +49,20 @@ def make(cls, value: Dict[str, Any]) -> 'ObjectProperty= Info': """ Build an ObjectPropertyInfo from a Dict with an unknown shape. """ - assert value.keys() >=3D {'name', 'type'} - return cls(value['name'], value['type'], + assert value.keys() >=3D {'name', 'kind'} + return cls(value['name'], value['kind'], value.get('qom-type'), value.get('description'), value.get('default-value')) =20 @property def child(self) -> bool: """Is this property a child property?""" - return self.type.startswith('child<') + return self.kind =3D=3D "child" =20 @property def link(self) -> bool: """Is this property a link property?""" - return self.type.startswith('link<') + return self.kind =3D=3D "link" =20 =20 class ObjectPropertyValue: --=20 2.55.0 From nobody Sun Nov 29 02:11:46 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1795687393; cv=none; d=zohomail.com; s=zohoarc; b=TTbJ83vu2tEJm4S0xeq7JPSei4IrYqWwiMUYmsajitpY1o070WgOSm7Gb3Zaf02wCecgNECz3sz2Vda0BO1z1gbCxbnIL+EmGkJ2ajmMVI83eQ1/7TYqV52LBBR1OjzFAz/lAGvm8v314WplNHcWqNUcD2g2sVj2TClwVnvKkC8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795687393; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PHQZfw7/yqiv4DHK6LpdiOeHrxqcdzQGiY4buOVXSkU=; b=VLlDHJT/D3FYcCQDr3jxX2VAbY+/W6aiPcDBJY0oZBUUqSP50ovBekk8JTy8+0KDOeeQ22viLNBxIQ2O+3O0e3n4smfX/LmRdQvAdWFoK2+dbLDInYnsTBcy4A4KTcXy50hrxnJO2a70Rq3w5A2AekVK8Wfjtw4iOmBYYJEbAz4= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1795687393014886.6928500169181; Thu, 26 Nov 2026 02:03:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xWWIp-0008IK-Mc; Thu, 26 Nov 2026 05:02:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xWWIc-00089A-Hf for qemu-devel@nongnu.org; Thu, 26 Nov 2026 05:01:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xWWIZ-0006hh-OU for qemu-devel@nongnu.org; Thu, 26 Nov 2026 05:01:54 -0500 Received: from mx-prod-mc-08.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-621-VoSxaqbbMvWdxrO6V89DZQ-1; Thu, 26 Nov 2026 10:01:46 +0000 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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A4D34180063E; Thu, 26 Nov 2026 10:01:45 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 63DD51801A60; Thu, 26 Nov 2026 10:01:45 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id ECEC521E6890; Thu, 26 Nov 2026 11:01:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795687311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PHQZfw7/yqiv4DHK6LpdiOeHrxqcdzQGiY4buOVXSkU=; b=h3aatKchTj89JqxRLclXQFmFKHiAEIhRLD4P06CMRIbYZpyKn2aSlkfpvZWCSdAL67buG7 GGccusSED/SCtarRvPkun8NDYwyWyCN0UIHWKSkuMFRJkCCLfrqVr6VyQMrl7YQ+HxjmgE 6L6QnXL+Y0x7LLXNwCEAKc9h+Yb/Xtk= X-MC-Unique: VoSxaqbbMvWdxrO6V89DZQ-1 X-Mimecast-MFC-AGG-ID: VoSxaqbbMvWdxrO6V89DZQ_1795687305 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com, jsnow@redhat.com, crosa@redhat.com, eblake@redhat.com, devel@lists.libvirt.org Subject: [PATCH 13/16] qom: Extend ObjectPropertyValue so clients don't have to parse @type Date: Thu, 26 Nov 2026 11:01:36 +0100 Message-ID: <20261126100139.3557890-14-armbru@redhat.com> In-Reply-To: <20261126100139.3557890-1-armbru@redhat.com> References: <20261126100139.3557890-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.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, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1795687393224158500 Content-Type: text/plain; charset="utf-8" ObjectPropertyValue member @type is "child" for a child property of QOM type T, and "link" for a link property of QOM type T. Such encoding of information in strings should be avoided in QMP, because it requires clients to parse the strings in addition to parse JSON. Turn ObjectPropertyValue into a union with discriminator @kind and a variant member @qom-type in branches "child" and "link". This provides the same information unencoded. A later commit will deprecate @type. Signed-off-by: Markus Armbruster --- qapi/qom.json | 12 +++++++++--- qom/qom-qmp-cmds.c | 9 +++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/qapi/qom.json b/qapi/qom.json index ca74b652a0d..0b274787b3f 100644 --- a/qapi/qom.json +++ b/qapi/qom.json @@ -86,6 +86,8 @@ # # @name: the name of the property. # +# @kind: TODO +# # @type: the type of the property, as described in # `ObjectPropertyInfo`. # @@ -101,11 +103,15 @@ # # Since: 10.1 ## -{ 'struct': 'ObjectPropertyValue', - 'data': { 'name': 'str', +{ 'union': 'ObjectPropertyValue', + 'base': { 'name': 'str', + 'kind': 'ObjectPropertyKind', 'type': 'str', 'qapi-type': { 'type': 'str', 'features': [ 'unstable' ] }, - '*value': 'any' } } + '*value': 'any' }, + 'discriminator': 'kind', + 'data': { 'child': 'ObjectPropertyQomType', + 'link': 'ObjectPropertyQomType' } } =20 ## # @ObjectPropertiesValues: diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c index 2b491caaf7a..d2945d1efe0 100644 --- a/qom/qom-qmp-cmds.c +++ b/qom/qom-qmp-cmds.c @@ -97,6 +97,15 @@ static void qom_list_add_property_value(Object *obj, Obj= ectProperty *prop, QAPI_LIST_PREPEND(*props, item); =20 item->name =3D g_strdup(prop->name); + if (object_property_is_child(prop)) { + item->kind =3D OBJECT_PROPERTY_KIND_CHILD; + item->u.child.qom_type =3D g_strdup(prop->qom_type); + } else if (object_property_is_link(prop)) { + item->kind =3D OBJECT_PROPERTY_KIND_LINK; + item->u.link.qom_type =3D g_strdup(prop->qom_type); + } else { + item->kind =3D OBJECT_PROPERTY_KIND_OTHER; + } item->type =3D g_strdup(prop->type); if (prop->qapi_type) { assert(prop->qapi_type->masked_name); --=20 2.55.0 From nobody Sun Nov 29 02:11:46 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1795687366; cv=none; d=zohomail.com; s=zohoarc; b=CFIO0hf5NFE46pU7WgH++dFE3jtu++00z7ed6/xeQ19FBkenqyhM5XMmVCat3P9ZR/zAlX/VT5q1cpvFiR91QOJAmD0sh04xZuc7232EBi6ckERR2Y9B3psGE0sgPA8yfwOg73yflGs2GamF6GSHBfQoRxbcIgvzQJAtkr50iVY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795687366; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tBXSG+H7LRnCUOaKPsf8ZOXQ+tDRciM4YhlGnyva13E=; b=TFsgj967tQrIouPZlI2IHZOXz9aLeIM38zeSFrfwgdXL9Ih3qo1ZwsUvrgjpjmC+k3kLfz4UL1Uh6zdK6uRg05FiJ+AGxvTXt4UKQZ4/EbGz1buw6i2JeWFfKNnHEVIawOqE/21Ixif3sDY89lqQsdKJF1eWf/LdExa3QoQ2yRo= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1795687366123164.21497843230554; Thu, 26 Nov 2026 02:02:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xWWJ9-0008QJ-9z; Thu, 26 Nov 2026 05:02:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xWWId-00089G-ML for qemu-devel@nongnu.org; Thu, 26 Nov 2026 05:01:56 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xWWIa-0006i3-8F for qemu-devel@nongnu.org; Thu, 26 Nov 2026 05:01:55 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-148-ZIDkzn6cMzilCCUr0mqDQg-1; Thu, 26 Nov 2026 10:01:46 +0000 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 905E41956049; Thu, 26 Nov 2026 10:01:45 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4D50E300022B; Thu, 26 Nov 2026 10:01:45 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id F0F0321E6892; Thu, 26 Nov 2026 11:01:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795687311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tBXSG+H7LRnCUOaKPsf8ZOXQ+tDRciM4YhlGnyva13E=; b=T3hazm8mAk0+Y2zUZocKbqdmkdk5vrTRoOCfU82f/jsC49+vAV7MZAs6H6XGyMxlWPCCrM zESFJykK+wy+LLvWu2Z5bQU8mUHlVnbe/2SNiNP2CDafzRlVgYGmUBhNJZhR+kj5+n7Coc em/EiDYpp3frMx1IvTQRdf8QXnmlmzY= X-MC-Unique: ZIDkzn6cMzilCCUr0mqDQg-1 X-Mimecast-MFC-AGG-ID: ZIDkzn6cMzilCCUr0mqDQg_1795687305 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com, jsnow@redhat.com, crosa@redhat.com, eblake@redhat.com, devel@lists.libvirt.org Subject: [PATCH 14/16] tests: Wean off ObjectPropertyValue member @type Date: Thu, 26 Nov 2026 11:01:37 +0100 Message-ID: <20261126100139.3557890-15-armbru@redhat.com> In-Reply-To: <20261126100139.3557890-1-armbru@redhat.com> References: <20261126100139.3557890-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=lists1p.gnu.org; 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: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1795687366925158500 Content-Type: text/plain; charset="utf-8" Use member @kind instead. Signed-off-by: Markus Armbruster --- tests/qtest/qom-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qtest/qom-test.c b/tests/qtest/qom-test.c index 6f1e9606c5e..51e31d79997 100644 --- a/tests/qtest/qom-test.c +++ b/tests/qtest/qom-test.c @@ -98,7 +98,7 @@ static void test_list_get(QTestState *qts, QList *paths) prop =3D qobject_to(QDict, qlist_entry_obj(prop_entry)); g_assert(qdict_haskey(prop, "name")); g_assert(qdict_haskey(prop, "type")); - has_child |=3D strstart(qdict_get_str(prop, "type"), "child<",= NULL); + has_child |=3D !strcmp(qdict_get_str(prop, "kind"), "child"); } =20 if (has_child) { @@ -109,7 +109,7 @@ static void test_list_get(QTestState *qts, QList *paths) =20 QLIST_FOREACH_ENTRY(properties, prop_entry) { prop =3D qobject_to(QDict, qlist_entry_obj(prop_entry)); - if (strstart(qdict_get_str(prop, "type"), "child<", NULL))= { + if (!strcmp(qdict_get_str(prop, "kind"), "child")) { g_autofree char *child_path =3D g_strdup_printf( "%s/%s", path, qdict_get_str(prop, "name")); qlist_append_str(child_paths, child_path); --=20 2.55.0 From nobody Sun Nov 29 02:11:46 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1795687360; cv=none; d=zohomail.com; s=zohoarc; b=XXrAv8gNKGQk5RCFrHlScnoojBkBh10U6lvJolFNdyfU4kEcHgL+iKMhbprZn4ZrWkV3vvQTQJ4d5m8JmXevhx/r4TwjvM83sHnjERN+2rxqW2hKAwvXygMG8foTDzVbwRe93j7yhyi3Wznd9Sd0LXwXOYhHN9ldyygJr7mDDI4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795687360; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+AbLji0IfyYfwjZTpbMpa0hLpPEf0/vhPjdwsNulQD0=; b=MNsl7uFlWkrDLUl96i1BHXHZ+HKrcnGziJ4TjXhNtqWMMh1Hq1PRryNcrgvskl8+4ttF5giZtCMe1dMf93TBte0+hkjrVzHg4Q12XdpVEQMMGhgv96CYqv7wgHg2in5YUj5jeS2mKm1C8SrMtP6sGaU/S1Sc3fzFgacdSJY7YHg= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1795687360349388.1457037983131; Thu, 26 Nov 2026 02:02:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xWWIq-0008Iu-3A; Thu, 26 Nov 2026 05:02:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xWWIe-0008Aq-GK for qemu-devel@nongnu.org; Thu, 26 Nov 2026 05:01:57 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xWWIa-0006hm-3t for qemu-devel@nongnu.org; Thu, 26 Nov 2026 05:01:55 -0500 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-661-Yakw_yeNNcazSJH4lQQuzg-1; Thu, 26 Nov 2026 10:01:49 +0000 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4C46B1955EAC; Thu, 26 Nov 2026 10:01:48 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0A9D01956086; Thu, 26 Nov 2026 10:01:48 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 00D8021E6893; Thu, 26 Nov 2026 11:01:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795687311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+AbLji0IfyYfwjZTpbMpa0hLpPEf0/vhPjdwsNulQD0=; b=NrIyiPRcyMHKBSXol+VzJ8jkmuZAryRhjd0hidL76HugoVdTipCk0FtxWZT3UB8wj2cQFb GTYj1QXLUePeWP2vxOxhhvKNC8hu2d2LmGoAUQcJ4fqYH3qzj7iPAPgYM7MVgTui+QZPjb zDeMFFdrH1+M6Kb9O12o2nVZ9t11GDE= X-MC-Unique: Yakw_yeNNcazSJH4lQQuzg-1 X-Mimecast-MFC-AGG-ID: Yakw_yeNNcazSJH4lQQuzg_1795687308 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, berrange@redhat.com, jsnow@redhat.com, crosa@redhat.com, eblake@redhat.com, devel@lists.libvirt.org Subject: [PATCH 15/16] python/qemu: Wean off ObjectPropertyValue member @type Date: Thu, 26 Nov 2026 11:01:38 +0100 Message-ID: <20261126100139.3557890-16-armbru@redhat.com> In-Reply-To: <20261126100139.3557890-1-armbru@redhat.com> References: <20261126100139.3557890-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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=lists1p.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 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, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1795687363175158500 Content-Type: text/plain; charset="utf-8" QOMTree._list_nodes() uses @type to print non-child properties like "NAME: VALUE (TYPE)". Drop (TYPE). This affects qom-tree. Replace all other uses of @type by @kind and @qom-type. Signed-off-by: Markus Armbruster --- python/qemu/utils/qom.py | 2 +- python/qemu/utils/qom_common.py | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/python/qemu/utils/qom.py b/python/qemu/utils/qom.py index 05e5f141791..9f113240f9b 100644 --- a/python/qemu/utils/qom.py +++ b/python/qemu/utils/qom.py @@ -242,7 +242,7 @@ def _list_nodes(self, paths: List[str]) -> None: value =3D item.value if value is None: value =3D "" - print(f" {item.name}: {value} ({item.type})") + print(f" {item.name}: {value}") =20 print('') =20 diff --git a/python/qemu/utils/qom_common.py b/python/qemu/utils/qom_common= .py index 8d324f29cc3..c0f684bc455 100644 --- a/python/qemu/utils/qom_common.py +++ b/python/qemu/utils/qom_common.py @@ -69,9 +69,11 @@ class ObjectPropertyValue: """ Represents a property return from e.g. qom-tree-get """ - def __init__(self, name: str, type_: str, value: object): + def __init__(self, name: str, kind: str, qom_type: Optional[str], + value: object): self.name =3D name - self.type =3D type_ + self.kind =3D kind + self.qom_type =3D qom_type self.value =3D value =20 @classmethod @@ -79,13 +81,14 @@ def make(cls, value: Dict[str, Any]) -> 'ObjectProperty= Value': """ Build an ObjectPropertyValue from a Dict with an unknown shape. """ - assert value.keys() >=3D {'name', 'type'} - return cls(value['name'], value['type'], value.get('value')) + assert value.keys() >=3D {'name', 'kind'} + return cls(value['name'], value['kind'], value.get('qom-type'), + value.get('value')) =20 @property def child(self) -> bool: """Is this property a child property?""" - return self.type.startswith('child<') + return self.kind =3D=3D "child" =20 =20 class ObjectPropertiesValues: @@ -104,7 +107,7 @@ def make(cls, value: Dict[str, Any]) -> 'ObjectProperti= esValues': """ assert value.keys() <=3D {'properties'} props =3D [ObjectPropertyValue(item['name'], - item['type'], + item['kind'], item.get('qom-type'), item.get('value')) for item in value['properties']] return cls(props) --=20 2.55.0 From nobody Sun Nov 29 02:11:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; 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 38.145.34.151 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=1795688526; cv=none; d=zohomail.com; s=zohoarc; b=hCR8SX76dmjaX4AfBCFBpvdS+2F82kaNyaI1GR2mf+1xMGwp/DBNyjkgj33XGvkUC6f6k2Xk+MADOWiGNp/GRg4KXOTj5ciN20CPiL1axTOEpmTiu3m5VEAP5pUJd2e2u1f52Q4DUhnWIZpEFCwChB2stpbtKsmxalq+lyuf7SU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795688526; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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:Subject:Subject:To:To:Message-Id; bh=D4uXfk4qDq+zTFu8XagmlUY80VJzweXnCNuzSi5EFdc=; b=CKmoPilhFx5upwODVKus7KBsre66P+11eujFxkQ19e986TarRiWxNx5JXy3n6Bjajte2pq66CsWF/ARLYuFUUqxL7ytgVR+W/v28IwrZexFqTqG5Q1sp5Y1GQr2tWiyryf3ICouy4g7Kr46wIjPGv8kV3vstfZuoAQIpzh93ML8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 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 [38.145.34.151]) by mx.zohomail.com with SMTPS id 1795688526702919.6256409995148; Thu, 26 Nov 2026 02:22:06 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 99C0C41CB6; Thu, 26 Nov 2026 05:22:04 -0500 (EST) Received: from [172.19.199.28] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 37F6244106; Thu, 26 Nov 2026 05:03:36 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 0BE5C417E6; Thu, 26 Nov 2026 05:01:54 -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 145FB3F88B for ; Thu, 26 Nov 2026 05:01:52 -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-539-mf3N4OoiNt-vcmfx1e-8yw-1; Thu, 26 Nov 2026 10:01:49 +0000 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 5E8DC1800665; Thu, 26 Nov 2026 10:01:48 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.44.22.2]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E3DCE18011DC; Thu, 26 Nov 2026 10:01:47 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 04E4921E6894; Thu, 26 Nov 2026 11:01:40 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_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=1795687312; 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=D4uXfk4qDq+zTFu8XagmlUY80VJzweXnCNuzSi5EFdc=; b=OJa0zI5Clj4JI/xmw2uPpyvm2GzwkzvCc/w8naCYkZvfCu2gmXBheiWRZdDToEvVAtsM04 J1SI16HvYvOTp9FHet6y2LQ+j4efdxYonMNsbheRQ0o7ULLAJG2WPM1DVh87D7a7Nc1MUT 1WPRnWFev052FSqCPFp0H+dkOSdM0Ms= X-MC-Unique: mf3N4OoiNt-vcmfx1e-8yw-1 X-Mimecast-MFC-AGG-ID: mf3N4OoiNt-vcmfx1e-8yw_1795687308 To: qemu-devel@nongnu.org Subject: [PATCH 16/16] qom: Deprecate ObjectPropertyInfo, ObjectPropertyValue member @type Date: Thu, 26 Nov 2026 11:01:39 +0100 Message-ID: <20261126100139.3557890-17-armbru@redhat.com> In-Reply-To: <20261126100139.3557890-1-armbru@redhat.com> References: <20261126100139.3557890-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-MFC-PROC-ID: i5zsMWjxIsCANM2Kk5QMRGm_ByNSHVMWT644J91GtBM_1795687308 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: N3GPHH52CJLCKUSOHC7SDZYLD5JWYWE6 X-Message-ID-Hash: N3GPHH52CJLCKUSOHC7SDZYLD5JWYWE6 X-MailFrom: armbru@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 CC: marcandre.lureau@redhat.com, pbonzini@redhat.com, jsnow@redhat.com, crosa@redhat.com, eblake@redhat.com, devel@lists.libvirt.org 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: Markus Armbruster via Devel Reply-To: Markus Armbruster X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1795688527338158501 Content-Type: text/plain; charset="utf-8"; x-default="true" Use members @kind, @qapi-type, and @qom-type instead. Signed-off-by: Markus Armbruster ACKed-by: Peter Krempa --- docs/about/deprecated.rst | 5 +++++ qapi/qom.json | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 5ab329705b6..bcae9c0afbc 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -190,6 +190,11 @@ so the concept of an 'unavailable' trace event no long= er exists. The ``ignore-unavailable`` parameter in ``trace-event-set-state`` thus has no effect and should no longer be used. =20 +``qom-list``, ``qom-list-property``, ``qom-list-get`` return value member = @type (since 12.0) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''= ''''''''''''''''''' + +Use members @kind, @qapi-type, and @qom-type instead. + Human Machine Protocol (HMP) commands ------------------------------------- =20 diff --git a/qapi/qom.json b/qapi/qom.json index 0b274787b3f..e41add67059 100644 --- a/qapi/qom.json +++ b/qapi/qom.json @@ -66,15 +66,16 @@ # # Features: # -# @unstable: Member @qapi-type is experimental. +# @deprecated: Member @type is deprecated. Use @kind, @qapi-type, and +# @qom-type instead. # # Since: 1.2 ## { 'union': 'ObjectPropertyInfo', 'base': { 'name': 'str', 'kind': 'ObjectPropertyKind', - 'type': 'str', - 'qapi-type': { 'type': 'str', 'features': [ 'unstable' ] }, + 'type': { 'type': 'str', 'features': [ 'deprecated' ] }, + 'qapi-type': 'str', '*description': 'str', '*default-value': 'any' }, 'discriminator': 'kind', @@ -99,15 +100,16 @@ # # Features: # -# @unstable: Member @qapi-type is experimental. +# @deprecated: Member @type is deprecated. Use @kind, @qapi-type, and +# @qom-type instead. # # Since: 10.1 ## { 'union': 'ObjectPropertyValue', 'base': { 'name': 'str', 'kind': 'ObjectPropertyKind', - 'type': 'str', - 'qapi-type': { 'type': 'str', 'features': [ 'unstable' ] }, + 'type': { 'type': 'str', 'features': [ 'deprecated' ] }, + 'qapi-type': 'str', '*value': 'any' }, 'discriminator': 'kind', 'data': { 'child': 'ObjectPropertyQomType', --=20 2.55.0