qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] blockjob: drop block_job_pause/resume_all()
@ 2018-04-24  8:52 Stefan Hajnoczi
  2018-04-24  8:58 ` Kevin Wolf
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2018-04-24  8:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jeff Cody, Kevin Wolf, qemu-block, Max Reitz, 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.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 include/block/blockjob_int.h | 14 --------------
 blockjob.c                   | 27 ---------------------------
 2 files changed, 41 deletions(-)

diff --git a/include/block/blockjob_int.h b/include/block/blockjob_int.h
index 642adce68b..d5a515de9b 100644
--- a/include/block/blockjob_int.h
+++ b/include/block/blockjob_int.h
@@ -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.
diff --git a/blockjob.c b/blockjob.c
index 27f957e571..dfffad921a 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -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.
-- 
2.14.3

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

* Re: [Qemu-devel] [PATCH] blockjob: drop block_job_pause/resume_all()
  2018-04-24  8:52 [Qemu-devel] [PATCH] blockjob: drop block_job_pause/resume_all() Stefan Hajnoczi
@ 2018-04-24  8:58 ` Kevin Wolf
  2018-04-24 19:03 ` [Qemu-devel] [Qemu-block] " John Snow
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Kevin Wolf @ 2018-04-24  8:58 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel, Jeff Cody, qemu-block, Max Reitz

Am 24.04.2018 um 10:52 hat Stefan Hajnoczi geschrieben:
> 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.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

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

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

* Re: [Qemu-devel] [Qemu-block] [PATCH] blockjob: drop block_job_pause/resume_all()
  2018-04-24  8:52 [Qemu-devel] [PATCH] blockjob: drop block_job_pause/resume_all() Stefan Hajnoczi
  2018-04-24  8:58 ` Kevin Wolf
@ 2018-04-24 19:03 ` John Snow
  2018-04-25 13:26 ` Alberto Garcia
  2018-04-27 10:26 ` [Qemu-devel] " Stefan Hajnoczi
  3 siblings, 0 replies; 5+ messages in thread
From: John Snow @ 2018-04-24 19:03 UTC (permalink / raw)
  To: Stefan Hajnoczi, qemu-devel; +Cc: Kevin Wolf, qemu-block, Max Reitz



On 04/24/2018 04:52 AM, Stefan Hajnoczi wrote:
> 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!

> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

Reviewed-by: John Snow <jsnow@redhat.com>

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

* Re: [Qemu-devel] [Qemu-block] [PATCH] blockjob: drop block_job_pause/resume_all()
  2018-04-24  8:52 [Qemu-devel] [PATCH] blockjob: drop block_job_pause/resume_all() Stefan Hajnoczi
  2018-04-24  8:58 ` Kevin Wolf
  2018-04-24 19:03 ` [Qemu-devel] [Qemu-block] " John Snow
@ 2018-04-25 13:26 ` Alberto Garcia
  2018-04-27 10:26 ` [Qemu-devel] " Stefan Hajnoczi
  3 siblings, 0 replies; 5+ messages in thread
From: Alberto Garcia @ 2018-04-25 13:26 UTC (permalink / raw)
  To: Stefan Hajnoczi, qemu-devel; +Cc: Kevin Wolf, qemu-block, Max Reitz

On Tue 24 Apr 2018 10:52:40 AM CEST, Stefan Hajnoczi wrote:
> 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.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

Reviewed-by: Alberto Garcia <berto@igalia.com>

Berto

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

* Re: [Qemu-devel] [PATCH] blockjob: drop block_job_pause/resume_all()
  2018-04-24  8:52 [Qemu-devel] [PATCH] blockjob: drop block_job_pause/resume_all() Stefan Hajnoczi
                   ` (2 preceding siblings ...)
  2018-04-25 13:26 ` Alberto Garcia
@ 2018-04-27 10:26 ` Stefan Hajnoczi
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2018-04-27 10:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jeff Cody, Kevin Wolf, qemu-block, Max Reitz

[-- Attachment #1: Type: text/plain, Size: 693 bytes --]

On Tue, Apr 24, 2018 at 09:52:40AM +0100, Stefan Hajnoczi wrote:
> 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.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

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

end of thread, other threads:[~2018-04-27 12:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-24  8:52 [Qemu-devel] [PATCH] blockjob: drop block_job_pause/resume_all() Stefan Hajnoczi
2018-04-24  8:58 ` Kevin Wolf
2018-04-24 19:03 ` [Qemu-devel] [Qemu-block] " John Snow
2018-04-25 13:26 ` Alberto Garcia
2018-04-27 10:26 ` [Qemu-devel] " Stefan Hajnoczi

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