All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Alessandro Ratti <alessandro@0x65c.net>
Cc: qemu-devel@nongnu.org,  peter.maydell@linaro.org,
	 berrange@redhat.com, mst@redhat.com,  pbonzini@redhat.com
Subject: Re: [PATCH v2 2/2] hw/qdev: Remove qdev_get_human_name()
Date: Tue, 17 Mar 2026 08:08:25 +0100	[thread overview]
Message-ID: <87h5qflyqe.fsf@pond.sub.org> (raw)
In-Reply-To: <20260311215003.664815-3-alessandro@0x65c.net> (Alessandro Ratti's message of "Wed, 11 Mar 2026 22:50:03 +0100")

Alessandro Ratti <alessandro@0x65c.net> writes:

> Remove qdev_get_human_name() and switch its two callers in
> hw/block/block.c to qdev_get_printable_name().
>
> 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
> device path first, providing more informative output.
>
> Narrow the scope of dev_id in blk_check_size_and_read_all() to the
> blocks where it is actually used.
>
> Suggested-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Alessandro Ratti <alessandro@0x65c.net>

This replaces two ways to describe a device to the user by one.  Good.

One half of the uses is unchanged.  Good.

The other half can now show a bus-specific device path instead of the
canonical QOM path.  This path can be difficult to interpret: we have
some twenty .get_dev_path() methods, and each of them can format however
it wants.  I need to guess the format to make sense of the value.  I'm
inclined to call this a regression.

To address this, please insert another patch before this one that
changes

        device <dev-path>

  to

        <bus> device <dev-path>

This removes the guesswork, and actually satisfies the claim "more
informative output".

If you have reasons to do it in a follow-up patch instead, explain them
briefly.

qdev_get_human_name() is a better name than qdev_get_printable_name().
Please consider renaming the function so we keep the better name.



  reply	other threads:[~2026-03-17  7:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11 21:50 [PATCH v2 0/2] qdev: Consolidate qdev_get_human_name() into qdev_get_printable_name() Alessandro Ratti
2026-03-11 21:50 ` [PATCH v2 1/2] hw/qdev: Clarify fallback order in qdev_get_printable_name() Alessandro Ratti
2026-03-17  6:46   ` Markus Armbruster
2026-03-17 21:19     ` Alessandro Ratti
2026-03-11 21:50 ` [PATCH v2 2/2] hw/qdev: Remove qdev_get_human_name() Alessandro Ratti
2026-03-17  7:08   ` Markus Armbruster [this message]
2026-03-17 21:38     ` Alessandro Ratti
2026-03-18  6:33       ` Markus Armbruster
2026-03-18  6:34         ` Markus Armbruster
2026-03-18  7:04       ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h5qflyqe.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=alessandro@0x65c.net \
    --cc=berrange@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.