From 9f25eccc1cdbe6ee985b7a5954fa621c2012912e Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 30 Mar 2012 13:17:12 +0200 Subject: block: set job->speed in block_set_speed There is no need to do this in every implementation of set_speed (even though there is only one right now). Signed-off-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'block.c') diff --git a/block.c b/block.c index 16e14fa7d5..33630ebacc 100644 --- a/block.c +++ b/block.c @@ -4085,10 +4085,16 @@ void block_job_complete(BlockJob *job, int ret) int block_job_set_speed(BlockJob *job, int64_t value) { + int rc; + if (!job->job_type->set_speed) { return -ENOTSUP; } - return job->job_type->set_speed(job, value); + rc = job->job_type->set_speed(job, value); + if (rc == 0) { + job->speed = value; + } + return rc; } void block_job_cancel(BlockJob *job) -- cgit v1.2.3