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