Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
4b5a626
Language correction.
Apr 7, 2017
b471ed5
CA-249786: removed build number comparison from pool join rules.
Apr 7, 2017
6af6adf
CA-250143: Stat the mirror _before_ removing it
jonludlam Apr 11, 2017
d71e1f6
Makefile: add setup.ml prerequisite
gaborigloi Apr 12, 2017
a2891f4
CA-242706: call update_getty at xapi startup
gaborigloi Mar 28, 2017
7024873
Merge pull request #2995 from gaborigloi/makefile
thomassa Apr 12, 2017
e6b6414
CA-250376: Add protocol option in firewall-port script
taoyongd Apr 13, 2017
f58b9f3
CA-171948: Make add_to_map DB calls idempotent
jonludlam Apr 13, 2017
5f754cb
CA-171948: Add a parameter to allow the db add_to_map to be idempotent
jonludlam Apr 13, 2017
d5a8900
CA-171948: Reinstate non-idempotency, with a switch
jonludlam Apr 14, 2017
6f28f54
CA-171948: Add a label for the boolean argument of idempotent
jonludlam Apr 18, 2017
825884d
Merge pull request #3001 from jonludlam/CA-171948
Apr 20, 2017
13f7987
CA-249662: Pool_patch handler: If an SR is not specified, use default_SR
jonludlam Apr 20, 2017
0eb2bac
Merge pull request #3003 from jonludlam/CA-249662
mseri Apr 21, 2017
56a55a8
CA-250757: Refresh software version after update been applied
cheng-z Apr 20, 2017
49bd2d4
Merge pull request #3004 from cheng-z/CA-250757-master
Apr 24, 2017
30a7392
CA-250748: MTU on pif does not always sync to xapi db
taoyongd Apr 21, 2017
4563373
Merge pull request #3007 from taoyongd/CA-250748
robhoes Apr 25, 2017
db21bee
CA-251251: Use /var/update/applied/uuid mtime for patch apply time
cheng-z Apr 26, 2017
213ea57
Merge pull request #3012 from cheng-z/CA-251251
Apr 26, 2017
1a4a7cd
CA-250858: Fix potential bug in `wlb_reports.ml` when WLB health chec…
krizex Apr 27, 2017
119f0fa
End the temporary yum.conf file with a newline
andyhhp Apr 28, 2017
d7f780b
Merge pull request #3005 from krizex/CA-250858
lindig May 2, 2017
3c4402c
Merge pull request #3018 from andyhhp/master
lindig May 2, 2017
b2dbcfb
Remove old SM backends
gaborigloi May 3, 2017
3c05950
Remove unused, obsolete storage_proxy.ml
gaborigloi May 3, 2017
63d7ba1
Merge pull request #3022 from gaborigloi/remove_storage_proxy
mseri May 3, 2017
03a6f24
Merge pull request #3021 from gaborigloi/remove_old_sm
mseri May 3, 2017
749e763
CA-249668: Add new API error `TLS_CONNECTION_FAILED`
sharady Apr 28, 2017
96c21c5
CA-249668: Raise an API error `tls_connection_failed` on TLS connecti…
sharady Apr 28, 2017
9713bdc
Storage_access: fix task names to match called op
gaborigloi May 4, 2017
1192022
Merge pull request #3019 from sharady/CA-249668
thomassa May 4, 2017
598cf23
opam: update to xs-opam version
gaborigloi May 5, 2017
8a0a666
Travis: Add OPAM build method and coverage
gaborigloi May 5, 2017
ef96187
Merge pull request #3027 from gaborigloi/travis_opam_coverage
May 5, 2017
7a11e2d
Merge pull request #3026 from gaborigloi/storage_access_task_names
May 5, 2017
f93a876
README: add build, coverage, LoC badges
gaborigloi May 8, 2017
1315fa6
VDI.snapshot: check that SM has this capability
gaborigloi May 5, 2017
9569f07
Merge pull request #3028 from gaborigloi/add_badges
mseri May 8, 2017
ddf6f3b
Remove Datamodel.last_release_schema_m{aj|in}or_vsn
thomassa May 10, 2017
c7bfa4b
Merge pull request #3032 from thomassa/no_last_release_schema_vsn
thomassa May 11, 2017
6b094d3
Record_util: Remove unused string_to_vdi_type fn
gaborigloi May 11, 2017
4c70ad8
Cli_operations: fix confusing indentation
gaborigloi May 12, 2017
1e9220a
smint.ml: Remove unused all_capabilites variable
gaborigloi May 15, 2017
7efa662
CA-253489 xe update-upload: test if default SR is valid
gaborigloi May 12, 2017
b2a21c8
CA-253489 xe update-upload: extend help message
gaborigloi May 12, 2017
7abecc4
CA-205515 i18n: JA/SC: The error message about failed to join a domai…
minglumlu May 15, 2017
dba3783
Merge pull request #3037 from minglumlu/CA-205515
mseri May 16, 2017
c1f9331
Merge pull request #3040 from gaborigloi/remove_all_capabilites
mseri May 16, 2017
c591e67
Update xapi_vm_helpers and xapi_xenops for ocaml 4.03+
mseri May 16, 2017
57bc487
Update cli_operations to work with 4.03+
May 17, 2017
9b4ea20
Merge pull request #3046 from mseri/fix-403
mseri May 17, 2017
4f30998
Travis: fix OPAM coverage job
gaborigloi May 18, 2017
af68965
Merge pull request #3047 from gaborigloi/fix_travis_coverage
mseri May 18, 2017
2d60708
Merge pull request #3029 from gaborigloi/add_snapshot_capability_check
mseri May 18, 2017
ddbd967
Refactor Xapi_vdi.check_operation_error
thomassa May 18, 2017
80e38c4
Remove unused function Xapi_vdi.cancel_task
thomassa May 18, 2017
d2fc72d
New file Xapi_vdi.mli
thomassa May 18, 2017
3cfbf6d
Merge pull request #3048 from thomassa/refactor-vdi-check-op-error
thomassa May 19, 2017
9d3a28b
Replaced hardcoded values with variables.
May 12, 2017
4792136
Removed release dundee_plus as it was never released.
May 19, 2017
fcd0232
CA-245333: Extended the release order to include the corresponding AP…
May 19, 2017
25b42f9
Generate automatically the list of releases for the docs navigation m…
May 19, 2017
4691dca
Merge pull request #3038 from kc284/master
May 19, 2017
b7f582a
Factor out duplication into Cli_util.is_valid_ref
gaborigloi May 16, 2017
b445af3
CA-252876: AD group name with parenthesis not work as expect in XenSe…
fillzero May 9, 2017
d5b7b6b
Merge pull request #3039 from gaborigloi/CA-253489-cli-check-valid-ref
gaborigloi May 22, 2017
4128788
Merge pull request #3031 from fillzero/CA-252876
May 22, 2017
4fbaf2f
CA-242706: Add "warning" comment explaining issue
gaborigloi May 22, 2017
f4eda00
Add inferred mli file for Xapi_ha
gaborigloi May 22, 2017
f914603
xapi_ha.mli: restrict to values used externally
gaborigloi May 22, 2017
3c6b586
xapi_ha.mli: remove unused Not_started exception
gaborigloi May 22, 2017
90d3e0a
xapi_ha.mli: add ocamldoc comments
gaborigloi May 22, 2017
10b5068
CA-223802 [xso-672] When existing network is deactivated and new netw…
minglumlu May 23, 2017
da564b1
Merge pull request #3052 from gaborigloi/add_xapi_ha_mli
mseri May 23, 2017
6e85a89
Merge pull request #3050 from gaborigloi/add_comment
mseri May 23, 2017
0ed23b5
CA-247321: Refactor Db_gc, move gc functions to Db_gc_util
DeliZhangX May 25, 2017
71cb6b6
CA-247321: Refactor Db_gc_util, change function definition order foll…
DeliZhangX May 25, 2017
1657eb8
CA-247321: Clean up host_patch table in resync_host
DeliZhangX May 25, 2017
ab5bca8
Merge pull request #3042 from Deli-Zhang/CA-247321
thomassa May 25, 2017
695ca0d
xapi_crashdump.ml: remove dead code
gaborigloi May 22, 2017
a8c5478
Xapi_crashdump: replace nothrow function with helper
gaborigloi May 22, 2017
f55495e
Add Inverness release to the datamodel
gaborigloi May 25, 2017
826b36f
Datamodel: deprecate crashdump XenAPI class
gaborigloi May 26, 2017
bef7f64
Datamodel: add comment about how to declare new XS release
gaborigloi May 26, 2017
1d90461
Clean up Xapi_vm_lifecycle.check_operation_error
gaborigloi May 23, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .travis-opam-coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# SUMMARY:
# Builds & tests xapi with coverage in a Ubuntu 16.04 Docker container with
# OCaml 4.02.3, then uploads the coverage information to coveralls.

