All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] rework daemonizing logic in qemu-nbd
Date: Sun, 15 Jan 2012 18:46:48 +0100	[thread overview]
Message-ID: <jev3e8$444$1@dough.gmane.org> (raw)
In-Reply-To: <4F130D78.1070903@redhat.com>

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	other threads:[~2012-01-15 17:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-14 12:39 [Qemu-devel] [PATCH] rework daemonizing logic in qemu-nbd Michael Tokarev
2012-01-15 10:42 ` Paolo Bonzini
2012-01-15 12:50   ` Michael Tokarev
2012-01-15 16:11     ` Paolo Bonzini
2012-01-15 16:44       ` Michael Tokarev
2012-01-15 17:31         ` Paolo Bonzini
2012-01-15 17:46           ` Paolo Bonzini [this message]
2012-01-16  7:22           ` Michael Tokarev
2012-01-16  7:41             ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='jev3e8$444$1@dough.gmane.org' \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.