mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
block: move restarting of throttled reqs to block/throttle-groups.c
We want to remove throttled_reqs from block/io.c. This is the easy part---hide the handling of throttled_reqs during disable/enable of throttling within throttle-groups.c. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
733bbc8cea
commit
a72f641407
3 changed files with 16 additions and 14 deletions
15
block/io.c
15
block/io.c
|
@ -62,28 +62,15 @@ static int coroutine_fn bdrv_co_do_write_zeroes(BlockDriverState *bs,
|
|||
void bdrv_set_io_limits(BlockDriverState *bs,
|
||||
ThrottleConfig *cfg)
|
||||
{
|
||||
int i;
|
||||
|
||||
throttle_group_config(bs, cfg);
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
qemu_co_enter_next(&bs->throttled_reqs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static void bdrv_start_throttled_reqs(BlockDriverState *bs)
|
||||
{
|
||||
bool enabled = bs->io_limits_enabled;
|
||||
int i;
|
||||
|
||||
bs->io_limits_enabled = false;
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
while (qemu_co_enter_next(&bs->throttled_reqs[i])) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
throttle_group_restart_bs(bs);
|
||||
bs->io_limits_enabled = enabled;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue