Re: [Qemu-devel] [PATCH v3] qemu-nbd: Implement socket activation.

2017-02-03 Thread Paolo Bonzini
On 03/02/2017 11:22, Richard W.M. Jones wrote: > > I think that the --fork option is mainly intended for command line use > of qemu-nbd. If you're running qemu-nbd from a program there's no > real reason to use --fork, since you can control the fork process > better yourself. > > LISTEN_PID is

Re: [Qemu-devel] [PATCH v3] qemu-nbd: Implement socket activation.

2017-02-03 Thread Richard W.M. Jones
On Fri, Feb 03, 2017 at 10:58:15AM -0800, Paolo Bonzini wrote: > On 03/02/2017 10:56, Richard W.M. Jones wrote: > > On Fri, Feb 03, 2017 at 09:31:43AM -0800, Paolo Bonzini wrote: > >> On 03/02/2017 09:09, Richard W.M. Jones wrote: > >>> +if (fork_process) { > >>> +return "Fork (--fork)

Re: [Qemu-devel] [PATCH v3] qemu-nbd: Implement socket activation.

2017-02-03 Thread Paolo Bonzini
On 03/02/2017 10:56, Richard W.M. Jones wrote: > On Fri, Feb 03, 2017 at 09:31:43AM -0800, Paolo Bonzini wrote: >> >> >> On 03/02/2017 09:09, Richard W.M. Jones wrote: >>> + const char *port, >>> +

Re: [Qemu-devel] [PATCH v3] qemu-nbd: Implement socket activation.

2017-02-03 Thread Richard W.M. Jones
On Fri, Feb 03, 2017 at 09:31:43AM -0800, Paolo Bonzini wrote: > > > On 03/02/2017 09:09, Richard W.M. Jones wrote: > > + const char *port, > > + bool fork_process) > > +{ > > +if (device != NU

Re: [Qemu-devel] [PATCH v3] qemu-nbd: Implement socket activation.

2017-02-03 Thread Paolo Bonzini
On 03/02/2017 09:09, Richard W.M. Jones wrote: > + const char *port, > + bool fork_process) > +{ > +if (device != NULL) { > +return "NBD device can't be set when using socket activation

[Qemu-devel] [PATCH v3] qemu-nbd: Implement socket activation.

2017-02-03 Thread Richard W.M. Jones
Socket activation (sometimes known as systemd socket activation) allows an Internet superserver to pass a pre-opened listening socket to the process, instead of having qemu-nbd open a socket itself. This is done via the LISTEN_FDS and LISTEN_PID environment variables, and a standard file descripto

[Qemu-devel] [PATCH v3] qemu-nbd: Implement socket activation.

2017-02-03 Thread Richard W.M. Jones
v2 -> v3: - Changes suggested by Stefan. - Retested it, using my socket activation code in virt-p2v: https://www.redhat.com/archives/libguestfs/2017-February/msg00036.html Rich.