qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, Michael Roth <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] configure: add libsystemd check
Date: Fri, 6 Jan 2017 12:59:15 +0000	[thread overview]
Message-ID: <20170106125915.GA17294@stefanha-x1.localdomain> (raw)
In-Reply-To: <20170105174550.GW3292@redhat.com>

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

On Thu, Jan 05, 2017 at 05:45:50PM +0000, Daniel P. Berrange wrote:
> On Thu, Jan 05, 2017 at 05:31:06PM +0000, Stefan Hajnoczi wrote:
> > libsystemd provides APIs for daemons that wish to integrate socket
> > activation and other systemd-related functionality.  This will be used
> > as an optional dependency by qemu-guest-agent.
> > 
> > In the future it could also be used for systemd logging or sd_notify(3)
> > service startup notification.
> > 
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > ---
> >  configure | 34 ++++++++++++++++++++++++++++++++++
> >  1 file changed, 34 insertions(+)
> > 
> > diff --git a/configure b/configure
> > index 218df87..c353ff7 100755
> > --- a/configure
> > +++ b/configure
> > @@ -321,6 +321,7 @@ numa=""
> >  tcmalloc="no"
> >  jemalloc="no"
> >  replication="yes"
> > +systemd=""
> >  
> >  # parse CC options first
> >  for opt do
> > @@ -1168,6 +1169,10 @@ for opt do
> >    ;;
> >    --enable-replication) replication="yes"
> >    ;;
> > +  --disable-systemd) systemd="no"
> > +  ;;
> > +  --enable-systemd) systemd="yes"
> > +  ;;
> >    *)
> >        echo "ERROR: unknown option $opt"
> >        echo "Try '$0 --help' for more information"
> > @@ -1401,6 +1406,7 @@ disabled with --disable-FEATURE, default is enabled if available:
> >    tcmalloc        tcmalloc support
> >    jemalloc        jemalloc support
> >    replication     replication support
> > +  systemd         systemd support
> >  
> >  NOTE: The object files are built at the place where configure is launched
> >  EOF
> > @@ -4720,6 +4726,27 @@ if compile_prog "" "" ; then
> >      have_af_vsock=yes
> >  fi
> >  
> > +##########################################
> > +# check for libsystemd
> > +if test "$systemd" != "no" ; then
> > +  cat > $TMPC << EOF
> > +#include <systemd/sd-daemon.h>
> > +int main(void) { (void)sd_listen_fds(1); return 0; }
> > +EOF
> > +  systemd_cflags=$($pkg_config --cflags libsystemd 2>/dev/null)
> > +  systemd_libs=$($pkg_config --libs libsystemd 2>/dev/null)
> > +  if $pkg_config libsystemd >/dev/null 2>&1 && \
> > +     compile_prog "$systemd_cflags" "$systemd_libs" ; then
> 
> Any reason why you're going to the trouble of compiling a
> program here ? The key benefit of pkg-config is that you
> don't need to do things like that to test for existance
> of the library - just trust the result of pkg-config check.
> 
> FWIW, it is easy to support socket activation without even
> using libsystemd. The systemd activation "protocol" is
> trivial - it merely sets "LISTEN_FDS" env variable to the
> number of FDs it has been passed down, and they are numbered
> from stderr fileno + 1.

After looking into it I found that LISTEN_FDS is considered stable and
"reimplementable independently":
https://www.freedesktop.org/wiki/Software/systemd/InterfacePortabilityAndStabilityChart/

I'll resend this patch without the libsystemd dependency.

I guess that will make packagers happy who wish to provide packages that
work both with and without systemd installed.

Stefan

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

  reply	other threads:[~2017-01-06 12:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-05 17:31 [Qemu-devel] [PATCH 0/2] qga: systemd socket activation for AF_UNIX and AF_VSOCK Stefan Hajnoczi
2017-01-05 17:31 ` [Qemu-devel] [PATCH 1/2] configure: add libsystemd check Stefan Hajnoczi
2017-01-05 17:45   ` Daniel P. Berrange
2017-01-06 12:59     ` Stefan Hajnoczi [this message]
2017-01-05 17:31 ` [Qemu-devel] [PATCH 2/2] qga: add systemd socket activation support Stefan Hajnoczi

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=20170106125915.GA17294@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=berrange@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /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).