jobs: utilize job_exit shim
commiteb23654dbe43b549ea2a9ebff9d8edf544d34a73
authorJohn Snow <jsnow@redhat.com>
Thu, 30 Aug 2018 01:57:31 +0000 (29 21:57 -0400)
committerMax Reitz <mreitz@redhat.com>
Fri, 31 Aug 2018 14:28:33 +0000 (31 16:28 +0200)
tree4801dd246bf808450c131683b57fd50c1f8dbcaf
parent7b508f6b7a38a8d9729772fa6e525da883fb120b
jobs: utilize job_exit shim

Utilize the job_exit shim by not calling job_defer_to_main_loop, and
where applicable, converting the deferred callback into the job_exit
callback.

This converts backup, stream, create, and the unit tests all at once.
Most of these jobs do not see any changes to the order in which they
clean up their resources, except the test-blockjob-txn test, which
now puts down its bs before job_completed is called.

This is safe for the same reason the reordering in the mirror job is
safe, because job_completed no longer runs under two locks, making
the unref safe even if it causes a flush.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 20180830015734.19765-7-jsnow@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/backup.c
block/create.c
block/stream.c
tests/test-bdrv-drain.c
tests/test-blockjob-txn.c
tests/test-blockjob.c