]> xenbits.xensource.com Git - xcp/xen-api-libs.git/log
xcp/xen-api-libs.git
14 years agoThis patch allows future patches to independently add modules to stdext without causi...
Jonathan Knowles [Mon, 23 Aug 2010 12:56:54 +0000 (13:56 +0100)]
This patch allows future patches to independently add modules to stdext without causing conflicts.

Signed-off-by: Jonathan Knowles <jonathan.knowles@eu.citrix.com>
14 years agoAdd some HTTP client code
David Scott [Mon, 23 Aug 2010 12:56:23 +0000 (13:56 +0100)]
Add some HTTP client code

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
14 years agoFirst cut at a 'tapctl' module which wraps the 'tap-ctl' command
David Scott [Fri, 23 Jul 2010 16:46:18 +0000 (17:46 +0100)]
First cut at a 'tapctl' module which wraps the 'tap-ctl' command

(Original version by Jon Ludlam <jonathan.ludlam@eu.citrix.com>)
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
14 years agoBindings to libvhd.
Jon Ludlam [Thu, 22 Jul 2010 14:37:45 +0000 (15:37 +0100)]
Bindings to libvhd.

This allows ocaml programs to manipulate VHD files suitable for use
with XCP/XenServer.

Sample usage:
Vhd.create filename virtual_size (Vhd.Ty_dynamic) (Vhdutil.max_size) [];
let uid = Vhd.with_vhd filename false Vhd.get_uid

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Acked-by: Dave Scott <dave.scott@eu.citrix.com>
14 years agoAdd functions Zerocheck.get_next{zero,nonzero} which can be used to detect sparseness...
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>
14 years agoAdd new modules: lazyList, extentlistSet, set_test to stdext
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>
14 years agoFix the source manifest generation by using a simple shell script to scan the SRPMS...
David Scott [Mon, 12 Jul 2010 07:33:28 +0000 (08:33 +0100)]
Fix the source manifest generation by using a simple shell script to scan the SRPMS, rather than a hideous make/shell fragment.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
14 years agotrivial fix.remove duplicate include
Yang Hongyang [Thu, 8 Jul 2010 15:49:16 +0000 (16:49 +0100)]
trivial fix.remove duplicate include

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
14 years agoThe checksumming for meta-data of mlvm now agrees with the original lvm.
Matthias Goergens [Thu, 8 Jul 2010 14:02:27 +0000 (15:02 +0100)]
The checksumming for meta-data of mlvm now agrees with the original lvm.

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com>
14 years agoCA-38567: Fail Unixext calls with a proper Unix_error.
Daniel Stodden [Thu, 8 Jul 2010 14:00:49 +0000 (15:00 +0100)]
CA-38567: Fail Unixext calls with a proper Unix_error.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoMinor improvements to Stdext (Listext, Either, Fun, and Opt).
Rok Strnisa [Thu, 8 Jul 2010 13:59:21 +0000 (14:59 +0100)]
Minor improvements to Stdext (Listext, Either, Fun, and Opt).

REQUIRED FOR:
This patch is required for the 'encrypt-vm-migrate' patch in xen-api.hg.

Signed-off-by: Rok Strnisa <rok.strnisa@citrix.com>
14 years agoAdd stdext either/os built modules to RPM specfile
David Scott [Fri, 18 Jun 2010 16:49:32 +0000 (17:49 +0100)]
Add stdext either/os built modules to RPM specfile

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
14 years agoAdd biosdevname call to Netdev
Rob Hoes [Fri, 18 Jun 2010 13:32:23 +0000 (14:32 +0100)]
Add biosdevname call to Netdev

biosdevname is a tool used to find out the "real" device name of a network interface, according to the BIOS. This name is not affected by manual device renaming or changes in the Linux kernel.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
diff -r 96761a1835c1 netdev/netdev.ml--- a/netdev/netdev.ml
+++ b/netdev/netdev.ml
@@ -397,6 +397,13 @@
  not(List.mem "xen-backend" (String.split '/' link))
   with _ -> false

+let get_bios_name name =
+ try
+ let output, _ = Forkhelpers.execute_command_get_output "/sbin/biosdevname" ["-i"; name] in
+ let output = String.strip String.isspace output in
+ output
+ with _ -> name
+
 (* Dispatch network backend operations. *)

 let network_config_file = "/etc/xensource/network.conf"

14 years agoMove netdev from xen-api.hg into xen-api-libs.hg and make it into a ocamlfind library
Jon Ludlam [Fri, 18 Jun 2010 13:32:23 +0000 (14:32 +0100)]
Move netdev from xen-api.hg into xen-api-libs.hg and make it into a ocamlfind library

Signed-off-by: Jon Ludlam <Jonathan.Ludlam@eu.citrix.com>
diff -r 07f69949f0bf Makefile.in--- a/Makefile.in
+++ b/Makefile.in
@@ -37,6 +37,7 @@
 allxen:
 ifeq ($(HAVE_XEN),1)
  $(MAKE) -C mmap
+ $(MAKE) -C netdev
  $(MAKE) -C xc
  $(MAKE) -C xb
  $(MAKE) -C xs
@@ -74,6 +75,7 @@
 installxen:
 ifeq ($(HAVE_XEN),1)
  $(MAKE) -C mmap install