set -uex

# Currently there is no way of specifying OPAM depexts for multiple versions of
# a given disto, and our current depexts only work with Ubuntu >= 16.04, due to
# a change in packages (libsystemd-dev). Since the build environments of Travis
# are older then Ubuntu 16.04, we have to run the build in a Docker container
# with an appropriate Ubuntu version.
# We need to pass some Travis environment variables to the container to enable
# uploading to coveralls and detection of Travis CI.
docker run --rm --volume=$PWD:/mnt --workdir=/mnt \
--env "TRAVIS=$TRAVIS" \
--env "TRAVIS_JOB_ID=$TRAVIS_JOB_ID" \
ocaml/opam:ubuntu-16.04_ocaml-4.02.3 \
bash -uex -c '
sudo apt-get update

# replace the base remote with xs-opam
opam repository remove default
opam repository add xs-opam https://github.com/xapi-project/xs-opam.git

# install the dependencies of xapi
opam pin add --no-action xapi .
opam depext --yes xapi
opam install --deps-only xapi

# build and test xapi with coverage, then submit the coverage information to coveralls
sudo apt-get install --yes wget
wget https://raw.githubusercontent.com/simonjbeaumont/ocaml-travis-coveralls/master/travis-coveralls.sh
COV_CONF="./configure" bash -ex travis-coveralls.sh
'

