From: shawn Subject: Re: [patch]Make xend to take care of dead qemu-dm process Date: Thu, 29 May 2008 10:23:28 +0800 Message-ID: <1212027808.3303.10.camel@redfuture-desktop.cn.oracle.com> References: <1211788123.31313.17.camel@redfuture-desktop.cn.oracle.com> <1211966649.3303.7.camel@redfuture-desktop.cn.oracle.com> <18493.10205.299841.377360@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <18493.10205.299841.377360@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson Cc: xen-devel List-Id: xen-devel@lists.xenproject.org Hi Ian, Thanks for your explanation:) Imporving this patch regards, xiaowei On Wed, 2008-05-28 at 10:37 +0100, Ian Jackson wrote: > shawn writes ("Re: [Xen-devel] [patch]Make xend to take care of dead qemu-dm process"): > > Could I ask if there is any methodology mistakes to solve this problem? > > or need I keep improving this patch? > > I made some suggestions in a recent pair of messages in the thread > `c/s 17731 portability issues'. Did you not receive those messages ? > >From over here they appear to have been copied to you as the author of > the errant patch. > > Anyway, let me repeat myself: > > Certainly running ps in this way is not the right way to do it. > > Since qemu-dm is started by xend, it is quite possible for xend to > have a better and more reliable arrangement for detecting termination > of the qemu-dm process. No polling is needed (and thus failure > detection can be immediate). > > I suggested a design involving a named pipe. qemu-dm would be passed > the writing end across exec but just keep it, and not write anything > to it. xend would keep the reading end, and when it becomes readable > would collect the qemu-dm exit status with waitpid (with W_NOHANG). > xend would then kill the domain and report the fact of termination and > also qemu-dm's exit status if available. > > On restart, xend would attempt to open the fifo again with > O_RDONLY|O_NONBLOCK which would fail EWOUDLBLOCK if qemu-dm was no > longer running; if it was still running then termination can be > detected as above, although the exit status won't be recoverable. > > Does this all make sense ? I'd be happy to expand on it if you'd like > to ask questions. We'll make sure to review your next submission > thoroughly. > > Ian.