+ $(MAKE) -C netdev install
  $(MAKE) -C xc install
  $(MAKE) -C xb install
  $(MAKE) -C xs install
@@ -112,6 +114,7 @@
 ifeq ($(HAVE_XEN),1)
  $(MAKE) -C eventchn uninstall
  $(MAKE) -C xsrpc uninstall
+ $(MAKE) -C netdev uninstall
  $(MAKE) -C xs uninstall
  $(MAKE) -C xb uninstall
  $(MAKE) -C xc uninstall
@@ -162,6 +165,7 @@
  $(MAKE) -C stunnel doc
  $(MAKE) -C xsrpc doc
  $(MAKE) -C mmap doc
+ $(MAKE) -C netdev doc
  $(MAKE) -C forking_executioner doc
  $(MAKE) -C mlvm doc
  $(MAKE) -C cpuid doc
@@ -190,6 +194,7 @@

 cleanxen:
  $(MAKE) -C mmap clean
+ $(MAKE) -C netdev clean
  $(MAKE) -C xc clean
  $(MAKE) -C xb clean
  $(MAKE) -C xs clean

14 years agoChange the 'close' field in the request record to be mutable rather than a reference
Jon Ludlam [Fri, 18 Jun 2010 13:13:26 +0000 (14:13 +0100)]
Change the 'close' field in the request record to be mutable rather than a reference

Signed-off-by: Jon Ludlam <Jonathan.Ludlam@eu.citrix.com>
diff -r d8eb3fec758c http-svr/Makefile--- a/http-svr/Makefile Mon Mar 15 11:57:11 2010 +0000
+++ b/http-svr/Makefile Mon Mar 15 12:01:14 2010 +0000
@@ -8,6 +8,8 @@
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
 OCAMLOPTFLAGS = -g -dtypes

+PP = camlp4o -I ../rpc-light -I $(shell ocamlfind query type-conv) pa_type_conv.cmo pa_rpc.cma
+
 OCAMLABI := $(shell ocamlc -version)
 OCAMLLIBDIR := $(shell ocamlc -where)
 OCAMLDESTDIR ?= $(OCAMLLIBDIR)
@@ -31,13 +33,13 @@
  $(OCAMLC) -a -o $@ $(foreach obj,$(OBJS),$(obj).cmo)

 %.cmo: %.ml %.cmi
- $(OCAMLC) -c -thread -I ../stdext -I ../log -o $@ $<
+ $(OCAMLC) -c -pp '${PP}' -thread -I ../rpc-light -I ../stdext -I ../log -o $@ $<

 %.cmi: %.mli
- $(OCAMLC) -c -thread -o $@ $<
+ $(OCAMLC) -c -I ../rpc-light -thread -o $@ $<

 %.cmx: %.ml %.cmi
- $(OCAMLOPT) $(OCAMLOPTFLAGS) -c -thread -I ../stdext -I ../log -o $@ $<
+ $(OCAMLOPT) $(OCAMLOPTFLAGS) -pp '${PP}' -c -thread -I ../rpc-light -I ../stdext -I ../log -o $@ $<

 %.o: %.c
  $(CC) $(CFLAGS) -c -o $@ $<

14 years agoAdd biosdevname call to Netdev
Rob Hoes [Fri, 18 Jun 2010 13:32:23 +0000 (14:32 +0100)]
Add biosdevname call to Netdev

biosdevname is a tool used to find out the "real" device name of a network interface, according to the BIOS. This name is not affected by manual device renaming or changes in the Linux kernel.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
diff -r 96761a1835c1 netdev/netdev.ml--- a/netdev/netdev.ml
+++ b/netdev/netdev.ml
@@ -397,6 +397,13 @@
  not(List.mem "xen-backend" (String.split '/' link))
   with _ -> false

+let get_bios_name name =
+ try
+ let output, _ = Forkhelpers.execute_command_get_output "/sbin/biosdevname" ["-i"; name] in
+ let output = String.strip String.isspace output in
+ output
+ with _ -> name
+
 (* Dispatch network backend operations. *)

 let network_config_file = "/etc/xensource/network.conf"

14 years agoMove netdev from xen-api.hg into xen-api-libs.hg and make it into a ocamlfind library
Jon Ludlam [Fri, 18 Jun 2010 13:32:23 +0000 (14:32 +0100)]
Move netdev from xen-api.hg into xen-api-libs.hg and make it into a ocamlfind library

Signed-off-by: Jon Ludlam <Jonathan.Ludlam@eu.citrix.com>
diff -r 07f69949f0bf Makefile.in--- a/Makefile.in
+++ b/Makefile.in
@@ -37,6 +37,7 @@
 allxen:
 ifeq ($(HAVE_XEN),1)
  $(MAKE) -C mmap
+ $(MAKE) -C netdev
  $(MAKE) -C xc
  $(MAKE) -C xb
  $(MAKE) -C xs
@@ -74,6 +75,7 @@
 installxen:
 ifeq ($(HAVE_XEN),1)
  $(MAKE) -C mmap install
+ $(MAKE) -C netdev install
  $(MAKE) -C xc install
  $(MAKE) -C xb install
  $(MAKE) -C xs install
