qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Denis V. Lunev" <den@openvz.org>,
	qemu-devel@nongnu.org, Denis Plotnikov <dplotnikov@virtuozzo.com>
Subject: Re: [Qemu-devel] [PATCH 1/1] qemu-nbd: add the option to use pre-created server socket
Date: Thu, 29 Sep 2016 13:32:35 +0100	[thread overview]
Message-ID: <20160929123235.GQ5312@redhat.com> (raw)
In-Reply-To: <d74d073a-9865-551f-f861-bb21608ec857@redhat.com>

On Thu, Sep 29, 2016 at 02:18:54PM +0200, Paolo Bonzini wrote:
> 
> 
> On 29/09/2016 13:13, 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.
> 
> This is 100% true, but I find daemonization to be a hack, so file
> descriptor passing has its place.
> 
> Still, I'd prefer to have a --socket-activation option which uses the
> systemd socket activation protocol.  The systemd protocol can be
> implemented easily by any management layer.

That's a nice idea - system socket activation is pretty simple todo


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|

  reply	other threads:[~2016-09-29 12:32 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 [this message]
2016-09-29 13:41   ` Stefan Hajnoczi
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=20160929123235.GQ5312@redhat.com \
    --to=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).