qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-devel@nongnu.org, "Richard W.M. Jones" <rjones@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] qemu-ga: obey LISTEN_PID when using systemd socket activation
Date: Mon, 20 Mar 2017 14:12:25 +0000	[thread overview]
Message-ID: <20170320141225.GY17887@stefanha-x1.localdomain> (raw)
In-Reply-To: <ab488c57-5006-e5db-145b-5b0cba1d3ead@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1249 bytes --]

On Fri, Mar 17, 2017 at 11:57:38AM +0100, Paolo Bonzini wrote:
> 
> 
> On 17/03/2017 10:41, Stefan Hajnoczi wrote:
> >> 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.
> > 
> > I intentionally wrote qga socket activation this way.  It allows socket
> > activation to work together with daemonization.  That combination is
> > probably not very useful so it's fine to get rid of it.
> 
> This works with my patch (and I've tested it now), because it looks up
> LISTEN_FDS only once, way before daemonization.
> 
> The run_agent function grew a parameter that tells it to use
> FIRST_SOCKET_ACTIVATION_FD as the file descriptor, without requiring
> another look at the environment.  (And because daemonization forks but
> doesn't exec, setting the cloexec flag doesn't get in the way either).

Good point, I thought it would exec for some reason but it doesn't need
to!

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

      reply	other threads:[~2017-03-20 14:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16 16:36 [Qemu-devel] [PATCH v2] qemu-ga: obey LISTEN_PID when using systemd socket activation Paolo Bonzini
2017-03-16 17:03 ` Richard W.M. Jones
2017-03-17  9:41 ` Stefan Hajnoczi
2017-03-17 10:57   ` Paolo Bonzini
2017-03-20 14:12     ` Stefan Hajnoczi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170320141225.GY17887@stefanha-x1.localdomain \
    --to=stefanha@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@redhat.com \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).