Skip to content

Commit d7d376c

Browse files
authored
Merge pull request #5860 from stephenchengCloud/private/stephenche/sync_with_master
Sync feature/py3 branch with master
2 parents 9c20863 + 97e117d commit d7d376c

File tree

218 files changed

+8242
-1867
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+8242
-1867
lines changed

.github/workflows/other.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobs:
5858
--cov-fail-under 0
5959
env:
6060
PYTHONDEVMODE: yes
61+
PYTHONPATH: "python3:python3/stubs"
6162

6263
- name: Upload coverage report to Coveralls
6364
uses: coverallsapp/github-action@v2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ _build/
22
*.bak
33
*.native
44
.merlin
5+
_coverage/
56
*.install
67
*.swp
78
compile_flags.txt

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ JOBS = $(shell getconf _NPROCESSORS_ONLN)
66
PROFILE=release
77
OPTMANDIR ?= $(OPTDIR)/man/man1/
88

9-
.PHONY: build clean test doc python format install uninstall
9+
.PHONY: build clean test doc python format install uninstall coverage
1010

1111
# if we have XAPI_VERSION set then set it in dune-project so we use that version number instead of the one obtained from git
1212
# this is typically used when we're not building from a git repo
@@ -20,6 +20,11 @@ build:
2020
check:
2121
dune build @check -j $(JOBS)
2222

23+
coverage:
24+
dune runtest --instrument-with bisect_ppx --force --profile=$(RELEASE) -j $(JOBS)
25+
bisect-ppx-report html
26+
bisect-ppx-report summary --per-file
27+
2328
clean:
2429
dune clean
2530

@@ -57,6 +62,7 @@ TEST_TIMEOUT=600
5762
TEST_TIMEOUT2=1200
5863
test:
5964
ulimit -S -t $(TEST_TIMEOUT); \
65+
ulimit -n 2048; \
6066
(sleep $(TEST_TIMEOUT) && ps -ewwlyF --forest)& \
6167
PSTREE_SLEEP_PID=$$!; \
6268
trap "kill $${PSTREE_SLEEP_PID}" INT TERM EXIT; \
@@ -204,6 +210,7 @@ install: build doc sdk doc-json
204210
install -D -m 755 _build/install/default/bin/xcp-rrdd-iostat $(DESTDIR)$(LIBEXECDIR)/xcp-rrdd-plugins/xcp-rrdd-iostat
205211
install -D -m 755 _build/install/default/bin/xcp-rrdd-squeezed $(DESTDIR)$(LIBEXECDIR)/xcp-rrdd-plugins/xcp-rrdd-squeezed
206212
install -D -m 755 _build/install/default/bin/xcp-rrdd-xenpm $(DESTDIR)$(LIBEXECDIR)/xcp-rrdd-plugins/xcp-rrdd-xenpm
213+
install -D -m 755 _build/install/default/bin/xcp-rrdd-dcmi $(DESTDIR)$(LIBEXECDIR)/xcp-rrdd-plugins/xcp-rrdd-dcmi
207214
install -D -m 644 ocaml/xcp-rrdd/bugtool-plugin/rrdd-plugins.xml $(DESTDIR)$(ETCXENDIR)/bugtool/xcp-rrdd-plugins.xml
208215
install -D -m 644 ocaml/xcp-rrdd/bugtool-plugin/rrdd-plugins/stuff.xml $(DESTDIR)$(ETCXENDIR)/bugtool/xcp-rrdd-plugins/stuff.xml
209216
install -D -m 755 ocaml/xcp-rrdd/bin/rrdp-scripts/sysconfig-rrdd-plugins $(DESTDIR)/etc/sysconfig/xcp-rrdd-plugins

doc/content/xapi/guides/howtos/add-field.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
+++
22
title = "Adding a field to the API"
33
+++
4-
This page describes how to add a field to XenAPI. A field is a parameter of a class that can be used in functions and read from the API.
4+
This page describes how to add a field to XenAPI. A field is a parameter of a class that can be used in functions and read from the API.
55

66
Bumping the database schema version
77
-----------------------------------
@@ -34,15 +34,15 @@ new API fields used for ActiveDirectory integration were added:
3434