@@ -112,6 +114,7 @@
 ifeq ($(HAVE_XEN),1)
  $(MAKE) -C eventchn uninstall
  $(MAKE) -C xsrpc uninstall
+ $(MAKE) -C netdev uninstall
  $(MAKE) -C xs uninstall
  $(MAKE) -C xb uninstall
  $(MAKE) -C xc uninstall
@@ -162,6 +165,7 @@
  $(MAKE) -C stunnel doc
  $(MAKE) -C xsrpc doc
  $(MAKE) -C mmap doc
+ $(MAKE) -C netdev doc
  $(MAKE) -C forking_executioner doc
  $(MAKE) -C mlvm doc
  $(MAKE) -C cpuid doc
@@ -190,6 +194,7 @@

 cleanxen:
  $(MAKE) -C mmap clean
+ $(MAKE) -C netdev clean
  $(MAKE) -C xc clean
  $(MAKE) -C xb clean
  $(MAKE) -C xs clean

14 years agoChange the 'close' field in the request record to be mutable rather than a reference
Jon Ludlam [Fri, 18 Jun 2010 13:13:26 +0000 (14:13 +0100)]
Change the 'close' field in the request record to be mutable rather than a reference

Signed-off-by: Jon Ludlam <Jonathan.Ludlam@eu.citrix.com>
diff -r d8eb3fec758c http-svr/Makefile--- a/http-svr/Makefile Mon Mar 15 11:57:11 2010 +0000
+++ b/http-svr/Makefile Mon Mar 15 12:01:14 2010 +0000
@@ -8,6 +8,8 @@
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
 OCAMLOPTFLAGS = -g -dtypes

+PP = camlp4o -I ../rpc-light -I $(shell ocamlfind query type-conv) pa_type_conv.cmo pa_rpc.cma
+
 OCAMLABI := $(shell ocamlc -version)
 OCAMLLIBDIR := $(shell ocamlc -where)
 OCAMLDESTDIR ?= $(OCAMLLIBDIR)
@@ -31,13 +33,13 @@
  $(OCAMLC) -a -o $@ $(foreach obj,$(OBJS),$(obj).cmo)

 %.cmo: %.ml %.cmi
- $(OCAMLC) -c -thread -I ../stdext -I ../log -o $@ $<
+ $(OCAMLC) -c -pp '${PP}' -thread -I ../rpc-light -I ../stdext -I ../log -o $@ $<

 %.cmi: %.mli
- $(OCAMLC) -c -thread -o $@ $<
+ $(OCAMLC) -c -I ../rpc-light -thread -o $@ $<

 %.cmx: %.ml %.cmi
- $(OCAMLOPT) $(OCAMLOPTFLAGS) -c -thread -I ../stdext -I ../log -o $@ $<
+ $(OCAMLOPT) $(OCAMLOPTFLAGS) -pp '${PP}' -c -thread -I ../rpc-light -I ../stdext -I ../log -o $@ $<

 %.o: %.c
  $(CC) $(CFLAGS) -c -o $@ $<

14 years agoMake ocamldoc work with custom syntax within xen-api-libs.
Rok Strnisa [Thu, 17 Jun 2010 21:16:18 +0000 (22:16 +0100)]
Make ocamldoc work with custom syntax within xen-api-libs.

signed-off-by: Rok Strnisa <rok.strnisa@citrix.com>

14 years agomlvm/redo.ml was rid of a warning
Matthias Goergens [Thu, 17 Jun 2010 21:16:18 +0000 (22:16 +0100)]
mlvm/redo.ml was rid of a warning

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com>
14 years agovg.ml was rid of warnings.
Matthias Goergens [Thu, 17 Jun 2010 21:16:18 +0000 (22:16 +0100)]
vg.ml was rid of warnings.

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com>
14 years agocomment on constants on mlvm/constants.ml
Matthias Goergens [Thu, 17 Jun 2010 21:16:18 +0000 (22:16 +0100)]
comment on constants on mlvm/constants.ml

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com>
14 years agocamldm/camldm_stubs.c: Camldm.status can deal with empty tables, now. (+comment)
Matthias Goergens [Thu, 17 Jun 2010 21:16:18 +0000 (22:16 +0100)]
camldm/camldm_stubs.c: Camldm.status can deal with empty tables, now. (+comment)

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com>
14 years agocamldm_stubs.c: removed some debugging messages
Matthias Goergens [Thu, 17 Jun 2010 21:16:18 +0000 (22:16 +0100)]
camldm_stubs.c: removed some debugging messages

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com>
14 years agocamldm/camldm_stubs.c: removed whitespace
Matthias Goergens [Thu, 17 Jun 2010 21:16:18 +0000 (22:16 +0100)]
camldm/camldm_stubs.c: removed whitespace

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com>
14 years agoThose functions are of use outside of the original context, and nested functions
Matthias Goergens [Thu, 17 Jun 2010 21:16:18 +0000 (22:16 +0100)]
Those functions are of use outside of the original context, and nested functions
aren't really idiomatic C anyway.

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com>
14 years agocamldm/camldm_stubs.c: Tests have confirmed that camldm_ls does not leak memory.
Matthias Goergens [Thu, 17 Jun 2010 21:16:18 +0000 (22:16 +0100)]
camldm/camldm_stubs.c: Tests have confirmed that camldm_ls does not leak memory.

