qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
	qemu-devel@nongnu.org,  eblake@redhat.com,  eduardo@habkost.net,
	pbonzini@redhat.com,  marcel.apfelbaum@gmail.com,
	 mst@redhat.com, philmd@linaro.org,
	 den-plotnikov@yandex-team.ru, antonkuchin@yandex-team.ru,
	 "reviewer:Incompatible changes" <libvir-list@redhat.com>
Subject: Re: [PATCH v4 14/16] qapi: deprecate "device" field of DEVICE_* events
Date: Tue, 14 Feb 2023 17:28:17 +0100	[thread overview]
Message-ID: <87wn4kfbz2.fsf@pond.sub.org> (raw)
In-Reply-To: <Y+uTz2QfWGo2HUZ1@redhat.com> ("Daniel P. Berrangé"'s message of "Tue, 14 Feb 2023 13:59:43 +0000")

Daniel P. Berrangé <berrange@redhat.com> writes:

> On Tue, Feb 14, 2023 at 12:57:28PM +0100, Markus Armbruster wrote:
>> Daniel P. Berrangé <berrange@redhat.com> writes:
>> 
>> > On Tue, Feb 14, 2023 at 09:54:22AM +0100, Markus Armbruster wrote:
>> >> Daniel P. Berrangé <berrange@redhat.com> writes:
>> >> 
>> >> > On Mon, Feb 13, 2023 at 05:01:01PM +0300, Vladimir Sementsov-Ogievskiy wrote:
>> >> >> The device field is redundant, because QOM path always include device
>> >> >> ID when this ID exist.
>> >> >
>> >> > The flipside to that view is that applications configuring QEMU are
>> >> > specifying the device ID for -device (CLI) / device_add (QMP) and
>> >> > not the QOM path. IOW, the device ID is the more interesting field
>> >> > than QOM path, so feels like the wrong one to be dropping.
>> >> 
>> >> QOM path is a reliable way to identify a device.  Device ID isn't:
>> >> devices need not have one.  Therefore, dropping the QOM path would be
>> >> wrong.
>> >> 
>> >> > Is there any real benefit to dropping this ? 
>> >> 
>> >> The device ID is a trap for the unwary: relying on it is fine until you
>> >> run into a scenario where you have to deal with devices lacking IDs.
>> >
>> > When a mgmt app is configuring QEMU though, it does it exclusively
>> > with device ID values. If I add a device "-device foo,id=dev0",
>> > and then later hot-unplug it "device_del dev0", it is pretty
>> > reasonable to then expect that the DEVICE_DELETED even will then
>> > include the ID value the app has been using elsewhere.
>> 
>> The management application would be well advised to use QOM paths with
>> device_del, because only that works even for devices created by default
>> (which have no ID), and devices the user created behind the management
>> application's back.
>
> If an application is using -nodefaults, then the only devices which
> exist will be those which are hardwired into the machine, and they
> can't be used with device_del anyway as they're hardwired.

Your trust in the sanity of our board code is touching ;)

> So the only reason is to cope with devices created secretly by
> the users, and that's a hairy enough problem that most apps won't
> even try to cope with it.

Fair enough.

> At least in terms of the device hotplug area, it feels like we're
> adding an extra hurdle for apps to solve a problem that they don't
> actually face in practice.
>
> QOM paths are needed in some other QMP commands though, where
> there is definite need to refer to devices that are hardwired,
> most obviously qom-set/qom-get.

