[Qemu-devel] [PATCH 0/2] vl: Drain before (block) job cancel when quitting

Max Reitz posted 2 patches 4 years, 9 months ago
Test s390x passed
Test checkpatch passed
Test asan passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190612220839.1374-1-mreitz@redhat.com
Maintainers: Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
vl.c                       | 11 ++++++++
tests/qemu-iotests/218     | 55 ++++++++++++++++++++++++++++++++++++--
tests/qemu-iotests/218.out |  4 +++
3 files changed, 68 insertions(+), 2 deletions(-)
[Qemu-devel] [PATCH 0/2] vl: Drain before (block) job cancel when quitting
Posted by Max Reitz 4 years, 9 months ago
Quitting qemu should lead to qemu exiting pretty much immediately.  That
means if you have a block job running on a throttled block node, the
node should ignore its throttling and the job should be cancelled
immediately.

Unfortunately, that is not what happens.  Currently, the node will be
drained (with a bdrv_drain_all()), and then again unquiesced (because
bdrv_drain_all() ends).  Then, the block job is cancelled; but at this
point, the node is no longer drained, so it will block, as it befits a
throttling node.

To fix this issue, we have to keep all nodes drained while we cancel all
block jobs when quitting qemu.  This will make the throttle node ignore
its throttling and thus let the block job cancel immediately.


Max Reitz (2):
  vl: Drain before (block) job cancel when quitting
  iotests: Test quitting with job on throttled node

 vl.c                       | 11 ++++++++
 tests/qemu-iotests/218     | 55 ++++++++++++++++++++++++++++++++++++--
 tests/qemu-iotests/218.out |  4 +++
 3 files changed, 68 insertions(+), 2 deletions(-)

-- 
2.21.0


Re: [Qemu-devel] [PATCH 0/2] vl: Drain before (block) job cancel when quitting
Posted by Max Reitz 4 years, 9 months ago
On 13.06.19 00:08, Max Reitz wrote:
> Quitting qemu should lead to qemu exiting pretty much immediately.  That
> means if you have a block job running on a throttled block node, the
> node should ignore its throttling and the job should be cancelled
> immediately.
> 
> Unfortunately, that is not what happens.  Currently, the node will be
> drained (with a bdrv_drain_all()), and then again unquiesced (because
> bdrv_drain_all() ends).  Then, the block job is cancelled; but at this
> point, the node is no longer drained, so it will block, as it befits a
> throttling node.
> 
> To fix this issue, we have to keep all nodes drained while we cancel all
> block jobs when quitting qemu.  This will make the throttle node ignore
> its throttling and thus let the block job cancel immediately.

I forgot to mention: This series depends on “block: Keep track of parent
quiescing”, specifically patch 3 (“iotests: Add @has_quit to
vm.shutdown()”).

Based-on: <20190605161118.14544-1-mreitz@redhat.com>

Max

> Max Reitz (2):
>   vl: Drain before (block) job cancel when quitting
>   iotests: Test quitting with job on throttled node
> 
>  vl.c                       | 11 ++++++++
>  tests/qemu-iotests/218     | 55 ++++++++++++++++++++++++++++++++++++--
>  tests/qemu-iotests/218.out |  4 +++
>  3 files changed, 68 insertions(+), 2 deletions(-)
> 


Re: [Qemu-devel] [PATCH 0/2] vl: Drain before (block) job cancel when quitting
Posted by Kevin Wolf 4 years, 8 months ago
Am 13.06.2019 um 00:08 hat Max Reitz geschrieben:
> Quitting qemu should lead to qemu exiting pretty much immediately.  That
> means if you have a block job running on a throttled block node, the
> node should ignore its throttling and the job should be cancelled
> immediately.
> 
> Unfortunately, that is not what happens.  Currently, the node will be
> drained (with a bdrv_drain_all()), and then again unquiesced (because
> bdrv_drain_all() ends).  Then, the block job is cancelled; but at this
> point, the node is no longer drained, so it will block, as it befits a
> throttling node.
> 
> To fix this issue, we have to keep all nodes drained while we cancel all
> block jobs when quitting qemu.  This will make the throttle node ignore
> its throttling and thus let the block job cancel immediately.

Thanks, applied to the block branch.

Kevin