A comment in the file reflects this finding.

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com>
14 years agocamldm/camldm.ml: camldm_ls is an analogue to dmsetup ls.
Matthias Goergens [Thu, 17 Jun 2010 21:16:18 +0000 (22:16 +0100)]
camldm/camldm.ml: camldm_ls is an analogue to dmsetup ls.

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com>
14 years agocamldm/Makefile: OCAMLOPTFLAGS are now used
Matthias Goergens [Thu, 17 Jun 2010 21:16:18 +0000 (22:16 +0100)]
camldm/Makefile: OCAMLOPTFLAGS are now used

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com>
14 years agostdext/Either: A module for type ('a, 'b) t = Left of 'a | Right of 'b
Matthias Goergens [Thu, 17 Jun 2010 21:16:18 +0000 (22:16 +0100)]
stdext/Either: A module for type ('a, 'b) t = Left of 'a | Right of 'b
and helper functions.

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com>
14 years agoin stdext/Opt: Renamed cat_options to cat_some, to be more in line with the coming...
Matthias Goergens [Thu, 17 Jun 2010 21:16:18 +0000 (22:16 +0100)]
in stdext/Opt: Renamed cat_options to cat_some, to be more in line with the coming either module.

Signed-off-by: Matthias Goergens <Matthias.Goergens@citrix.com>
14 years agostdext/Listext got a function make_assoc to build Lisp-like assoc lists
Matthias Goergens [Thu, 17 Jun 2010 21:16:18 +0000 (22:16 +0100)]
stdext/Listext got a function make_assoc to build Lisp-like assoc lists

Signed-off-by: Matthias Goergens <Matthias.Goergens@citrix.com>
14 years agoExtended a comment in stdext/stringext.ml
Matthias Goergens [Thu, 17 Jun 2010 21:16:18 +0000 (22:16 +0100)]
Extended a comment in stdext/stringext.ml

Signed-off-by: Matthias Goergens <Matthias.Goergens@citrix.com>
14 years agostdext/Os: A simple module for running stuff on the command line.
Matthias Goergens [Thu, 17 Jun 2010 21:16:18 +0000 (22:16 +0100)]
stdext/Os: A simple module for running stuff on the command line.

Signed-off-by: Matthias Goergens <Matthias.Goergens@citrix.com>
14 years agoFix indentation in stdext/listext.mli
Matthias Goergens [Thu, 17 Jun 2010 21:16:18 +0000 (22:16 +0100)]
Fix indentation in stdext/listext.mli

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com>
14 years agoThe module stdext/Listext got a safe_head function that wraps hd in an option type.
Matthias Goergens [Thu, 17 Jun 2010 21:16:18 +0000 (22:16 +0100)]
The module stdext/Listext got a safe_head function that wraps hd in an option type.

Signed-off-by: Matthias Goergens <Matthias.Goergens@citrix.com>
14 years agoAvoid permission problems by installing the .spec files to $(RPM_SPECSDIR) before...
David Scott [Tue, 1 Jun 2010 15:38:25 +0000 (16:38 +0100)]
Avoid permission problems by installing the .spec files to $(RPM_SPECSDIR) before calling $(RPMBUILD)

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
14 years agoHook RPMs into main mk/Makefile
David Scott [Fri, 28 May 2010 14:22:28 +0000 (15:22 +0100)]
Hook RPMs into main mk/Makefile

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
14 years agoGenerate rpms from xen-api-libs.hg:
David Scott [Fri, 28 May 2010 14:22:28 +0000 (15:22 +0100)]
Generate rpms from xen-api-libs.hg:

xapi-devel: devel libraries needed by xapi
xapi-utils: utility binaries
xapi-fe: fork/exec daemon

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
15 years agoCA-37279: Stunnel error from WLB connect "No route to host"
Ewan Mellor [Thu, 29 Apr 2010 09:22:07 +0000 (10:22 +0100)]
CA-37279: Stunnel error from WLB connect "No route to host"

Understand "No route to host" as an expected error message from stunnel, and turn that into API error WLB_UNKNOWN_HOST if we see it when contacting WLB.

This is two patches, one for xen-api-libs.hg, and one for xen-api.hg.

Signed-off-by: Ewan Mellor <ewan.mellor@eu.citrix.com>
15 years agoAdd some optional parameters to Stunnel.disconnect to cope with the stunnel zombie...
Zheng Li [Tue, 20 Apr 2010 18:05:48 +0000 (19:05 +0100)]
Add some optional parameters to Stunnel.disconnect to cope with the stunnel zombie process issue and for future benefits.

Signed-off-by: Zheng Li <dev@zheng.li>
15 years agoCA-40149: Add an explicit cache of the local hostname and make it posible to invalida...
David Scott [Mon, 12 Apr 2010 16:54:42 +0000 (17:54 +0100)]
CA-40149: Add an explicit cache of the local hostname and make it posible to invalidate the cache.

The hostname is included in every log line.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
15 years agoCA-38844: Add support for Intel FlexMigration on Nehalem/Westmere
Rob Hoes [Fri, 9 Apr 2010 09:49:50 +0000 (10:49 +0100)]
CA-38844: Add support for Intel FlexMigration on Nehalem/Westmere

