On Thu, Mar 16, 2017 at 05:15:35PM +0100, Paolo Bonzini wrote: > 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" <rjo...@redhat.com> > Cc: Stefan Hajnoczi <stefa...@redhat.com> > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> > --- > include/qemu/systemd.h | 26 +++++++++++++ > qemu-nbd.c | 100 > ++++--------------------------------------------- > qga/main.c | 51 +++++++------------------ > util/Makefile.objs | 1 + > util/systemd.c | 77 +++++++++++++++++++++++++++++++++++++
A MAINTAINERS file entry for these new files ? > 5 files changed, 125 insertions(+), 130 deletions(-) > create mode 100644 include/qemu/systemd.h > create mode 100644 util/systemd.c Reviewed-by: Daniel P. Berrange <berra...@redhat.com> 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/ :|