aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-03-30 13:17:12 +0200
committerKevin Wolf <kwolf@redhat.com>2012-04-05 14:54:40 +0200
commit9f25eccc1cdbe6ee985b7a5954fa621c2012912e (patch)
treec5073fdee6f93b78e56a14e87ee00182c3dd6300 /block.c
parent3e914655f268f627ef004a8f1ea0355311b5aca6 (diff)
downloadqemu-9f25eccc1cdbe6ee985b7a5954fa621c2012912e.zip
qemu-9f25eccc1cdbe6ee985b7a5954fa621c2012912e.tar.gz
qemu-9f25eccc1cdbe6ee985b7a5954fa621c2012912e.tar.bz2
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 <pbonzini@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/block.c b/block.c
index 16e14fa..33630eb 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)