Note: this patch should go in together with the flex-maskability patch in xen-api.hg.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
15 years agoAdd Prashanth to the CREDITS file on request. Prashanth contributed the json
David Scott [Wed, 7 Apr 2010 10:57:42 +0000 (11:57 +0100)]
Add Prashanth to the CREDITS file on request. Prashanth contributed the json
parser originally to XCI:

 http://xenbits.xen.org/gitweb?p=xenclient/toolstack.git;a=history;f=libs/json/json_parse.ml;h=723d2bf068fdf4728de67708b42b168180a4396f;hb=eeff0b8b98dff445c71cd4aaa6cfd98b8bac5d44

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
15 years agoMerge Stunnel.attempt_one_connect_new into Stunnel.attempt_one_connect and other...
Zheng Li [Wed, 31 Mar 2010 09:26:20 +0000 (10:26 +0100)]
Merge Stunnel.attempt_one_connect_new into Stunnel.attempt_one_connect and other minor improvements.

Signed-off-by: Zheng Li <dev@zheng.li>
15 years agomlvm depends on camldm hence should have the same dependency as camldm
Zheng Li [Tue, 23 Mar 2010 00:39:58 +0000 (00:39 +0000)]
mlvm depends on camldm hence should have the same dependency as camldm

Signed-off-by: Zheng Li <dev@zheng.li>
15 years agoCA-38687: be more accepting of ISO8601 dates without a timezone.
David Scott [Tue, 30 Mar 2010 10:30:33 +0000 (11:30 +0100)]
CA-38687: be more accepting of ISO8601 dates without a timezone.

Note that xapi expects all dates to be in UTC; xapi knows nothing about timezones.

The XMLRPC spec is vague but encourages people to *omit* the timezone information from requests. We now accept such vague inputs but we still expect them to be in UTC.

The following python snippet produces no results without the fix and the full message list (as expected) with the fix:

<<<<<
#!/usr/bin/env python

import xmlrpclib

x = xmlrpclib.Server("http://localhost")
session = x.session.login_with_password("root", "password")["Value"]
print repr(x.message.get_since(session, xmlrpclib.DateTime(0)))
>>>>>

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
15 years agoAdd Cpuid.features_mask function.
Rob Hoes [Mon, 29 Mar 2010 09:47:47 +0000 (10:47 +0100)]
Add Cpuid.features_mask function.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
15 years agoCA-39123: Fix xapi execution in a VM. The new get_boot_cpufeatures hypercall hasn...
Jon Ludlam [Wed, 24 Mar 2010 12:16:36 +0000 (12:16 +0000)]
CA-39123: Fix xapi execution in a VM. The new get_boot_cpufeatures hypercall hasn't yet been implemented in xiu. This is a temporary patch to fix the symptoms until xiu is fixed to do this properly.

Original patch by Ian Campbell.

Signed-off-by: Jon Ludlam <Jonathan.Ludlam@eu.citrix.com>
15 years agoCA-38120: if we fork/exec a process and it doesn't exit with 0 (ie non-zero exit...
David Scott [Tue, 16 Mar 2010 20:54:36 +0000 (20:54 +0000)]
CA-38120: if we fork/exec a process and it doesn't exit with 0 (ie non-zero exit or signal of some kind) then log a message to syslog containing the pid, truncated cmdline and exit status.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
15 years agoUse correct upstream name for /dev/xen/evtchn.
Ian Campbell [Mon, 15 Feb 2010 17:35:01 +0000 (17:35 +0000)]
Use correct upstream name for /dev/xen/evtchn.

This name has been upstream since forever and the typo here was leaving us with two device nodes.

If the device is not present then do not create it. The assumption that /dev/xen/ev{en,}tchn is minor 63 does not hold since the driver requests a dynamic minor.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
15 years ago[rpc-light] fix a typo in rpc-light; base type is 'float', not 'flaot'.
Thomas Gazagnaire [Mon, 8 Mar 2010 17:47:55 +0000 (17:47 +0000)]
[rpc-light] fix a typo in rpc-light; base type is 'float', not 'flaot'.

Thanks to Marcus Granado to have spotten this one.

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
15 years agoCP-1652: Cpuid modules gets physical and current CPU features from Xen
Rob Hoes [Mon, 8 Mar 2010 11:35:48 +0000 (11:35 +0000)]
CP-1652: Cpuid modules gets physical and current CPU features from Xen

Previously, the physical features were kept in a file in dom0 on first boot. This is not very robust, so now all physical and current CPU features come directly from Xen via a hypercall.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
15 years agoMove Xen_cmdline module from xen-api.hg to xen-api-lib.hg
Rob Hoes [Mon, 8 Mar 2010 11:35:47 +0000 (11:35 +0000)]
Move Xen_cmdline module from xen-api.hg to xen-api-lib.hg

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
15 years agoCP-1634: Bindings for xc_get_boot_cpufeatures
Vincent Hanquez [Wed, 17 Feb 2010 09:05:03 +0000 (09:05 +0000)]
CP-1634: Bindings for xc_get_boot_cpufeatures

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
Acked-by: Rob Hoes <rob.hoes@citrix.com>
15 years agoCA-38105: add a simple CLI and stresstest to test the fe daemon.
David Scott [Mon, 8 Mar 2010 11:28:56 +0000 (11:28 +0000)]
CA-38105: add a simple CLI and stresstest to test the fe daemon.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
15 years agoCA-38105: remove a unix domain socket leak in an error path.
David Scott [Mon, 8 Mar 2010 11:28:56 +0000 (11:28 +0000)]
CA-38105: remove a unix domain socket leak in an error path.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
15 years agoCA-38105: Fix a heap corruption in the stub_unix_recv_fd C fn.
David Scott [Mon, 8 Mar 2010 11:28:56 +0000 (11:28 +0000)]
CA-38105: Fix a heap corruption in the stub_unix_recv_fd C fn.

The ocaml manual states
"caml_alloc_small(n, t) returns a fresh small block of size n <= Max_young_wosize words, with tag t. If this block is a structured block (i.e. if t < No_scan_tag), then the fields of the block (initially containing garbage) must be initialized with legal values (using direct assignment to the fields of the block) before the next allocation."

This function returns a tuple including an AF_UNIX value of type Unix.sockaddr where:
  type sockaddr =
  | AF_UNIX of string
  | ...

Unfortunately the C fn called copy_string() to add the string to the heap block *without setting the field of the block*. This means that the field contains garbage so, in the rare event of the string allocation exhausting the minor heap and invoking a GC, the GC follows the garbage pointer and crashes. Helpfully the stack makes this obvious:

Program terminated with signal 11, Segmentation fault.
[New process 19425]
#0  0x0808135a in caml_oldify_mopup ()
(gdb) bt
#0  0x0808135a in caml_oldify_mopup ()
#1  0x08081416 in caml_empty_minor_heap ()
#2  0x080814fc in caml_minor_collection ()
#3  0x080820cc in caml_alloc_string ()
#4  0x0808216c in caml_copy_string ()
#5  0x080786d2 in stub_unix_recv_fd ()
#6  0x0805536f in camlFecomms__receive_named_fd_91 ()

The fix is to initialise the field to a legal value before calling copy_string. Note that the field is unconditionally reset to a proper string type in the following if statement.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
15 years agoCA-38105: Fix segfault in fork-and-exec-daemon.
Jon Ludlam [Mon, 8 Mar 2010 11:28:56 +0000 (11:28 +0000)]
CA-38105: Fix segfault in fork-and-exec-daemon.

The segfault would have happened when a message was receieved on this socket without an associated fd being sent. This is bad behaviour on the part of the client, but shouldn't cause a segfault. This patch fixes the segfault, but we'll need to fix the client too!

Signed-off-by: Jon Ludlam <Jonathan.Ludlam@eu.citrix.com
15 years agoCA-38105: The recent patch to the recv_fd function causes it to return an fd of ...
Jon Ludlam [Mon, 8 Mar 2010 11:28:56 +0000 (11:28 +0000)]
CA-38105: The recent patch to the recv_fd function causes it to return an fd of -1 rather than segfault, so catch that and log what was actually received on the socket

Signed-off-by: Jon Ludlam <Jonathan.Ludlam@eu.citrix.com>
15 years agoCA-38105: remove some unused variables from C stubs
David Scott [Mon, 8 Mar 2010 11:28:56 +0000 (11:28 +0000)]
CA-38105: remove some unused variables from C stubs

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
15 years agoCP-1635: Cpuid module to obtain CPU information
Rob Hoes [Wed, 17 Feb 2010 10:14:40 +0000 (10:14 +0000)]
CP-1635: Cpuid module to obtain CPU information

This module obtains the vendor/model/family/stepping as well as feature information from the CPU, and determines whether CPU feature masks can be applied.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
15 years agoCP-1622: Listext function to replace the value for a key in an assoc list
Rob Hoes [Wed, 17 Feb 2010 10:14:31 +0000 (10:14 +0000)]
CP-1622: Listext function to replace the value for a key in an assoc list

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
15 years agoMakes the allocator more robust by enabling allocation of 0 bytes.
Matthias Goergens [Tue, 2 Feb 2010 16:21:53 +0000 (16:21 +0000)]
Makes the allocator more robust by enabling allocation of 0 bytes.

`normalize' and `alloc_specified_area' no longer get confused by 0 byte allocations.

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com> (Mercurial doesn't like Umlaute.)
15 years agomlvm-refactor: allocator (first part) changed to applicative style
Matthias Goergens [Mon, 8 Feb 2010 18:07:17 +0000 (18:07 +0000)]
mlvm-refactor: allocator (first part) changed to applicative style

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com>
15 years agoTests the allocator using the Kaputt framework.
Matthias Goergens [Tue, 2 Feb 2010 16:43:42 +0000 (16:43 +0000)]
Tests the allocator using the Kaputt framework.

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com> (Mercurial doesn't like Umlaute.)
15 years agoAdds `join' to the Opt module
Matthias Goergens [Tue, 2 Feb 2010 16:07:11 +0000 (16:07 +0000)]
Adds `join' to the Opt module

`join' collapses (Some (Some a)) down to (Some a), and gives Nothing otherwise.

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com>
15 years agoAdds take and tails to our extended list module
Matthias Goergens [Tue, 2 Feb 2010 16:00:16 +0000 (16:00 +0000)]
Adds take and tails to our extended list module

`take' gives the first n elements of a list (or less if the list is
shorter).  `tails' gives a list of all suffixes of a list.

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com>
15 years agoModule Fun gets operators for function composition and application.
Matthias Goergens [Tue, 2 Feb 2010 15:42:13 +0000 (15:42 +0000)]
Module Fun gets operators for function composition and application.

Exposes function composition (++) and function composition with two
arguments (+++) to the Fun module of our extended standard library.
Adds and exposes function application ($).

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com>
15 years agoAdding extensions to some modules in the extended standard library:
Matthias Goergens [Tue, 26 Jan 2010 15:01:01 +0000 (15:01 +0000)]
Adding extensions to some modules in the extended standard library:
- to the Map module
- to the List module
- and some functional combinators (like compose with (++)) in Fun module

Signed-off-by: Matthias Goergens <matthias.goergens@citrix.com>
15 years agoFix a bug in LV resizing
Jonathan Ludlam [Tue, 26 Jan 2010 15:15:05 +0000 (15:15 +0000)]
Fix a bug in LV resizing

Signed-off-by: Jon Ludlam <Jonathan.Ludlam@eu.citrix.com>
15 years agoAdd rpc-light support to MLVM to allow it to marshal its data structures as an RPC.t
Jonathan Ludlam [Mon, 18 Jan 2010 14:59:40 +0000 (14:59 +0000)]
Add rpc-light support to MLVM to allow it to marshal its data structures as an RPC.t

Signed-off-by: Jon Ludlam <Jonathan.Ludlam@eu.citrix.com>
15 years agoAdd (string,t) Hashtbl.t support to rpc-light
Jonathan Ludlam [Mon, 18 Jan 2010 14:59:40 +0000 (14:59 +0000)]
Add (string,t) Hashtbl.t support to rpc-light

Signed-off-by: Jon Ludlam <Jonathan.Ludlam@eu.citrix.com>
15 years agoCA-35920: add hypercall simulator support for SCHEDOP_remote_shutdown
David Scott [Thu, 4 Feb 2010 22:29:53 +0000 (22:29 +0000)]
CA-35920: add hypercall simulator support for SCHEDOP_remote_shutdown

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
15 years agoCA-36554: call setsid() before exec() to make sure children don't accidentally kill...
David Scott [Wed, 3 Feb 2010 22:33:21 +0000 (22:33 +0000)]
CA-36554: call setsid() before exec() to make sure children don't accidentally kill us when they (eg) send their entire process group a SIGQUIT.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
15 years agoCA-36554: improve the logging around the fork/exec daemon.
David Scott [Wed, 3 Feb 2010 22:33:20 +0000 (22:33 +0000)]
CA-36554: improve the logging around the fork/exec daemon.

Switch from a buffer to a list of strings, one entry prepended on every 'debug' invocation. In the error path, walk the reversed list and dump each string separately to syslog.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
15 years ago[ocamldoc] Ensure 'make doc' works with mlvm lib
Rob Hoes [Fri, 15 Jan 2010 12:02:55 +0000 (12:02 +0000)]
[ocamldoc] Ensure 'make doc' works with mlvm lib

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
15 years agoFix camldm after renaming of jsonrpc to rpc-light.json. Also add a datatype maybe...
Jonathan Ludlam [Fri, 15 Jan 2010 12:02:42 +0000 (12:02 +0000)]
Fix camldm after renaming of jsonrpc to rpc-light.json. Also add a datatype maybe needed for rpc-light

Signed-off-by: Jonathan Ludlam <Jonathan.Ludlam@eu.citrix.com>
Acked-by: David Scott <dave.scott@eu.citrix.com>
15 years ago[http-svr] parse the content-type of the request and store that information in the...
Thomas Gazagnaire [Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)]
[http-svr] parse the content-type of the request and store that information in the request structure

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
15 years agoAdd a method to trigger a sleep button push in a domain
Paul Durrant [Tue, 5 Jan 2010 17:03:49 +0000 (17:03 +0000)]
Add a method to trigger a sleep button push in a domain

Signed-off-by: Paul Durrant <paul.durrant@eu.citrix.com>
15 years agoAdd a method to trigger a power button push in a domain
Paul Durrant [Tue, 22 Dec 2009 16:22:25 +0000 (16:22 +0000)]
Add a method to trigger a power button push in a domain

signed-off-by: Paul Durrant <paul.durrant@citrix.com>

15 years ago[rpc-light] In xmlrpc, when waiting for a tag opening, do not pay attention to any DTD
Thomas Gazagnaire [Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)]
[rpc-light] In xmlrpc, when waiting for a tag opening, do not pay attention to any DTD

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
15 years ago[rpc-light] when (un)marshaling variant, if it has no arguments then consider it...
Thomas Gazagnaire [Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)]
[rpc-light] when (un)marshaling variant, if it has no arguments then consider it as a string.

This bit is also necessary to discuss with the SM backend.
Basically, if you have 'type t = Foo | Bar of int with rpc' you will consider than the value Foo is actually the same thing as the string "Foo" (if you don't want to have a capital letter, use polymorphic variants as 'type t = [ `foo | `bar of int ]' which will give that the value `foo will be considered as the string "foo").

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
15 years ago[rpc-light] Optimize the way (string * t) list are marshaled
Thomas Gazagnaire [Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)]
[rpc-light] Optimize the way (string * t) list are marshaled

