Revision d80b60fc2433cc934533f594bfa4e2b6c6103ba3 authored by Alberto Garcia on 08 June 2018, 15:15:36 UTC, committed by Michael Roth on 21 June 2018, 01:45:06 UTC
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>
Message-id: 20180608151536.7378-1-berto@igalia.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
(cherry picked from commit bc33c047d1ec0b35c9cd8be62bcefae2da28654f)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
1 parent f647a4f
History
File Mode Size
aarch64-core.xml -rw-r--r-- 1.5 KB
aarch64-fpu.xml -rw-r--r-- 3.3 KB
arm-core.xml -rw-r--r-- 1.1 KB
arm-neon.xml -rw-r--r-- 3.9 KB
arm-vfp.xml -rw-r--r-- 1.2 KB
arm-vfp3.xml -rw-r--r-- 2.0 KB
cf-core.xml -rw-r--r-- 1.1 KB
cf-fp.xml -rw-r--r-- 1.0 KB
i386-32bit-core.xml -rw-r--r-- 2.7 KB
i386-32bit-sse.xml -rw-r--r-- 2.0 KB
i386-32bit.xml -rw-r--r-- 480 bytes
i386-64bit-core.xml -rw-r--r-- 3.0 KB
i386-64bit-sse.xml -rw-r--r-- 2.4 KB
i386-64bit.xml -rw-r--r-- 477 bytes
m68k-fp.xml -rw-r--r-- 1021 bytes
power-altivec.xml -rw-r--r-- 2.4 KB
power-core.xml -rw-r--r-- 2.1 KB
power-fpu.xml -rw-r--r-- 2.0 KB
power-spe.xml -rw-r--r-- 1.5 KB
power-vsx.xml -rw-r--r-- 2.0 KB
power64-core.xml -rw-r--r-- 2.1 KB
s390-acr.xml -rw-r--r-- 1.4 KB
s390-cr.xml -rw-r--r-- 1.3 KB
s390-fpr.xml -rw-r--r-- 1.4 KB
s390-gs.xml -rw-r--r-- 578 bytes
s390-virt.xml -rw-r--r-- 859 bytes
s390-vx.xml -rw-r--r-- 2.4 KB
s390x-core64.xml -rw-r--r-- 1.5 KB

back to top