Hi Paolo, On 03/23/2017 02:39 PM, Paolo Bonzini wrote:
!job is always checked prior to the call, drop it from here.
I agree with you this is currently true, *but* block_job_user_paused() is exported in "block/blockjob.h" so any future access (external to blockdev.c) could eventually happen with job == NULL. I'd NACK this patch for for this reason, but I checked and there is no access to this function outside of blockdev.c, so I think the best is to make block_job_user_paused() static (removing the public declaration) and safely drop the !job check, what do you think?
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- blockjob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blockjob.c b/blockjob.c index 9b619f385..a9fb624 100644 --- a/blockjob.c +++ b/blockjob.c @@ -480,7 +480,7 @@ static bool block_job_should_pause(BlockJob *job) bool block_job_user_paused(BlockJob *job) { - return job ? job->user_paused : 0; + return job->user_paused; } void coroutine_fn block_job_pause_point(BlockJob *job)