Skip to content

Commit e0d3512

Browse files
authored
Merge master to feature branch (#6425)
2 parents b89ed21 + dc40428 commit e0d3512

File tree

194 files changed

+3448
-1727
lines changed

Some content is hidden

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

194 files changed

+3448
-1727
lines changed

.github/workflows/docs.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,23 @@ jobs:
3131
- name: Update Ubuntu repositories
3232
run: sudo apt-get update
3333

34+
# We set DUNE_CACHE_STORAGE_MODE, it is required for dune cache to work inside opam for now,
35+
# otherwise it gets EXDEV and considers it a cache miss
3436
- name: Use ocaml
35-
uses: ocaml/setup-ocaml@v2
37+
uses: ocaml/setup-ocaml@v3
3638
with:
3739
ocaml-compiler: ${{ steps.dotenv.outputs.ocaml_version_full }}
3840
opam-repositories: |
3941
xs-opam: ${{ steps.dotenv.outputs.repository }}
42+
dune-cache: true
43+
opam-pin: false
44+
cache-prefix: v3-${{ steps.system-info.outputs.name }}-${{ steps.system-info.outputs.release }}
45+
env:
46+
DUNE_CACHE_STORAGE_MODE: copy
4047

4148
- name: Install dependencies
42-
run: opam pin list --short | xargs opam install --deps-only -v
49+
shell: bash
50+
run: opam install . --deps-only -v
4351

4452
- name: Generate xapi-storage docs
4553
run: |

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ DUNE_IU_PACKAGES1+=gzip http-lib pciutil sexpr stunnel uuid xml-light2 zstd xapi
155155
DUNE_IU_PACKAGES1+=message-switch message-switch-cli message-switch-core message-switch-lwt
156156
DUNE_IU_PACKAGES1+=message-switch-unix xapi-idl xapi-forkexecd xapi-storage xapi-storage-script xapi-storage-cli
157157
DUNE_IU_PACKAGES1+=xapi-nbd varstored-guard xapi-log xapi-open-uri xapi-tracing xapi-tracing-export xapi-expiry-alerts cohttp-posix
158-
DUNE_IU_PACKAGES1+=xapi-rrd xapi-inventory clock xapi-sdk
159-
DUNE_IU_PACKAGES1+=xapi-stdext-date xapi-stdext-encodings xapi-stdext-pervasives xapi-stdext-std xapi-stdext-threads xapi-stdext-unix xapi-stdext-zerocheck xapi-tools
158+
DUNE_IU_PACKAGES1+=xapi-rrd xapi-inventory clock xapi-sdk tgroup
159+
DUNE_IU_PACKAGES1+=xapi-stdext-encodings xapi-stdext-pervasives xapi-stdext-std xapi-stdext-threads xapi-stdext-unix xapi-stdext-zerocheck xapi-tools
160160

161161

162162
install-dune1:

dune-project

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
(formatting (enabled_for ocaml))
44
(using menhir 2.0)
55
(using directory-targets 0.1)
6+
(opam_file_location inside_opam_directory)
67

78
(cram enable)
89
(implicit_transitive_deps false)
@@ -669,16 +670,6 @@ This package provides an Lwt compatible interface to the library.")
669670
(name xapi-inventory)
670671
)
671672

