Skip to content

Commit e6e6dd5

Browse files
authored
Merge 26.1-lcm into feature/26.1-lcm/trusted-certs (#7012)
No conflicts. One extra commit daef7c7 to bump up schema_minor_vsn.
2 parents 8789d0c + daef7c7 commit e6e6dd5

45 files changed

Lines changed: 874 additions & 636 deletions

Some content is hidden

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

ocaml/idl/datamodel.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11009,7 +11009,7 @@ let http_actions =
1100911009
; ( "get_vm_rrds"
1101011010
, ( Get
1101111011
, "/vm_rrds"
11012-
, true
11012+
, false
1101311013
, [String_query_arg "uuid"; Bool_query_arg "json"]
1101411014
, _R_READ_ONLY
1101511015
, []
@@ -11026,7 +11026,7 @@ let http_actions =
1102611026
)
1102711027
(* For XC < 8460 compatibility, remove when out of support *)
1102811028
; ( "get_host_rrds"
11029-
, (Get, "/host_rrds", true, [Bool_query_arg "json"], _R_READ_ONLY, [])
11029+
, (Get, "/host_rrds", false, [Bool_query_arg "json"], _R_READ_ONLY, [])
1103011030
)
1103111031
; ( Constants.get_sr_rrd
1103211032
, ( Get

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 = 793
13+
let schema_minor_vsn = 794
1414

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

ocaml/idl/ocaml_backend/dune

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
(libraries
55
astring
66
cmdliner
7-
fmt
8-
ptime.clock
97
uuidm
108
xapi-consts
119
xapi-datamodel

ocaml/idl/ocaml_backend/gen_rbac.ml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,10 @@ let internal_role_local_root = "_local_root_"
3434

3535
(* the output of this function is used as input by the automatic tests *)
3636
let writer_csv static_permissions_roles =
37-
let now =
38-
let now = Ptime_clock.now () in
39-
let str = Fmt.str "%a" Ptime.(pp_rfc3339 ~frac_s:3 ~tz_offset_s:0 ()) now in
40-
(* remove separators between Year, Month, and Day; to keep old logging format *)
41-
Astring.String.filter (function '-' -> false | _ -> true) str
42-
in
43-
Printf.sprintf "%s,PERMISSION/ROLE,%s\n" now
37+
Printf.sprintf "%s,PERMISSION/ROLE,%s\n"
38+
(let t = Debug.gettimestring () in
39+
String.sub t 0 (String.length t - 1)
40+
)
4441
(* role titles are ordered by roles in roles_all *)
4542
(List.fold_left (fun rr r -> rr ^ r ^ ",") "" Datamodel_roles.roles_all)
4643
^ List.fold_left

ocaml/libs/log/debug.ml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,13 @@ let tasks : task ThreadLocalTable.t = ThreadLocalTable.make ()
7474
let names : string ThreadLocalTable.t = ThreadLocalTable.make ()
7575

7676
let gettimestring () =
77-
let now = Ptime_clock.now () in
78-
Fmt.str "%a|" Ptime.(pp_rfc3339 ~frac_s:3 ~tz_offset_s:0 ()) now
77+
let time = Unix.gettimeofday () in
78+
let tm = Unix.gmtime time in
79+
let msec = time -. floor time in
80+
Printf.sprintf "%d%.2d%.2dT%.2d:%.2d:%.2d.%.3dZ|" (1900 + tm.Unix.tm_year)
81+
(tm.Unix.tm_mon + 1) tm.Unix.tm_mday tm.Unix.tm_hour tm.Unix.tm_min
82+
tm.Unix.tm_sec
83+
(int_of_float (1000.0 *. msec))
7984

8085
(** [escape str] efficiently escapes non-printable characters and in addition
8186
the backslash character. The function is efficient in the sense that it will

ocaml/libs/log/debug.mli

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ val with_thread_named : string -> ('a -> 'b) -> 'a -> 'b
3131

3232
module type BRAND = sig val name : string end
3333

34+
val gettimestring : unit -> string
35+
(** The current time of day in a format suitable for logging *)
36+
3437
val set_facility : Syslog.facility -> unit
3538
(** Set the syslog facility that will be used by this program. *)
3639

ocaml/libs/log/dune

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
fmt
1010
mtime
1111
logs
12-
ptime
13-
ptime.clock
1412
threads.posix
1513
xapi-backtrace
1614
unix

ocaml/quicktest/qt.ml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,20 +180,25 @@ module VDI = struct
180180

181181
let test_vdi_name_description = "VDI for storage quicktest"
182182

183-
let make rpc session_id ?(virtual_size = 4194304L) sR =
183+
let make rpc session_id ?(virtual_size = Int64.(mul (mul 4L 1024L) 1024L))
184+
?backing_format sR =
185+
let sm_config =
186+
match backing_format with Some x -> [("image-format", x)] | None -> []
187+
in
184188
Client.Client.VDI.create ~sR ~session_id ~rpc
185189
~name_label:test_vdi_name_label
186190
~name_description:test_vdi_name_description ~_type:`user ~sharable:false
187191
~read_only:false ~virtual_size ~xenstore_data:[] ~other_config:[] ~tags:[]
188-
~sm_config:[]
192+
~sm_config
189193

190194
let with_destroyed rpc session_id self f =
191195
Xapi_stdext_pervasives.Pervasiveext.finally f (fun () ->
192196
Client.Client.VDI.destroy ~rpc ~session_id ~self
193197
)
194198

195-
let with_new rpc session_id ?(virtual_size = 4194304L) sr f =
196-
let self = make rpc session_id ~virtual_size sr in
199+
let with_new rpc session_id ?(virtual_size = Int64.(mul (mul 4L 1024L) 1024L))
200+
?backing_format sr f =
201+
let self = make rpc session_id ~virtual_size ?backing_format sr in
197202
with_destroyed rpc session_id self (fun () -> f self)
198203

199204
let with_any rpc session_id sr_info f =

ocaml/quicktest/qt.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ module VDI : sig
7373
rpc
7474
-> API.ref_session
7575
-> ?virtual_size:int64
76+
-> ?backing_format:string
7677
-> API.ref_SR
7778
-> (API.ref_VDI -> 'a)
7879
-> 'a

ocaml/quicktest/qt_filter.mli

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ module SR : sig
6868
val not_type : string -> srs -> srs
6969
(** Filters out SRs of the given type *)
7070

71+
val is_smapiv1 : Qt.sr_info -> bool
72+
(** Whether this is a v1 (true) or v3+ (false) SR *)
73+
7174
val smapiv1 : srs -> srs
7275
(** Selects SMAPIv1 SRs *)
7376

0 commit comments

Comments
 (0)