From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=44847 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSR5P-0001L9-DB for qemu-devel@nongnu.org; Tue, 14 Dec 2010 04:22:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSR5O-0002Xn-4z for qemu-devel@nongnu.org; Tue, 14 Dec 2010 04:22:19 -0500 Received: from [222.73.24.84] (port=65095 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSR5N-0002VM-OJ for qemu-devel@nongnu.org; Tue, 14 Dec 2010 04:22:18 -0500 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id 03FFE171A49 for ; Tue, 14 Dec 2010 17:22:06 +0800 (CST) Received: from mailserver.fnst.cn.fujitus.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id oBE9HIqv008182 for ; Tue, 14 Dec 2010 17:17:19 +0800 Message-ID: <4D07378B.3050901@cn.fujitsu.com> Date: Tue, 14 Dec 2010 17:23:23 +0800 From: Wen Congyang MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] disable sigcld handling before calling pclose() References: <4D005006.9080307@cn.fujitsu.com> In-Reply-To: <4D005006.9080307@cn.fujitsu.com> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=GB2312 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel At 2010-12-09 11:41, Wen Congyang Write: > When I use the command 'virsh save' to save the domain state, > I receive the following error message: > operation failed: Migration unexpectedly failed. > > I debug the qemu by adding some printf(), and find the function > pclose() returns -1. > > I use strace to trace qemu, the log is as the following: > ====== > close(17) = 0 > --- SIGCHLD (Child exited) @ 0 (0) --- > wait4(-1, NULL, WNOHANG, NULL) = 22016 > rt_sigreturn(0) = 0 > wait4(22016, 0x7fff7f1034fc, 0, NULL) = -1 ECHILD (No child processes) > ====== > > We wait the child twice: one is in signal SIGCHLD handling and the other > one is in pclose(). > > We should disable sigcld handling before calling pclose(). > > Signed-off-by: Wen Congyang > Ping :)