aboutsummaryrefslogtreecommitdiff
path: root/block/mirror.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-01-22 15:01:11 +0100
committerKevin Wolf <kwolf@redhat.com>2013-01-25 18:18:35 +0100
commit88ff0e48eedd679a9dc1122676d8aa29f8d07571 (patch)
treed2ceecf4ac04df8facabeb6a66cf85bb57272898 /block/mirror.c
parent0e87ba2ccbf900cc5a56b95e0671e5a5d2c2f6a0 (diff)
mirror: do nothing on zero-sized disk
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>
Diffstat (limited to 'block/mirror.c')
-rw-r--r--block/mirror.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/mirror.c b/block/mirror.c
index 9347533b9b..a62ad86c28 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -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;
}