qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH v2] disable sigcld handling before calling pclos


From: Paolo Bonzini
Subject: [Qemu-devel] Re: [PATCH v2] disable sigcld handling before calling pclose()
Date: Wed, 05 Jan 2011 10:21:50 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101103 Fedora/1.0-0.33.b2pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.6

On 12/21/2010 05:05 AM, Wen Congyang wrote:
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().

I wondered whether we need SIGCHLD handling at all. fork is called only from:

- xen_domain_watcher in hw/xen_domainbuild.c

- launch_script in net/tap.c

- SLIRP's fork_exec ("mini inetd")

For the first, the child will always "outlive" the parent. For the second, we do waitpid in the function. So SLIRP is the only real user of the SIGCHLD handler and in fact this:

http://www.google.com/codesearch/p?hl=en#tGk9u3ZS0cw/pub/Linux/system/network/serial/slirp-1.0.9.tar.gz|s3yKHVXI6eg/slirp-1.0.9/src/main.c

suggests that the handler came from there (search for do_wait). Would anybody object to removing the support for Samba under SLIRP and all the resulting cruft?

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]