qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/4] qemu-nbd: do not start the block layer in t


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 4/4] qemu-nbd: do not start the block layer in the parent
Date: Fri, 04 Nov 2011 12:25:32 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1

On 11/04/2011 12:22 PM, Kevin Wolf wrote:
>
>  That's exactly what this series did.  However, daemonization has also to
>  be done before opening the image file.  So the series has to support
>  reporting errors to syslog, and also qemu-nbd will not give a nonzero
>  exit status when errors occur.

The parent could wait until the initialisation is done.

You need to daemonize first, then fork the server. If you fork the server before daemonizing, the server:

1) is not in its own process group, and still has a controlling TTY;

2) is not your child so your process structure is all broken, with the client and server being both child of PID 1;

3) is not your child, so you cannot reliably kill it (because if it has exited and PID 1 has already reaped it, you might kill a random process instead!).

Paolo



reply via email to

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