Skip to contentSkip to conversation

blockjob: drop block_job_pause/resume_all()

PATCH Applied Stefan Hajnoczi 4 participants 5 messages Apr 24, 2018 – Apr 27, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 blockjob: drop block_job_pause/resume_all()

Commit 8119334918e86f45877cfc139192d54f2449a239 ("block: Don't block_job_pause_all() in bdrv_drain_all()") removed the only callers of block_job_pause/resume_all().

Pausing and resuming now happens in child_job_drained_begin/end() so it's no longer necessary to globally pause/resume jobs.

---
 include/block/blockjob_int.h | 14 --------------
 blockjob.c                   | 27 ---------------------------
 2 files changed, 41 deletions(-)
include/block/blockjob_int.h +0 -14
index 642adce68b..d5a515de9b 100644
@@ -168,20 +168,6 @@ void block_job_sleep_ns(BlockJob *job, int64_t ns);
  */
 void block_job_yield(BlockJob *job);
 
-/**
- * block_job_pause_all:
- *
- * Asynchronously pause all jobs.
- */
-void block_job_pause_all(void);
-
-/**
- * block_job_resume_all:
- *
- * Resume all block jobs.  Must be paired with a preceding block_job_pause_all.
- */
-void block_job_resume_all(void);
-
 /**
  * block_job_early_fail:
  * @bs: The block device.
blockjob.c +0 -27
index 27f957e571..dfffad921a 100644
@@ -988,19 +988,6 @@ void *block_job_create(const char *job_id, const BlockJobDriver *driver,
     return job;
 }
 
-void block_job_pause_all(void)
-{
-    BlockJob *job = NULL;
-    while ((job = block_job_next(job))) {
-        AioContext *aio_context = blk_get_aio_context(job->blk);
-
-        aio_context_acquire(aio_context);
-        block_job_ref(job);
-        block_job_pause(job);
-        aio_context_release(aio_context);
-    }
-}
-
 void block_job_early_fail(BlockJob *job)
 {
     assert(job->status == BLOCK_JOB_STATUS_CREATED);
@@ -1078,20 +1065,6 @@ void coroutine_fn block_job_pause_point(BlockJob *job)
     }
 }
 
-void block_job_resume_all(void)
-{
-    BlockJob *job, *next;
-
-    QLIST_FOREACH_SAFE(job, &block_jobs, job_list, next) {
-        AioContext *aio_context = blk_get_aio_context(job->blk);
-
-        aio_context_acquire(aio_context);
-        block_job_resume(job);
-        block_job_unref(job);
-        aio_context_release(aio_context);
-    }
-}
-
 /*
  * Conditionally enter a block_job pending a call to fn() while
  * under the block_job_lock critical section.
Signature · 1 line
2.14.3
#1 lore raw

Am 24.04.2018 um 10:52 hat Stefan Hajnoczi geschrieben:

Quoted 8 lines

Commit 8119334918e86f45877cfc139192d54f2449a239 ("block: Don't block_job_pause_all() in bdrv_drain_all()") removed the only callers of block_job_pause/resume_all().

Pausing and resuming now happens in child_job_drained_begin/end() so it's no longer necessary to globally pause/resume jobs.

Yes, the same is part of my upcoming huge (non-)block job series. I think git should resolve the conflict fine, so feel free to apply this already while I finish my series.

Kevin

Reviewed-by on v1 1/1
#2 lore raw
In reply to Stefan Hajnoczi
Quoted 7 lines · Stefan Hajnoczi

Commit 8119334918e86f45877cfc139192d54f2449a239 ("block: Don't block_job_pause_all() in bdrv_drain_all()") removed the only callers of block_job_pause/resume_all().

Pausing and resuming now happens in child_job_drained_begin/end() so it's no longer necessary to globally pause/resume jobs.

neat!

Quoted 1 line
Reviewed-by on v1 1/1
#3 lore raw
In reply to Stefan Hajnoczi
Quoted 8 lines · Stefan Hajnoczi

Commit 8119334918e86f45877cfc139192d54f2449a239 ("block: Don't block_job_pause_all() in bdrv_drain_all()") removed the only callers of block_job_pause/resume_all().

Pausing and resuming now happens in child_job_drained_begin/end() so it's no longer necessary to globally pause/resume jobs.

Berto

author Applied
#4 lore raw
In reply to Stefan Hajnoczi
Quoted 4 lines · Stefan Hajnoczi

Commit 8119334918e86f45877cfc139192d54f2449a239 ("block: Don't block_job_pause_all() in bdrv_drain_all()") removed the only callers of block_job_pause/resume_all().

Quoted 8 lines

Pausing and resuming now happens in child_job_drained_begin/end() so it's no longer necessary to globally pause/resume jobs.

---
 include/block/blockjob_int.h | 14 --------------
 blockjob.c                   | 27 ---------------------------
 2 files changed, 41 deletions(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan