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

login
register
mail settings
Submitter Paolo Bonzini
Date Jan. 22, 2013, 2:01 p.m.
Message ID <1358863272-29482-2-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/214555/
State New
Headers show

Comments

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

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