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>
This commit is contained in:
Paolo Bonzini 2013-01-22 15:01:11 +01:00 committed by Kevin Wolf
parent 0e87ba2ccb
commit 88ff0e48ee
1 changed files with 1 additions and 1 deletions

View 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;
}