blockjob: rename block_job_is_paused()

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
This commit is contained in:
Stefan Hajnoczi 2016-06-16 17:56:23 +01:00
parent 17bd51f936
commit a7f3b7ff03
2 changed files with 3 additions and 12 deletions

View 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;