ratelimit: treat zero speed as unlimited
commit720507ed95023e45620f305767d12cd716e8b8ca
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 14 Jun 2021 08:11:26 +0000 (14 10:11 +0200)
committerVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Fri, 25 Jun 2021 11:22:21 +0000 (25 14:22 +0300)
treed0c3a997b280da8eab6df328309e993912294ca7
parente0da9171e02f4534124b9a9e07333382b38376c6
ratelimit: treat zero speed as unlimited

Both users of RateLimit, block-copy.c and blockjob.c, treat
a speed of zero as unlimited, while RateLimit treats it as
"as slow as possible".  The latter is nicer from the code
point of view but pretty useless, so disable rate limiting
if a speed of zero is provided.

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20210614081130.22134-2-eesposit@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
include/qemu/ratelimit.h