Jon Ludlam [Mon, 21 Dec 2009 18:10:58 +0000 (18:10 +0000)]
A few bits and pieces to support the vhd daemon
* Introduce a dereferencing type to camldm so that PVs can be referenced by ID rather than by device name. This is useful for passing a device-mapper table between hosts where the physical device for a particular PV is different.
* Implement device-mapper reload/suspend/resume so that a table can be changed without tearing down the device
* A few more helper functions for stdext
Signed-off-by: Jon Ludlam <Jonathan.Ludlam@eu.citrix.com>
David Scott [Mon, 21 Dec 2009 15:36:49 +0000 (15:36 +0000)]
CA-33440: Now that the direct fork code has been moved to stunnel, simplify the 'pidty' to only consider the single case of forking via the external daemon.
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
David Scott [Mon, 21 Dec 2009 15:36:49 +0000 (15:36 +0000)]
CA-33440: Move the unsafe direct fork_and_exec code from forkhelpers into stunnel, since it's only stunnel (called from the CLI) which actually needs it.
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
David Scott [Mon, 21 Dec 2009 14:22:52 +0000 (14:22 +0000)]
CA-36075: add back in a sane default $PATH for subprocesses that need it.
In particular the 'EXTSR' storage backend expects to find 'pvcreate' on the path. Rather than just fixing this one instance and then seeing what else fails, this patch should prevent this class of error recurring.
Note that the only place we actually pass a custom environment to a subprocess is when installing the debian etch template.
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
David Scott [Fri, 18 Dec 2009 20:48:37 +0000 (20:48 +0000)]
CA-33440: when starting an stunnel process, careful to handle the case where we still do fork the binary directly i.e. that used by quicktest and the CLI.
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
David Scott [Fri, 18 Dec 2009 20:48:36 +0000 (20:48 +0000)]
CA-33440: Add an 'install.sh' into which we can place commands like 'chkconfig --add fe'. Eventually we can trigger this from a proper package post-install script.
The script is named by repo currently:
/etc/xensource/scripts/install/install-xen-api-libs.hg.sh
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Jonathan Knowles [Fri, 20 Nov 2009 14:22:16 +0000 (14:22 +0000)]
Adds functions "file_lines_{fold,iter}" to the Unixext module. These functions implement the standard "fold" and "iter" functions for all the lines in a file.
Signed-off-by: Jonathan Knowles <jonathan.knowles@eu.citrix.com>
David Scott [Wed, 11 Nov 2009 17:41:48 +0000 (17:41 +0000)]
Use autoconf to detect: xen headers; XS_RESTRICT in patchqueue; ocaml packages xmlm, type-conf; libdevicemapper; and linux-specific CDROM ioctls.
Modify the xen-api-libs.hg master Makefile to conditionally compile only those libraries whose system dependencies are met. So we:
* don't compile the xen libraries (xc, xb etc) if xen/xen.h is missing
* don't compile the cdrom library if the linux ioctls are missing
* don't compile the xml-light2, rss libraries if xmlm is missing
* don't compile rpc-light if type-conv is missing
* don't compile camldm if libdevicemapper is missing
This makes it easier for these libs to be used by other tools which may not need (eg) the xen or devicemapper bindings. Note that xen-api.hg needs most of these so any missing library will lead to a xen-api.hg build failure.
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
[packaging] separate the normal Makefile from the one used to build the components and create a bins target which build and install binaries (as closeandexec).
Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
David Scott [Fri, 30 Oct 2009 12:50:07 +0000 (12:50 +0000)]
Switch all xapi syslog logging to 'local6' rather than 'daemon' (ie same as blktapcntrl is about to use). This allows us to (i) keep logging through syslog; but (ii) define in the syslog.conf whether the data is written synchronously or not.
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Rob Hoes [Wed, 28 Oct 2009 17:06:00 +0000 (17:06 +0000)]
[ocamldoc] Build-in Ocamldoc support
Typing 'make doc' will generate documentation for the libraries in xen-api-libs. The documentation is integrated in the xen-api documentation (the custom ocamldoc generator in xen-api.hg is used). This only works when xen-api.hg is present in myrepos and 'make doc' has been executed in it.
David Scott [Fri, 2 Oct 2009 17:22:52 +0000 (18:22 +0100)]
CA-28788: fix the 'atomic_write_to_file' function which always ended up setting the perms to 0o0 despite the face that it tries to set them to 0o644.
As AndyP points out, the 'temp_file_in_dir' function creates the file with 0o0 and Unix.open only uses the given permissions if it actually creates a file. Therefore we add a Unix.chmod to set the permissions we want.
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Rpc-light is a camlp4 library to easily marshall and unmarshall ML types to and from different RPC values (at the moment, only XML-RPC conversions are implemented).
Xen hg user [Thu, 28 May 2009 11:05:33 +0000 (12:05 +0100)]
Initial import of hg.uk.xensource.com/carbon/trunk/api-libs.hg c/s 255:b95c318ded7c dated 'Thu May 28 12:05:33 2009 +0100'. Also add LICENSE and CREDITS file.
David Scott [Wed, 21 Jul 2010 22:29:38 +0000 (23:29 +0100)]
Add functions Zerocheck.get_next{zero,nonzero} which can be used to detect sparseness (relatively efficiently). Both functions primarily use aligned unsigned int-sized accesses.
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
David Scott [Wed, 21 Jul 2010 22:29:15 +0000 (23:29 +0100)]
Add new modules: lazyList, extentlistSet, set_test to stdext
lazyList contains a simple lazy list implementation.
extentlistSet contains a Set implementation where elements are stored as a list of (start, length) pairs
set_test contains functions to test a set implementation
extentlistset_test contains test cases for extentlistSet using set_test.
Signed-off-by: David Scott <dave.scott@eu.citrix.com>