qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] qemu-ga: obey LISTEN_PID when using systemd soc


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] qemu-ga: obey LISTEN_PID when using systemd socket activation
Date: Thu, 16 Mar 2017 17:34:30 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0


On 16/03/2017 17:19, Daniel P. Berrange wrote:
> 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" <address@hidden>
>> Cc: Stefan Hajnoczi <address@hidden>
>> Signed-off-by: Paolo Bonzini <address@hidden>
>> ---
>>  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 ?

No idea of who would be a candidate.

Thanks for the fast review!

Paolo

>>  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 <address@hidden>
> 
> 
> Regards,
> Daniel
> 



reply via email to

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