OSDN Git Service

blockjobs: fix set-speed kick
authorJohn Snow <jsnow@redhat.com>
Sat, 10 Mar 2018 08:27:26 +0000 (03:27 -0500)
committerKevin Wolf <kwolf@redhat.com>
Mon, 19 Mar 2018 11:01:24 +0000 (12:01 +0100)
If speed is '0' it's not actually "less than" the previous speed.
Kick the job in this case too.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockjob.c

index 801d29d..afd92db 100644 (file)
@@ -499,7 +499,7 @@ void block_job_set_speed(BlockJob *job, int64_t speed, Error **errp)
     }
 
     job->speed = speed;
-    if (speed <= old_speed) {
+    if (speed && speed <= old_speed) {
         return;
     }