From: Max Reitz <mreitz@redhat.com>
To: Alberto Garcia <berto@igalia.com>, qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org, qemu-block@nongnu.org,
Kevin Wolf <kwolf@redhat.com>,
Manos Pitsidianakis <el13635@mail.ntua.gr>
Subject: Re: [Qemu-devel] [PATCH] throttle: Fix crash on reopen
Date: Sat, 9 Jun 2018 23:52:50 +0200 [thread overview]
Message-ID: <5dc8086d-3d8c-9ccf-93e1-4ac802c1b56f@redhat.com> (raw)
In-Reply-To: <20180608151536.7378-1-berto@igalia.com>
[-- Attachment #1: Type: text/plain, Size: 1666 bytes --]
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 <berto@igalia.com>
> ---
> 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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2018-06-09 21:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-08 15:15 [Qemu-devel] [PATCH] throttle: Fix crash on reopen Alberto Garcia
2018-06-09 21:52 ` Max Reitz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5dc8086d-3d8c-9ccf-93e1-4ac802c1b56f@redhat.com \
--to=mreitz@redhat.com \
--cc=berto@igalia.com \
--cc=el13635@mail.ntua.gr \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).