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

[Xen-devel] [PATCH v4 00/15] xen: add systemd support



From: "Luis R. Rodriguez" <mcgrof@xxxxxxxx>

This is my 4th series which I addresses all feedback from the
first 3 series on adding systemd support into xen. I've taken
things a bit further, I've been avoiding autoconf but in the end
that proved to provide the best solution. Additionally not
originally understanding systemd's socket stuff prompted me to
look into that and decided its best to just switch to active sockets
for systemd [0] intregration for both censtored and oxenstored. I've
also decided its best to avoid separate service files for the
two daemons given that we can do this cleanly with autoconf.

I've run time tested this against today's tip against the
upstream kernel, on OpenSUSE using both censtored and oxenstored.

To build you can use either of with the default preferring
oxenstored if ocaml tools are present:

./configure --with-xenstored=cxenstored --enable-systemd
./configure --with-xenstored=oxenstored --enable-systemd

Systems should just have to:

systemctl enable xenstored.socket

And then anything that will tickle the sockets:

/var/run/xenstored/socket
/var/run/xenstored/socket_ro

will trigger either censtored or oxenstored to activate. This
example suffices:

nc -U /var/run/xenstored/socket_ro

This example also happens to test the order of supply / demand
of sockets through sytsemd's active socket mechanism and our
integration to do this in order. Sine we cannot currently stop
the xenstore this means we cannot take advantage of dynamically
switching xensrores live, but if that is fixed we should be able
to dynamically swap even the different types of xenstore on a
live system or just upgrade the xenstore without a reboot.

The ordering of active sockets implementation is begging to be
shared with a common small library but given that xc / xl are
not specific to the xenstore it would be pointless to stuff and
duplicate code for both in there. Both the cxenstore and oxenstored
handle their own store access on their own, if there's a desire to
unify that small piece of code we should consider other things to
stuff on it. For now this goes separately.

Systemd autconf support was split out as much as possible from
xen to make it useful for any other project, perhaps this can
go upstream to systemd.

Ocaml lacks support for systemd and as such I needed to extend
oxenstored support through a small stub for access to systemd.
System'd sd_listen_fds() can technically easily be implemented
in ocaml *but* given that FD_CLOEXEC support through the new
Unix.set_cloexec is only available on 4.00.1+dev which isn't
yet widely available I decided agianst this, this lets
systemd take care of FD_CLOEXEC for us. Proper support for
systemd should instead in the end be merged upstream into
ocaml, but who knows when that will happen.

Given the slew of autoconf updates to xen I only provide an
autogen.sh update after the last change to make things easier
to review.

[0] http://0pointer.de/blog/projects/socket-activation2.html
[1] http://caml.inria.fr/mantis/view.php?id=5569

