From: Stefan Hajnoczi <stefanha@gmail.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: "Denis V. Lunev" <den@openvz.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Denis Plotnikov <dplotnikov@virtuozzo.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/1] qemu-nbd: add the option to use pre-created server socket
Date: Thu, 29 Sep 2016 14:41:52 +0100 [thread overview]
Message-ID: <20160929134152.GA6983@stefanha-x1.localdomain> (raw)
In-Reply-To: <20160929111318.GN5312@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1121 bytes --]
On Thu, Sep 29, 2016 at 12:13:18PM +0100, Daniel P. Berrange wrote:
> On Thu, Sep 29, 2016 at 02:02:15PM +0300, Denis V. Lunev wrote:
> > From: Denis Plotnikov <dplotnikov@virtuozzo.com>
> >
> > Originally NBD server socket was created by qemu-nbd code. This leads to
> > the race when the management layer starts qemu-nbd server and allows a
> > client to connect to the server. In this case there is a possibility that
> > qemu-nbd does not open listening server socket yet. Creating listening
> > socket before starting of qemu-ndb and passing socket fd via command line
> > solves this issue completely.
>
> FWIW, this could be solved in qemu-nbd itself if we had a general
> ability to request "daemon" mode - currently it only daemonizes
> if attaching to a nbd block device.
>
> The key would be that qemu-nbd would open the listening socket
> before daemonizing. Thus when the mgmt application spawned
> qemu-nbd in daemon mode, it can be sure that the listener
> socket is present when waitpid() completes.
A patch to do that was just posted:
[PATCH v4 1/3] qemu-nbd: Add --fork option
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
next prev parent reply other threads:[~2016-09-29 13:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-29 11:02 [Qemu-devel] [PATCH 1/1] qemu-nbd: add the option to use pre-created server socket Denis V. Lunev
2016-09-29 11:13 ` Daniel P. Berrange
2016-09-29 12:18 ` Paolo Bonzini
2016-09-29 12:32 ` Daniel P. Berrange
2016-09-29 13:41 ` Stefan Hajnoczi [this message]
2016-09-29 15:05 ` Eric Blake
2016-09-29 15:52 ` Denis V. Lunev
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=20160929134152.GA6983@stefanha-x1.localdomain \
--to=stefanha@gmail.com \
--cc=berrange@redhat.com \
--cc=den@openvz.org \
--cc=dplotnikov@virtuozzo.com \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).