Skip to content

jobs: defer graph changes until finalize

John Snow qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest21 patches 25 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21jobs: canonize Error objectblock/backup.c block/commit.c block/create.c +8 more+21 -303 replies
2/21jobs: add exit shiminclude/qemu/job.h job.c+26 -05 replies
3/21block/backup: utilize job_exit shimblock/backup.c+1 -160 replies
4/21block/commit: utilize job_exit shimblock/commit.c+5 -145 replies
5/21block/mirror: utilize job_exit shimblock/mirror.c+11 -161 reply
6/21block/stream: utilize job_exit shimblock/stream.c+8 -151 reply
7/21block/create: utilize job_exit shimblock/create.c+1 -100 replies
8/21tests/test-blockjob-txn: utilize job_exit shimtests/test-blockjob-txn.c+3 -90 replies
9/21tests/test-blockjob: utilize job_exit shimtests/test-blockjob.c+4 -70 replies
10/21tests/test-bdrv-drain: utilize job_exit shimtests/test-bdrv-drain.c+0 -70 replies
11/21jobs: remove job_defer_to_main_loopinclude/qemu/job.h job.c+2 -550 replies
12/21jobs: allow entrypoints to return status codeblock/backup.c block/commit.c block/create.c +7 more+35 -290 replies
13/21block/commit: add block job creation flagsblock/commit.c blockdev.c include/block/block_int.h+11 -60 replies
14/21block/mirror: add block job creation flagsblock/mirror.c blockdev.c include/block/block_int.h+9 -40 replies
15/21block/stream: add block job creation flagsblock/stream.c blockdev.c include/block/block_int.h+9 -40 replies
16/21block/commit: refactor commit to use job callbacksblock/commit.c+61 -334 replies
17/21block/mirror: conservative mirror_exit refactorblock/mirror.c+22 -40 replies
18/21block/commit: refactor stream to use job callbacksblock/stream.c+15 -80 replies
19/21qapi/block-commit: expose new job propertiesblockdev.c qapi/block-core.json+10 -13 replies
20/21qapi/block-mirror: expose new job propertiesblockdev.c qapi/block-core.json+18 -20 replies
21/21qapi/block-stream: expose new job propertiesblockdev.c hmp.c qapi/block-core.json+14 -30 replies

Reviews trailers per patch

4 of 21 patches have a Reviewed-by or Acked-by.

PatchJeff Cody
1/21
2/21R-b
3/21
4/21R-b
5/21R-b
6/21R-b
7/21
8/21
9/21
10/21
11/21
12/21
13/21
14/21
15/21
16/21
17/21
18/21
19/21
20/21
21/21

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 00/21] jobs: defer graph changes until finalize

This series forces all jobs to use the "finalize" semantics that were introduced previously, but only exposed via the backup jobs. This series looks huge, but it's mostly mechanical changes broken out into a series of much smaller commits so that the changes are easier to follow at each step.

Patches one and two refactor jobs to allow a centralized call to job_completed, which allows us to avoid calling this function from underneath job_defer_to_main_loop_bh, which takes the aio_context lock.

Patches 3-10 take advantage of the new centralized job exit code, one job at a time. This should be a net reduction in SLOC.

Patch 11 removes the old job_defer_to_main_loop code. If it wasn't a net reduction in SLOC before, it is now.

Patch 12 is not necessary, but changes job entry routines to return a status code instead of asking you to store the retcode in the job object, so that coroutine functions read more like standard ones. SLOC balance is a wash slightly against my favor.

Patches 13-15 add job creation flags to the commit, mirror, and stream jobs respectively which previously did not filter these flags down to job creation time.

Patches 16-18 refactor the completion code for commit, mirror and stream respectively to allow graph manipulations to happen exclusively after the finalization step instead of immediately.

Patches 19-21 expose the new job creation flags to users via QMP.

John Snow (21):
jobs: canonize Error object
jobs: add exit shim
block/backup: utilize job_exit shim block/commit: utilize job_exit shim block/mirror: utilize job_exit shim block/stream: utilize job_exit shim block/create: utilize job_exit shim tests/test-blockjob-txn: utilize job_exit shim tests/test-blockjob: utilize job_exit shim tests/test-bdrv-drain: utilize job_exit shim
jobs: remove job_defer_to_main_loop
jobs: allow entrypoints to return status code block/commit: add block job creation flags block/mirror: add block job creation flags block/stream: add block job creation flags block/commit: refactor commit to use job callbacks block/mirror: conservative mirror_exit refactor block/commit: refactor stream to use job callbacks qapi/block-commit: expose new job properties qapi/block-mirror: expose new job properties qapi/block-stream: expose new job properties

 block/backup.c            |  21 ++-------
 block/commit.c            | 116 +++++++++++++++++++++++++++-------------------
 block/create.c            |  16 ++-----
 block/mirror.c            |  54 +++++++++++++--------
 block/stream.c            |  43 ++++++++---------
 blockdev.c                |  44 ++++++++++++++++--
 hmp.c                     |   5 +-
 include/block/block_int.h |  15 ++++--
 include/qemu/job.h        |  36 +++++---------
 job-qmp.c                 |   5 +-
 job.c                     |  64 ++++++++-----------------
 qapi/block-core.json      |  12 +++--
 tests/test-bdrv-drain.c   |  11 ++---
 tests/test-blockjob-txn.c |  23 ++++-----
 tests/test-blockjob.c     |  16 +++----
 15 files changed, 247 insertions(+), 234 deletions(-)
Signature · 1 line
2.14.4