qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/4] block: Keep track of parent quiescing
@ 2019-06-05 16:11 Max Reitz
  2019-06-05 16:11 ` [Qemu-devel] [PATCH 1/4] block: Introduce BdrvChild.parent_quiesce_counter Max Reitz
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Max Reitz @ 2019-06-05 16:11 UTC (permalink / raw)
  To: qemu-block; +Cc: Kevin Wolf, qemu-devel, Stefan Hajnoczi, Max Reitz

We currently do not keep track of how many times a child has quiesced
its parent.  We just guess based on the child’s quiesce_counter.  That
keeps biting us when we try to leave drained sections or detach children
(see e.g. commit 5cb2737e925042e).

I think we need an explicit counter to keep track of how many times a
parent has been quiesced (patch 1).  That just makes the code more
resilient.

Actually, no, we don’t need a counter, we need a boolean.  See patch 2
for the explanation.

Yes, it is a bit weird to introduce a counter first (patch 1) and then
immediately make it a boolean (patch 2).  But I believe this to be the
most logical change set.

(“Our current model relies on counting, so adding an explicit counter
makes sense.  It then turns out that counting is probably not the best
idea, so why not make it a boolean?”)


Max Reitz (4):
  block: Introduce BdrvChild.parent_quiesce_counter
  block: Make @parent_quiesced a bool
  iotests: Add @has_quit to vm.shutdown()
  iotests: Test commit with a filter on the chain

 include/block/block.h      |  9 +++---
 include/block/block_int.h  |  6 ++++
 block.c                    | 18 ++++-------
 block/io.c                 | 61 +++++++++++++++++++++++++++++---------
 tests/test-bdrv-drain.c    | 31 +++++++++++--------
 python/qemu/__init__.py    |  5 ++--
 tests/qemu-iotests/040     | 40 ++++++++++++++++++++++++-
 tests/qemu-iotests/040.out |  4 +--
 tests/qemu-iotests/255     |  2 +-
 9 files changed, 126 insertions(+), 50 deletions(-)

-- 
2.21.0



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-06-14 15:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-05 16:11 [Qemu-devel] [PATCH 0/4] block: Keep track of parent quiescing Max Reitz
2019-06-05 16:11 ` [Qemu-devel] [PATCH 1/4] block: Introduce BdrvChild.parent_quiesce_counter Max Reitz
2019-06-05 16:11 ` [Qemu-devel] [PATCH 2/4] block: Make @parent_quiesced a bool Max Reitz
2019-06-05 16:11 ` [Qemu-devel] [PATCH 3/4] iotests: Add @has_quit to vm.shutdown() Max Reitz
2019-06-05 16:11 ` [Qemu-devel] [PATCH 4/4] iotests: Test commit with a filter on the chain Max Reitz
2019-06-14 15:25 ` [Qemu-devel] [PATCH 0/4] block: Keep track of parent quiescing Kevin Wolf

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).