[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] throttle: Fix crash on reopen
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [PATCH] throttle: Fix crash on reopen |
Date: |
Sat, 9 Jun 2018 23:52:50 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
On 2018-06-08 17:15, Alberto Garcia wrote:
> The throttle block filter can be reopened, and with this it is
> possible to change the throttle group that the filter belongs to.
>
> The way the code does that is the following:
>
> - On throttle_reopen_prepare(): create a new ThrottleGroupMember
> and attach it to the new throttle group.
>
> - On throttle_reopen_commit(): detach the old ThrottleGroupMember,
> delete it and replace it with the new one.
>
> The problem with this is that by replacing the ThrottleGroupMember the
> previous value of io_limits_disabled is lost, causing an assertion
> failure in throttle_co_drain_end().
>
> This problem can be reproduced by reopening a throttle node:
>
> $QEMU -monitor stdio
> -object throttle-group,id=tg0,x-iops-total=1000 \
> -blockdev
> node-name=hd0,driver=qcow2,file.driver=file,file.filename=hd.qcow2 \
> -blockdev
> node-name=root,driver=throttle,throttle-group=tg0,file=hd0,read-only=on
>
> (qemu) block_stream root
> block/throttle.c:214: throttle_co_drain_end: Assertion
> `tgm->io_limits_disabled' failed.
>
> Since we only want to change the throttle group on reopen there's no
> need to create a ThrottleGroupMember and discard the old one. It's
> easier if we simply detach it from its current group and attach it to
> the new one.
>
> Signed-off-by: Alberto Garcia <address@hidden>
> ---
> block/throttle.c | 54 +++++++++++++++++++++++++++++++++---------------------
> 1 file changed, 33 insertions(+), 21 deletions(-)
Thanks, applied to my block branch:
https://git.xanclic.moe/XanClic/qemu/commits/branch/block
Max
signature.asc
Description: OpenPGP digital signature