{"id":2231425,"url":"http://patchwork.ozlabs.org/api/patches/2231425/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260430172204.1006673-19-pbonzini@redhat.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260430172204.1006673-19-pbonzini@redhat.com>","list_archive_url":null,"date":"2026-04-30T17:21:24","name":"[PULL,18/58] hw/qdev: Clarify fallback order in qdev_get_printable_name()","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"70991e493bff7f73dfc5975f2f913961892dfcae","submitter":{"id":2701,"url":"http://patchwork.ozlabs.org/api/people/2701/?format=json","name":"Paolo Bonzini","email":"pbonzini@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260430172204.1006673-19-pbonzini@redhat.com/mbox/","series":[{"id":502347,"url":"http://patchwork.ozlabs.org/api/series/502347/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=502347","date":"2026-04-30T17:21:16","name":"[PULL,01/58] pythondeps: bump to meson 1.11.1","version":1,"mbox":"http://patchwork.ozlabs.org/series/502347/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2231425/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2231425/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=fkBGuMYX;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=google header.b=n/gLD4fH;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g61Jw5n4wz1yHZ\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 01 May 2026 03:25:20 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wIV6X-0004sc-4Y; Thu, 30 Apr 2026 13:23:13 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <pbonzini@redhat.com>)\n id 1wIV6V-0004nG-JF\n for qemu-devel@nongnu.org; Thu, 30 Apr 2026 13:23:11 -0400","from us-smtp-delivery-124.mimecast.com ([170.10.133.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <pbonzini@redhat.com>)\n id 1wIV6T-0004Qu-Lk\n for qemu-devel@nongnu.org; Thu, 30 Apr 2026 13:23:11 -0400","from mail-qv1-f72.google.com (mail-qv1-f72.google.com\n [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-314-NXr-__kOPzaUjF7ZpEqmeA-1; Thu, 30 Apr 2026 13:23:07 -0400","by mail-qv1-f72.google.com with SMTP id\n 6a1803df08f44-8b49260e3d5so18117406d6.2\n for <qemu-devel@nongnu.org>; Thu, 30 Apr 2026 10:23:07 -0700 (PDT)","from [192.168.10.48] ([151.49.85.67])\n by smtp.gmail.com with ESMTPSA id\n 6a1803df08f44-8b3ff439c2csm22584136d6.23.2026.04.30.10.23.03\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 30 Apr 2026 10:23:04 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1777569789;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=+j0fl0DNtcWoFMMUu4/jC4alYmSV0o7g9FyZIwu1dMs=;\n b=fkBGuMYXLmN/KCaEoxlYwx0Q7LYID5pCkimb+Gz/ocCz/g/u2LyT/+g01z/f0h5tcanFbA\n 0pSsXyBQM+i8AtXueRbRvsl9hEcvurEnWGDmKYYK2WKeVQQuwwKlPFDW/4J96LfVx+0DbY\n lPkXeqOgPnTJ68S5hD20nDUU6vT69Wc=","v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1777569786; x=1778174586; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=+j0fl0DNtcWoFMMUu4/jC4alYmSV0o7g9FyZIwu1dMs=;\n b=n/gLD4fH4M/eoplLJ+ta5nF7YhlRlK5Mo7p1aoHFISxLj06jQ+tSwkpSAXD1apZ3dl\n C4K02Zgj3vFDeaX4qaBt7uwO1vRBjONa/Qmaj3sojWUJBcwSLqPlV0q5X2psZYGk6cNI\n IIMFrvnoig5XZMkr89vAPy5aZ/NhvCuLgU8TshCC831H6iOn/EuEM0mCc2O9ceC/tal3\n LbJsvl8cI2GqPyqHeZbxNO1Ey2E6l4m11HQ+HqyjeOeD2S14oL8lh+h9rW98mRhQ+lwp\n upVeWDavTSBrz/QaMbZGIhZBj6gf7o5ZQ4GZDS/ink0IB0aAq/LuXsnf8j8n8JRO9j/7\n C5yQ=="],"X-MC-Unique":"NXr-__kOPzaUjF7ZpEqmeA-1","X-Mimecast-MFC-AGG-ID":"NXr-__kOPzaUjF7ZpEqmeA_1777569787","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777569786; x=1778174586;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=+j0fl0DNtcWoFMMUu4/jC4alYmSV0o7g9FyZIwu1dMs=;\n b=sbZrBLSfDUrb7AbngSZwLiOHsj2oc/5IhsfJJfFq7H0i/JxPt/MYXx0Tjx5nSHILtu\n qbcU+d19LOhaqb20pJREGPMNUIcHmXudW9UXVX3RR2UcdnkN2OXyFKGn7NJFeynmoZX6\n ZGLCRonI9pDvRUkMGI8xEpQm7PYJfIBKM3vIGebtRJ5N1SCpJTR0y8yfFzFfJ8H4oC0h\n v4tQOPpXk9w4W25WYPYMkgAU4rYx38VBWZh6I5Ppz9BoPiTP+uMrL6JBfYsazj1SBUsP\n JwgSw6xp9cmwlNKTx9P0iMR4zXoe/O4HpjH/aKQVyxtkmNwjfnIkVlZoEIVwoWxgZ4Uk\n 45LA==","X-Gm-Message-State":"AOJu0Yz/bX1kmACAzdNwQhGGuUjckiBuy8IjPvP6GgxcvDCrlSKbON63\n UMBA7vGEDuWkTlF0zlOUwUGRb8BWByjAd7ClR4quTTH6lWuxaA7T85ujWWMfdCbCr2o9fxUvrK2\n VlXvN6AxVz7cmCTnWQi8A+9+rcwK+ePxCqzcHD2kcKUNTQSfGbfn2yaiLs9mbxw3+o9rZtj1Y6P\n 83jQ2dyXr9nlVMoosX8b5UjwmYsIwQcXd5T776KjJ9","X-Gm-Gg":"AeBDietEQ20J9EbiPT3UbjFGxUlV+gr4m6o8jqQbuFok+HiJ4wBpaT9Z4Zf3XSuHUSf\n ROvJejfzjny/fhJI6LiA0aAIFpX5eS3jQWqhyWkVNlBIiwii341Wv2MnJi2ktTghy+7NsZ+gPKq\n aWBCChXaXUT+mYzW8XNtSUN5ikvEoMWlV078Ebkz2uh6yjcskFBONxi2wz5qNTm/y9HydlCnSk4\n JyQvbK2/pv2Bd4VNwbhnpdzg+oSUu0zGJKa+TZzuLr/AUKNOZwVKvDFMo2Srj/nfZqPgSQONlAU\n +585yUAiQyQOwDdh4h5g0IiqrR2d5VxAJYr+Tv8bmOViBtFVpGUeCwDN6oAVYnpZQjTs9h2gpUR\n c/29NROfe7pVAV2wmTuD+8Dheayo6DelqKIMOfpC3daRmnh0L1lff0FrENN7CUs1Bv6x5JbNsmK\n jZ2bjLY2QjJ1yG77XH9kkXTqqgkuZT6Kc1a5c=","X-Received":["by 2002:a05:6214:4699:b0:8b1:f5da:f811 with SMTP id\n 6a1803df08f44-8b3fe808413mr62036386d6.48.1777569786153;\n Thu, 30 Apr 2026 10:23:06 -0700 (PDT)","by 2002:a05:6214:4699:b0:8b1:f5da:f811 with SMTP id\n 6a1803df08f44-8b3fe808413mr62035586d6.48.1777569785340;\n Thu, 30 Apr 2026 10:23:05 -0700 (PDT)"],"From":"Paolo Bonzini <pbonzini@redhat.com>","To":"qemu-devel@nongnu.org","Cc":"Alessandro Ratti <alessandro@0x65c.net>,\n Markus Armbruster <armbru@redhat.com>","Subject":"[PULL 18/58] hw/qdev: Clarify fallback order in\n qdev_get_printable_name()","Date":"Thu, 30 Apr 2026 19:21:24 +0200","Message-ID":"<20260430172204.1006673-19-pbonzini@redhat.com>","X-Mailer":"git-send-email 2.54.0","In-Reply-To":"<20260430172204.1006673-1-pbonzini@redhat.com>","References":"<20260430172204.1006673-1-pbonzini@redhat.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=170.10.133.124;\n envelope-from=pbonzini@redhat.com;\n 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,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001,\n 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 <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"},"content":"From: Alessandro Ratti <alessandro@0x65c.net>\n\nReplace the uninformative \"<unknown device>\" final fallback with the\ncanonical QOM path (e.g. /machine/peripheral-anon/device[0]).\n\nAlso clean up comments to accurately describe qdev_get_dev_path()\nbehavior, drop an unnecessary comment on the dev->id check, and rename\nthe @vdev parameter to @dev for consistency with surrounding code.\n\nUpdate the doc comment in qdev.h to reflect the new fallback chain.\n\nSigned-off-by: Alessandro Ratti <alessandro@0x65c.net>\nReviewed-by: Markus Armbruster <armbru@redhat.com>\nLink: https://lore.kernel.org/r/20260321100405.1525059-2-alessandro@0x65c.net\nSigned-off-by: Paolo Bonzini <pbonzini@redhat.com>\n---\n include/hw/core/qdev.h |  8 +++-----\n hw/core/qdev.c         | 26 +++++++-------------------\n 2 files changed, 10 insertions(+), 24 deletions(-)","diff":"diff --git a/include/hw/core/qdev.h b/include/hw/core/qdev.h\nindex 337d69ea2c3..226bd662901 100644\n--- a/include/hw/core/qdev.h\n+++ b/include/hw/core/qdev.h\n@@ -1067,11 +1067,9 @@ char *qdev_get_dev_path(DeviceState *dev);\n  * user-facing error messages. The function will never return NULL,\n  * so the name can be used without further checking or fallbacks.\n  *\n- * If the device has an explicitly set ID (e.g. by the user on the\n- * command line via \"-device thisdev,id=myid\") this is preferred.\n- * Otherwise we try the canonical QOM device path (which will be\n- * the PCI ID for PCI devices, for example). If all else fails\n- * we will return the placeholder \"<unknown device\">.\n+ * Return the device's ID if it has one.  Else, return the path of a\n+ * device on its bus if it has one.  Else return its canonical QOM\n+ * path.\n  */\n const char *qdev_get_printable_name(DeviceState *dev);\n \ndiff --git a/hw/core/qdev.c b/hw/core/qdev.c\nindex b36101f3a75..78156185d57 100644\n--- a/hw/core/qdev.c\n+++ b/hw/core/qdev.c\n@@ -412,33 +412,21 @@ char *qdev_get_dev_path(DeviceState *dev)\n     return NULL;\n }\n \n-const char *qdev_get_printable_name(DeviceState *vdev)\n+const char *qdev_get_printable_name(DeviceState *dev)\n {\n-    /*\n-     * Return device ID if explicity set\n-     * (e.g. -device virtio-blk-pci,id=foo)\n-     * This allows users to correlate errors with their custom device\n-     * names.\n-     */\n-    if (vdev->id) {\n-        return g_strdup(vdev->id);\n+    if (dev->id) {\n+        return g_strdup(dev->id);\n     }\n     /*\n-     * Fall back to the canonical QOM device path (eg. ID for PCI\n-     * devices).\n-     * This ensures the device is still uniquely and meaningfully\n-     * identified.\n+     * Fall back to a bus-specific device path, if the bus\n+     * provides one (e.g. PCI address \"0000:00:04.0\").\n      */\n-    const char *path = qdev_get_dev_path(vdev);\n+    const char *path = qdev_get_dev_path(dev);\n     if (path) {\n         return path;\n     }\n \n-    /*\n-     * Final fallback: if all else fails, return a placeholder string.\n-     * This ensures the error message always contains a valid string.\n-     */\n-    return g_strdup(\"<unknown device>\");\n+    return object_get_canonical_path(OBJECT(dev));\n }\n \n void qdev_add_unplug_blocker(DeviceState *dev, Error *reason)\n","prefixes":["PULL","18/58"]}