[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 14/16] qapi: deprecate "device" field of DEVICE_* events
From: |
Markus Armbruster |
Subject: |
Re: [PATCH v4 14/16] qapi: deprecate "device" field of DEVICE_* events |
Date: |
Tue, 14 Feb 2023 17:28:17 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
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.
- Re: [PATCH v4 14/16] qapi: deprecate "device" field of DEVICE_* events, (continued)
- Re: [PATCH v4 14/16] qapi: deprecate "device" field of DEVICE_* events, Markus Armbruster, 2023/02/14
- Re: [PATCH v4 14/16] qapi: deprecate "device" field of DEVICE_* events, Philippe Mathieu-Daudé, 2023/02/14
- Re: [PATCH v4 14/16] qapi: deprecate "device" field of DEVICE_* events, Markus Armbruster, 2023/02/14
- Re: [PATCH v4 14/16] qapi: deprecate "device" field of DEVICE_* events, Philippe Mathieu-Daudé, 2023/02/14
- Re: [PATCH v4 14/16] qapi: deprecate "device" field of DEVICE_* events, Markus Armbruster, 2023/02/14
- Re: [PATCH v4 14/16] qapi: deprecate "device" field of DEVICE_* events, Markus Armbruster, 2023/02/14
- Re: [PATCH v4 14/16] qapi: deprecate "device" field of DEVICE_* events, Daniel P . Berrangé, 2023/02/14
- Re: [PATCH v4 14/16] qapi: deprecate "device" field of DEVICE_* events, Markus Armbruster, 2023/02/14
- Re: [PATCH v4 14/16] qapi: deprecate "device" field of DEVICE_* events, Vladimir Sementsov-Ogievskiy, 2023/02/14
- Re: [PATCH v4 14/16] qapi: deprecate "device" field of DEVICE_* events, Daniel P . Berrangé, 2023/02/14
- Re: [PATCH v4 14/16] qapi: deprecate "device" field of DEVICE_* events,
Markus Armbruster <=
- Re: [PATCH v4 14/16] qapi: deprecate "device" field of DEVICE_* events, Vladimir Sementsov-Ogievskiy, 2023/02/15
- Re: [PATCH v4 14/16] qapi: deprecate "device" field of DEVICE_* events, Markus Armbruster, 2023/02/15
[PATCH v4 11/16] pcie: introduce pcie_sltctl_powered_off() helper, Vladimir Sementsov-Ogievskiy, 2023/02/13
[PATCH v4 09/16] pcie: drop unused PCIExpressIndicator, Vladimir Sementsov-Ogievskiy, 2023/02/13
[PATCH v4 16/16] qapi: introduce DEVICE_ON event, Vladimir Sementsov-Ogievskiy, 2023/02/13