Skip to content

job: Add job_wait_unpaused() for block-job-complete

Max Reitz qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 2 repliesIn review
  2. v13 patches 14 repliesSuperseded

v1 from the cover letter

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3job: Add job_wait_unpaused() for block-job-completeblockdev.c include/qemu/job.h job.c+71 -00 replies
2/3test-blockjob: Test job_wait_unpaused()tests/unit/test-blockjob.c+140 -00 replies
3/3iotests/041: block-job-complete on user-paused jobtests/qemu-iotests/041+12 -11 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/3] job: Add job_wait_unpaused() for block-job-complete

Hi,

v1:
https://lists.nongnu.org/archive/html/qemu-block/2021-04/msg00215.html

Alternative:
https://lists.nongnu.org/archive/html/qemu-block/2021-04/msg00261.html

Compared to v1, I’ve added an aio_wait_kick() to job_pause_point() (as suggested by Kevin) and adjusted the error message on job->user_paused (as suggested by John). I’ve kept the job->pause_count > 0 block because of the concern of nested event loops Kevin raised, and I’ve expanded its comment to explain the problem (I hope).

Note also the new note in patch 1’s commit message, which explains how we’d ideally want block-job-complete to be a coroutine QMP handler so we could yield instead of polling.

Furthermore, I’ve added the flaky test that I’ve also appended to the alternative series. Sometimes it fails 50/100 times for me, sometimes more like 20/100. (On master.) Maybe it won’t reproduce the problem for you at all.

git-backport-diff against v1:

Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch [down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively

001/4:[0015] [FC] 'job: Add job_wait_unpaused() for block-job-complete' 002/4:[----] [--] 'test-blockjob: Test job_wait_unpaused()' 003/4:[----] [--] 'iotests/041: block-job-complete on user-paused job' 004/4:[down] 'iotests: Test completion immediately after drain'

Max Reitz (4):
job: Add job_wait_unpaused() for block-job-complete
test-blockjob: Test job_wait_unpaused() iotests/041: block-job-complete on user-paused job
iotests: Test completion immediately after drain

 include/qemu/job.h                            |  15 ++
 blockdev.c                                    |   3 +
 job.c                                         |  53 +++++++
 tests/unit/test-blockjob.c                    | 140 ++++++++++++++++++
 tests/qemu-iotests/041                        |  13 +-
 .../tests/mirror-complete-after-drain         |  89 +++++++++++
 .../tests/mirror-complete-after-drain.out     |  14 ++
 7 files changed, 326 insertions(+), 1 deletion(-)
 create mode 100755 tests/qemu-iotests/tests/mirror-complete-after-drain
 create mode 100644 tests/qemu-iotests/tests/mirror-complete-after-drain.out
Signature · 1 line
2.29.2