From nobody Mon Feb 9 04:31:10 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=1767802440; cv=none; d=zohomail.com; s=zohoarc; b=hPme1BAlfj4Q0I+QiUbasB9//A0MNIpzw4diXOYPPURuEc6bFARxuthWI2B5LGnaY7opC0ec4xyoT+Wlm3p0zLrBDiNr2BZAYKKcALw7XKZNx4xPfuXbf+oJ4mDxozndxn7aJD7ej3zFtNtN8crqANyM/w6AtJrmDUojnoLpCtQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767802440; 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=XIu0NuT8xH1gLC7I9AJ6tXbflSuQTsSBe51EYgnpVd4=; b=UeXycqTH9Zlz2ghwBq04qNC7+/KmqUoy+Ll6Ou3O7w/bUuUnB8CAPv3jDZo6bO+wrS0ZFXmMuA1+A/NXfU4O3dSzDkzUjLbKxhPIRnISz5uDx1o2oCI/12CJoUHzRIvd7FtQmjXIOFPXxyR1/z8zCNVQ5h79c4Oo8/5C7cnseiU= 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 1767802440569486.10202759103834; Wed, 7 Jan 2026 08:14:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdW9n-0006WF-8E; 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-0006Gf-Hb for qemu-devel@nongnu.org; Wed, 07 Jan 2026 11:13:05 -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 1vdW9f-0005Jg-7C for qemu-devel@nongnu.org; Wed, 07 Jan 2026 11:13:04 -0500 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-586-lFBelQQOM4ubaAy5JAsEhg-1; Wed, 07 Jan 2026 11:13:00 -0500 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 BAA9C1954B14; Wed, 7 Jan 2026 16:12:59 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.32]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6F06A18008FF; Wed, 7 Jan 2026 16:12:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id F059D21E61A5; Wed, 07 Jan 2026 17:12:56 +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=XIu0NuT8xH1gLC7I9AJ6tXbflSuQTsSBe51EYgnpVd4=; b=JaGjsRpJgvYWiQzUXPmzJoLQPdEfAh0648oln7jnUELuNsofR39SsMXMb7vy+4PsYaz9/z f4NYKaFs82Lf+FLKNhFnOKhszGA+DMRjeiejckuoTHQEUDh6bCofIPWqEbiiAFwOUb27O0 pM5AbnutgISUHRU5Nkgu2pZboJXWEdk= X-MC-Unique: lFBelQQOM4ubaAy5JAsEhg-1 X-Mimecast-MFC-AGG-ID: lFBelQQOM4ubaAy5JAsEhg_1767802379 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 1/4] qdev: Fix "info qtree" to show links Date: Wed, 7 Jan 2026 17:12:53 +0100 Message-ID: <20260107161256.1321694-2-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.4.1 on 10.30.177.93 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.133.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_H3=0.001, RCVD_IN_MSPIKE_WL=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: 1767802442693158500 qdev_print_props() retrieves a property's value from its legacy property if it exists. A legacy property is created by qdev_class_add_legacy_property() when the property has a print() method or does not have a get() method. If it has a print() method, the legacy property's value is obtained from the property's print() method. This is used to format PCI addresses nicely, i.e. like 01.3 instead of 11. Else, if doesn't have a get() method, the legacy property is unreadable. "info qtree" silently skips unreadable properties. Link properties don't have a get() method, and are therefore skipped. This is wrong, because the underlying QOM property *is* readable. Change qdev_print_props() to simply use a print() method directly if it exists, else get the value via QOM. "info qtree" now shows links fine. For instance, machine "pc" onboard device "PIIX4_PM" property "bus" is now visible. Signed-off-by: Markus Armbruster Message-ID: <20251022101420.36059-3-armbru@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau --- system/qdev-monitor.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index 0bf514cb09..be18902bb2 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -762,19 +762,18 @@ static void qdev_print_props(Monitor *mon, DeviceStat= e *dev, DeviceClass *dc, for (int i =3D 0, n =3D dc->props_count_; i < n; ++i) { const Property *prop =3D &dc->props_[i]; char *value; - char *legacy_name =3D g_strdup_printf("legacy-%s", prop->name); =20 - if (object_property_get_type(OBJECT(dev), legacy_name, NULL)) { - value =3D object_property_get_str(OBJECT(dev), legacy_name, NU= LL); + if (prop->info->print) { + value =3D prop->info->print(OBJECT(dev), prop); } else { value =3D object_property_print(OBJECT(dev), prop->name, true, NULL); } - g_free(legacy_name); =20 if (!value) { continue; } + qdev_printf("%s =3D %s\n", prop->name, *value ? value : ""); g_free(value); --=20 2.52.0 From nobody Mon Feb 9 04:31:10 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 From nobody Mon Feb 9 04:31:10 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=1767802424; cv=none; d=zohomail.com; s=zohoarc; b=LRn376E8bBexJ4lUzNB/zeE7wAwjbk80kUNDlOcJcZpRk2vXFy6a8Ua4EXW4Cf+auGsWn0DKRZikdm449Wqe5JkjXD00N5Q5rL0Xbdckn6lYJ7LKbFMymNgO74uYulZG9mcvlFffg1WOeZOSICE1rmb3D8nB2ekV6ong/BGeX90= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767802424; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zvIbc5z9SdQCq83Vk1qBemPaH1jqlBkNFDuqrNgs054=; b=XO41V+LGDLHydKD5dS9W3e3Q7BwyhDFZky1F2wcuGDdl/jPN92JJHlrxOTilVlFGkOli5emGMSWGN5elRmTuCSWdL2fUa/wPRwdvmqOZw4RDt6hO+3NlatyxEl1b51/FGsjbRxNeLOTsY/mFSMpNf2sClNSj0iRe7aTOTKXisYE= 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 1767802424729517.5695526728766; Wed, 7 Jan 2026 08:13:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdW9o-0006Za-QA; Wed, 07 Jan 2026 11:13:12 -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 1vdW9i-0006Ih-9D for qemu-devel@nongnu.org; Wed, 07 Jan 2026 11:13:07 -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-0005Jm-Rc for qemu-devel@nongnu.org; Wed, 07 Jan 2026 11:13:06 -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-29-wDha-cjqPiibQqCKnMsnAA-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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B731E19560A7; 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 6DABE19560A2; Wed, 7 Jan 2026 16:12:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 13EFE21E61A9; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zvIbc5z9SdQCq83Vk1qBemPaH1jqlBkNFDuqrNgs054=; b=JDP3ouK5/0THLAm/rHakcM0mY4PabYvq/lByU2JbAogqB53l1DIquqg0vF+eibxo25pkHB kOBJ894v00QeKOVxp/tg8IkV3pa7x4IWzkYjQaVk57kvPuxhGMKSiHHJ/22Vgx43Pg5p+w 8aQF6X94+CxRFunk79z5wMCMEa4vaNA= X-MC-Unique: wDha-cjqPiibQqCKnMsnAA-1 X-Mimecast-MFC-AGG-ID: wDha-cjqPiibQqCKnMsnAA_1767802379 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Thomas Huth Subject: [PULL 3/4] scripts/device-crash-test: ERROR_RULE_LIST garbage collection Date: Wed, 7 Jan 2026 17:12:55 +0100 Message-ID: <20260107161256.1321694-4-armbru@redhat.com> In-Reply-To: <20260107161256.1321694-1-armbru@redhat.com> References: <20260107161256.1321694-1-armbru@redhat.com> MIME-Version: 1.0 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: 1767802426739158500 Content-Type: text/plain; charset="utf-8" Device 'nand' was dropped in commit commit e86c1f967a3. Device 'vfio-amd-xgbe' was dropped in commit aeb1a50d4a7. Device 'vfio-calxeda-xgmac' was dropped in commit 8ebc416ac17. The last error messages matching r"images* must be given with the 'pflash' parameter" was dropped in commit a2ccff4d2bc. The error message matching r"Option '-device [\w.,-]+' cannot be handled by this machine" was dropped in commit commit db78a605599. The error message matching r"Ignoring smp_cpus value" ceased to match in commit f2ad5140fa5, and was then dropped in commit 72649619341. The error message matching r"rom check and register reset failed" was lost in merge commit af3f37319cb. Signed-off-by: Markus Armbruster Message-ID: <20251128101321.3287186-1-armbru@redhat.com> Reviewed-by: Thomas Huth --- scripts/device-crash-test | 7 ------- 1 file changed, 7 deletions(-) diff --git a/scripts/device-crash-test b/scripts/device-crash-test index c1576e8b96..f97d9909c0 100755 --- a/scripts/device-crash-test +++ b/scripts/device-crash-test @@ -93,7 +93,6 @@ ERROR_RULE_LIST =3D [ {'device':'ivshmem-doorbell', 'expected':True}, # You must spec= ify a 'chardev' {'device':'ivshmem-plain', 'expected':True}, # You must spec= ify a 'memdev' {'device':'loader', 'expected':True}, # please includ= e valid arguments - {'device':'nand', 'expected':True}, # Unsupported N= AND block size 0x1 {'device':'nvdimm', 'expected':True}, # 'memdev' prop= erty is not set {'device':'nvme', 'expected':True}, # Device initia= lization failed {'device':'pc-dimm', 'expected':True}, # 'memdev' prop= erty is not set @@ -114,8 +113,6 @@ ERROR_RULE_LIST =3D [ {'device':'usb-redir', 'expected':True}, # Parameter 'ch= ardev' is missing {'device':'usb-serial', 'expected':True}, # Property char= dev is required {'device':'usb-storage', 'expected':True}, # drive propert= y not set - {'device':'vfio-amd-xgbe', 'expected':True}, # -device vfio-= amd-xgbe: vfio error: wrong host device name - {'device':'vfio-calxeda-xgmac', 'expected':True}, # -device vfio-= calxeda-xgmac: vfio error: wrong host device name {'device':'vfio-pci', 'expected':True}, # No provided h= ost device {'device':'vfio-pci-igd-lpc-bridge', 'expected':True}, # VFIO dummy IS= A/LPC bridge must have address 1f.0 {'device':'vhost-scsi.*', 'expected':True}, # vhost-scsi: m= issing wwpn @@ -159,7 +156,6 @@ ERROR_RULE_LIST =3D [ # Silence INFO messages for errors that are common on multiple # devices/machines: {'log':r"No '[\w-]+' bus found for device '[\w-]+'"}, - {'log':r"images* must be given with the 'pflash' parameter"}, {'log':r"(Guest|ROM|Flash|Kernel) image must be specified"}, {'log':r"[cC]ould not load [\w ]+ (BIOS|bios) '[\w-]+\.bin'"}, {'log':r"Couldn't find rom image '[\w-]+\.bin'"}, @@ -167,7 +163,6 @@ ERROR_RULE_LIST =3D [ {'log':r"Can't create a second ISA bus"}, {'log':r"duplicate fw_cfg file name"}, # sysbus-related error messages: most machines reject most dynamic sys= bus devices: - {'log':r"Option '-device [\w.,-]+' cannot be handled by this machine"}, {'log':r"Device [\w.,-]+ is not supported by this machine yet"}, {'log':r"Device [\w.,-]+ can not be dynamically instantiated"}, {'log':r"Platform Bus: Can not fit MMIO region of size "}, @@ -175,11 +170,9 @@ ERROR_RULE_LIST =3D [ {'device':'.*-spapr-cpu-core', 'log':r"CPU core type should be"}, {'log':r"MSI(-X)? is not supported by interrupt controller"}, {'log':r"pxb-pcie? devices cannot reside on a PCIe? bus"}, - {'log':r"Ignoring smp_cpus value"}, {'log':r"sd_init failed: Drive 'sd0' is already in use because it has = been automatically connected to another device"}, {'log':r"This CPU requires a smaller page size than the system is usin= g"}, {'log':r"MSI-X support is mandatory in the S390 architecture"}, - {'log':r"rom check and register reset failed"}, {'log':r"Unable to initialize GIC, CPUState for CPU#0 not valid"}, {'log':r"Multiple VT220 operator consoles are not supported"}, {'log':r"core 0 already populated"}, --=20 2.52.0 From nobody Mon Feb 9 04:31:10 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=1767802405; cv=none; d=zohomail.com; s=zohoarc; b=W8GQS7KOxeLVkd1jsObYQpuo7OC/OswYltxm+jvFCkeWJoIDZ+hROM1e9COGlspLMi2+IFVmZ80E32iOrIvxpTuCYt0zFORuShxbT9qHz8kG20USKzErk28Z6zNRfjdduupIvJe0ipYTVTm7TzbflRiOOMqSDEgEWy0KRYxn/wU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767802405; 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=6GhB7Dx9hbTVm1La553jV0EsD/xbrRhFLD6DIFkiJQ8=; b=GfKULG8rU0zKpUYVvJ42z8mhEYKLrYeklLPq7BIMDKkgY/iiVtlppSPUlZ2birzyB3o2XII1LafLrbqH74Y4WNIfw8QV/iWJy3qYBAnmEnrbQun+HUvfP21FRwjdRTTT4+lMME4+GZJpHPd9kUL8zYf+LnO1zCLILRa3PU1D818= 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 176780240538250.609093141060384; Wed, 7 Jan 2026 08:13:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdW9q-0006bF-KE; Wed, 07 Jan 2026 11:13:14 -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 1vdW9l-0006V0-0p for qemu-devel@nongnu.org; Wed, 07 Jan 2026 11:13:11 -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 1vdW9h-0005KF-Hv for qemu-devel@nongnu.org; Wed, 07 Jan 2026 11:13:07 -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-85-lQQRz8uAMwqXSOwStvdOGg-1; Wed, 07 Jan 2026 11:13:01 -0500 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 34C5319560B4; Wed, 7 Jan 2026 16:13:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.45.242.32]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9ECAA30002D1; Wed, 7 Jan 2026 16:12:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 1D12621E61AA; 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=1767802384; 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=6GhB7Dx9hbTVm1La553jV0EsD/xbrRhFLD6DIFkiJQ8=; b=a/1y5dkBWQICG3znkleDkyPLdVcrVxOGp+OAMIeK4cqw5n3aJH8WLsd6tkWlO1CDk2Ovmq TPYQmzn8bgZ4qVGwycujTppxzKZUX4Np/U1sFJGRHk+RIkPuGd+/NkylMmxcnBWdyK7/yN k2JaI3mgEHDR4i5TnEtEB3iWARH+seU= X-MC-Unique: lQQRz8uAMwqXSOwStvdOGg-1 X-Mimecast-MFC-AGG-ID: lQQRz8uAMwqXSOwStvdOGg_1767802380 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Jie Song , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 4/4] monitor/qmp: cleanup SocketChardev listener sources early to avoid fd handling race Date: Wed, 7 Jan 2026 17:12:56 +0100 Message-ID: <20260107161256.1321694-5-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.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=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: 1767802408871158500 From: Jie Song When starting a dummy QEMU process with virsh version, monitor_init_qmp() enables IOThread monitoring of the QMP fd by default. However, a race condition exists during the initialization phase: the IOThread only removes the main thread's fd watch when it reaches qio_net_listener_set_client_func= _full(), which may be delayed under high system load. This creates a window between monitor_qmp_setup_handlers_bh() and qio_net_listener_set_client_func_full() where both the main thread and IOThread are simultaneously monitoring the same fd and processing events. This race can cause either the main thread or the IOThread to hang and become unresponsive. Fix this by proactively cleaning up the listener's IO sources in monitor_init_qmp() before the IOThread initializes QMP monitoring, ensuring exclusive fd ownership and eliminating the race condition. Signed-off-by: Jie Song Reviewed-by: Marc-Andr=C3=A9 Lureau Message-ID: <20251125140706.114197-1-mail@jiesong.me> --- include/chardev/char-io.h | 2 ++ include/chardev/char.h | 2 ++ chardev/char-io.c | 8 ++++++++ chardev/char-socket.c | 10 ++++++++++ monitor/qmp.c | 5 +++++ 5 files changed, 27 insertions(+) diff --git a/include/chardev/char-io.h b/include/chardev/char-io.h index ac379ea70e..540131346d 100644 --- a/include/chardev/char-io.h +++ b/include/chardev/char-io.h @@ -43,4 +43,6 @@ int io_channel_send(QIOChannel *ioc, const void *buf, siz= e_t len); int io_channel_send_full(QIOChannel *ioc, const void *buf, size_t len, int *fds, size_t nfds); =20 +void remove_listener_fd_in_watch(Chardev *chr); + #endif /* CHAR_IO_H */ diff --git a/include/chardev/char.h b/include/chardev/char.h index b65e9981c1..192cad67d4 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -307,6 +307,8 @@ struct ChardevClass { =20 /* handle various events */ void (*chr_be_event)(Chardev *s, QEMUChrEvent event); + + void (*chr_listener_cleanup)(Chardev *chr); }; =20 Chardev *qemu_chardev_new(const char *id, const char *typename, diff --git a/chardev/char-io.c b/chardev/char-io.c index 3be17b51ca..beac5cd245 100644 --- a/chardev/char-io.c +++ b/chardev/char-io.c @@ -182,3 +182,11 @@ int io_channel_send(QIOChannel *ioc, const void *buf, = size_t len) { return io_channel_send_full(ioc, buf, len, NULL, 0); } + +void remove_listener_fd_in_watch(Chardev *chr) +{ + ChardevClass *cc =3D CHARDEV_GET_CLASS(chr); + if (cc->chr_listener_cleanup) { + cc->chr_listener_cleanup(chr); + } +} diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 26d2f11202..3f45dd2ecd 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -1570,6 +1570,15 @@ char_socket_get_connected(Object *obj, Error **errp) return s->state =3D=3D TCP_CHARDEV_STATE_CONNECTED; } =20 +static void tcp_chr_listener_cleanup(Chardev *chr) +{ + SocketChardev *s =3D SOCKET_CHARDEV(chr); + if (s->listener) { + qio_net_listener_set_client_func_full(s->listener, NULL, NULL, + NULL, chr->gcontext); + } +} + static void char_socket_class_init(ObjectClass *oc, const void *data) { ChardevClass *cc =3D CHARDEV_CLASS(oc); @@ -1587,6 +1596,7 @@ static void char_socket_class_init(ObjectClass *oc, c= onst void *data) cc->chr_add_client =3D tcp_chr_add_client; cc->chr_add_watch =3D tcp_chr_add_watch; cc->chr_update_read_handler =3D tcp_chr_update_read_handler; + cc->chr_listener_cleanup =3D tcp_chr_listener_cleanup; =20 object_class_property_add(oc, "addr", "SocketAddress", char_socket_get_addr, NULL, diff --git a/monitor/qmp.c b/monitor/qmp.c index e1419a9efa..687019811f 100644 --- a/monitor/qmp.c +++ b/monitor/qmp.c @@ -539,6 +539,11 @@ void monitor_init_qmp(Chardev *chr, bool pretty, Error= **errp) * e.g. the chardev is in client mode, with wait=3Don. */ remove_fd_in_watch(chr); + /* + * Clean up listener IO sources early to prevent racy fd + * handling between the main thread and the I/O thread. + */ + remove_listener_fd_in_watch(chr); /* * We can't call qemu_chr_fe_set_handlers() directly here * since chardev might be running in the monitor I/O --=20 2.52.0