Skip to content

Commit e3d84de

Browse files
authored
Merge pull request #5804 from edwintorok/feature/perf
Update feature/perf from master
2 parents ce17da2 + 4c49af7 commit e3d84de

File tree

137 files changed

+1386
-1251
lines changed

Some content is hidden

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

137 files changed

+1386
-1251
lines changed

configure.ml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,12 @@ let () =
8484
in
8585
List.iter print_endline lines ;
8686
(* Expand @LIBEXEC@ in udev rules *)
87-
try
88-
let xenopsd_libexecdir = Hashtbl.find config "XENOPSD_LIBEXECDIR" in
89-
expand "@LIBEXEC@" xenopsd_libexecdir "ocaml/xenopsd/scripts/vif.in"
90-
"ocaml/xenopsd/scripts/vif" ;
91-
expand "@LIBEXEC@" xenopsd_libexecdir
92-
"ocaml/xenopsd/scripts/xen-backend.rules.in"
93-
"ocaml/xenopsd/scripts/xen-backend.rules"
94-
with Not_found -> failwith "xenopsd_libexecdir not set"
87+
match Hashtbl.find_opt config "XENOPSD_LIBEXECDIR" with
88+
| Some xenopsd_libexecdir ->
89+
expand "@LIBEXEC@" xenopsd_libexecdir "ocaml/xenopsd/scripts/vif.in"
90+
"ocaml/xenopsd/scripts/vif" ;
91+
expand "@LIBEXEC@" xenopsd_libexecdir
92+
"ocaml/xenopsd/scripts/xen-backend.rules.in"
93+
"ocaml/xenopsd/scripts/xen-backend.rules"
94+
| None ->
95+
failwith "xenopsd_libexecdir not set"

dune-project

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,27 @@
227227

228228
(package
229229
(name xapi-networkd)
230+
(authors "Jon Ludlam")
231+
(synopsis "The XCP networking daemon")
232+
(depends
233+
(alcotest :with-test)
234+
astring
235+
base-threads
236+
(forkexec (= :version))
237+
(http-lib (= :version))
238+
mtime
239+
netlink
240+
re
241+
rpclib
242+
(xapi-idl (= :version))
243+
xapi-inventory
244+
(xapi-stdext-pervasives (= :version))
245+
(xapi-stdext-std (= :version))
246+
(xapi-stdext-threads (= :version))
247+
(xapi-stdext-unix (= :version))
248+
xapi-test-utils
249+
(xen-api-client (= :version))
250+
)
230251
)
231252

