From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:36539) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghGJ2-00026N-Ug for qemu-devel@nongnu.org; Wed, 09 Jan 2019 11:02:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghGIw-0004Fy-0K for qemu-devel@nongnu.org; Wed, 09 Jan 2019 11:02:12 -0500 Received: from m15-113.126.com ([220.181.15.113]:38523) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghGIv-0003oG-BW for qemu-devel@nongnu.org; Wed, 09 Jan 2019 11:02:05 -0500 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) From: fei In-Reply-To: <87k1jddf8y.fsf@dusky.pond.sub.org> Date: Thu, 10 Jan 2019 00:01:16 +0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20181225140449.15786-1-fli@suse.com> <20181225140449.15786-14-fli@suse.com> <87k1jddf8y.fsf@dusky.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH for-4.0 v9 13/16] qemu_thread: supplement error handling for migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Fei Li , qemu-devel@nongnu.org, shirley17fei@gmail.com, Peter Xu , "Dr . David Alan Gilbert" > =E5=9C=A8 2019=E5=B9=B41=E6=9C=889=E6=97=A5=EF=BC=8C23:26=EF=BC=8CMarkus A= rmbruster =E5=86=99=E9=81=93=EF=BC=9A >=20 > Fei Li writes: >=20 >> Update qemu_thread_create()'s callers by >> - setting an error on qemu_thread_create() failure for callers that >> set an error on failure; >> - reporting the error and returning failure for callers that return >> an error code on failure; >> - reporting the error and setting some state for callers that just >> report errors and choose not to continue on. >>=20 >> Cc: Markus Armbruster >> Cc: Dr. David Alan Gilbert >> Cc: Peter Xu >> Signed-off-by: Fei Li > [...] >> diff --git a/migration/ram.c b/migration/ram.c >> index eed1daf302..1e24a78eaa 100644 >> --- a/migration/ram.c >> +++ b/migration/ram.c > [...] >> @@ -3625,6 +3637,7 @@ static void compress_threads_load_cleanup(void) >> static int compress_threads_load_setup(QEMUFile *f) >> { >> int i, thread_count; >> + Error *local_err =3D NULL; >>=20 >> if (!migrate_use_compression()) { >> return 0; >> @@ -3646,10 +3659,13 @@ static int compress_threads_load_setup(QEMUFile *= f) >> qemu_cond_init(&decomp_param[i].cond); >> decomp_param[i].done =3D true; >> decomp_param[i].quit =3D false; >> - /* TODO: let the further caller handle the error instead of abor= t() */ >> - qemu_thread_create(decompress_threads + i, "decompress", >> - do_data_decompress, decomp_param + i, >> - QEMU_THREAD_JOINABLE, &error_abort); >> + if (!qemu_thread_create(decompress_threads + i, "decompress", >> + do_data_decompress, decomp_param + i, >> + QEMU_THREAD_JOINABLE, &local_err)) { >> + error_reportf_err(local_err, >> + "failed to create do_data_decompress: "); >> + goto exit; >=20 > Broken error handling, see my review of PATCH 16. Yep, seems both the compress_threads_save_setup() and compress_threads_load_= setup() have such problem. >=20 >> + } >> } >> return 0; >> exit: > [...]