Skip to contentSkip to conversation

qemu-img: wait for convert coroutines to complete

PATCH In review Denis V. Lunev 3 participants 4 messages Apr 18, 2017 – Apr 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu-img: wait for convert coroutines to complete

From: Anton Nefedov <[email protected]>

We should wait for other coroutines on error path, i.e. one of coroutines terminates with i/o error, before cleaning the common structures. In the other case we would crash in a lot of different places. This behaviour was introduced by commit 2d9187bc65.

---
 qemu-img.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qemu-img.c +1 -1
index b220cf7..3b04c5f 100644
@@ -1899,7 +1899,7 @@ static int convert_do_copy(ImgConvertState *s)
         qemu_coroutine_enter(s->co[i]);
     }
 
-    while (s->ret == -EINPROGRESS) {
+    while (s->running_coroutines) {
         main_loop_wait(false);
     }
 
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw

Am 18.04.2017 um 12:27 schrieb Denis V. Lunev:

Quoted 21 lines

From: Anton Nefedov <[email protected]>

We should wait for other coroutines on error path, i.e. one of coroutines terminates with i/o error, before cleaning the common structures. In the other case we would crash in a lot of different places. This behaviour was introduced by commit 2d9187bc65.

---
  qemu-img.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
qemu-img.c +0 -0
index b220cf7..3b04c5f 100644

qemu-img.c static int convert_do_copy(ImgConvertState *s) · line 1905

Quoted 8 lines
qemu-img.c +1 -1
@@ -1899,7 +1899,7 @@ static int convert_do_copy(ImgConvertState *s)
          qemu_coroutine_enter(s->co[i]);
      }
 
-    while (s->ret == -EINPROGRESS) {
+    while (s->running_coroutines) {
          main_loop_wait(false);
      }
 

Thanks for catching this.

Peter

#2 lore raw
In reply to Denis V. Lunev

Am 18.04.2017 um 12:27 schrieb Denis V. Lunev:

Quoted 7 lines

From: Anton Nefedov <[email protected]>

We should wait for other coroutines on error path, i.e. one of coroutines terminates with i/o error, before cleaning the common structures. In the other case we would crash in a lot of different places. This behaviour was introduced by commit 2d9187bc65.

Quoted 5 lines

This should go into 2.9.1

Peter

#3 lore raw
Quoted 14 lines · Peter Lieven

Am 18.04.2017 um 12:27 schrieb Denis V. Lunev:

Quoted 7 lines

From: Anton Nefedov <[email protected]>

We should wait for other coroutines on error path, i.e. one of coroutines terminates with i/o error, before cleaning the common structures. In the other case we would crash in a lot of different places. This behaviour was introduced by commit 2d9187bc65.

Quoted 5 lines
Quoted 6 lines

This should go into 2.9.1

Peter

Actually I'm afraid the patch is incorrect.. The erroneous coroutine bails out without reentering its possible dependent coroutine so it (and the following dependents) will never finish.

I'll send out the 2nd version soon

/Anton