Skip to content

Commit d70468e

Browse files
committed
Merge branch 'master' into feature/config-ntp-timezone-maxcstate
2 parents e4bf99c + 5b121e2 commit d70468e

21 files changed

Lines changed: 257 additions & 154 deletions

File tree

.git-blame-ignore-revs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ b12cf444edea15da6274975e1b2ca6a7fce2a090
3333
364c27f5d18ab9dd31825e67a93efabecad06823
3434
d8b4de9076531dd13bdffa20cc10c72290a52356
3535
bdf06bca7534fbc0c4fc3cee3408a51a22615226
36+
eefc649e17086fbc200e4da114ea673825e79864
3637

3738
# ocp-indent
3839
d018d26d6acd4707a23288b327b49e44f732725e

dune-project

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,14 +586,25 @@
586586
(depends
587587
qcow-stream
588588
cmdliner
589+
yojson
589590
)
590591
)
591592

592593
(package
593594
(name varstored-guard))
594595

595596
(package
596-
(name uuid))
597+
(name uuid)
598+
(synopsis "Library used by xapi to generate database UUIDs")
599+
(description
600+
"This library allows xapi to use UUIDs with phantom types to avoid mixing UUIDs from different classes of objects. It's based on `uuidm`.")
601+
(depends
602+
(alcotest :with-test)
603+
(fmt :with-test)
604+
ptime
605+
uuidm
606+
)
607+
)
597608

598609
(package
599610
(name stunnel)

ocaml/idl/datamodel_host.ml

Lines changed: 76 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,6 +1220,41 @@ let host_ntp_mode =
12201220
]
12211221
)
12221222

1223+
let host_numa_affinity_policy =
1224+
Enum
1225+
( "host_numa_affinity_policy"
1226+
, [
1227+
("any", "VMs are spread across all available NUMA nodes")
1228+
; ( "best_effort"
1229+
, "VMs are placed on the smallest number of NUMA nodes that they fit \
1230+
using soft-pinning, but the policy doesn't guarantee a balanced \
1231+
placement, falling back to the 'any' policy."
1232+
)
1233+
; ( "default_policy"
1234+
, "Use the NUMA affinity policy that is the default for the current \
1235+
version"
1236+
)
1237+
]
1238+
)
1239+
1240+
let latest_synced_updates_applied_state =
1241+
Enum
1242+
( "latest_synced_updates_applied_state"
1243+
, [
1244+
( "yes"
1245+
, "The host is up to date with the latest updates synced from remote \
1246+
CDN"
1247+
)
1248+
; ( "no"
1249+
, "The host is outdated with the latest updates synced from remote CDN"
1250+
)
1251+
; ( "unknown"
1252+
, "If the host is up to date with the latest updates synced from \
1253+
remote CDN is unknown"
1254+
)
1255+
]
1256+
)
1257+
12231258
let create_params =
12241259
[
12251260
{
@@ -1424,7 +1459,7 @@ let create_params =
14241459
"The maximum C-state that the host is allowed to enter, \"\" means \
14251460
unlimited; \"N\" means limit to CN; \"N,M\" means limit to CN with \
14261461
max sub cstate M."
1427-
; param_release= numbered_release "25.38.0-next"
1462+
; param_release= numbered_release "25.39.0-next"
14281463
; param_default= Some (VString "")
14291464
}
14301465
; {
@@ -1433,25 +1468,62 @@ let create_params =
14331468
; param_doc=
14341469
"Indicates NTP servers are assigned by DHCP, or configured by user, or \
14351470
the factory servers, or NTP is disabled"
1436-
; param_release= numbered_release "25.38.0-next"
1471+
; param_release= numbered_release "25.39.0-next"
14371472
; param_default= Some (VEnum "Factory")
14381473
}
14391474
; {
14401475
param_type= Set String
14411476
; param_name= "ntp_custom_servers"
14421477
; param_doc=
14431478
"Custom NTP servers configured by users, used in Custom NTP mode"
1444-
; param_release= numbered_release "25.38.0-next"
1479+
; param_release= numbered_release "25.39.0-next"
14451480
; param_default= Some (VSet [])
14461481
}
14471482
; {
14481483
param_type= String
14491484
; param_name= "timezone"
14501485
; param_doc=
14511486
"The time zone identifier as defined in the IANA Time Zone Database"
1452-
; param_release= numbered_release "25.38.0-next"
1487+
; param_release= numbered_release "25.39.0-next"
14531488
; param_default= Some (VString "UTC")
14541489
}
1490+
; {
1491+
param_type= host_numa_affinity_policy
1492+
; param_name= "numa_affinity_policy"
1493+
; param_doc= "NUMA-aware VM memory and vCPU placement policy"
1494+
; param_release= numbered_release "25.39.0-next"
1495+
; param_default= Some (VEnum "default_policy")
1496+
}
1497+
; {
1498+
param_type= latest_synced_updates_applied_state
1499+
; param_name= "latest_synced_updates_applied"
1500+
; param_doc=
1501+
"Default as 'unknown', 'yes' if the host is up to date with updates \
1502+
synced from remote CDN, otherwise 'no'"
1503+
; param_release= numbered_release "25.39.0-next"
1504+
; param_default= Some (VSet [])
1505+
}
1506+
; {
1507+
param_type= Set update_guidances
1508+
; param_name= "pending_guidances_full"
1509+
; param_doc=
1510+
"The set of pending full guidances after applying updates, which a \
1511+
user should follow to make some updates, e.g. specific hardware \
1512+
drivers or CPU features, fully effective, but the 'average user' \
1513+
doesn't need to"
1514+
; param_release= numbered_release "25.39.0-next"
1515+
; param_default= Some (VSet [])
1516+
}
1517+
; {
1518+
param_type= Set update_guidances
1519+
; param_name= "pending_guidances_recommended"
1520+
; param_doc=
1521+
"The set of pending recommended guidances after applying updates, \
1522+
which most users should follow to make the updates effective, but if \
1523+
not followed, will not cause a failure"
1524+
; param_release= numbered_release "25.39.0-next"
1525+
; param_default= Some (VSet [])
1526+
}
14551527
]
14561528

