* [Qemu-devel] [PATCH 1/1] qemu-img: wait for convert coroutines to complete
@ 2017-04-18 10:27 Denis V. Lunev
2017-04-18 11:22 ` Peter Lieven
2017-04-21 9:18 ` Peter Lieven
0 siblings, 2 replies; 4+ messages in thread
From: Denis V. Lunev @ 2017-04-18 10:27 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-block, Anton Nefedov, Denis V . Lunev, Peter Lieven,
Kevin Wolf, Max Reitz
From: Anton Nefedov <anton.nefedov@virtuozzo.com>
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.
Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Peter Lieven <pl@kamp.de>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Max Reitz <mreitz@redhat.com>
---
qemu-img.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qemu-img.c b/qemu-img.c
index b220cf7..3b04c5f 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -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);
}
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] qemu-img: wait for convert coroutines to complete
2017-04-18 10:27 [Qemu-devel] [PATCH 1/1] qemu-img: wait for convert coroutines to complete Denis V. Lunev
@ 2017-04-18 11:22 ` Peter Lieven
2017-04-21 9:18 ` Peter Lieven
1 sibling, 0 replies; 4+ messages in thread
From: Peter Lieven @ 2017-04-18 11:22 UTC (permalink / raw)
To: Denis V. Lunev, qemu-devel
Cc: qemu-block, Anton Nefedov, Kevin Wolf, Max Reitz
Am 18.04.2017 um 12:27 schrieb Denis V. Lunev:
> From: Anton Nefedov <anton.nefedov@virtuozzo.com>
>
> 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.
>
> Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com>
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> CC: Peter Lieven <pl@kamp.de>
> CC: Kevin Wolf <kwolf@redhat.com>
> CC: Max Reitz <mreitz@redhat.com>
> ---
> qemu-img.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/qemu-img.c b/qemu-img.c
> index b220cf7..3b04c5f 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -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);
> }
>
Reviewed-by: Peter Lieven <pl@kamp.de>
Thanks for catching this.
Peter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] qemu-img: wait for convert coroutines to complete
2017-04-18 10:27 [Qemu-devel] [PATCH 1/1] qemu-img: wait for convert coroutines to complete Denis V. Lunev
2017-04-18 11:22 ` Peter Lieven
@ 2017-04-21 9:18 ` Peter Lieven
2017-04-21 9:43 ` Anton Nefedov
1 sibling, 1 reply; 4+ messages in thread
From: Peter Lieven @ 2017-04-21 9:18 UTC (permalink / raw)
To: Denis V. Lunev, qemu-devel
Cc: qemu-block, Anton Nefedov, Kevin Wolf, Max Reitz, qemu-stable
Am 18.04.2017 um 12:27 schrieb Denis V. Lunev:
> From: Anton Nefedov <anton.nefedov@virtuozzo.com>
>
> 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.
>
> Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com>
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> CC: Peter Lieven <pl@kamp.de>
> CC: Kevin Wolf <kwolf@redhat.com>
> CC: Max Reitz <mreitz@redhat.com>
Cc: qemu-stable@nongnu.org
This should go into 2.9.1
Peter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] qemu-img: wait for convert coroutines to complete
2017-04-21 9:18 ` Peter Lieven
@ 2017-04-21 9:43 ` Anton Nefedov
0 siblings, 0 replies; 4+ messages in thread
From: Anton Nefedov @ 2017-04-21 9:43 UTC (permalink / raw)
To: Peter Lieven, Denis V. Lunev, qemu-devel
Cc: qemu-block, Kevin Wolf, Max Reitz, qemu-stable
On 04/21/2017 12:18 PM, Peter Lieven wrote:
> Am 18.04.2017 um 12:27 schrieb Denis V. Lunev:
>> From: Anton Nefedov <anton.nefedov@virtuozzo.com>
>>
>> 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.
>>
>> Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com>
>> Signed-off-by: Denis V. Lunev <den@openvz.org>
>> CC: Peter Lieven <pl@kamp.de>
>> CC: Kevin Wolf <kwolf@redhat.com>
>> CC: Max Reitz <mreitz@redhat.com>
>
> Cc: qemu-stable@nongnu.org
>
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-04-21 9:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-18 10:27 [Qemu-devel] [PATCH 1/1] qemu-img: wait for convert coroutines to complete Denis V. Lunev
2017-04-18 11:22 ` Peter Lieven
2017-04-21 9:18 ` Peter Lieven
2017-04-21 9:43 ` Anton Nefedov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).