3535
(* IMPORTANT: Please bump schema vsn if you change/add/remove a _field_.
3636
You do not have to dump vsn if you change/add/remove a message *)
37-
37+
3838
let schema_major_vsn = 5
3939
-let schema_minor_vsn = 55
4040
+let schema_minor_vsn = 56
41-
41+
4242
(* Historical schema versions just in case this is useful later *)
4343
let rio_schema_major_vsn = 5
4444
let rio_schema_minor_vsn = 19
45-
45+
4646
+let miami_release_schema_major_vsn = 5
4747
+let miami_release_schema_minor_vsn = 35
4848
+
@@ -95,7 +95,7 @@ See datamodel_types.ml for information about other parameters.
9595
Adding a field would change the constructors for the class – functions
9696
Db.*.create – and therefore, any references to these in the code need to be
9797
updated. In the example, the argument ~ha_enabled:false should be added to any
98-
call to Db.Pool.create.
98+
call to Db.Pool.create.
9999

100100
Examples of where these calls can be found is in `ocaml/tests/common/test_common.ml` and `ocaml/xapi/xapi_[class].ml`.
101101

@@ -113,7 +113,7 @@ if you don't want this field to show up in a *_params_list call. As an example,
113113
here is a field that we've just added to the SM class:
114114

115115
make_field ~name:"versioned-capabilities"
116-
~get:(fun () -> Record_util.s2sm_to_string "; " (x ()).API.sM_versioned_capabilities)
116+
~get:(fun () -> get_from_map (x ()).API.sM_versioned_capabilities)
117117
~get_map:(fun () -> (x ()).API.sM_versioned_capabilities)
118118
~hidden:true ();
119119

dune-project

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
(formatting (enabled_for ocaml))
33
(using menhir 2.0)
44

5+
(cram enable)
6+
(implicit_transitive_deps false)
57
(generate_opam_files true)
68

79
(name "xapi")
@@ -559,6 +561,8 @@ This package provides an Lwt compatible interface to the library.")
559561
base-unix
560562
(odoc :with-doc)
561563
(xapi-stdext-pervasives (= :version))
564+
(mtime :with-test)
565+
(xapi-stdext-unix (= :version))
562566
)
563567
)
564568

@@ -568,12 +572,19 @@ This package provides an Lwt compatible interface to the library.")
568572
(authors "Jonathan Ludlam")
569573
(depends
570574
(ocaml (>= 4.12.0))
575+
(alcotest :with-test)
571576
base-unix
577+
(bisect_ppx :with-test)
572578
(fd-send-recv (>= 2.0.0))
579+
fmt
580+
(mtime (and (>= 2.0.0) :with-test))
581+
(logs :with-test)
582+
(qcheck-core (and (>= 0.21.2) :with-test))
573583
(odoc :with-doc)
574584
xapi-backtrace
575585
unix-errno
576586
(xapi-stdext-pervasives (= :version))
587+
polly
577588
)
578589
)
579590

ocaml/database/dune

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
xapi-datamodel
4242
xapi-log
4343
(re_export xapi-schema)
44+
xapi-idl.updates
4445
xapi-stdext-encodings
4546
xapi-stdext-pervasives
4647
xapi-stdext-std

ocaml/database/master_connection.ml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ let do_db_xml_rpc_persistent_with_reopen ~host:_ ~path (req : string) :
271271
!Db_globs.permanent_master_failure_retry_interval ;
272272
Thread.delay !Db_globs.permanent_master_failure_retry_interval ;
273273
!Db_globs.restart_fn ()
274-
| e -> (
274+
| e ->
275275
error "Caught %s" (Printexc.to_string e) ;
276276
(* RPC failed - there's no way we can recover from this so try reopening connection every 2s + backoff delay *)
277277
( match !my_connection with
@@ -322,9 +322,7 @@ let do_db_xml_rpc_persistent_with_reopen ~host:_ ~path (req : string) :
322322
debug "%s: Sleep interrupted, retrying master connection now"
323323
__FUNCTION__ ;
324324
update_backoff_delay () ;
325-
try open_secure_connection () with _ -> ()
326-
(* oh well, maybe nextime... *)
327-
)
325+
D.log_and_ignore_exn open_secure_connection
328326
done ;
329327
!result
330328

ocaml/database/redo_log.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,8 @@ let startup log =
642642
) ;
643643
match !(log.device) with
644644
| None ->
645-
D.info "Could not find block device"
645+
D.info "Could not find block device" ;
646+
broken log
646647
| Some device ->
647648
D.info "Using block device at %s" device ;
648649
(* Check that the block device exists *)

ocaml/forkexecd/lib/dune

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
fd-send-recv
88
rpclib.core
99
rpclib.json
10+
rpclib.xml
1011
uuid
1112
xapi-backtrace
1213
xapi-log

ocaml/forkexecd/test/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(executable
22
(modes exe)
33
(name fe_test)
4-
(libraries forkexec uuid xapi-stdext-unix))
4+
(libraries forkexec uuid xapi-stdext-unix fd-send-recv))
55

66
(rule
77
(alias runtest)

0 commit comments

Comments
 (0)