14571529
let create =
@@ -2357,23 +2429,6 @@ let cleanup_pool_secret =
23572429
]
23582430
~allowed_roles:_R_LOCAL_ROOT_ONLY ~hide_from_docs:true ()
23592431

2360-
let host_numa_affinity_policy =
2361-
Enum
2362-
( "host_numa_affinity_policy"
2363-
, [
2364-
("any", "VMs are spread across all available NUMA nodes")
2365-
; ( "best_effort"
2366-
, "VMs are placed on the smallest number of NUMA nodes that they fit \
2367-
using soft-pinning, but the policy doesn't guarantee a balanced \
2368-
placement, falling back to the 'any' policy."
2369-
)
2370-
; ( "default_policy"
2371-
, "Use the NUMA affinity policy that is the default for the current \
2372-
version"
2373-
)
2374-
]
2375-
)
2376-
23772432
let set_numa_affinity_policy =
23782433
call ~name:"set_numa_affinity_policy" ~lifecycle:[]
23792434
~doc:"Set VM placement NUMA affinity policy"
@@ -2581,24 +2636,6 @@ let update_firewalld_service_status =
25812636
status."
25822637
~allowed_roles:_R_POOL_OP ()
25832638

2584-
let latest_synced_updates_applied_state =
2585-
Enum
2586-
( "latest_synced_updates_applied_state"
2587-
, [
2588-
( "yes"
2589-
, "The host is up to date with the latest updates synced from remote \
2590-
CDN"
2591-
)
2592-
; ( "no"
2593-
, "The host is outdated with the latest updates synced from remote CDN"
2594-
)
2595-
; ( "unknown"
2596-
, "If the host is up to date with the latest updates synced from \
2597-
remote CDN is unknown"
2598-
)
2599-
]
2600-
)
2601-
26022639
let get_tracked_user_agents =
26032640
call ~name:"get_tracked_user_agents" ~lifecycle:[]
26042641
~doc:

ocaml/idl/dune

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@
6464
)
6565

