From nobody Sun Mar 22 14:11:52 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1774087521142199.6797649543854; Sat, 21 Mar 2026 03:05:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w3tBx-0003gm-F2; Sat, 21 Mar 2026 06:04:25 -0400 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 1w3tBv-0003gD-Ou for qemu-devel@nongnu.org; Sat, 21 Mar 2026 06:04:23 -0400 Received: from v5227.v57ae4e16.euw1.send.eu.mailgun.net ([161.38.204.227]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w3tBt-0002wY-Nv for qemu-devel@nongnu.org; Sat, 21 Mar 2026 06:04:23 -0400 Received: from fedora (pub158181109038.dh-hfc.datazug.ch [158.181.109.38]) by 712eb054bc9015b0ebda65af28a98072b50f328f288845fcd2556865c8031c9b with SMTP id 69be6d234146bb649678bc4c; Sat, 21 Mar 2026 10:04:19 GMT DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=0x65c.net; q=dns/txt; s=email; t=1774087459; x=1774094659; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Subject: Cc: To: To: From: From: Sender: Sender; bh=ca1saslxUS3ge7uS5EHvv0YnftKce2vGIGBqgj6mVB8=; b=UvAaUzYD3IvSS9nlRRhpMXPDeNhm7OimMNKqBn9bzP392WQJfdstIsb2pj7W4LKVpuNVxnMbwntE5aLPk8rFHIo/5z4ZLMWgHO4h8+MfpjGNwS7Dwxs+cWiytXPNytWlupAtKDRlHwAuw18UuQlEOr+g/3rlztNiHEpCVTAdMzozPtidEJ5swtemflFbizwEyEpSK17JOihw9Sav+szXF0TWcbSBvVcOYyuJta0Y2JTcesoIQJV3okIR9/WAGjF6GauzaNcBOQh3ouwXb3FBUro8kEWakVNJyhIp4kKPyizOcEtqNejA9x92IR6rGluDfCz5+ZXfwbaoVa+ptFIm+g== X-Mailgun-Sid: WyJiNjdhNCIsInFlbXUtZGV2ZWxAbm9uZ251Lm9yZyIsIjU0ZWY0Il0= X-Mailgun-Sending-Ip: 161.38.204.227 From: Alessandro Ratti To: qemu-devel@nongnu.org Cc: armbru@redhat.com, peter.maydell@linaro.org, berrange@redhat.com, mst@redhat.com, pbonzini@redhat.com, Alessandro Ratti Subject: [PATCH v3 1/3] hw/qdev: Clarify fallback order in qdev_get_printable_name() Date: Sat, 21 Mar 2026 11:04:03 +0100 Message-ID: <20260321100405.1525059-2-alessandro@0x65c.net> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260321100405.1525059-1-alessandro@0x65c.net> References: <20260321100405.1525059-1-alessandro@0x65c.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=161.38.204.227; envelope-from=bounce+db73df.54ef4-qemu-devel=nongnu.org@0x65c.net; helo=v5227.v57ae4e16.euw1.send.eu.mailgun.net X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, SPF_HELO_NONE=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: fail (Header signature does not verify) X-ZM-MESSAGEID: 1774087522774158500 Content-Type: text/plain; charset="utf-8" Replace the uninformative "" final fallback with the canonical QOM path (e.g. /machine/peripheral-anon/device[0]). Also clean up comments to accurately describe qdev_get_dev_path() behavior, drop an unnecessary comment on the dev->id check, and rename the @vdev parameter to @dev for consistency with surrounding code. Update the doc comment in qdev.h to reflect the new fallback chain. Signed-off-by: Alessandro Ratti --- hw/core/qdev.c | 26 +++++++------------------- include/hw/core/qdev.h | 8 +++----- 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index e48616b2c6..c44616b4b8 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -411,33 +411,21 @@ char *qdev_get_dev_path(DeviceState *dev) return NULL; } =20 -const char *qdev_get_printable_name(DeviceState *vdev) +const char *qdev_get_printable_name(DeviceState *dev) { - /* - * Return device ID if explicity set - * (e.g. -device virtio-blk-pci,id=3Dfoo) - * This allows users to correlate errors with their custom device - * names. - */ - if (vdev->id) { - return g_strdup(vdev->id); + if (dev->id) { + return g_strdup(dev->id); } /* - * Fall back to the canonical QOM device path (eg. ID for PCI - * devices). - * This ensures the device is still uniquely and meaningfully - * identified. + * Fall back to a bus-specific device path, if the bus + * provides one (e.g. PCI address "0000:00:04.0"). */ - const char *path =3D qdev_get_dev_path(vdev); + const char *path =3D qdev_get_dev_path(dev); if (path) { return path; } =20 - /* - * Final fallback: if all else fails, return a placeholder string. - * This ensures the error message always contains a valid string. - */ - return g_strdup(""); + return object_get_canonical_path(OBJECT(dev)); } =20 void qdev_add_unplug_blocker(DeviceState *dev, Error *reason) diff --git a/include/hw/core/qdev.h b/include/hw/core/qdev.h index f99a8979cc..b87497906a 100644 --- a/include/hw/core/qdev.h +++ b/include/hw/core/qdev.h @@ -1094,11 +1094,9 @@ char *qdev_get_dev_path(DeviceState *dev); * user-facing error messages. The function will never return NULL, * so the name can be used without further checking or fallbacks. * - * If the device has an explicitly set ID (e.g. by the user on the - * command line via "-device thisdev,id=3Dmyid") this is preferred. - * Otherwise we try the canonical QOM device path (which will be - * the PCI ID for PCI devices, for example). If all else fails - * we will return the placeholder ". + * Return the device's ID if it has one. Else, return the path of a + * device on its bus if it has one. Else return its canonical QOM + * path. */ const char *qdev_get_printable_name(DeviceState *dev); =20 --=20 2.53.0 From nobody Sun Mar 22 14:11:52 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1774087540747550.7617900829136; Sat, 21 Mar 2026 03:05:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w3tBx-0003h5-Un; Sat, 21 Mar 2026 06:04:25 -0400 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 1w3tBv-0003g9-Iy for qemu-devel@nongnu.org; Sat, 21 Mar 2026 06:04:23 -0400 Received: from v54.v54282eed.euw1.send.eu.mailgun.net ([185.250.239.4]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w3tBt-0002wZ-RG for qemu-devel@nongnu.org; Sat, 21 Mar 2026 06:04:23 -0400 Received: from fedora (pub158181109038.dh-hfc.datazug.ch [158.181.109.38]) by 712eb054bc9015b0ebda65af28a98072b50f328f288845fcd2556865c8031c9b with SMTP id 69be6d23116b32221fb88b4c; Sat, 21 Mar 2026 10:04:19 GMT DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=0x65c.net; q=dns/txt; s=email; t=1774087459; x=1774094659; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Subject: Cc: To: To: From: From: Sender: Sender; bh=C6q7t67jlFGF1sb20kXq8E0dionftyjcl4lKtqCKFXw=; b=WxEQr3bdUWl73DkEXXZZZK8nUxeV9YTfJAKjOfMkoGl7rMQQoxQjy8npHVZGWnJbuk0ha2btw6uA6lahiOf5rE03N1RZdosesgaf5ZAPGaUdcuNAgjsfZnaa8mDG2HXieIbq5Mt5E4lg8UUfzfh/jERx/oMwkzXyRXN3AbV8FoTIpTkaGp96wGc8Wc+bnXHyT5VPYm+SsVwP4s3F8NKS+0ZS2K5ZewzNGKWmmkftZb9Fz3og8EmNY644YGvbsfEomihNhWxOs79+/mp6yR4fmLfTOxfjfuwv6oVSyt6+Anbetx1meK7jhYBK1dCjIy8G6WQ8khk1hTFSSkQCdGXOJw== X-Mailgun-Sid: WyJiNjdhNCIsInFlbXUtZGV2ZWxAbm9uZ251Lm9yZyIsIjU0ZWY0Il0= X-Mailgun-Sending-Ip: 185.250.239.4 From: Alessandro Ratti To: qemu-devel@nongnu.org Cc: armbru@redhat.com, peter.maydell@linaro.org, berrange@redhat.com, mst@redhat.com, pbonzini@redhat.com, Alessandro Ratti Subject: [PATCH v3 2/3] hw/qdev: Prefix bus type in qdev_get_printable_name() device paths Date: Sat, 21 Mar 2026 11:04:04 +0100 Message-ID: <20260321100405.1525059-3-alessandro@0x65c.net> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260321100405.1525059-1-alessandro@0x65c.net> References: <20260321100405.1525059-1-alessandro@0x65c.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=185.250.239.4; envelope-from=bounce+db73df.54ef4-qemu-devel=nongnu.org@0x65c.net; helo=v54.v54282eed.euw1.send.eu.mailgun.net X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, SPF_HELO_NONE=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: fail (Header signature does not verify) X-ZM-MESSAGEID: 1774087541148158500 Content-Type: text/plain; charset="utf-8" Raw get_dev_path() output (e.g. "0000:00:04.0", "/1") is ambiguous without knowing which bus produced it. Prefix the path with the bus type name so error messages become self-describing. Examples: - PCIE device 0000:00:04.0 - virtio-pci-bus device 0000:00:03.0 Suggested-by: Markus Armbruster Signed-off-by: Alessandro Ratti --- hw/core/qdev.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index c44616b4b8..904e710f8e 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -418,11 +418,13 @@ const char *qdev_get_printable_name(DeviceState *dev) } /* * Fall back to a bus-specific device path, if the bus - * provides one (e.g. PCI address "0000:00:04.0"). + * provides one (e.g. "PCI device 0000:00:04.0"). */ - const char *path =3D qdev_get_dev_path(dev); + g_autofree char *path =3D qdev_get_dev_path(dev); if (path) { - return path; + const char *bus_type =3D object_get_typename(OBJECT(dev->parent_bu= s)); + char *name =3D g_strdup_printf("%s device %s", bus_type, path); + return name; } =20 return object_get_canonical_path(OBJECT(dev)); --=20 2.53.0 From nobody Sun Mar 22 14:11:52 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177408751884332.5178395775763; Sat, 21 Mar 2026 03:05:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w3tBy-0003hJ-Aa; Sat, 21 Mar 2026 06:04:26 -0400 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 1w3tBx-0003ga-2s for qemu-devel@nongnu.org; Sat, 21 Mar 2026 06:04:25 -0400 Received: from v5227.v57ae4e16.euw1.send.eu.mailgun.net ([161.38.204.227]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w3tBt-0002wd-Rh for qemu-devel@nongnu.org; Sat, 21 Mar 2026 06:04:24 -0400 Received: from fedora (pub158181109038.dh-hfc.datazug.ch [158.181.109.38]) by 712eb054bc9015b0ebda65af28a98072b50f328f288845fcd2556865c8031c9b with SMTP id 69be6d244146bb649678c26c; Sat, 21 Mar 2026 10:04:20 GMT DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=0x65c.net; q=dns/txt; s=email; t=1774087460; x=1774094660; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Subject: Cc: To: To: From: From: Sender: Sender; bh=P0eCPQz7NQO89Ee/DoQZcNv7gZm4ir9SUdszgWqF3LQ=; b=DP/ntKIj/SWAeaAfh2+/gKsT7Sv5jIOk6Qwu3q2xh0g4qVjS8b4FHiENNiFoRefAB7dUcebGtrauvUqPs3Wq214o+yu891ucjbzBw4KlfReLPnKdygA1ZwKq1OfLU1uVT9U1XG4GEglVi6/Tba+FT9qt0OiJ7DG4PSyyUYhKc4F/Oc1/s/UyhhMhEKEIEMJKDccjME5Bq+GAzyblgdA5UsGLEFAQ3gnGdtZO3tTAafZM6D8jwZnN791o3j19fODe41WmxSheZa04RGzQqMW9427LfEiGEcNOmnR/IfS70YIZa4xQrvrjbaSMatbMc8wRFoUJstn7bQ4hAWtIAZFgcQ== X-Mailgun-Sid: WyJiNjdhNCIsInFlbXUtZGV2ZWxAbm9uZ251Lm9yZyIsIjU0ZWY0Il0= X-Mailgun-Sending-Ip: 161.38.204.227 From: Alessandro Ratti To: qemu-devel@nongnu.org Cc: armbru@redhat.com, peter.maydell@linaro.org, berrange@redhat.com, mst@redhat.com, pbonzini@redhat.com, Alessandro Ratti Subject: [PATCH v3 3/3] hw/qdev: Consolidate qdev_get_printable_name() into qdev_get_human_name() Date: Sat, 21 Mar 2026 11:04:05 +0100 Message-ID: <20260321100405.1525059-4-alessandro@0x65c.net> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260321100405.1525059-1-alessandro@0x65c.net> References: <20260321100405.1525059-1-alessandro@0x65c.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=161.38.204.227; envelope-from=bounce+db73df.54ef4-qemu-devel=nongnu.org@0x65c.net; helo=v5227.v57ae4e16.euw1.send.eu.mailgun.net X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, SPF_HELO_NONE=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: fail (Header signature does not verify) X-ZM-MESSAGEID: 1774087521250158500 Content-Type: text/plain; charset="utf-8" Rename qdev_get_printable_name() to qdev_get_human_name(), remove the old qdev_get_human_name() implementation, and switch the three qdev_get_printable_name() callers in hw/virtio/virtio.c. qdev_get_printable_name() subsumes qdev_get_human_name(): both return the device ID when set and fall back to the canonical QOM path, but qdev_get_printable_name() also tries the bus-specific path first, providing more informative output. Suggested-by: Peter Maydell Signed-off-by: Alessandro Ratti --- hw/core/qdev.c | 10 +--------- hw/virtio/virtio.c | 6 +++--- include/hw/core/qdev.h | 26 +++++--------------------- 3 files changed, 9 insertions(+), 33 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 904e710f8e..93347f67bb 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -411,7 +411,7 @@ char *qdev_get_dev_path(DeviceState *dev) return NULL; } =20 -const char *qdev_get_printable_name(DeviceState *dev) +char *qdev_get_human_name(DeviceState *dev) { if (dev->id) { return g_strdup(dev->id); @@ -857,14 +857,6 @@ Object *machine_get_container(const char *name) return container; } =20 -char *qdev_get_human_name(DeviceState *dev) -{ - g_assert(dev !=3D NULL); - - return dev->id ? - g_strdup(dev->id) : object_get_canonical_path(OBJECT(dev)); -} - static MachineInitPhase machine_phase; =20 bool phase_check(MachineInitPhase phase) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 8fcf6cfd0b..63e2faee99 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -281,7 +281,7 @@ void virtio_init_region_cache(VirtIODevice *vdev, int n) len =3D address_space_cache_init(&new->desc, vdev->dma_as, addr, size, packed); if (len < size) { - g_autofree const char *devname =3D qdev_get_printable_name(DEVICE(= vdev)); + g_autofree char *devname =3D qdev_get_human_name(DEVICE(vdev)); =20 virtio_error(vdev, "Failed to map descriptor ring for device %s: " @@ -294,7 +294,7 @@ void virtio_init_region_cache(VirtIODevice *vdev, int n) len =3D address_space_cache_init(&new->used, vdev->dma_as, vq->vring.used, size, true); if (len < size) { - g_autofree const char *devname =3D qdev_get_printable_name(DEVICE(= vdev)); + g_autofree char *devname =3D qdev_get_human_name(DEVICE(vdev)); =20 virtio_error(vdev, "Failed to map used ring for device %s: " @@ -307,7 +307,7 @@ void virtio_init_region_cache(VirtIODevice *vdev, int n) len =3D address_space_cache_init(&new->avail, vdev->dma_as, vq->vring.avail, size, false); if (len < size) { - g_autofree const char *devname =3D qdev_get_printable_name(DEVICE(= vdev)); + g_autofree char *devname =3D qdev_get_human_name(DEVICE(vdev)); =20 virtio_error(vdev, "Failed to map avalaible ring for device %s: " diff --git a/include/hw/core/qdev.h b/include/hw/core/qdev.h index b87497906a..43d8e58432 100644 --- a/include/hw/core/qdev.h +++ b/include/hw/core/qdev.h @@ -1049,13 +1049,12 @@ Object *machine_get_container(const char *name); * qdev_get_human_name() - Return a human-readable name for a device * @dev: The device. Must be a valid and non-NULL pointer. * - * .. note:: - * This function is intended for user friendly error messages. - * - * Returns: A newly allocated string containing the device id if not null, - * else the object canonical path. + * Returns: A newly allocated string suitable for user-facing error + * messages. * - * Use g_free() to free it. + * Return the device's ID if it has one. Else, return the path of a + * device on its bus if it has one. Else return its canonical QOM + * path. */ char *qdev_get_human_name(DeviceState *dev); =20 @@ -1085,21 +1084,6 @@ extern bool qdev_hot_removed; */ char *qdev_get_dev_path(DeviceState *dev); =20 -/** - * qdev_get_printable_name: Return human readable name for device - * @dev: Device to get name of - * - * Returns: A newly allocated string containing some human - * readable name for the device, suitable for printing in - * user-facing error messages. The function will never return NULL, - * so the name can be used without further checking or fallbacks. - * - * Return the device's ID if it has one. Else, return the path of a - * device on its bus if it has one. Else return its canonical QOM - * path. - */ -const char *qdev_get_printable_name(DeviceState *dev); - void qbus_set_hotplug_handler(BusState *bus, Object *handler); void qbus_set_bus_hotplug_handler(BusState *bus); =20 --=20 2.53.0