This bit is necessary to discuss with the SM backend and it is also a nice optiomization. Basically, if you have: 'type t = (kk, vv) list with rpc' the library will check if value of type 'kk' are marshaled to a string; if yes, instead of having a list of stuff, it creates a dictionary which is what the python XenAPI bindings are looking for.

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
15 years ago[rpc-light] Protect the XML strings as xml-light2.
Thomas Gazagnaire [Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)]
[rpc-light] Protect the XML strings as xml-light2.

xmlrpc converts '>' to '&gt', '<' to '&lt', '"' to '&quot' and do not erase weird characters (need to use a proper unicode validation functions at one point)

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
15 years ago[rpc-light] XMLRPC fault need to be parsed correctly
Thomas Gazagnaire [Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)]
[rpc-light] XMLRPC fault need to be parsed correctly

Moreover, in case of complex return value v when we have an error, apply the xapi policy which is to create a structure { Status : Failure; ErrorDescription : v }. When unmarshalling the XMLRPC, if we got { Status : Success; Value: v }, then it is equivalent to v. This is sufficiently flexible to discuss with the SM backend and xapi (which have different conventions).

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
15 years ago[rpc-light] Do not wait for an optional field when unparsing an {JSON,XML}RPC.
Thomas Gazagnaire [Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)]
[rpc-light] Do not wait for an optional field when unparsing an {JSON,XML}RPC.

If you have:
type t = { foo : int option; bar : string } with rpc

It is allright to do not have the foo field if its value is None

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
15 years ago[rpc-light] Never call 'exit i' on error, because that's not good when you run it...
Thomas Gazagnaire [Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)]
[rpc-light] Never call 'exit i' on error, because that's not good when you run it in a daemon

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
15 years ago[rpc-light] Fix-up some bugs in the XML parser code
Thomas Gazagnaire [Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)]
[rpc-light] Fix-up some bugs in the XML parser code

Also add some tests to check that the library can understand what the SM backend is saying

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
15 years ago[rpc-light] Add some friendly error messages on runtime errors
Thomas Gazagnaire [Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)]
[rpc-light] Add some friendly error messages on runtime errors

This patch defines an exception 'Parse_error of (string * string * input)' when;
- the 1st string is the symbol the parser got
- the 2nd string is the symbol the parser was waiting for

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
15 years ago[rpc-light] Add a function to marshal and unmarshal XMLRPC to a bigbuffer
Thomas Gazagnaire [Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)]
[rpc-light] Add a function to marshal and unmarshal XMLRPC to a bigbuffer

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
15 years ago[rpc-light] Add some basic RPC int functions.
Thomas Gazagnaire [Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)]
[rpc-light] Add some basic RPC int functions.

This patch adds rpc_of_unit and unit_of_rpc

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
15 years ago[rpc-light] Add some basic RPC int functions.
Thomas Gazagnaire [Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)]
[rpc-light] Add some basic RPC int functions.

This patch adds rpc_of_{int,int32,int64} and {int,int32,int64}_of_rpc

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
15 years ago[rpc-light] Add some explicit runtime exceptions when an runtime error occurs.
Thomas Gazagnaire [Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)]
[rpc-light] Add some explicit runtime exceptions when an runtime error occurs.

A friendly error message is displayed as well if Rpc.set_debug true is called before.

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
15 years ago[rpc-light] Add a function to parse XMLRPC from an input channel.
Thomas Gazagnaire [Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)]
[rpc-light] Add a function to parse XMLRPC from an input channel.

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
15 years ago[rpc-light] test (un)marshalling of phatom types.
Thomas Gazagnaire [Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)]
[rpc-light] test (un)marshalling of phatom types.

'type 'a t = string with rpc' has to work.

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
15 years ago[rpc-light] Backport the value library and clean-up the Makefile and the library...
Thomas Gazagnaire [Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)]
[rpc-light] Backport the value library and clean-up the Makefile and the library building.

The value library is part of the ocaml-orm project available here: http://github.com/avsm/ocaml-orm-sqlite
This backport improves multiple points of the value library (which will be upstreamed later), like the polymorphic type variables or the type variable with module names (ie. 'type t = 'a M.tt with rpc' will work). Basically, all the types used by xapi are handles + some minor extensions as objects.

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
15 years ago[rpc-light] Make the abstraction layer more uniform, especially for the error handling.
Thomas Gazagnaire [Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)]
[rpc-light] Make the abstraction layer more uniform, especially for the error handling.

Indeed, XMLRPC and JSONRPC are a bit different on error handling, but abstract these minor differences away.

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
15 years ago[stdext] Add the function Bigbuffer.append_string : Bigbuffer.t -> string -> unit
Thomas Gazagnaire [Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)]
[stdext] Add the function Bigbuffer.append_string : Bigbuffer.t -> string -> unit

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
15 years agoMinor ocamldoc fix.
Rob Hoes [Tue, 22 Dec 2009 15:16:05 +0000 (15:16 +0000)]
Minor ocamldoc fix.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>