qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/1] qemu-nbd: add the option to use pre-created


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 1/1] qemu-nbd: add the option to use pre-created server socket
Date: Thu, 29 Sep 2016 14:18:54 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0


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 <address@hidden>
>>
>> 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.

Paolo



reply via email to

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