Am 16.09.2026 um 10:17 hat Hanna Czenczek geschrieben:
> On 03.09.26 16:30, Stefan Hajnoczi wrote:
> > On Mon, Aug 31, 2026 at 03:52:03PM +0200, Hanna Czenczek wrote:
> > > This device property allows setting up an I/O latency threshold for when
> > > to emit a delay QMP event.
> > > 
> > > Signed-off-by: Hanna Czenczek <[email protected]>
> > > ---
> > >   include/hw/block/block.h   |  5 ++++-
> > >   blockdev.c                 | 16 +++++++++++++++-
> > >   hw/block/block.c           |  4 +++-
> > >   tests/qemu-iotests/172.out | 38 ++++++++++++++++++++++++++++++++++++++
> > >   4 files changed, 60 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/include/hw/block/block.h b/include/hw/block/block.h
> > > index df941df19f2..e7e401dd303 100644
> > > --- a/include/hw/block/block.h
> > > +++ b/include/hw/block/block.h
> > > @@ -36,6 +36,7 @@ typedef struct BlockConf {
> > >       BlockdevOnError werror;
> > >       uint32_t num_stats_intervals;
> > >       uint32_t *stats_intervals;
> > > +    uint32_t delay_alert_ms;
> > >   } BlockConf;
> > >   static inline unsigned int get_physical_block_exp(BlockConf *conf)
> > > @@ -83,7 +84,9 @@ static inline unsigned int 
> > > get_physical_block_exp(BlockConf *conf)
> > >                               _conf.account_failed, ON_OFF_AUTO_AUTO),    
> > > \
> > >       DEFINE_PROP_ARRAY("stats-intervals", _state,                        
> > > \
> > >                        _conf.num_stats_intervals, _conf.stats_intervals,  
> > > \
> > > -                     qdev_prop_uint32, uint32_t)
> > > +                     qdev_prop_uint32, uint32_t),                       \
> > > +    DEFINE_PROP_UINT32("delay-alert-ms", _state, _conf.delay_alert_ms,  \
> > > +                       0)                                               \
> > The latency histogram feature uses nanoseconds (64-bit integer) whereas
> > this patch series uses delay-alert-ms (uint32) and a double
> > floating-point seconds value in the QMP event. Maybe stick to 64-bit
> > integer nanoseconds everywhere for consistency?
> 
> I don’t have technical objections because doing so is easy, of course.
> Personally, I found nanoseconds really unwieldy to specify here. But I
> suppose if @block-latency-histogram-set does the same, then I might as well.

I don't expect this to be used much by human users, and for a machine
interface, what makes things unwieldy is having to keep track of which
value has which unit instead of just sticking to one unit everywhere.

I had the same comment before seeing that Stefan already pointed it out.

Kevin


Reply via email to