qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] rework daemonizing logic in qemu-nbd


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] rework daemonizing logic in qemu-nbd
Date: Sun, 15 Jan 2012 18:46:48 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0

On 01/15/2012 06:31 PM, Paolo Bonzini wrote:


We're doomed anyway, and it is even good
we've a small remote chance for our error message to
be seen.  Currently it just goes to /dev/null.

No, currently it is sent from the daemon to the parent through the pipe,
the parent prints it and exits with status code 1.  With your patch, if
the dup2 wins the race you exit with status code 0; if the client thread
wins the race it is the same as master.

Actually, the dup2 will always win the race. Until the main loop starts and accepts the connection from the client thread, the client thread will be stuck connect()ing to the server socket. So, the client thread will never be able to report problems connecting /dev/nbd (for example you won't get an error if you chose a device that is already busy). So it looks like there is no race, but there is a bug. :)

Please disprove me if I'm wrong, of course.

Paolo




reply via email to

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