From nobody Mon Feb 9 17:36:06 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=1767802406; cv=none; d=zohomail.com; s=zohoarc; b=BgOAltRSZLSsmU+guEqVK9kvkM/tUste6fD+Q0M40cG2G1Z497IEsgQaqq1K+cNJtNR8YfQtOEFDARR5OKvKY/KzWWw5cD9H+p3qMQ4xN9IEb/mXPz3X4+IxPfNfJ+zxNdf2fEowEIlrNug0wTQZjtPp3JPNyfx1A8gMFmAJLig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767802406; h=Content-Type: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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=IuH4NneW6dmx/vIK/35JcRmcY6UxMtTTa8w1UT0S2Ss=; b=gE7ghfIrSQ/6Xjw1sdvgWfBQcgq75lqxm01Rv3QHYCGUU2bJt+IDYEwgsCJo6PDGKTp9mNUOdph89SM6ov6oin5Ajt9BgFI/Wf2B53CU8gNehhsitY45mz44WpqKMOay1L82Jm/mQlaYBfOBfY67yAyQGeUb8UaFhR1hmsbGwWU= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1767802406388156.4573950867789; Wed, 7 Jan 2026 08:13:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdW9n-0006Tk-6c; Wed, 07 Jan 2026 11:13:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vdW9h-0006Gk-H3 for qemu-devel@nongnu.org; Wed, 07 Jan 2026 11:13:05 -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 1vdW9f-0005Jj-Fn for qemu-devel@nongnu.org; Wed, 07 Jan 2026 11:13:05 -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-695-BAARGUfWN1K_W8LluYqyDg-1; Wed, 07 Jan 2026 11:13:00 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 DC390180057E; Wed, 7 Jan 2026 16:12:59 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.32]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8036119560A7; Wed, 7 Jan 2026 16:12:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 065FF21E61A8; Wed, 07 Jan 2026 17:12:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767802382; 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=IuH4NneW6dmx/vIK/35JcRmcY6UxMtTTa8w1UT0S2Ss=; b=L/mUE+d/dQ9x3CcZzotwANJ3cF+rDlF32yhqRaTNG7STPD/Vq6PjqT489xwT0xrKuyMLox AkZ8taX1YMI68+k87UAgvXzScc3BjzSYf/qFfM4AIZDNND7vARctCE+y10iLkMsIeU1QU3 1/92LCNX9iscK+GDBFCLa5iImGGRrKY= X-MC-Unique: BAARGUfWN1K_W8LluYqyDg-1 X-Mimecast-MFC-AGG-ID: BAARGUfWN1K_W8LluYqyDg_1767802380 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 2/4] qdev: Legacy properties are now unused internally, drop Date: Wed, 7 Jan 2026 17:12:54 +0100 Message-ID: <20260107161256.1321694-3-armbru@redhat.com> In-Reply-To: <20260107161256.1321694-1-armbru@redhat.com> References: <20260107161256.1321694-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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: 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: 1767802408686158500 Legacy properties are an accidental and undocumented external interface. qom-set doesn't work for them (no .set() method). qom-get and qom-list-get work only when the underlying qdev property has a .print() method, i.e. the PCI address properties, as explained in the previous commit. Here's one that works: (qemu) qom-get /machine/unattached/device[3]/pm addr 11 (qemu) qom-get /machine/unattached/device[3]/pm legacy-addr "01.3" And here's one that doesn't: (qemu) qom-get /machine/unattached/device[3]/pm bus "/machine/i440fx/pci.0" (qemu) qom-get /machine/unattached/device[3]/pm legacy-bus Error: Property 'PIIX4_PM.legacy-bus' is not readable Actual use of this undocumented interface seems quite unlikely. A deprecation period seems unnecessary. Drop it. Signed-off-by: Markus Armbruster Message-ID: <20251022101420.36059-4-armbru@redhat.com> Acked-by: Marc-Andr=C3=A9 Lureau [Commit message improved] --- hw/core/qdev-properties.c | 46 --------------------------------------- 1 file changed, 46 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 05489c8fbb..c96ccfb263 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -1110,51 +1110,6 @@ static void qdev_class_add_property(DeviceClass *kla= ss, const char *name, object_class_property_set_description(oc, name, prop->info->descriptio= n); } =20 -/** - * Legacy property handling - */ - -static void qdev_get_legacy_property(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) -{ - const Property *prop =3D opaque; - char *s; - - s =3D prop->info->print(obj, prop); - visit_type_str(v, name, &s, errp); - g_free(s); -} - -/** - * qdev_class_add_legacy_property: - * @dev: Device to add the property to. - * @prop: The qdev property definition. - * - * Add a legacy QOM property to @dev for qdev property @prop. - * - * Legacy properties are string versions of QOM properties. The format of - * the string depends on the property type. Legacy properties are only - * needed for "info qtree". - * - * Do not use this in new code! QOM Properties added through this interfa= ce - * will be given names in the "legacy" namespace. - */ -static void qdev_class_add_legacy_property(DeviceClass *dc, const Property= *prop) -{ - g_autofree char *name =3D NULL; - - /* Register pointer properties as legacy properties */ - if (!prop->info->print && prop->info->get) { - return; - } - - name =3D g_strdup_printf("legacy-%s", prop->name); - object_class_property_add(OBJECT_CLASS(dc), name, "str", - prop->info->print ? qdev_get_legacy_property : prop->info->get, - NULL, NULL, (Property *)prop); -} - void device_class_set_props_n(DeviceClass *dc, const Property *props, size= _t n) { /* We used a hole in DeviceClass because that's still a lot. */ @@ -1167,7 +1122,6 @@ void device_class_set_props_n(DeviceClass *dc, const = Property *props, size_t n) for (size_t i =3D 0; i < n; ++i) { const Property *prop =3D &props[i]; assert(prop->name); - qdev_class_add_legacy_property(dc, prop); qdev_class_add_property(dc, prop->name, prop); } } --=20 2.52.0