Skip to content

Commit 231bb73

Browse files
authored
Merge pull request #5878 from psafont/up
2 parents 842de7b + 34ee1ef commit 231bb73

File tree

9 files changed

+123
-139
lines changed

9 files changed

+123
-139
lines changed

dune-project

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
(synopsis "Xen-API client library for remotely-controlling a xapi host")
6868
(authors "David Scott" "Anil Madhavapeddy" "Jerome Maloberti" "John Else" "Jon Ludlam" "Thomas Sanders" "Mike McClurg")
6969
(depends
70-
7170
(alcotest :with-test)
7271
astring
7372
(cohttp (>= "0.22.0"))
@@ -188,7 +187,6 @@
188187
(description "This daemon monitors 'datasources' i.e. time-varying values such as performance counters and records the samples in RRD archives. These archives can be used to examine historical performance trends.")
189188
(depends
190189
(ocaml (>= "4.02.0"))
191-
192190
(alcotest :with-test)
193191
astring
194192
(gzip (= :version))
@@ -301,6 +299,68 @@
301299

302300
(package
303301
(name xapi)
302+
(synopsis "The toolstack daemon which implements the XenAPI")
303+
(description "This daemon exposes the XenAPI and is used by clients such as 'xe' and 'XenCenter' to manage clusters of Xen-enabled hosts.")
304+
(depends
305+
alcotest ; needed for the quicktest binary
306+
angstrom
307+
base-threads
308+
base64
309+
cdrom
310+
conf-pam
311+
(crowbar :with-test)
312+
ctypes
313+
ctypes-foreign
314+
domain-name
315+
(ezxenstore (= :version))
316+
(fmt :with-test)
317+
hex
318+
(http-lib (and :with-test (= :version))) ; the public library is only used for testing
319+
ipaddr
320+
mirage-crypto
321+
mirage-crypto-pk
322+
(mirage-crypto-rng (>= "0.11.0"))
323+
(message-switch-unix (= :version))
324+
mtime
325+
opentelemetry-client-ocurl
326+
pci
327+
(pciutil (= :version))
328+
ppx_deriving_rpc
329+
ppx_sexp_conv
330+
ppx_deriving
331+
psq
332+
rpclib
333+
(rrdd-plugin (= :version))
334+
rresult
335+
sexpr
336+
sha
337+
(stunnel (= :version))
338+
tar
339+
tar-unix
340+
(uuid (= :version))
341+
x509
342+
(xapi-client (= :version))
343+
(xapi-cli-protocol (= :version))
344+
(xapi-consts (= :version))
345+
(xapi-datamodel (= :version))
346+
(xapi-expiry-alerts (= :version))
347+
(xapi-idl (= :version))
348+
(xapi-inventory (= :version))
349+
(xapi-log (= :version))
350+
(xapi-stdext-date (= :version))
351+
(xapi-stdext-pervasives (= :version))
352+
(xapi-stdext-std (= :version))
353+
(xapi-stdext-threads (= :version))
354+
(xapi-stdext-unix (= :version))
355+
(xapi-stdext-zerocheck (= :version))
356+
(xapi-test-utils :with-test)
357+
(xapi-tracing (= :version))
358+
(xapi-types (= :version))
359+
(xapi-xenopsd (= :version))
360+
(xml-light2 (= :version))
361+
yojson
362+
(zstd (= :version))
363+
)
304364
)
305365

306366
(package

ocaml/gencert/dune

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
forkexec
1111
mirage-crypto
1212
mirage-crypto-pk
13+
mirage-crypto-rng
1314
mirage-crypto-rng.unix
1415
ptime
1516
ptime.clock.os
@@ -52,6 +53,7 @@
5253
gencertlib
5354
mirage-crypto
5455
mirage-crypto-pk
56+
mirage-crypto-rng
5557
mirage-crypto-rng.unix
5658
ptime
5759
result

ocaml/gencert/lib.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ open Rresult
1919

2020
type t_certificate = Leaf | Chain
2121

22-
let () = Mirage_crypto_rng_unix.initialize ()
23-
2422
let validate_private_key pkcs8_private_key =
2523
let ensure_rsa_key_length = function
2624
| `RSA priv ->

ocaml/gencert/selfcert.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ let valid_from' date =
4141
| None, false ->
4242
Ptime_clock.now ()
4343

44-
(** initialize the random number generator at program startup when this
45-
module is loaded. *)
46-
let () = Mirage_crypto_rng_unix.initialize ()
44+
(* Needed to initialize the rng to create random serial codes when signing
45+
certificates *)
46+
let () = Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna)
4747

4848
(** [write_cert] writes a PKCS12 file to [path]. The typical file
4949
extension would be ".pem". It attempts to do that atomically by
@@ -158,7 +158,7 @@ let host ~name ~dns_names ~ips ?valid_from ~valid_for_days pemfile cert_gid =
158158
in
159159
R.failwith_error_msg res
160160

161-
let serial_stamp () = Unix.gettimeofday () |> string_of_float
161+
let serial_stamp () = Ptime_clock.now () |> Ptime.to_float_s |> string_of_float
162162

163163
let xapi_pool ?valid_from ~valid_for_days ~uuid pemfile cert_gid =
164164
let valid_from = valid_from' valid_from in

ocaml/gencert/test_lib.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ open Rresult.R.Infix
88
let ( let* ) = Rresult.R.bind
99

1010
(* Initialize RNG for testing certificates *)
11-
let () = Mirage_crypto_rng_unix.initialize ()
11+
let () = Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna)
1212

1313
let time_of_rfc3339 date =
1414
match Ptime.of_rfc3339 date with

ocaml/xapi/certificates.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ module D = Debug.Make (struct let name = "certificates" end)
1919

2020
open D
2121

22-
let () = Mirage_crypto_rng_unix.initialize ()
23-
2422
(* Certificate locations:
2523
* a) stunnel external = /etc/xensource/xapi-ssl.pem
2624
* b) stunnel SNI (internal) = /etc/xensource/xapi-pool-tls.pem

ocaml/xapi/dune

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@
122122
message-switch-core
123123
message-switch-unix
124124
mirage-crypto
125-
mirage-crypto-rng.unix
126125
mtime
127126
mtime.clock.os
128127
pam

xapi.opam

Lines changed: 54 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,94 @@
11
# This file is generated by dune, edit dune-project instead
2-
license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"
32
opam-version: "2.0"
4-
maintainer: "xen-api@lists.xen.org"
5-
authors: [ "xen-api@lists.xen.org" ]
6-
homepage: "https://github.com/xapi-project/xen-api"
3+
synopsis: "The toolstack daemon which implements the XenAPI"
4+
description:
5+
"This daemon exposes the XenAPI and is used by clients such as 'xe' and 'XenCenter' to manage clusters of Xen-enabled hosts."
6+
maintainer: ["Xapi project maintainers"]
7+
authors: ["xen-api@lists.xen.org"]
8+
license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"
9+
homepage: "https://xapi-project.github.io/"
710
bug-reports: "https://github.com/xapi-project/xen-api/issues"
8-
dev-repo: "git+https://github.com/xapi-project/xen-api.git"
9-
build: [
10-
["dune" "build" "-p" name "-j" jobs ]
11-
["dune" "runtest" "-p" name "-j" jobs] {with-test}
12-
]
1311
depends: [
14-
"ocaml"
15-
"dune"
16-
"alcotest" # needed to generate the quicktest binary
12+
"dune" {>= "3.15"}
13+
"alcotest"
1714
"angstrom"
15+
"base-threads"
1816
"base64"
1917
"cdrom"
2018
"conf-pam"
2119
"crowbar" {with-test}
2220
"ctypes"
2321
"ctypes-foreign"
2422
"domain-name"
25-
"ezxenstore"
23+
"ezxenstore" {= version}
2624
"fmt" {with-test}
2725
"hex"
28-
"http-lib" {with-test} # the public library is only used for testing
26+
"http-lib" {with-test & = version}
2927
"ipaddr"
30-
"mirage-crypto" {with-test}
28+
"mirage-crypto"
3129
"mirage-crypto-pk"
32-
"mirage-crypto-rng" {with-test}
33-
"message-switch-unix"
30+
"mirage-crypto-rng" {>= "0.11.0"}
31+
"message-switch-unix" {= version}
3432
"mtime"
3533
"opentelemetry-client-ocurl"
3634
"pci"
37-
"pciutil"
35+
"pciutil" {= version}
3836
"ppx_deriving_rpc"
3937
"ppx_sexp_conv"
4038
"ppx_deriving"
4139
"psq"
4240
"rpclib"
43-
"rrdd-plugin"
41+
"rrdd-plugin" {= version}
4442
"rresult"
4543
"sexpr"
4644
"sha"
47-
"stunnel"
45+
"stunnel" {= version}
4846
"tar"
4947
"tar-unix"
50-
"base-threads"
51-
"base-unix"
52-
"uuid"
48+
"uuid" {= version}
5349
"x509"
54-
"xapi-client"
55-
"xapi-cli-protocol"
56-
"xapi-consts"
57-
"xapi-datamodel"
58-
"xapi-expiry-alerts"
59-
"xapi-stdext-date"
60-
"xapi-stdext-pervasives"
61-
"xapi-stdext-std"
62-
"xapi-stdext-threads"
63-
"xapi-stdext-unix"
64-
"xapi-stdext-zerocheck"
50+
"xapi-client" {= version}
51+
"xapi-cli-protocol" {= version}
52+
"xapi-consts" {= version}
53+
"xapi-datamodel" {= version}
54+
"xapi-expiry-alerts" {= version}
55+
"xapi-idl" {= version}
56+
"xapi-inventory" {= version}
57+
"xapi-log" {= version}
58+
"xapi-stdext-date" {= version}
59+
"xapi-stdext-pervasives" {= version}
60+
"xapi-stdext-std" {= version}
61+
"xapi-stdext-threads" {= version}
62+
"xapi-stdext-unix" {= version}
63+
"xapi-stdext-zerocheck" {= version}
6564
"xapi-test-utils" {with-test}
66-
"xapi-tracing"
67-
"xapi-types"
68-
"xapi-xenopsd"
69-
"xapi-idl"
70-
"xapi-inventory"
71-
"xml-light2"
65+
"xapi-tracing" {= version}
66+
"xapi-types" {= version}
67+
"xapi-xenopsd" {= version}
68+
"xml-light2" {= version}
7269
"yojson"
73-
"zstd"
70+
"zstd" {= version}
71+
"odoc" {with-doc}
7472
]
73+
build: [
74+
["dune" "subst"] {dev}
75+
[
76+
"dune"
77+
"build"
78+
"-p"
79+
name
80+
"-j"
81+
jobs
82+
"@install"
83+
"@runtest" {with-test}
84+
"@doc" {with-doc}
85+
]
86+
]
87+
dev-repo: "git+https://github.com/xapi-project/xen-api.git"
7588
depexts: [
7689
["hwdata" "libxxhash-dev" "libxxhash0"] {os-distribution = "debian"}
7790
["hwdata" "libxxhash-dev" "libxxhash0"] {os-distribution = "ubuntu"}
7891
["hwdata" "xxhash-devel" "xxhash-libs"] {os-distribution = "centos"}
7992
["hwdata" "xxhash-devel" "xxhash-libs"] {os-distribution = "fedora"}
8093
["hwdata" "xxhash-dev" "xxhash"] {os-distribution = "alpine"}
8194
]
82-
synopsis: "The xapi toolstack daemon which implements the XenAPI"
83-
description: """
84-
This daemon exposes the XenAPI and is used by clients such as 'xe'
85-
and 'XenCenter' to manage clusters of Xen-enabled hosts."""
86-
url {
87-
src: "https://github.com/xapi-project/xen-api/archive/master.tar.gz"
88-
}

xapi.opam.template

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,7 @@
1-
opam-version: "2.0"
2-
maintainer: "xen-api@lists.xen.org"
3-
authors: [ "xen-api@lists.xen.org" ]
4-
homepage: "https://github.com/xapi-project/xen-api"
5-
bug-reports: "https://github.com/xapi-project/xen-api/issues"
6-
dev-repo: "git+https://github.com/xapi-project/xen-api.git"
7-
build: [
8-
["dune" "build" "-p" name "-j" jobs ]
9-
["dune" "runtest" "-p" name "-j" jobs] {with-test}
10-
]
11-
depends: [
12-
"ocaml"
13-
"dune"
14-
"alcotest" # needed to generate the quicktest binary
15-
"angstrom"
16-
"base64"
17-
"cdrom"
18-
"conf-pam"
19-
"crowbar" {with-test}
20-
"ctypes"
21-
"ctypes-foreign"
22-
"domain-name"
23-
"ezxenstore"
24-
"fmt" {with-test}
25-
"hex"
26-
"http-lib" {with-test} # the public library is only used for testing
27-
"ipaddr"
28-
"mirage-crypto" {with-test}
29-
"mirage-crypto-pk"
30-
"mirage-crypto-rng" {with-test}
31-
"message-switch-unix"
32-
"mtime"
33-
"opentelemetry-client-ocurl"
34-
"pci"
35-
"pciutil"
36-
"ppx_deriving_rpc"
37-
"ppx_sexp_conv"
38-
"ppx_deriving"
39-
"psq"
40-
"rpclib"
41-
"rrdd-plugin"
42-
"rresult"
43-
"sexpr"
44-
"sha"
45-
"stunnel"
46-
"tar"
47-
"tar-unix"
48-
"base-threads"
49-
"base-unix"
50-
"uuid"
51-
"x509"
52-
"xapi-client"
53-
"xapi-cli-protocol"
54-
"xapi-consts"
55-
"xapi-datamodel"
56-
"xapi-expiry-alerts"
57-
"xapi-stdext-date"
58-
"xapi-stdext-pervasives"
59-
"xapi-stdext-std"
60-
"xapi-stdext-threads"
61-
"xapi-stdext-unix"
62-
"xapi-stdext-zerocheck"
63-
"xapi-test-utils" {with-test}
64-
"xapi-tracing"
65-
"xapi-types"
66-
"xapi-xenopsd"
67-
"xapi-idl"
68-
"xapi-inventory"
69-
"xml-light2"
70-
"yojson"
71-
"zstd"
72-
]
731
depexts: [
742
["hwdata" "libxxhash-dev" "libxxhash0"] {os-distribution = "debian"}
753
["hwdata" "libxxhash-dev" "libxxhash0"] {os-distribution = "ubuntu"}
764
["hwdata" "xxhash-devel" "xxhash-libs"] {os-distribution = "centos"}
775
["hwdata" "xxhash-devel" "xxhash-libs"] {os-distribution = "fedora"}
786
["hwdata" "xxhash-dev" "xxhash"] {os-distribution = "alpine"}
797
]
80-
synopsis: "The xapi toolstack daemon which implements the XenAPI"
81-
description: """
82-
This daemon exposes the XenAPI and is used by clients such as 'xe'
83-
and 'XenCenter' to manage clusters of Xen-enabled hosts."""
84-
url {
85-
src: "https://github.com/xapi-project/xen-api/archive/master.tar.gz"
86-
}

0 commit comments

Comments
 (0)