6666
(tests
67-
(names schematest test_datetimes)
67+
(names schematest test_datetimes test_host)
6868
(modes exe)
69-
(modules schematest test_datetimes)
69+
(modules schematest test_datetimes test_host)
7070
(libraries
7171
astring
7272
rpclib.core

ocaml/idl/test_host.ml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module DT = Datamodel_types
2+
module FieldSet = Astring.String.Set
3+
4+
let recent_field (f : DT.field) = f.lifecycle.transitions = []
5+
6+
let rec field_full_names = function
7+
| DT.Field f ->
8+
if recent_field f then
9+
f.full_name |> String.concat "_" |> Seq.return
10+
else
11+
Seq.empty
12+
| DT.Namespace (_, xs) ->
13+
xs |> List.to_seq |> Seq.concat_map field_full_names
14+
15+
let () =
16+
let create_params =
17+
Datamodel_host.create_params
18+
|> List.map (fun p -> p.DT.param_name)
19+
|> FieldSet.of_list
20+
and fields =
21+
Datamodel_host.t.contents
22+
|> List.to_seq
23+
|> Seq.concat_map field_full_names
24+
|> FieldSet.of_seq
25+
in
26+
let missing_in_create_params = FieldSet.diff fields create_params in
27+
if not (FieldSet.is_empty missing_in_create_params) then (
28+
Format.eprintf "Missing fields in create_params: %a@." FieldSet.dump
29+
missing_in_create_params ;
30+
exit 1
31+
)

ocaml/idl/test_host.mli

Whitespace-only changes.

ocaml/libs/xapi-stdext/lib/xapi-fdcaps/operations.mli

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,18 @@ val setup : unit -> unit
4747

4848
(** {1 Static property tests} *)
4949

50-
val as_readable : (([< readable] as 'a), 'b) make -> ([> readable], 'b) make
50+
val as_readable : ([< readable], 'b) make -> ([> readable], 'b) make
5151
(** [as_readable_opt t] returns [Some t] when [t] is readable, and [None] otherwise. *)
5252

5353
val as_writable : ([< writable], 'b) make -> ([> writable], 'b) make
5454
(** [as_writable_opt t] returns [Some t] when [t] is readable, and [None] otherwise. *)
5555

5656
(** {1 Runtime property tests} *)
5757

58-
val as_readable_opt :
59-
(([< rw] as 'a), 'b) make -> ([> readable], 'b) make option
58+
val as_readable_opt : ([< rw], 'b) make -> ([> readable], 'b) make option
6059
(** [as_readable_opt t] returns [Some t] when [t] is readable, and [None] otherwise. *)
6160

62-
val as_writable_opt :
63-
(([< rw] as 'a), 'b) make -> ([> writable], 'b) make option
61+
val as_writable_opt : ([< rw], 'b) make -> ([> writable], 'b) make option
6462
(** [as_writable_opt t] returns [Some t] when [t] is readable, and [None] otherwise. *)
6563

6664
val as_spipe_opt : ('a, [< kind]) make -> ('a, [> espipe]) make option

ocaml/networkd/bin/network_server.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ let reset_state () =
212212
) ;
213213
None
214214
in
215+
Inventory.reread_inventory () ;
215216
config := Network_config.read_management_conf reset_order
216217

217218
let set_gateway_interface _dbg name =

ocaml/sdk-gen/c/helper.ml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,16 @@ let comment doc ?(indent = 0) s =
2828
let buf = Buffer.create 16 in
2929
let formatter = Format.formatter_of_buffer buf in
3030
let open Format in
31-
let out, flush, newline, spaces =
32-
let funcs = Format.pp_get_formatter_out_functions formatter () in
33-
(funcs.out_string, funcs.out_flush, funcs.out_newline, funcs.out_spaces)
34-
in
35-
31+
let funcs = Format.pp_get_formatter_out_functions formatter () in
32+
let original_out_newline = funcs.out_newline in
3633
let funcs =
3734
{
38-
out_string= out
39-
; out_flush= flush
40-
; out_newline=
41-
(fun () -> out (Printf.sprintf "\n%s * " indent_str) 0 (indent + 4))
42-
; out_spaces= spaces
43-
; out_indent= spaces
35+
funcs with
36+
out_newline=
37+
(fun () ->
38+
funcs.out_string (Printf.sprintf "\n%s * " indent_str) 0 (indent + 4)
39+
)
40+
; out_indent= funcs.out_spaces
4441
}
4542
in
4643
Format.pp_set_formatter_out_functions formatter funcs ;
@@ -61,7 +58,7 @@ let comment doc ?(indent = 0) s =
6158
Format.fprintf formatter "%!" ;
6259

6360
Format.pp_set_formatter_out_functions formatter
64-
{funcs with out_newline= newline} ;
61+
{funcs with out_newline= original_out_newline} ;
6562

6663
let result = Buffer.contents buf in
6764
let n = String.length result in

ocaml/tests/common/test_common.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ let make_host ~__context ?(uuid = make_uuid ()) ?(name_label = "host")
185185
~console_idle_timeout ~ssh_auto_mode ~secure_boot
186186
~software_version:(Xapi_globs.software_version ())
187187
~https_only ~max_cstate:"" ~ntp_mode:`Factory ~ntp_custom_servers:[]
188-
~timezone:"UTC"
188+
~timezone:"UTC" ~numa_affinity_policy:`default_policy
189+
~latest_synced_updates_applied:`unknown ~pending_guidances_full:[]
190+
~pending_guidances_recommended:[]
189191
in
190192
Db.Host.set_cpu_info ~__context ~self:host ~value:default_cpu_info ;
191193
host

0 commit comments

Comments
 (0)