qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH] throttle: Check current timers before updating


From: Stefan Hajnoczi
Subject: Re: [Qemu-block] [PATCH] throttle: Check current timers before updating any_timer_armed[]
Date: Tue, 16 Jun 2015 10:53:09 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Jun 15, 2015 at 06:41:15PM +0300, Alberto Garcia wrote:
> Calling throttle_group_config() cancels all timers from a particular
> BlockDriverState, so any_timer_armed[] should be updated accordingly.
> 
> However, with the current code it may happen that a timer is armed in
> a different BlockDriverState from the same group, so any_timer_armed[]
> would be set to false in a situation where there is still a timer
> armed.
> 
> The consequence is that we might end up with two timers armed. This
> should not have any noticeable impact however, since all accesses to
> the ThrottleGroup are protected by a lock, and the situation would
> become normal again shortly thereafter as soon as all timers have been
> fired.
> 
> The correct way to solve this is to check that we're actually
> cancelling a timer before updating any_timer_armed[].
> 
> Signed-off-by: Alberto Garcia <address@hidden>
> ---
>  block/throttle-groups.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

Attachment: pgpzdUoTzHIu6.pgp
Description: PGP signature


reply via email to

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