Luis R. Rodriguez (15):
  xenstore: add support for a retry open limit on xenstored
  xencommons: use the retry limit instead of implementing our own
    timeout
  xenstored: enable usage of config.h on both xenstored and oxenstored
  cxenstored: add support for systemd active sockets
  oxenstored: add support for systemd active sockets
  tools/xendomains: make xl the default
  tools/xendomains: do space cleanups
  tools/xendomains: move to libexec and use a smaller init helper
  autoconf: xen: force a refresh with autoconf
  autoconf: update m4/pkg.m4
  autoconf: xen: move standard variables to a generic place
  autoconf: xen: peg the xenstored preference onto the top level config
  systemd: add xen systemd service and module files
  autoconf: xen: add systemd support into the build system
  autoconf: xen: trigger an update with autogen.sh

 .gitignore                                         |    7 +
 Config.mk                                          |   13 -
 Makefile                                           |   11 +-
 autogen.sh                                         |    8 +-
 config/StdGNU.mk                                   |   19 +-
 config/Tools.mk.in                                 |    6 +
 config/Toplevel.mk.in                              |   27 +
 config/xen-environment-header.in                   |   16 +
 config/xen-environment-scripts.in                  |   18 +
 configure                                          | 2396 ++++++++++++++++-
 configure.ac                                       |   10 +-
 docs/man/xenstore.pod.1                            |    7 +-
 m4/expand_config.m4                                |  122 +
 m4/pkg.m4                                          |   88 +-
 m4/pkg.m4.README                                   |   21 +
 m4/systemd.m4                                      |  105 +
 stubdom/Makefile                                   |   17 +-
 stubdom/configure                                  | 2390 +++++++++++++++++
 stubdom/configure.ac                               |    4 +
 tools/config.h.in                                  |    3 +
 tools/configure                                    | 2815 +++++++++++++++++++-
 tools/configure.ac                                 |   29 +-
 tools/hotplug/Linux/Makefile                       |   14 +-
 tools/hotplug/Linux/init.d/xencommons              |   25 +-
 tools/hotplug/Linux/init.d/xendomains              |  567 +---
 tools/hotplug/Linux/systemd/Makefile               |   44 +
 tools/hotplug/Linux/systemd/proc-xen.mount.in      |    9 +
 .../Linux/systemd/var-lib-xenstored.mount.in       |   13 +
 .../systemd/xen-qemu-dom0-disk-backend.service.in  |   22 +
 .../hotplug/Linux/systemd/xen-watchdog.service.in  |   13 +
 .../Linux/systemd/xen.conf.modules-load.d.in       |   16 +
 tools/hotplug/Linux/systemd/xenconsoled.service.in |   20 +
 tools/hotplug/Linux/systemd/xendomains.service.in  |   16 +
 tools/hotplug/Linux/systemd/xenstored.service.in   |   25 +
 tools/hotplug/Linux/systemd/xenstored.socket.in    |    9 +
 tools/hotplug/Linux/xendomains                     |  585 ++++
 tools/hotplug/common/Makefile                      |    7 +-
 tools/libxl/Makefile                               |   11 +-
 tools/ocaml/xenstored/Makefile                     |   15 +-
 tools/ocaml/xenstored/systemd.ml                   |   16 +
 tools/ocaml/xenstored/systemd.mli                  |   21 +
 tools/ocaml/xenstored/systemd_stubs.c              |  166 ++
 tools/ocaml/xenstored/utils.ml                     |   21 +-
 tools/python/Makefile                              |    6 +-
 tools/xenstore/Makefile                            |    7 +
 tools/xenstore/xenstore_client.c                   |   40 +-
 tools/xenstore/xs.c                                |  127 +
 47 files changed, 9267 insertions(+), 680 deletions(-)
 create mode 100644 config/xen-environment-header.in
 create mode 100644 config/xen-environment-scripts.in
 create mode 100644 m4/expand_config.m4
 create mode 100644 m4/pkg.m4.README
 create mode 100644 m4/systemd.m4
 create mode 100644 tools/hotplug/Linux/systemd/Makefile
 create mode 100644 tools/hotplug/Linux/systemd/proc-xen.mount.in
 create mode 100644 tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in
 create mode 100644 
tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
 create mode 100644 tools/hotplug/Linux/systemd/xen-watchdog.service.in
 create mode 100644 tools/hotplug/Linux/systemd/xen.conf.modules-load.d.in
 create mode 100644 tools/hotplug/Linux/systemd/xenconsoled.service.in
 create mode 100644 tools/hotplug/Linux/systemd/xendomains.service.in
 create mode 100644 tools/hotplug/Linux/systemd/xenstored.service.in
 create mode 100644 tools/hotplug/Linux/systemd/xenstored.socket.in
 create mode 100644 tools/hotplug/Linux/xendomains
 create mode 100644 tools/ocaml/xenstored/systemd.ml
 create mode 100644 tools/ocaml/xenstored/systemd.mli
 create mode 100644 tools/ocaml/xenstored/systemd_stubs.c

-- 
1.9.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.