19 changes: 19 additions & 0 deletions .travis-xenserver-build-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SUMMARY:
# Builds and tests xapi using xenserver-build-env, which installs the
# dependencies as RPMs.

set -uex

wget https://raw.githubusercontent.com/xenserver/xenserver-build-env/master/utils/travis-build-repo.sh

# only run deploy.sh when the build succeeds
env \
CONTAINER_NAME=build-env \
OCAMLRUNPARAM=b \
REPO_PACKAGE_NAME=xapi \
REPO_CONFIGURE_CMD=./configure \
REPO_BUILD_CMD=make \
REPO_TEST_CMD='make test' \
REPO_DOC_CMD='make doc-json' \
bash travis-build-repo.sh && \
( ( test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && bash deploy.sh ) || true )
23 changes: 9 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
language: c
sudo: required
services: docker
install:
- wget https://raw.githubusercontent.com/xenserver/xenserver-build-env/master/utils/travis-build-repo.sh
script: bash travis-build-repo.sh
after_success:
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && bash deploy.sh
sudo: true
script: bash ./.travis-$BUILD_METHOD.sh
env:
global:
- CONTAINER_NAME=build-env
- OCAMLRUNPARAM=b
- REPO_PACKAGE_NAME=xapi
- REPO_CONFIGURE_CMD=./configure
- REPO_BUILD_CMD=make
- REPO_TEST_CMD='make test'
- REPO_DOC_CMD='make doc-json'
# for BUILD_METHOD=xenserver-build-env
- secure: tokxJl2litqu/T6UUwzkLRZzlbxnbYqVG2QRKKQz3tkIXyZHQWTS2NAyH7mwDgdBq2dDVSxAUxS1jWq/vGraX7MmbVz37Pz8wjykoIfIRtQuEx+REDAvAzWSw+1LTpUf7ZcI+F2SpgJrnH87uN5AAc220UqIx8TvAtGrita+2+o=
matrix:
- OCAML_VERSION=4.02
- BUILD_METHOD=xenserver-build-env
- BUILD_METHOD=opam-coverage
notifications:
slack: citrix:BHYQZbI8m036ELU21gZil75Y
matrix:
fast_finish: true
allow_failures:
- env: BUILD_METHOD=opam-coverage
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ build: setup.data

