qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] bug introduced by "block: Move throttling fields from B


From: Paolo Bonzini
Subject: Re: [Qemu-block] bug introduced by "block: Move throttling fields from BDS to BB"
Date: Fri, 14 Oct 2016 21:29:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0


On 14/10/2016 16:11, Paolo Bonzini wrote:
> -    ThrottleGroup *tg = container_of(blk_bs(blk)->throttle_state,
> -                                     ThrottleGroup, ts);
> +    BlockBackendPublic *blkp = blk_get_public(blk);
> +    ThrottleGroup *tg = container_of(blkp->throttle_state, ThrottleGroup, 
> ts);
>      BlockBackend *token, *start;
>  
>      start = token = tg->tokens[is_write];
>  
>      /* get next bs round in round robin style */
>      token = throttle_group_next_blk(token);
> -    while (token != start && !blk_bs(token)->pending_reqs[is_write]) {
> +    while (token != start && !blkp->pending_reqs[is_write]) {
>          token = throttle_group_next_blk(token);
>      }
> 
> 
> blkp isn't updated every time token is updated.

BTW, the simplest fix is probably to introduce a function

static inline bool blk_has_pending_reqs(BlockBackend *blk,
                                        bool is_write)

Paolo



reply via email to

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