qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/21] jobs: defer graph changes until finalize
@ 2018-08-07  4:33 John Snow
  2018-08-07  4:33 ` [Qemu-devel] [PATCH 01/21] jobs: canonize Error object John Snow
                   ` (21 more replies)
  0 siblings, 22 replies; 47+ messages in thread
From: John Snow @ 2018-08-07  4:33 UTC (permalink / raw)
  To: qemu-devel, qemu-block
  Cc: kwolf, Jeff Cody, Max Reitz, jtc, Markus Armbruster,
	Dr. David Alan Gilbert, Eric Blake, John Snow

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

-- 
2.14.4

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

end of thread, other threads:[~2018-08-16  6:52 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-07  4:33 [Qemu-devel] [PATCH 00/21] jobs: defer graph changes until finalize John Snow
2018-08-07  4:33 ` [Qemu-devel] [PATCH 01/21] jobs: canonize Error object John Snow
2018-08-08 14:57   ` Kevin Wolf
2018-08-08 15:50     ` John Snow
2018-08-08 16:02       ` Kevin Wolf
2018-08-07  4:33 ` [Qemu-devel] [PATCH 02/21] jobs: add exit shim John Snow
2018-08-08  4:02   ` Jeff Cody
2018-08-08 13:55     ` John Snow
2018-08-08 15:23     ` Kevin Wolf
2018-08-08 15:38       ` John Snow
2018-08-08 15:47         ` Kevin Wolf
2018-08-07  4:33 ` [Qemu-devel] [PATCH 03/21] block/backup: utilize job_exit shim John Snow
2018-08-07  4:33 ` [Qemu-devel] [PATCH 04/21] block/commit: " John Snow
2018-08-08  3:41   ` Jeff Cody
2018-08-08 14:00     ` John Snow
2018-08-08 16:29   ` Kevin Wolf
2018-08-15 20:52     ` John Snow
2018-08-16  6:41       ` Kevin Wolf
2018-08-07  4:33 ` [Qemu-devel] [PATCH 05/21] block/mirror: " John Snow
2018-08-08  3:47   ` Jeff Cody
2018-08-07  4:33 ` [Qemu-devel] [PATCH 06/21] block/stream: " John Snow
2018-08-08  3:47   ` Jeff Cody
2018-08-07  4:33 ` [Qemu-devel] [PATCH 07/21] block/create: " John Snow
2018-08-07  4:33 ` [Qemu-devel] [PATCH 08/21] tests/test-blockjob-txn: " John Snow
2018-08-07  4:33 ` [Qemu-devel] [PATCH 09/21] tests/test-blockjob: " John Snow
2018-08-07  4:33 ` [Qemu-devel] [PATCH 10/21] tests/test-bdrv-drain: " John Snow
2018-08-07  4:33 ` [Qemu-devel] [PATCH 11/21] jobs: remove job_defer_to_main_loop John Snow
2018-08-07  4:33 ` [Qemu-devel] [PATCH 12/21] jobs: allow entrypoints to return status code John Snow
2018-08-07  4:33 ` [Qemu-devel] [PATCH 13/21] block/commit: add block job creation flags John Snow
2018-08-07  4:33 ` [Qemu-devel] [PATCH 14/21] block/mirror: " John Snow
2018-08-07  4:33 ` [Qemu-devel] [PATCH 15/21] block/stream: " John Snow
2018-08-07  4:33 ` [Qemu-devel] [PATCH 16/21] block/commit: refactor commit to use job callbacks John Snow
2018-08-09 15:12   ` Kevin Wolf
2018-08-09 16:22     ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2018-08-15 21:17     ` [Qemu-devel] " John Snow
2018-08-16  6:52       ` Kevin Wolf
2018-08-07  4:33 ` [Qemu-devel] [PATCH 17/21] block/mirror: conservative mirror_exit refactor John Snow
2018-08-07  4:33 ` [Qemu-devel] [PATCH 18/21] block/commit: refactor stream to use job callbacks John Snow
2018-08-07  4:33 ` [Qemu-devel] [PATCH 19/21] qapi/block-commit: expose new job properties John Snow
2018-08-07 14:52   ` Eric Blake
2018-08-07 18:11     ` John Snow
2018-08-10 11:47     ` Kevin Wolf
2018-08-07  4:33 ` [Qemu-devel] [PATCH 20/21] qapi/block-mirror: " John Snow
2018-08-07  4:33 ` [Qemu-devel] [PATCH 21/21] qapi/block-stream: " John Snow
2018-08-15 14:44 ` [Qemu-devel] [Qemu-block] [PATCH 00/21] jobs: defer graph changes until finalize Peter Krempa
2018-08-15 15:00   ` Kevin Wolf
2018-08-15 15:04     ` Peter Krempa

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