From: Markus Armbruster <armbru@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: Markus Armbruster <armbru@redhat.com>,
qemu-devel@nongnu.org, eblake@redhat.com, eduardo@habkost.net,
berrange@redhat.com, pbonzini@redhat.com,
marcel.apfelbaum@gmail.com, mst@redhat.com,
den-plotnikov@yandex-team.ru
Subject: Re: [PATCH v3 13/15] qapi: add HOTPLUG_STATE event
Date: Fri, 10 Feb 2023 13:01:12 +0100 [thread overview]
Message-ID: <874jrtsp9z.fsf@pond.sub.org> (raw)
In-Reply-To: <c361c5f3-c623-09e9-0519-cf9ba68ae0a1@yandex-team.ru> (Vladimir Sementsov-Ogievskiy's message of "Fri, 10 Feb 2023 14:36:37 +0300")
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:
> On 10.02.23 13:23, Markus Armbruster wrote:
>> Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:
>>
>>> For PCIe and SHPC hotplug it's important to track led indicators,
>>> especially the power led. Add an event that helps.
>>>
>>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
>>> ---
[...]
>>> +##
>>> +# @HotplugState:
>>> +#
>>> +# @hotplug-device: hotplug device id
>>> +# @hotplug-path: hotplug device path
>>> +# @hotplug-slot: hotplug device slot (only for SHPC)
>>> +# @device: device name
>>> +# @path: device path
>>> +# @power-led: Power Indicator
>>> +# @attention-led: Attention Indicator
>>> +# @state: slot state, only for SHPC hotplug controller
>>> +# @power: Power Controller state, only for PCIe hotplug
>>
>>
>>
>>> +#
>>> +# Since: 8.0
>>> +##
>>> +{ 'struct': 'HotplugState',
>>> + 'data': { '*hotplug-device': 'str',
>>> + 'hotplug-path': 'str',
>>> + '*hotplug-slot': 'int',
>>> + '*device': 'str',
>>> + 'path': 'str',
>>> + '*power-led': 'HotplugLedState',
>>> + '*attention-led': 'HotplugLedState',
>>> + '*state': 'HotplugSlotState',
>>> + '*power': 'HotplugPowerState' } }
>>
>> Too terse.
>
> Will fix)
>
>>
>> What do @hotplug-device and @device name? Are these qdev-id?
>>
>> What kind of paths are @hotplug-path and @path? Are these paths to an
>> object device in the QOM tree? Which object?
>
> device / path is same name and path as for DEVICE_DELETED
Got it. But there we have just one device, and here we have two. Which
two?
Also, DEVICE_DELETED's doc comment is better:
# @device: the device's ID if it has one
#
# @path: the device's QOM path
Suggest to steal from there.
>> What's a @hotplug-slot?
>
> pci slot. Significant for SHPC
>
>>
>>> +
>>> +##
>>> +# @HOTPLUG_STATE:
>>> +#
>>> +# Emitted whenever the state of hotplug controller is changed.
>>
>> Suggest "the state of hotplug controller changes."
>>
>> Regardless, too terse. What state changes exactly trigger the event?
>
> Any change of power-led / attention-led / state / power.
>
> Will add a description
>
>>
>>> +# Only changed values are included into event.
>>
>> "in the event"
>>
>> Which values are included for each event trigger?
>
> - device ids and names always included
> - power-led / attention-led / state / power - only those who changed
>
>>
>>> +# Only SHPC and PCIe-native hotplug are supported.
>>
>> Suggest something like "only ... provide this event."
>>
>> Are parts of HotplugState specific to "SHPC and PCIe-native"? Or asked
>> differently: when we make other kinds of hotplug send the event, what
>> would we need to change here?
>
> Hmm. Looks like I'd better use a union with type discriminator. This way we'll be able to add any other hotplug later.
>
> (and even now it's better, as not all 4 state fields are shared for PCIe and SHPC)
A union feels like the way to go.
>>> +#
>>> +# Since: 8.0
>>> +##
>>> +{ 'event': 'HOTPLUG_STATE',
>>> + 'data': 'HotplugState' }
>>
>> [...]
next prev parent reply other threads:[~2023-02-10 12:02 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-09 20:07 [PATCH v3 00/15] pci hotplug tracking Vladimir Sementsov-Ogievskiy
2023-02-09 20:07 ` [PATCH v3 01/15] pci/shpc: set attention led to OFF on reset Vladimir Sementsov-Ogievskiy
2023-02-09 20:07 ` [PATCH v3 02/15] pci/shpc: change shpc_get_status() return type to uint8_t Vladimir Sementsov-Ogievskiy
2023-02-09 20:07 ` [PATCH v3 03/15] pci/shpc: shpc_slot_command(): handle PWRONLY -> ENABLED transition Vladimir Sementsov-Ogievskiy
2023-02-09 20:07 ` [PATCH v3 04/15] pci/shpc: more generic handle hot-unplug in shpc_slot_command() Vladimir Sementsov-Ogievskiy
2023-02-09 20:07 ` [PATCH v3 05/15] pci/shpc: pass PCIDevice pointer to shpc_slot_command() Vladimir Sementsov-Ogievskiy
2023-02-09 20:07 ` [PATCH v3 06/15] pcie: pcie_cap_slot_write_config(): use correct macro Vladimir Sementsov-Ogievskiy
2023-02-09 20:08 ` [PATCH v3 07/15] pcie_regs: drop duplicated indicator value macros Vladimir Sementsov-Ogievskiy
2023-02-09 20:08 ` [PATCH v3 08/15] pcie: drop unused PCIExpressIndicator Vladimir Sementsov-Ogievskiy
2023-02-09 20:08 ` [PATCH v3 09/15] pcie: pcie_cap_slot_enable_power() use correct helper Vladimir Sementsov-Ogievskiy
2023-02-09 20:08 ` [PATCH v3 10/15] pcie: introduce pcie_sltctl_powered_off() helper Vladimir Sementsov-Ogievskiy
2023-02-09 21:23 ` Philippe Mathieu-Daudé
2023-02-09 20:08 ` [PATCH v3 11/15] pcie: set power indicator to off on reset by default Vladimir Sementsov-Ogievskiy
2023-02-09 20:08 ` [PATCH v3 12/15] pci: introduce pci_find_the_only_child() Vladimir Sementsov-Ogievskiy
2023-02-09 20:08 ` [PATCH v3 13/15] qapi: add HOTPLUG_STATE event Vladimir Sementsov-Ogievskiy
2023-02-09 21:28 ` Philippe Mathieu-Daudé
2023-02-10 10:47 ` Vladimir Sementsov-Ogievskiy
2023-02-10 11:20 ` Philippe Mathieu-Daudé
2023-02-10 10:23 ` Markus Armbruster
2023-02-10 11:36 ` Vladimir Sementsov-Ogievskiy
2023-02-10 12:01 ` Markus Armbruster [this message]
2023-02-10 13:38 ` Vladimir Sementsov-Ogievskiy
2023-02-09 20:08 ` [PATCH v3 14/15] qapi: introduce DEVICE_ON event Vladimir Sementsov-Ogievskiy
2023-02-09 21:37 ` Philippe Mathieu-Daudé
2023-02-10 13:49 ` Vladimir Sementsov-Ogievskiy
2023-02-13 9:30 ` Markus Armbruster
2023-02-13 11:43 ` Vladimir Sementsov-Ogievskiy
2023-02-09 20:08 ` [PATCH v3 15/15] qapi: introduce query-hotplug command Vladimir Sementsov-Ogievskiy
2023-02-10 10:09 ` Markus Armbruster
2023-02-10 13:51 ` 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=874jrtsp9z.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=den-plotnikov@yandex-team.ru \
--cc=eblake@redhat.com \
--cc=eduardo@habkost.net \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--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 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.