doc: setup.data build
$(SETUP) -doc $(DOCFLAGS)
./jsapi.native -destdir _build/ocaml/doc
./jsapi.native -destdir _build/ocaml/doc -templdir ocaml/doc/templates

test: setup.data build
$(SETUP) -test $(TESTFLAGS)

all:
all: setup.ml
$(SETUP) -all $(ALLFLAGS)

uninstall: setup.data
Expand All @@ -26,10 +26,10 @@ uninstall: setup.data
reinstall: setup.data
$(SETUP) -reinstall $(REINSTALLFLAGS)

clean:
clean: setup.ml
$(SETUP) -clean $(CLEANFLAGS)

distclean:
distclean: setup.ml
$(SETUP) -distclean $(DISTCLEANFLAGS)

setup.data: setup.ml
Expand All @@ -38,7 +38,7 @@ setup.data: setup.ml
setup.ml: _oasis
oasis setup -setup-update dynamic

configure:
configure: setup.ml
$(SETUP) -configure $(CONFIGUREFLAGS)

.PHONY: build doc test all install uninstall reinstall clean distclean configure
Expand Down Expand Up @@ -95,5 +95,4 @@ install: setup.data rbac_static.csv
mkdir -p $(DESTDIR)$(DOCDIR)/html/xenserver
cp -r -L _build/ocaml/doc/api $(DESTDIR)$(DOCDIR)/html/xenserver
cd ocaml/doc && cp *.js *.html *.css *.png $(DESTDIR)$(DOCDIR)/html/xenserver
cp ocaml/doc/xenserver/* $(DESTDIR)$(DOCDIR)/html/xenserver

cp _build/ocaml/doc/branding.js $(DESTDIR)$(DOCDIR)/html/xenserver/branding.js
4 changes: 4 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Xapi Project's XenAPI Management Toolstack
==========================================

[![Build Status](https://travis-ci.org/xapi-project/xen-api.svg?branch=master)](https://travis-ci.org/xapi-project/xen-api)
[![Coverage Status](https://coveralls.io/repos/github/xapi-project/xen-api/badge.svg?branch=master)](https://coveralls.io/github/xapi-project/xen-api?branch=master)
[![Lines of Code](https://tokei.rs/b1/github/xapi-project/xen-api)](https://github.com/xapi-project/xen-api)

Xen API (or xapi) is a management stack that configures and controls
Xen-enabled hosts and resource pools, and co-ordinates resources
within the pool. Xapi exposes the Xen API interface for many
Expand Down
3 changes: 2 additions & 1 deletion _oasis
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,8 @@ Executable jsapi
xapi-consts,
stdext,
uuid,
gzip
gzip,
mustache


############################################################################
Expand Down
3 changes: 3 additions & 0 deletions _tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# OASIS_START
# OASIS_STOP
<ocaml/xapi/cli_operations.ml>: warn(-52)
14 changes: 12 additions & 2 deletions ocaml/database/db_cache_impl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,24 @@ let process_structured_field_locked t (key,value) tblname fld objref proc_fn_sel
let newval = match proc_fn_selector with
| AddSet -> add_to_set key existing_str
| RemoveSet -> remove_from_set key existing_str
| AddMap ->
| AddMap | AddMapLegacy ->
begin
try
add_to_map key value existing_str
(* We use the idempotent map add if we're using the non-legacy
process function, or if the global field 'idempotent_map' has
been set. By default, the Db calls on the master use the
legacy functions, but those on the slave use the new one.
This means xapi code should always assume idempotent_map is
true *)
let idempotent =
(proc_fn_selector = AddMap) || !Db_globs.idempotent_map
in
add_to_map ~idempotent key value existing_str
with Duplicate ->
error "Duplicate key in set or map: table %s; field %s; ref %s; key %s" tblname fld objref key;
raise (Duplicate_key (tblname,fld,objref,key));
end

| RemoveMap -> remove_from_map key existing_str in
write_field_locked t tblname objref fld newval
with Not_found ->
Expand Down
7 changes: 4 additions & 3 deletions ocaml/database/db_cache_types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,10 @@ let remove_from_set key t =
Schema.Value.Set (List.filter (fun x -> x <> key) t)

exception Duplicate
let add_to_map key value t =
let add_to_map ~idempotent key value t =
let t = Schema.Value.Unsafe_cast.pairs t in
if List.mem key (List.map fst t) then raise Duplicate;
Schema.Value.Pairs ((key, value) :: t)
if List.mem_assoc key t && (not idempotent || List.assoc key t <> value) then raise Duplicate;
Schema.Value.Pairs ((key, value) :: List.filter (fun (k, _) -> k <> key) t)

let remove_from_map key t =
let t = Schema.Value.Unsafe_cast.pairs t in
Expand Down Expand Up @@ -500,4 +500,5 @@ type structured_op_t =
| RemoveSet
| AddMap
| RemoveMap
| AddMapLegacy
[@@deriving rpc]
3 changes: 2 additions & 1 deletion ocaml/database/db_cache_types.mli
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ end
exception Duplicate
val add_to_set : string -> Schema.Value.t -> Schema.Value.t
val remove_from_set : string -> Schema.Value.t -> Schema.Value.t
val add_to_map : string -> string -> Schema.Value.t -> Schema.Value.t
val add_to_map : idempotent:bool -> string -> string -> Schema.Value.t -> Schema.Value.t
val remove_from_map : string -> Schema.Value.t -> Schema.Value.t

val set_field : string -> string -> string -> Schema.Value.t -> Database.t -> Database.t
Expand All @@ -169,5 +169,6 @@ type structured_op_t =
| RemoveSet
| AddMap
| RemoveMap
| AddMapLegacy
val structured_op_t_of_rpc: Rpc.t -> structured_op_t
val rpc_of_structured_op_t: structured_op_t -> Rpc.t
3 changes: 3 additions & 0 deletions ocaml/database/db_globs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ let static_vdis_dir = ref "/etc/xensource/static-vdis"
(* Note the following has an equivalent in the xapi layer *)
let http_limit_max_rpc_size = 300 * 1024 (* 300K *)

(* add_to_map is idempotent *)
let idempotent_map = ref false

(** Dynamic configurations to be read whenever xapi (re)start *)

let permanent_master_failure_retry_interval = ref 60.
Expand Down
5 changes: 3 additions & 2 deletions ocaml/database/db_rpc_common_v1.ml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ let marshall_structured_op x =
AddSet -> "addset"
| RemoveSet -> "removeset"
| AddMap -> "addmap"
| RemoveMap -> "removemap" in
| RemoveMap -> "removemap"
| AddMapLegacy -> "addmap" (* Nb, we always use 'non-legacy' mode for remote access *)
in
XMLRPC.To.string str
let unmarshall_structured_op xml =
match (XMLRPC.From.string xml) with
Expand Down Expand Up @@ -311,4 +313,3 @@ let unmarshall_read_records_where_response xml =
[ref_xml; rec_xml] -> (XMLRPC.From.string ref_xml, unmarshall_read_record_response rec_xml)
| _ -> raise DB_remote_marshall_error)
xml_refs_and_recs_list

10 changes: 10 additions & 0 deletions ocaml/database/db_rpc_common_v2.ml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ module Request = struct
| Read_records_where of string * Db_filter_types.expr
| Process_structured_field of (string * string) * string * string * string * Db_cache_types.structured_op_t
[@@deriving rpc]

(* Make sure the slave only ever uses the idempotent version *)
let rpc_of_t t =
let t' =
match t with
| Process_structured_field (a,b,c,d,Db_cache_types.AddMapLegacy) ->
Process_structured_field (a,b,c,d,Db_cache_types.AddMap)
| x -> x
in
rpc_of_t t'
end

module Response = struct
Expand Down
72 changes: 0 additions & 72 deletions ocaml/doc/branding.js

This file was deleted.

Loading