232253
(package
@@ -243,6 +264,14 @@
243264

244265
(package
245266
(name xapi-forkexecd)
267+
(synopsis "Sub-process control service for xapi")
268+
(description "This daemon creates and manages sub-processes on behalf of xapi.")
269+
(depends
270+
astring
271+
(forkexec (= :version))
272+
(uuid (= :version))
273+
(xapi-stdext-unix (= :version))
274+
)
246275
)
247276

248277
(package
@@ -446,6 +475,19 @@ This package provides an Lwt compatible interface to the library.")
446475

447476
(package
448477
(name forkexec)
478+
(synopsis "Process-spawning library")
479+
(description "Client and server library to spawn processes.")
480+
(depends
481+
base-threads
482+
(fd-send-recv (>= "2.0.0"))
483+
ppx_deriving_rpc
484+
rpclib
485+
(uuid (= :version))
486+
(xapi-log (= :version))
487+
(xapi-stdext-pervasives (= :version))
488+
(xapi-stdext-unix (= :version))
489+
(xapi-tracing (= :version))
490+
)
449491
)
450492

451493
(package
@@ -515,7 +557,6 @@ This package provides an Lwt compatible interface to the library.")
515557
(synopsis "Xapi's standard library extension, Threads")
516558
(authors "Jonathan Ludlam")
517559
(depends
518-
ocaml
519560
base-threads
520561
base-unix
521562
(odoc :with-doc)
@@ -552,7 +593,6 @@ This package provides an Lwt compatible interface to the library.")
552593
(synopsis "Xapi's standard library extension, Zerocheck")
553594
(authors "Jonathan Ludlam")
554595
(depends
555-
ocaml
556596
(odoc :with-doc)
557597
)
558598
)

forkexec.opam

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,37 @@
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/"
3+
synopsis: "Process-spawning library"
4+
description: "Client and server library to spawn processes."
5+
maintainer: ["Xapi project maintainers"]
6+
authors: ["xen-api@lists.xen.org"]
7+
license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"
8+
homepage: "https://xapi-project.github.io/"
79
bug-reports: "https://github.com/xapi-project/xen-api/issues"
8-
dev-repo: "git+https://github.com/xapi-project/xen-api.git"
9-
tags: [ "org:xapi-project" ]
10-
11-
build: [[ "dune" "build" "-p" name "-j" jobs ]]
12-
1310
depends: [
14-
"ocaml"
15-
"dune"
11+
"dune" {>= "3.0"}
1612
"base-threads"
17-
"fd-send-recv"
13+
"fd-send-recv" {>= "2.0.0"}
1814
"ppx_deriving_rpc"
1915
"rpclib"
20-
"uuid"
21-
"xapi-log"
22-
"xapi-stdext-pervasives"
23-
"xapi-stdext-unix"
24-
"xapi-tracing"
16+
"uuid" {= version}
17+
"xapi-log" {= version}
18+
"xapi-stdext-pervasives" {= version}
19+
"xapi-stdext-unix" {= version}
20+
"xapi-tracing" {= version}
21+
"odoc" {with-doc}
2522
]
26-
synopsis: "Sub-process control service for xapi"
27-
description:
28-
"This daemon creates and manages sub-processes on behalf of xapi."
29-
url {
30-
src: "https://github.com/xapi-project/xen-api/archive/master.tar.gz"
31-
}
23+
build: [
24+
["dune" "subst"] {dev}
25+
[
26+
"dune"
27+
"build"
28+
"-p"
29+
name
30+
"-j"
31+
jobs
32+
"@install"
33+
"@runtest" {with-test}
34+
"@doc" {with-doc}
35+
]
36+
]
37+
dev-repo: "git+https://github.com/xapi-project/xen-api.git"

forkexec.opam.template

Lines changed: 0 additions & 29 deletions
This file was deleted.

ocaml/database/db_backend.ml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,5 @@ let is_session_registered session =
104104

105105
let get_registered_database session =
106106
with_lock db_registration_mutex (fun () ->
107-
if Hashtbl.mem foreign_databases session then
108-
Some (Hashtbl.find foreign_databases session)
109-
else
110-
None
107+
Hashtbl.find_opt foreign_databases session
111108
)

ocaml/database/db_conn_store.ml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ let read_db_connections () = !db_connections
4141
let with_db_conn_lock db_conn f =
4242
let db_conn_m =
4343
with_lock db_conn_locks_m (fun () ->
44-
try Hashtbl.find db_conn_locks db_conn
45-
with _ ->
46-
(* If we don't have a lock already for this connection then go make one dynamically and use that from then on *)
47-
let new_dbconn_mutex = Mutex.create () in
48-
Hashtbl.replace db_conn_locks db_conn new_dbconn_mutex ;
49-
new_dbconn_mutex
44+
match Hashtbl.find_opt db_conn_locks db_conn with
45+
| Some x ->
46+
x
47+
| None ->
48+
(* If we don't have a lock already for this connection then go make one dynamically and use that from then on *)
49+
let new_dbconn_mutex = Mutex.create () in
50+
Hashtbl.replace db_conn_locks db_conn new_dbconn_mutex ;
51+
new_dbconn_mutex
5052
)
5153
in
5254
with_lock db_conn_m (fun () -> f ())

ocaml/database/stats.ml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,9 @@ let sample (name : string) (x : float) : unit =
7777
let x' = log x in
7878
with_lock timings_m (fun () ->
7979
let p =
80-
if Hashtbl.mem timings name then
81-
Hashtbl.find timings name
82-
else
83-
Normal_population.empty
80+
Option.value
81+
(Hashtbl.find_opt timings name)
82+
~default:Normal_population.empty
8483
in
8584
let p' = Normal_population.sample p x' in
8685
Hashtbl.replace timings name p'

ocaml/forkexecd/test/fe_test.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,10 @@ let test_internal_failure_error () =
221221
Forkhelpers.safe_close_and_exec None (Some fd) None [] exe args |> ignore ;
222222
fail "Expected an exception"
223223
with
224-
| Fd_send_recv.Unix_error _ ->
224+
| Fd_send_recv.Unix_error _ | Unix.Unix_error (Unix.EBADF, _, _) ->
225225
leak_fd_detect ()
226226
| e ->
227+
Printexc.print_backtrace stderr ;
227228
fail "Failed with unexpected exception: %s" (Printexc.to_string e)
228229

229230
let master fds =

ocaml/idl/datamodel_host.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,7 @@ let set_power_on_mode =
13671367
[
13681368
(Published, rel_cowley, "")
13691369
; (Changed, rel_stockholm, "Removed iLO script")
1370+
; (Changed, "24.19.0", "Replaced DRAC mode with IPMI")
13701371
]
13711372
~in_product_since:rel_midnight_ride
13721373
~doc:"Set the power-on-mode, host, user and password"
@@ -1375,7 +1376,7 @@ let set_power_on_mode =
13751376
(Ref _host, "self", "The host")
13761377
; ( String
13771378
, "power_on_mode"
1378-
, "power-on-mode can be empty, wake-on-lan, DRAC or other"
1379+
, "power-on-mode can be empty, wake-on-lan, IPMI or other"
13791380
)
13801381
; (Map (String, String), "power_on_config", "Power on config")
13811382
]

ocaml/idl/datamodel_lifecycle.ml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
let prototyped_of_class = function
2+
| "VM_group" ->
3+
Some "24.18.0-next"
24
| "Observer" ->
35
Some "23.14.0"
46
| "VTPM" ->
@@ -7,6 +9,10 @@ let prototyped_of_class = function
79
None
810

911
let prototyped_of_field = function
12+
| "VM_group", "VMs" ->
13+
Some "24.18.0-next"
14+
| "VM_group", "placement" ->
15+
Some "24.18.0-next"
1016
| "Observer", "enabled" ->
1117
Some "23.14.0"
1218
| "Observer", "components" ->
@@ -55,6 +61,8 @@ let prototyped_of_field = function
5561
Some "22.27.0"
5662
| "host", "last_software_update" ->
5763
Some "22.20.0"
64+
| "VM", "groups" ->
65+
Some "24.18.0-next"
5866
| "VM", "pending_guidances_full" ->
5967
Some "24.10.0"
6068
| "VM", "pending_guidances_recommended" ->
@@ -63,6 +71,8 @@ let prototyped_of_field = function
6371
Some "23.18.0"
6472
| "VM", "actions__after_softreboot" ->
6573
Some "23.1.0"
74+
| "pool", "recommendations" ->
75+
Some "24.18.0-next"
6676
| "pool", "update_sync_enabled" ->
6777
Some "23.18.0"
6878
| "pool", "update_sync_day" ->
@@ -139,6 +149,8 @@ let prototyped_of_message = function
139149
Some "24.17.0"
140150
| "VM", "restart_device_models" ->
141151
Some "23.30.0"
152+
| "VM", "set_groups" ->
153+
Some "24.18.0-next"
142154
| "pool", "get_guest_secureboot_readiness" ->
143155
Some "24.17.0"
144156
| "pool", "set_ext_auth_max_threads" ->

0 commit comments

Comments
 (0)