From: "Luis R. Rodriguez" <mcgrof@suse.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Keir Fraser <keir@xen.org>,
"Luis R. Rodriguez" <mcgrof@do-not-panic.com>,
Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
Jan Beulich <jbeulich@suse.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v5 12/14] autoconf: xen: enable explicit preference option for xenstored preference
Date: Thu, 22 May 2014 01:02:33 +0200 [thread overview]
Message-ID: <20140521230233.GA13289@wotan.suse.de> (raw)
In-Reply-To: <1400687040.7272.28.camel@kazak.uk.xensource.com>
On Wed, May 21, 2014 at 04:44:00PM +0100, Ian Campbell wrote:
> On Tue, 2014-05-20 at 05:31 -0700, Luis R. Rodriguez wrote:
> > diff --git a/README b/README
> > index 079e6a9..4183b34 100644
> > --- a/README
> > +++ b/README
>
> > +If you enable oxenstored the cxenstored will still be built and installed,
> > +the xenstored used can be changed through the configuration file:
> > +
> > +/etc/xen/scripts/hotplugpath.sh
>
> That's an unconventional place for such a configuration. Today it is
> in /etc/{sysconfig,default}/xencommons, I think, which is more expected
> IMHO. That comes from tools/hotplug/Linux/init.d/sysconfig.xencommons.
Yeah good point, I had not seen that.
> It might be reasonable for hotplugpath.sh to define
> XENSTORE_xenstored=/path/to/xenstored
> XENSTORE_oxenstored=/path/to/oxenstored
>
> and use the existing XENSTORED variable in sysconfig to select which.
Ah but but hotplugpath.sh is one of those automatically generated files
and after my last patch in this series they are all now shared in one
master file, config/xen-environment-scripts.in, and since the we want
to keep script file Shell / Python agnostic checking which one is set
on sysconfig is not something reasonable to do on that master file.
So here's the thing:
My series of patches already deals with the old init and xencommons script to
start xenstore, it used the hotplugpath.sh for deducing the xenstore
daemon it should use by default and switching this to rely on the sysconfig
xencommons should be easy if it wasn't already dealt with there already.
For systemd though we can't use varibles on ExecStart for the process, we
however can use environment variables. We have a few options. Fedora's
approach was to use two service unit files which conflicted with each other,
although I'm sure we can work it out by using a target unit and let folks
flip it seems rather silly to me to maintain two service unit files with
identical entries. Therefore in my new approach usres would have to manually
edit the service file with the differnt path / binary. Another possibility
is to have a central launcher binary that just does getenv() and execve()
on the desired binary. If this is agreeable I can work on it and it could
even be shared by the old init as well.
> This would also avoid the user having to update the name and the path
> (as would the use of basename mind you)
Agreed.
> > diff --git a/m4/expand_config.m4 b/m4/expand_config.m4
> > index 717fcd1..40d9707 100644
> > --- a/m4/expand_config.m4
> > +++ b/m4/expand_config.m4
> > @@ -58,4 +58,65 @@ AC_SUBST(XEN_RUN_DIR)
> >
>
> I'd say that most of this belongs in something which is handled from
> tools/configure.ac not the top level. m4/xenstored.m4 seems logical.
Sure.
> > XEN_PAGING_DIR=/var/lib/xen/xenpaging
> > AC_SUBST(XEN_PAGING_DIR)
> > +
> > +AC_DEFUN([AX_XEN_OCAML_XENSTORE_CHECK], [
> > + AC_PROG_OCAML
> > + AC_PROG_FINDLIB
> > + AS_IF([test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"], [
>
> THen you could rely on m4/ocaml.m4 to have checked all this already.
Just including m4/ocaml.m4 won't get us much, the above logic assumes
that file was included so there is a bit of a trick we need to adjust
in order to avoid multiple calls to the same checks.
>
> > + AC_MSG_ERROR([Missing ocaml dependencies for oxenstored, try installing ocaml ocaml-compiler-libs ocaml-runtime ocaml-findlib])
> > + ])
> > +])
> > +
> > +AC_DEFUN([AX_XEN_OCAML_XENSTORE_DEFAULTS], [
>
> Why is this separate from CHECK?
Its not a check, I should remove the double calls to AC_PROG_OCAML
and AC_PROG_OCAML, what this does is it sets the defaults based
on your build system without considering any flags passed.
> Also there can't be any need to call
> AC_PROG_{OCAML,FINDLIB} quite as many times as you do, surely.
We can surely move the AC_PROG_OCAML and AC_PROG_FINDLIB calls outside
so that the check can be done just once. We want to support not having
to pass the flag for specifying the xenstore preference.
> > + xenstore="oxenstored"
> > + xenstored=$SBINDIR/oxenstored
> > + AC_PROG_OCAML
> > + AC_PROG_FINDLIB
> > + AS_IF([test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"], [
> > + xenstore="cxenstored"
> > + xenstored=$SBINDIR/xenstored
> > + ])
> > +])
> > +
> > +AS_IF([test "x$XENSTORE" = "x"], [
> > +AC_ARG_WITH([xenstored],
> > + AS_HELP_STRING([--with-xenstored@<:@=cxenstored|cxenstored@:>@],
> > + [This lets you choose which xenstore daemon you want, you have
> > + two options: the original xenstored written in C (cxenstored)
> > + or the newer and robust one written in Ocaml (oxenstored).
> > + The oxenstored daemon is the default but will but can only
> > + be used if you have ocaml library / build dependencies solved,
> > + if you have not specified a preference and do not have ocaml
> > + dependencies resolved we'll enable the C xenstored for you. If
> > + you ask for oxenstored we'll complain until you resolve those
> > + dependencies]),
>
> Does this not end up with an overly verbose configure --help output?
Its fine by me, check and let me know if its too much.
> > + [
> > + AS_IF([test "x$withval" = "xcxenstored"], [
> > + xenstore="cxenstored"
> > + xenstored=$SBINDIR/xenstored
> > + ])
> > + AS_IF([test "x$withval" = "xoxenstored"], [
> > + xenstore="oxenstored"
> > + xenstored=$SBINDIR/oxenstored
> > + AX_XEN_OCAML_XENSTORE_CHECK()
> > + ])
>
> xenstore=$withval
OK
> if $xenstore = ocaml && ocaml not detected ;
> AC_ERROR[].
> fi
That's what AX_XEN_OCAML_XENSTORE_CHECK() does, but I agree this
can be simplified. Will work on that.
>
> > + AS_IF([test "x$withval" != "xoxenstored" && test "x$withval" != "xcxenstored"], [
> > + AC_MSG_ERROR([Unsupported xenstored specified, supported types: oxenstored cxenstored])
> > + ])
> > + ],
> > + [
> > + AX_XEN_OCAML_XENSTORE_DEFAULTS()
> > + ])
> > +])
> > +
> > +XENSTORE=$xenstore
> > +AC_SUBST(XENSTORE)
> > +
> > +AS_IF([test "x$XENSTORED" = "x"], [
> > + XENSTORED=$xenstored
> > +])
> > +AC_SUBST(XENSTORED)
> > +
> > +AS_IF([test "x$XENSTORE" != "xcxenstored" && test "x$XENSTORE" != "xoxenstored"],
> > + [AC_MSG_ERROR([Invalid xenstore: $XENSTORE])])
>
> Didn't this already get checked above?
Yeah I went trigger happy with checks, will remove.
Luis
next prev parent reply other threads:[~2014-05-21 23:02 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-20 12:31 [PATCH v5 00/14] xen: add systemd support Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 01/14] xenstored: enable usage of config.h on both xenstored and oxenstored Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 02/14] libxenstore.so: add support for systemd Luis R. Rodriguez
2014-05-21 14:35 ` Ian Campbell
2014-05-21 14:56 ` Ian Campbell
2014-05-21 16:32 ` Luis R. Rodriguez
2014-05-21 16:48 ` Ian Campbell
2014-05-21 17:15 ` Luis R. Rodriguez
2014-05-22 9:36 ` Ian Campbell
2014-05-22 9:59 ` Luis R. Rodriguez
2014-05-21 16:24 ` Luis R. Rodriguez
2014-05-21 16:39 ` Ian Campbell
2014-05-21 17:29 ` Luis R. Rodriguez
2014-05-22 9:39 ` Ian Campbell
2014-05-22 10:01 ` Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 03/14] cxenstored: add support for systemd active sockets Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 04/14] oxenstored: " Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 05/14] oxenstored: force FD_CLOEXEC with Unix.set_close_on_exec on LSB init Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 06/14] tools/xendomains: make xl the default Luis R. Rodriguez
2014-05-21 15:05 ` Ian Campbell
2014-05-21 17:29 ` Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 07/14] tools/xendomains: do space cleanups Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 08/14] tools/xendomains: move to libexec and use a smaller init helper Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 09/14] autoconf: xen: force a refresh with autoconf Luis R. Rodriguez
2014-05-21 15:07 ` Ian Campbell
2014-05-21 17:35 ` Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 10/14] autoconf: update m4/pkg.m4 Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 11/14] autoconf: xen: move standard variables to a generic place Luis R. Rodriguez
2014-05-20 13:37 ` Jan Beulich
[not found] ` <537B76D1020000780001422C@suse.com>
2014-05-20 17:54 ` Luis R. Rodriguez
2014-05-21 7:32 ` Jan Beulich
2014-05-21 8:03 ` Luis R. Rodriguez
2014-05-21 8:11 ` Jan Beulich
2014-05-21 8:27 ` Luis R. Rodriguez
2014-05-21 10:33 ` Ian Campbell
2014-05-21 13:54 ` Jan Beulich
2014-05-21 15:14 ` Ian Campbell
2014-05-21 15:20 ` Jan Beulich
2014-05-21 15:26 ` Ian Campbell
2014-05-21 21:54 ` Luis R. Rodriguez
2014-05-22 9:46 ` Ian Campbell
2014-05-20 12:31 ` [PATCH v5 12/14] autoconf: xen: enable explicit preference option for xenstored preference Luis R. Rodriguez
2014-05-21 15:44 ` Ian Campbell
2014-05-21 23:02 ` Luis R. Rodriguez [this message]
2014-05-22 10:05 ` Ian Campbell
2014-05-23 23:20 ` Luis R. Rodriguez
2014-05-28 9:30 ` Ian Campbell
2014-05-29 16:09 ` Don Koch
2014-05-29 23:29 ` Luis R. Rodriguez
[not found] ` <20140529232918.GG26450@wotan.suse.de>
2014-06-01 6:15 ` [systemd-devel] " Lennart Poettering
[not found] ` <20140601061547.GC16257@tango.0pointer.de>
2014-06-05 0:31 ` Luis R. Rodriguez
[not found] ` <20140605003103.GB22052@wotan.suse.de>
2014-06-05 2:52 ` Cameron Norman
2014-06-05 11:22 ` Lennart Poettering
[not found] ` <20140605112213.GA17673@tango.0pointer.de>
2014-06-05 18:01 ` Luis R. Rodriguez
[not found] ` <20140605180137.GD22052@wotan.suse.de>
2014-06-05 19:24 ` Lennart Poettering
[not found] ` <20140605192421.GA6248@tango.0pointer.de>
2014-06-05 19:26 ` Andrew Lutomirski
[not found] ` <CALZWFR+LQ3XK4RQ335CNqjr8zucWw4GieKwZS3N5m0w4yJXuBA@mail.gmail.com>
2014-06-10 1:15 ` Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 13/14] xencommons: move module list into a generic place Luis R. Rodriguez
2014-05-20 13:40 ` Jan Beulich
[not found] ` <537B776D020000780001425E@suse.com>
2014-05-20 18:03 ` Luis R. Rodriguez
2014-05-20 12:31 ` [PATCH v5 14/14] systemd: add xen systemd service and module files Luis R. Rodriguez
2014-05-20 12:48 ` Luis R. Rodriguez
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=20140521230233.GA13289@wotan.suse.de \
--to=mcgrof@suse.com \
--cc=Ian.Campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=mcgrof@do-not-panic.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xenproject.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).