qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 18/18] qapi: introduce DEVICE_ON event


From: Michael S. Tsirkin
Subject: Re: [PATCH v5 18/18] qapi: introduce DEVICE_ON event
Date: Thu, 2 Mar 2023 05:05:58 -0500

On Thu, Mar 02, 2023 at 01:03:12PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> On 02.03.23 11:44, Michael S. Tsirkin wrote:
> > On Thu, Feb 16, 2023 at 09:03:56PM +0300, Vladimir Sementsov-Ogievskiy 
> > wrote:
> > > We have DEVICE_DELETED event, that signals that device_del command is
> > > actually completed. But we don't have a counter-part for device_add.
> > > Still it's sensible for SHPC and PCIe-native hotplug, as there are time
> > > when the device in some intermediate state. Let's add an event that say
> > > that the device is finally powered on, power indicator is on and
> > > everything is OK for next manipulation on that device.
> > > 
> > > Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
> > > ---
> > >   qapi/qdev.json | 10 ++++++++++
> > >   hw/pci/pcie.c  | 14 ++++++++++++++
> > >   hw/pci/shpc.c  | 12 ++++++++++++
> > >   3 files changed, 36 insertions(+)
> > > 
> > > diff --git a/qapi/qdev.json b/qapi/qdev.json
> > > index 6f2d8d6647..116a8a7de8 100644
> > > --- a/qapi/qdev.json
> > > +++ b/qapi/qdev.json
> > > @@ -348,3 +348,13 @@
> > >   { 'command': 'query-hotplug',
> > >     'data': { 'id': 'str' },
> > >     'returns': 'HotplugInfo' }
> > > +
> > > +##
> > > +# @DEVICE_ON:
> > > +#
> > > +# Emitted whenever the device insertion completion is acknowledged by 
> > > the guest.
> > > +# For now only emitted for SHPC and PCIe-native hotplug.
> > > +#
> > > +# Since: 8.0
> > > +##
> > > +{ 'event': 'DEVICE_ON', 'data': 'DeviceAndPath' }
> > 
> > Same as any event, this has to be accompanied by a query.
> > Which query returns the "ON" status?
> > 
> 
> Hmm. Seems correct to add "ON" status into "hostplug state", to be returned 
> by query-hotplug. And then, its change should be reported by HOTPLUG_STATE, 
> and separate DEVICE_ON is not needed.
> 
> -- 
> Best regards,
> Vladimir

Given it can go on and off at any time ... I'm not that sure this makes
sense as a generic thing. one has to know about specifics of how shpc
behaves to understand and use it correctly.

-- 
MST




reply via email to

[Prev in Thread] Current Thread [Next in Thread]