]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
blockjob: rename block_job_is_paused()
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 16 Jun 2016 16:56:23 +0000 (17:56 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 20 Jun 2016 10:44:12 +0000 (11:44 +0100)
The block_job_is_paused() function name is not great because callers
only use it to determine whether pausing has been requested.  Rename it
to highlight those semantics and remove it from the public header file
as there are no external callers.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 1466096189-6477-3-git-send-email-stefanha@redhat.com

blockjob.c
include/block/blockjob.h

index 5137dce808318195eef8b20993537f0243a35f8d..21cc3ee33275de816a319e0acecff2d9ad33af41 100644 (file)
@@ -252,7 +252,7 @@ void block_job_pause(BlockJob *job)
     job->pause_count++;
 }
 
-bool block_job_is_paused(BlockJob *job)
+static bool block_job_should_pause(BlockJob *job)
 {
     return job->pause_count > 0;
 }
@@ -361,11 +361,11 @@ void block_job_sleep_ns(BlockJob *job, QEMUClockType type, int64_t ns)
     }
 
     job->busy = false;
-    if (!block_job_is_paused(job)) {
+    if (!block_job_should_pause(job)) {
         co_aio_sleep_ns(blk_get_aio_context(job->blk), type, ns);
     }
     /* The job can be paused while sleeping, so check this again */
-    if (block_job_is_paused(job)) {
+    if (block_job_should_pause(job)) {
         qemu_coroutine_yield();
     }
     job->busy = true;
index 00ac4184ccb84ef0634b2256e16066982bf127cb..8fcecf9a7960985fd3618be96114848ff07ed745 100644 (file)
@@ -347,15 +347,6 @@ void block_job_event_completed(BlockJob *job, const char *msg);
  */
 void block_job_event_ready(BlockJob *job);
 
-/**
- * block_job_is_paused:
- * @job: The job being queried.
- *
- * Returns whether the job is currently paused, or will pause
- * as soon as it reaches a sleeping point.
- */
-bool block_job_is_paused(BlockJob *job);
-
 /**
  * block_job_cancel_sync:
  * @job: The job to be canceled.