Paolo Bonzini 53fabd4b86 qemu-ga: obey LISTEN_PID when using systemd socket activation
qemu-ga's socket activation support was not obeying the LISTEN_PID
environment variable, which avoids that a process uses a socket-activation
file descriptor meant for its parent.

Mess can for example ensue if a process forks a children before consuming
the socket-activation file descriptor and therefore setting O_CLOEXEC
on it.

Luckily, qemu-nbd also got socket activation code, and its copy does
support LISTEN_PID.  Some extra fixups are needed to ensure that the
code can be used for both, but that's what this patch does.  The
main change is to replace get_listen_fds's "consume" argument with
the FIRST_SOCKET_ACTIVATION_FD macro from the qemu-nbd code.

Cc: "Richard W.M. Jones" <rjones@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-03-19 11:12:12 +01:00
..
2016-06-07 18:19:23 +03:00
2016-10-26 08:29:01 -07:00
2016-11-01 10:29:03 -06:00
2016-02-23 12:43:05 +00:00
2017-03-07 16:07:46 +01:00
2016-06-16 18:39:03 +02:00
2017-01-24 23:26:52 +03:00
2017-01-24 17:54:47 +00:00
2016-06-07 18:19:24 +03:00
2017-01-23 15:32:46 +00:00
2016-02-23 12:43:05 +00:00
2016-02-23 12:43:05 +00:00
2016-09-15 15:32:22 +03:00
2016-09-23 11:42:52 +08:00
2017-01-24 23:26:52 +03:00