Also query-cpus-fast, query-hotpluggable-cpus, and possibly more I
missed.



  reply	other threads:[~2023-02-14 16:28 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 14:00 [PATCH v4 00/16] pci hotplug tracking Vladimir Sementsov-Ogievskiy
2023-02-13 14:00 ` [PATCH v4 01/16] pci/shpc: set attention led to OFF on reset Vladimir Sementsov-Ogievskiy
2023-02-13 14:16   ` Philippe Mathieu-Daudé
2023-02-14  9:49     ` Vladimir Sementsov-Ogievskiy
2023-02-14 19:31   ` Anton Kuchin
2023-02-13 14:00 ` [PATCH v4 02/16] pci/shpc: change shpc_get_status() return type to uint8_t Vladimir Sementsov-Ogievskiy
2023-02-14 19:32   ` Anton Kuchin
2023-02-13 14:00 ` [PATCH v4 03/16] pci/shpc: shpc_slot_command(): handle PWRONLY -> ENABLED transition Vladimir Sementsov-Ogievskiy
2023-02-14 19:33   ` Anton Kuchin
2023-02-13 14:00 ` [PATCH v4 04/16] pci/shpc: more generic handle hot-unplug in shpc_slot_command() Vladimir Sementsov-Ogievskiy
2023-02-14 19:34   ` Anton Kuchin
2023-02-13 14:00 ` [PATCH v4 05/16] pci/shpc: pass PCIDevice pointer to shpc_slot_command() Vladimir Sementsov-Ogievskiy
2023-02-14 19:35   ` Anton Kuchin
2023-02-13 14:00 ` [PATCH v4 06/16] pci/shpc: refactor shpc_device_plug_common() Vladimir Sementsov-Ogievskiy
2023-02-14 19:36   ` Anton Kuchin
2023-02-13 14:00 ` [PATCH v4 07/16] pcie: pcie_cap_slot_write_config(): use correct macro Vladimir Sementsov-Ogievskiy
2023-02-14 19:37   ` Anton Kuchin
2023-02-13 14:00 ` [PATCH v4 08/16] pcie_regs: drop duplicated indicator value macros Vladimir Sementsov-Ogievskiy
2023-02-14 19:39   ` Anton Kuchin
2023-02-13 14:00 ` [PATCH v4 09/16] pcie: drop unused PCIExpressIndicator Vladimir Sementsov-Ogievskiy
2023-02-14 19:40   ` Anton Kuchin
2023-02-13 14:00 ` [PATCH v4 10/16] pcie: pcie_cap_slot_enable_power() use correct helper Vladimir Sementsov-Ogievskiy
2023-02-14 19:41   ` Anton Kuchin
2023-02-13 14:00 ` [PATCH v4 11/16] pcie: introduce pcie_sltctl_powered_off() helper Vladimir Sementsov-Ogievskiy
2023-02-14 19:41   ` Anton Kuchin
2023-02-13 14:00 ` [PATCH v4 12/16] pcie: set power indicator to off on reset by default Vladimir Sementsov-Ogievskiy
2023-02-14 19:42   ` Anton Kuchin
2023-02-13 14:01 ` [PATCH v4 13/16] pci: introduce pci_find_the_only_child() Vladimir Sementsov-Ogievskiy
2023-02-14 19:43   ` Anton Kuchin
2023-02-13 14:01 ` [PATCH v4 14/16] qapi: deprecate "device" field of DEVICE_* events Vladimir Sementsov-Ogievskiy
2023-02-13 14:13   ` Daniel P. Berrangé
2023-02-14  8:54     ` Markus Armbruster
2023-02-14  9:25       ` Peter Krempa
2023-02-14 11:14         ` Daniel P. Berrangé
2023-02-14 11:49           ` Markus Armbruster
2023-02-14 11:53             ` Philippe Mathieu-Daudé
2023-02-14 12:17               ` Markus Armbruster
2023-02-14 13:56                 ` Philippe Mathieu-Daudé
2023-02-14 16:18                   ` Markus Armbruster
2023-02-14 11:53             ` Markus Armbruster
2023-02-14 11:13       ` Daniel P. Berrangé
2023-02-14 11:57         ` Markus Armbruster
2023-02-14 13:51           ` Vladimir Sementsov-Ogievskiy
2023-02-14 13:59           ` Daniel P. Berrangé
2023-02-14 16:28             ` Markus Armbruster [this message]
2023-02-15 21:00               ` Vladimir Sementsov-Ogievskiy
2023-02-16  0:34                 ` Markus Armbruster
2023-02-13 14:01 ` [PATCH v4 15/16] qapi: add HOTPLUG_STATE event Vladimir Sementsov-Ogievskiy
2023-02-13 14:10   ` Philippe Mathieu-Daudé
2023-02-14  8:56     ` Markus Armbruster
2023-02-14  9:52       ` Vladimir Sementsov-Ogievskiy
2023-02-13 14:01 ` [PATCH v4 16/16] qapi: introduce DEVICE_ON event Vladimir Sementsov-Ogievskiy
2023-02-13 14:12   ` Philippe Mathieu-Daudé
2023-02-14  8:58     ` Markus Armbruster
2023-02-14  9:56       ` Vladimir Sementsov-Ogievskiy

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=87wn4kfbz2.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=antonkuchin@yandex-team.ru \
    --cc=berrange@redhat.com \
    --cc=den-plotnikov@yandex-team.ru \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=libvir-list@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@yandex-team.ru \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).