]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
mirror: do nothing on zero-sized disk
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 22 Jan 2013 14:01:11 +0000 (15:01 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 25 Jan 2013 17:18:35 +0000 (18:18 +0100)
On a zero-sized disk we need to break out of the job successfully
before bdrv_dirty_iter_init is called, otherwise you will get an
assertion failure with the next patch.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/mirror.c

index 9347533b9bdc7f48c4b9442ad565e27945781271..a62ad86c28f7ce017d68dd42da3a71c2167d95de 100644 (file)
@@ -305,7 +305,7 @@ static void coroutine_fn mirror_run(void *opaque)
     }
 
     s->common.len = bdrv_getlength(bs);
-    if (s->common.len < 0) {
+    if (s->common.len <= 0) {
         block_job_completed(&s->common, s->common.len);
         return;
     }