Re: [Qemu-devel] [PATCH] fix: avoid infinite loop when blockjob encountering failure

2017-06-16 Thread Max Reitz
On 2017-06-15 04:38, sochin.jiang wrote: > Thanks for your kindly reply. > > I do have made a mistake that ignoring the AIOContext lock. > > About the patch, firstly, if job->ret comes to be non-zero(also means > job->completed to be true) , blockjob 'callback'(common_block_job_cb) will be > ca

Re: [Qemu-devel] [PATCH] fix: avoid infinite loop when blockjob encountering failure

2017-06-14 Thread sochin.jiang
I realized blockjob is freed after completed unless we call block_job_ref() before run_block_job is called. On 2017/6/15 10:38, sochin.jiang wrote: > Thanks for your kindly reply. > > I do have made a mistake that ignoring the AIOContext lock. > > About the patch, firstly, if job->ret comes to b

Re: [Qemu-devel] [PATCH] fix: avoid infinite loop when blockjob encountering failure

2017-06-14 Thread sochin.jiang
Thanks for your kindly reply. I do have made a mistake that ignoring the AIOContext lock. About the patch, firstly, if job->ret comes to be non-zero(also means job->completed to be true) , blockjob 'callback'(common_block_job_cb) will be called, blockjob error will be put into errp. It won't re

Re: [Qemu-devel] [PATCH] fix: avoid infinite loop when blockjob encountering failure

2017-06-14 Thread Max Reitz
Thanks for your patch! The issue can be reproduced as follows: $ qemu-img create -f qcow2 -b \ "json:{'driver':'raw','file':{ 'driver':'blkdebug','inject-error':[{'event':'write_aio'}], 'image':{'driver':'null-co'}}}" \ overlay.qcow2 $ qemu-io -c 'write 0 64k' overlay.qcow

Re: [Qemu-devel] [PATCH] fix: avoid infinite loop when blockjob encountering failure

2017-06-14 Thread sochin.jiang
All right, Thanks... On 2017/6/14 14:46, Fam Zheng wrote: > On Tue, 06/13 23:33, no-re...@patchew.org wrote: >> In file included from /tmp/qemu-test/src/hw/net/vmxnet3.c:30: >> /tmp/qemu-test/src/include/migration/register.h:18: error: redefinition of >> typedef ‘LoadStateHandler’ >> /tmp/qemu-

Re: [Qemu-devel] [PATCH] fix: avoid infinite loop when blockjob encountering failure

2017-06-13 Thread Fam Zheng
On Tue, 06/13 23:33, no-re...@patchew.org wrote: > In file included from /tmp/qemu-test/src/hw/net/vmxnet3.c:30: > /tmp/qemu-test/src/include/migration/register.h:18: error: redefinition of > typedef ‘LoadStateHandler’ > /tmp/qemu-test/src/include/migration/vmstate.h:32: note: previous declaration

Re: [Qemu-devel] [PATCH] fix: avoid infinite loop when blockjob encountering failure

2017-06-13 Thread no-reply
Hi, This series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally. Subject: [Qemu-devel] [PATCH] fix: avoid infinite loop when blockjob encountering failure Type: series Message-id

[Qemu-devel] [PATCH] fix: avoid infinite loop when blockjob encountering failure

2017-06-13 Thread sochin.jiang
From: "sochin.jiang" img_commit could fall into infinite loop if it's blockjob fail encountering any I/O error. Try to fix it. Signed-off-by: sochin.jiang --- qemu-img.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index 0ad698d..6ba565d 1006