Am 24.02.26 um 3:34 PM schrieb Kevin Wolf: > Am 16.01.2026 um 15:39 hat Fiona Ebner geschrieben: >> With '-drive', it is possible to specify the throttle configuration >> directly on the commandline. Add the possibility to do the same when >> using the modern way with '-blockdev' and a front-end device. Using a >> throttle filter block node is not always an option: in particular, the >> mirror block job operates on a root block node and it might be desired >> to throttle only the guest IO, but not to the block job. > > Hm, is there still a reason why we require a root node for the source?
I'm not sure if the restriction could be lifted. But AFAICS, that doesn't help in my case with a throttle node as the root node: Say I'm mirroring the node below throttle and the job is ready to be completed. Further, assume that requests pile up for the root node, while the node below is mostly idle, which can easily happen with low throttle limits: At some moment, there might be no IO in-flight for the node below throttle and thus the mirror can complete, while all the in-flight requests for the throttle node are currently being intercepted by the throttle group and waiting for the timer to wake them. Because, the call to bdrv_inc_in_flight() for the node below throttle only happens after the intercepted requests are woken. Mirror and the node below do not know about the parent's in flight requests. Is this interpretation correct? There are scenarios where we finish the job via block-job-cancel after freezing the guest filesystem to ensure consistency, so having intercepted requests as described above would mess it up. >> There already is a 'block_set_io_throttle' QMP command, but it's nicer >> to be able to do it via the commandline too. >> >> Signed-off-by: Fiona Ebner <[email protected]> >> --- >> >> Hope I didn't miss a way to do this already. >> >> Should changing via qom-set be supported? Currently, an attempt fails: >>> Error: Attempt to set property 'throttle-group' on device 'scsi0' >>> (type 'scsi-hd') after it was realized >> but there already is the 'block_set_io_throttle' QMP command. > > It would be nice, but I don't think runtime writable properties are used > much in devices because I believe this would have to be done with plain > QOM properties, i.e. outside of qdev. > > Though if it's actually easy, we could consider implementing it. > >> hw/block/block.c | 15 +++++++++++++++ >> include/hw/block/block.h | 4 +++- >> tests/qemu-iotests/172.out | 38 ++++++++++++++++++++++++++++++++++++++ >> 3 files changed, 56 insertions(+), 1 deletion(-) > > Looks good to me, though maybe we could also use a qemu-iotests case > that actually tries to set the property instead of only updating the > output everywhere for having no throttle group. Ack, I'll send a v2 with a test. Best Regards, Fiona
