qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/9] jobs: Job Exit Refactoring Pt 1
@ 2018-08-23 22:08 John Snow
  2018-08-23 22:08 ` [Qemu-devel] [PATCH v2 1/9] jobs: change start callback to run callback John Snow
                   ` (8 more replies)
  0 siblings, 9 replies; 23+ messages in thread
From: John Snow @ 2018-08-23 22:08 UTC (permalink / raw)
  To: qemu-block, qemu-devel
  Cc: kwolf, Stefan Hajnoczi, jtc, Jeff Cody, Max Reitz, John Snow

This is part one of a two part series that refactors the exit logic
of jobs.

Part one removes job_defer_to_main_loop.
Part two removes the job->exit() callback introduced in part one.

It's redundant to have each job manage deferring to the main loop
itself. Unifying this makes sense from an API standpoint.
Doing so also allows us to remove a tricky case where the completion
code is called under an aio_context lock, which then calls the
finalization code which is itself executed under a second aio_context
lock, leading to deadlocks.

Removing this recursive lock acquisition is necessary for converting
mirror to only modify its graph post-finalization, but it's also just
safer and will bite us less in the future.

This series introduces a job->exit callback, but after jobs are
fully transitioned to using the .commit/.abort callbacks in Pt 2,
this new completion callback will be removed again. It's only here
as a crutch to let us investigate the completion refactoring in Pt 2
more carefully.

V2:

001/9:[----] [--] 'jobs: change start callback to run callback'
002/9:[0003] [FC] 'jobs: canonize Error object'
003/9:[0005] [FC] 'jobs: add exit shim'
004/9:[0002] [FC] 'block/commit: utilize job_exit shim'
005/9:[----] [--] 'block/mirror: utilize job_exit shim'
006/9:[----] [--] 'jobs: utilize job_exit shim'
007/9:[down] 'block/backup: make function variables consistently named'
008/9:[down] 'jobs: remove ret argument to job_completed; privatize it'
009/9:[----] [--] 'jobs: remove job_defer_to_main_loop'

002: Update commit message
     Remove errant space (Eric, Max)
     Update error message setting (Kevin)
003: Add comment clarifying that .exit is temporary/transitional (Max, Eric)
004: change reference from `ret` to `job->ret`
     (Note: most of these references go away in Pt 2 of the series,
            except for those in mirror_exit.) (for Max.)
007: Added, at Eric's suggestion.
008: Moved forward from Pt 2 of the series. (Max.)

Hopefully this version makes the trajectory clearer.
--js

John Snow (9):
  jobs: change start callback to run callback
  jobs: canonize Error object
  jobs: add exit shim
  block/commit: utilize job_exit shim
  block/mirror: utilize job_exit shim
  jobs: utilize job_exit shim
  block/backup: make function variables consistently named
  jobs: remove ret argument to job_completed; privatize it
  jobs: remove job_defer_to_main_loop

 block/backup.c            | 81 +++++++++++++++++++----------------------------
 block/commit.c            | 29 ++++++-----------
 block/create.c            | 19 ++++-------
 block/mirror.c            | 35 +++++++++-----------
 block/stream.c            | 29 +++++++----------
 include/qemu/job.h        | 62 +++++++++++++++---------------------
 job-qmp.c                 |  5 +--
 job.c                     | 73 +++++++++++++++---------------------------
 tests/test-bdrv-drain.c   | 13 +++-----
 tests/test-blockjob-txn.c | 25 ++++++---------
 tests/test-blockjob.c     | 17 +++++-----
 trace-events              |  2 +-
 12 files changed, 150 insertions(+), 240 deletions(-)

-- 
2.14.4

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

end of thread, other threads:[~2018-08-31  9:07 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-23 22:08 [Qemu-devel] [PATCH v2 0/9] jobs: Job Exit Refactoring Pt 1 John Snow
2018-08-23 22:08 ` [Qemu-devel] [PATCH v2 1/9] jobs: change start callback to run callback John Snow
2018-08-27  9:30   ` Max Reitz
2018-08-30  0:06     ` John Snow
2018-08-31  9:06       ` Max Reitz
2018-08-23 22:08 ` [Qemu-devel] [PATCH v2 2/9] jobs: canonize Error object John Snow
2018-08-27  9:41   ` Max Reitz
2018-08-27 10:43     ` Max Reitz
2018-08-23 22:08 ` [Qemu-devel] [PATCH v2 3/9] jobs: add exit shim John Snow
2018-08-27 10:00   ` Max Reitz
2018-08-23 22:08 ` [Qemu-devel] [PATCH v2 4/9] block/commit: utilize job_exit shim John Snow
2018-08-27 10:28   ` Max Reitz
2018-08-23 22:08 ` [Qemu-devel] [PATCH v2 5/9] block/mirror: " John Snow
2018-08-27 10:30   ` Max Reitz
2018-08-23 22:08 ` [Qemu-devel] [PATCH v2 6/9] jobs: " John Snow
2018-08-27 10:37   ` Max Reitz
2018-08-23 22:08 ` [Qemu-devel] [PATCH v2 7/9] block/backup: make function variables consistently named John Snow
2018-08-27 10:41   ` Max Reitz
2018-08-23 22:08 ` [Qemu-devel] [PATCH v2 8/9] jobs: remove ret argument to job_completed; privatize it John Snow
2018-08-27 10:52   ` Max Reitz
2018-08-27 18:43     ` John Snow
2018-08-23 22:08 ` [Qemu-devel] [PATCH v2 9/9] jobs: remove job_defer_to_main_loop John Snow
2018-08-27 10:56   ` Max Reitz

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