[1/2] mirror: do nothing on zero-sized disk

Submitted by Paolo Bonzini on Jan. 22, 2013, 2:01 p.m.

Details

Message ID 1358863272-29482-2-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini Jan. 22, 2013, 2:01 p.m.
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>
---
 block/mirror.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/block/mirror.c b/block/mirror.c
index 9347533..a62ad86 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;
     }