672-
(package
673-
(name xapi-stdext-date)
674-
(synopsis "Xapi's standard library extension, Dates")
675-
(authors "Jonathan Ludlam")
676-
(depends
677-
(clock (= :version))
678-
ptime
679-
)
680-
)
681-
682673
(package
683674
(name xapi-stdext-encodings)
684675
(synopsis "Xapi's standard library extension, Encodings")
@@ -720,12 +711,14 @@ This package provides an Lwt compatible interface to the library.")
720711
(synopsis "Xapi's standard library extension, Threads")
721712
(authors "Jonathan Ludlam")
722713
(depends
714+
ambient-context
723715
base-threads
724716
base-unix
725717
(alcotest :with-test)
726718
(clock (= :version))
727719
(fmt :with-test)
728720
mtime
721+
tgroup
729722
(xapi-log (= :version))
730723
(xapi-stdext-pervasives (= :version))
731724
(xapi-stdext-unix (= :version))

ocaml/idl/datamodel.ml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7621,6 +7621,10 @@ module VM_guest_metrics = struct
76217621
~ty:Bool ~default_value:(Some (VBool false)) "PV_drivers_detected"
76227622
"At least one of the guest's devices has successfully connected to \
76237623
the backend."
7624+
; field ~qualifier:DynamicRO ~lifecycle:[]
7625+
~ty:(Map (String, String))
7626+
~default_value:(Some (VMap [])) "services"
7627+
"The guest's services data."
76247628
]
76257629
()
76267630
end
@@ -8972,7 +8976,7 @@ module Message = struct
89728976
let get_all_records_where =
89738977
call ~name:"get_all_records_where"
89748978
~lifecycle:[(Published, rel_orlando, "")]
8975-
~params:[(String, "expr", "The expression to match (not currently used)")]
8979+
~params:[(String, "expr", "The expression to match")]
89768980
~flags:[`Session]
89778981
~result:(Map (Ref _message, Record _message), "The messages")
89788982
~allowed_roles:_R_READ_ONLY ()
@@ -10539,12 +10543,12 @@ let all_system =
1053910543
(**
1054010544
These are the pairs of (object, field) which are bound together in
1054110545
the database schema.
10542-
10546+
1054310547
It is assumed that, for any entry (p, p'), neither p nor p'
1054410548
appears in any other entry. It may be the case that p = p', which
1054510549
is the only instance where some object-field pair may appear more
1054610550
than once.
10547-
10551+
1054810552
This is implicitly assumed by other code which treats this list -
1054910553
and its symmetric closure - as an association list
1055010554
without duplicate keys. *)

ocaml/idl/datamodel_common.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ open Datamodel_roles
1010
to leave a gap for potential hotfixes needing to increment the schema version.*)
1111
let schema_major_vsn = 5
1212

13-
let schema_minor_vsn = 786
13+
let schema_minor_vsn = 788
1414

1515
(* Historical schema versions just in case this is useful later *)
1616
let rio_schema_major_vsn = 5

ocaml/idl/datamodel_lifecycle.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ let prototyped_of_field = function
109109
Some "22.27.0"
110110
| "host", "last_software_update" ->
111111
Some "22.20.0"
112+
| "VM_guest_metrics", "services" ->
113+
Some "25.15.0"
112114
| "VM_guest_metrics", "netbios_name" ->
113115
Some "24.28.0"
114116
| "VM", "groups" ->
@@ -121,6 +123,8 @@ let prototyped_of_field = function
121123
Some "23.18.0"
122124
| "VM", "actions__after_softreboot" ->
123125
Some "23.1.0"
126+
| "pool", "ha_reboot_vm_on_internal_shutdown" ->
127+
Some "25.15.0-next"
124128
| "pool", "license_server" ->
125129
Some "25.6.0"
126130
| "pool", "recommendations" ->

ocaml/idl/datamodel_pool.ml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2191,6 +2191,12 @@ let t =
21912191
~ty:(Map (String, String))
21922192
~default_value:(Some (VMap [])) "license_server"
21932193
"Licensing data shared within the whole pool"
2194+
; field ~writer_roles:_R_POOL_OP ~qualifier:RW ~lifecycle:[] ~ty:Bool
2195+
~default_value:(Some (VBool true))
2196+
"ha_reboot_vm_on_internal_shutdown"
2197+
"Indicates whether an HA-protected VM that is shut down from \
2198+
inside (not through the API) should be automatically rebooted \
2199+
when HA is enabled"
21942200
]
21952201
)
21962202
()

ocaml/idl/schematest.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ let hash x = Digest.string x |> Digest.to_hex
33
(* BEWARE: if this changes, check that schema has been bumped accordingly in
44
ocaml/idl/datamodel_common.ml, usually schema_minor_vsn *)
55

6-
let last_known_schema_hash = "ad67a64cd47cdea32085518c1fb38d27"
6+
let last_known_schema_hash = "e10b420b0863116ee188eea9e63b1349"
77

88
let current_schema_hash : string =
99
let open Datamodel_types in

ocaml/libs/resources/test/dune

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
(action (run %{test} -e))
55
(libraries
66
safe-resources
7+
logs
78
logs.fmt
89
alcotest
910
)

ocaml/libs/tgroup/tgroup.ml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,11 @@ module Group = struct
253253
External.name // External.Unauthenticated.name
254254

255255
let to_string g = match g with Group group -> to_cgroup group
256+
257+
let authenticated_root =
258+
of_creator (Creator.make ~identity:Identity.root_identity ())
259+
260+
let unauthenticated = Group External_Unauthenticated
256261
end
257262

258263
module Cgroup = struct

ocaml/libs/tgroup/tgroup.mli

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module Group : sig
3737

3838
val of_string : string -> t
3939
(** [of_string s] creates an originator from a string [s].
40-
40+
4141
e.g create an originator based on a http header. *)
4242

4343
val to_string : t -> string
@@ -76,6 +76,14 @@ module Group : sig
7676

7777
val to_string : t -> string
7878
(** [to_string g] returns the string representation of the group [g].*)
79+
80+
val authenticated_root : t
81+
(** [authenticated_root] represents the main classification of internal xapi
82+
threads. *)
83+
84+
val unauthenticated : t
85+
(** [unauthenticated] represents the classification of xapi threads for
86+
unauthenticated users. *)
7987
end
8088

8189
(** [Cgroup] module encapsulates different function for managing the cgroups
@@ -87,7 +95,7 @@ module Cgroup : sig
8795
val dir_of : Group.t -> t option
8896
(** [dir_of group] returns the full path of the cgroup directory corresponding
8997
to the group [group] as [Some dir].
90-
98+
9199
Returns [None] if [init dir] has not been called. *)
92100

93101
val init : string -> unit

ocaml/libs/tracing/tracing.ml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -437,10 +437,7 @@ module Span = struct
437437

438438
let to_propagation_context span =
439439
let traceparent = span |> get_context |> SpanContext.to_traceparent in
440-
span
441-
|> get_context
442-
|> SpanContext.context_of_span_context
443-
|> TraceContext.with_traceparent (Some traceparent)
440+
span |> get_trace_context |> TraceContext.with_traceparent (Some traceparent)
444441

445442
let with_trace_context span trace_context =
446443
let span_context =

ocaml/libs/tracing/tracing_export.ml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,7 @@ module Content = struct
8383
)
8484
in
8585
let tags =
86-
let span_context = Span.get_context s in
87-
let trace_context =
88-
SpanContext.context_of_span_context span_context
89-
in
86+
let trace_context = Span.get_trace_context s in
9087
let baggage =
9188
TraceContext.baggage_of trace_context |> Option.value ~default:[]
9289
in

0 commit comments

Comments
 (0)