From 88ff0e48eedd679a9dc1122676d8aa29f8d07571 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 22 Jan 2013 15:01:11 +0100 Subject: [PATCH] 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 Reviewed-by: Eric Blake Reviewed-by: Laszlo Ersek Signed-off-by: Kevin Wolf --- block/mirror.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }