From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
To: xen-devel@lists.xenproject.org
Cc: Keir Fraser <keir@xen.org>,
Ian Campbell <ian.campbell@citrix.com>, Tim Deegan <tim@xen.org>,
"Luis R. Rodriguez" <mcgrof@suse.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v5 12/14] autoconf: xen: enable explicit preference option for xenstored preference
Date: Tue, 20 May 2014 05:31:33 -0700 [thread overview]
Message-ID: <1400589095-3872-13-git-send-email-mcgrof@do-not-panic.com> (raw)
In-Reply-To: <1400589095-3872-1-git-send-email-mcgrof@do-not-panic.com>
From: "Luis R. Rodriguez" <mcgrof@suse.com>
As it stands oxenstored will be used by default if ocaml tools are
found, the init system will also try to use oxenstored first if its
found otherwise the cxenstored will be used. Lets simplify the init
script and let users be explicit about the preference through configure.
This adds support to let you be explicit about the xenstored preference,
you can only use one of these two options:
./configure --with-xenstored=cxenstored
./configure --with-xenstored=oxenstored
We continue with the old behaviour and default oxenstored will be used
but only if you have ocaml dependencies. Since the xenstored preference
is explicit now we can move it to the shared top level config and use
this to simplify both the legacy init script and eventually our systemd
service files. This should also make it clear on how you can still
enable usage of cxenstored but still also use ocaml tools. If you have
both oxenstored and cxenstored installed you can change the xenstore by
a simple flip on the system configuration file.
In order to help with documentation we update the README with some
details on configure usage refer to the wiki [0] [1] [2] for more elaborate
details.
[0] http://wiki.xen.org/wiki/Xenstored
[1] http://wiki.xen.org/wiki/XenStore
[2] http://wiki.xen.org/wiki/XenStoreReference
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
Cc: Tim Deegan <tim@xen.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
Please run ./autgen.sh after this patch is applied.
README | 34 +++++++++++++++++++
config/Toplevel.mk.in | 3 ++
| 3 ++
config/xen-environment-scripts.in | 3 ++
configure.ac | 1 +
m4/expand_config.m4 | 61 +++++++++++++++++++++++++++++++++++
stubdom/configure.ac | 1 +
tools/hotplug/Linux/init.d/xencommons | 6 ----
8 files changed, 106 insertions(+), 6 deletions(-)
diff --git a/README b/README
index 079e6a9..4183b34 100644
--- a/README
+++ b/README
@@ -145,6 +145,40 @@ Further documentation can be found on the wiki:
http://wiki.xen.org/wiki/Category:Host_Configuration#System_wide_xen_configuration
+xenstored: cxenstored and oxenstored
+====================================
+
+Xen uses a xenstore [0] to upkeep configuration and status information shared
+between domains. A daemon is provided to help respond to queries from dom0
+and guests, details for the xenstored can be found on the wiki's xenstored [2]
+page. Two xenstored daemons are supported and you can choose which xenstored
+you want to enable on a system through configure:
+
+ ./configure --with-xenstored=cxenstored
+ ./configure --with-xenstored=oxenstored
+
+By defalut oxenstored will be used if the ocaml development tools are found.
+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
+
+This file has two relevant variables which are specific to the version of
+xenstored used:
+
+ * XENSTORED - specifies the full path of the xenstored binary
+ * XENSTORE - specifies the name of the xenstored binary
+
+You can change the preferred xenstored you want to use in the configuration
+but since we cannot stop the daemon a reboot will be required to make the
+change take effect. The original /etc/xen/scripts/hotplugpath.sh is sourced
+from the general xen system configuration file documented above, which is
+generated at build time after running ./configure.
+
+[0] http://wiki.xen.org/wiki/XenStore
+[1] http://wiki.xen.org/wiki/XenStoreReference
+[2] http://wiki.xen.org/wiki/Xenstored
+
Python Runtime Libraries
========================
diff --git a/config/Toplevel.mk.in b/config/Toplevel.mk.in
index fc2754c..bea9d96 100644
--- a/config/Toplevel.mk.in
+++ b/config/Toplevel.mk.in
@@ -23,3 +23,6 @@ XENFIRMWAREDIR := @XENFIRMWAREDIR@
XEN_CONFIG_DIR := @XEN_CONFIG_DIR@
XEN_SCRIPT_DIR := @XEN_SCRIPT_DIR@
+
+XENSTORED := @XENSTORED@
+XENSTORE := @XENSTORE@
--git a/config/xen-environment-header.in b/config/xen-environment-header.in
index 7dd7a53..3ee8e32 100644
--- a/config/xen-environment-header.in
+++ b/config/xen-environment-header.in
@@ -11,3 +11,6 @@
#define XEN_LOCK_DIR "@XEN_LOCK_DIR@"
#define XEN_RUN_DIR "@XEN_RUN_DIR@"
#define XEN_PAGING_DIR "@XEN_PAGING_DIR@"
+
+#define XENSTORED @XENSTORED@
+#define XENSTORE @XENSTORE@
diff --git a/config/xen-environment-scripts.in b/config/xen-environment-scripts.in
index 9623231..a17e0e9 100644
--- a/config/xen-environment-scripts.in
+++ b/config/xen-environment-scripts.in
@@ -13,3 +13,6 @@ XEN_LOG_DIR="@XEN_LOG_DIR@"
XEN_LIB_STORED="@XEN_LIB_STORED@"
XEN_RUN_DIR="@XEN_RUN_DIR@"
XEN_PAGING_DIR="@XEN_PAGING_DIR@"
+
+XENSTORED="@XENSTORED@"
+XENSTORE="@XENSTORE@"
diff --git a/configure.ac b/configure.ac
index 3f26a39..f5faa4f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,6 +16,7 @@ AC_CANONICAL_HOST
m4_include([m4/features.m4])
m4_include([m4/subsystem.m4])
m4_include([m4/expand_config.m4])
+m4_include([m4/ocaml.m4])
AX_XEN_EXPAND_CONFIG()
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)
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"], [
+ 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], [
+ 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]),
+ [
+ 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()
+ ])
+ 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])])
])
diff --git a/stubdom/configure.ac b/stubdom/configure.ac
index d6b0fbf..3c30004 100644
--- a/stubdom/configure.ac
+++ b/stubdom/configure.ac
@@ -17,6 +17,7 @@ m4_include([../m4/path_or_fail.m4])
m4_include([../m4/depends.m4])
m4_include([../m4/fetcher.m4])
m4_include([../m4/expand_config.m4])
+m4_include([../m4/ocaml.m4])
AX_XEN_EXPAND_CONFIG()
diff --git a/tools/hotplug/Linux/init.d/xencommons b/tools/hotplug/Linux/init.d/xencommons
index 4ebd636..2bb6f26 100644
--- a/tools/hotplug/Linux/init.d/xencommons
+++ b/tools/hotplug/Linux/init.d/xencommons
@@ -83,12 +83,6 @@ do_start () {
if [ -n "$XENSTORED" ] ; then
echo -n Starting $XENSTORED...
$XENSTORED --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
- elif [ -x ${SBINDIR}/oxenstored ] ; then
- echo -n Starting oxenstored...
- ${SBINDIR}/oxenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
- elif [ -x ${SBINDIR}/xenstored ] ; then
- echo -n Starting C xenstored...
- ${SBINDIR}/xenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
else
echo "No xenstored found"
exit 1
--
2.0.0.rc3.18.g00a5b79
next prev parent reply other threads:[~2014-05-20 12:32 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 ` Luis R. Rodriguez [this message]
2014-05-21 15:44 ` [PATCH v5 12/14] autoconf: xen: enable explicit preference option for xenstored preference Ian Campbell
2014-05-21 23:02 ` Luis R. Rodriguez
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=1400589095-3872-13-git-send-email-mcgrof@do-not-panic.com \
--to=mcgrof@do-not-panic.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=mcgrof@suse.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).