Skip to content

Commit 31944c9

Browse files
authored
Merge master to feature/trusted-certs (#7010)
```diff commit 4da9ef6 Merge: 1c49383 043e6bd Author: Ming Lu <ming.lu@cloud.com> Date: Wed Apr 15 09:56:22 2026 +0800 Merge branch 'master' into private/mingl/feature/trusted-certs diff --cc ocaml/idl/datamodel_common.ml index 93a3fbc,0fe08b11c..25e689f --- a/ocaml/idl/datamodel_common.ml +++ b/ocaml/idl/datamodel_common.ml @@@ -3,21 -3,21 +3,21 @@@ open Datamodel_types open Lifecycle open Datamodel_roles (* IMPORTANT: Please bump schema vsn if you change/add/remove a _field_. You do not have to bump vsn if you change/add/remove a message When introducing a new release, bump the schema minor version to the next hundred to leave a gap for potential hotfixes needing to increment the schema version.*) let schema_major_vsn = 5 - let schema_minor_vsn = 794 -let schema_minor_vsn = 901 ++let schema_minor_vsn = 902 (* Historical schema versions just in case this is useful later *) let rio_schema_major_vsn = 5 let rio_schema_minor_vsn = 19 let miami_release_schema_major_vsn = 5 let miami_release_schema_minor_vsn = 35 diff --cc ocaml/idl/schematest.ml index e92f9e9,c963c8f11..a7fc9bd --- a/ocaml/idl/schematest.ml +++ b/ocaml/idl/schematest.ml @@@ -1,16 -1,16 +1,16 @@@ let hash x = Digest.string x |> Digest.to_hex (* BEWARE: if this changes, check that schema has been bumped accordingly in ocaml/idl/datamodel_common.ml, usually schema_minor_vsn *) - let last_known_schema_hash = "ce90c659723cbcd5265e4dd856802b74" -let last_known_schema_hash = "32bbba07579ca8844fa6162164530268" ++let last_known_schema_hash = "a64e7e1133a10add1b39d22cd6bbc352" let current_schema_hash : string = let open Datamodel_types in let hash_of_obj x = List.map rpc_of_content x.contents |> List.map Jsonrpc.to_string |> String.concat "" |> hash in Datamodel.all_system |> List.map hash_of_obj |> String.concat ":" |> hash
2 parents 1c49383 + 4da9ef6 commit 31944c9

117 files changed

Lines changed: 1729 additions & 1098 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ _coverage/
77
*.swp
88
compile_flags.txt
99
_opam
10+
**/*.[ch]~
11+
.zed/
1012

1113
# tests
1214
xapi-db.xml

doc/content/design/external-auth-ldaps.md

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ Given `ldaps` default to `false`, this feature is **NOT** enabled until explicit
9191

9292
#### 3.1.2 Error code
9393
Following new error codes added to indicate ldaps enable related error
94-
- AUTH_NO_CERT, no certs can be used for ldaps, refer to 4.1.2 for certs finding.
95-
- AUTH_INVALID_CERT, found certs, but none of the certs can be used to connect to DC
94+
- POOL_AUTH_ENABLE_FAILED_NO_CERTS, no certs can be used for ldaps, refer to 4.1.2 for certs finding.
95+
- POOL_AUTH_ENABLE_FAILED_INVALID_CERTS, found certs, but none of the certs can be used to connect to DC
96+
**Note**: Current error code handing infrustrucure requires the error code prefix with POOL_AUTH_ENABLE_FAILED
9697

9798
### 3.2 Set/Get Pool LDAPS Status
9899

@@ -137,7 +138,7 @@ This API may raise following errors
137138
- AUTH_NO_CERT, no certs found to enable ldaps, refer to 4.1.2 for certs finding
138139
- AUTH_INVALID_CERT, found certs, but none of the certs can be used to connect to DC
139140
- AUTH_IS_DISABLED, AD is not enabled
140-
- AUTH_LDAPS_PING_FAILED, failed to do ldaps query on all DCs with valid certs
141+
- AUTH_SET_LDAPS_FAILED, Failed to set ldaps, the error message contains the details like ldap query on domain failed
141142

142143
#### 3.2.2 Get Pool LDAPS Status
143144

@@ -211,24 +212,6 @@ This design is following [trusted-certificates.md](https://github.com/xapi-proje
211212
- `pool.external_auth_set_ldaps` API
212213
- (Re)join domain
213214

214-
### 4.2 Xapi Configuration
215-
216-
#### 4.2.1 winbind-tls-verify-peer
217-
218-
For security, xapi asks winbind to verify CA certificate. `ca_and_name_if_available` is the default.
219-
220-
However, user may want to disable this verification for debug purpose.
221-
222-
`winbind-tls-verify-peer` is introduced for xapi configuration, and the possible values are `no_check`, `ca_only`, `ca_and_name_if_available`, `ca_and_name` and `as_strict_as_possible`.
223-
The configured value will override `tls verify peer` value in xapi generated samba configuration. Refer to [smb.conf](https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html) for the details.
224-
225-
226-
**Note:** This item is not intended for public documentation. This is only for debug purpose, or system tuning for specific scenarios from engineering/support team.
227-
228-
#### 4.2.2 ad-warning-message-interval
229-
230-
xapi sends warning message to user with this interval on LDAP query failure. Default to 1 week. Refer to section "Session revalidate" for the details.
231-
232215
## 5. Session Revalidate
233216

234217
xapi LDAP queries domain user status (if user has been added to manage XenServer) at configurable interval, and destroys the session created by domain user if user no longer in healthy status.
@@ -238,23 +221,11 @@ However, the LDAP query may fail due to various issues as follows:
238221
- Temporary network issues
239222
- CA certificate is not properly configured, or expired, etc.
240223

241-
Instead of destroying user session for stability, a warning message will be sent to user with the details at configurable interval `ad-warning-message-interval`.
242-
243-
- If no LDAP error, do nothing
244-
- If error happens, send the warning message if:
245-
- first time see the error through xapi start up (so no need to persist last send time) or
246-
- `current_time - last_sent_time > winbind_warning_message_interval`
247-
248-
The message is defined as follows:
249-
- name: AD_DC_LDAP_CHECK
250-
- priority: Warning
251-
- cls: `Host
252-
- Body: LDAP(S) query check to `<DC>` of `<domain>` failed from `<host>` of `<pool>`
224+
Instead of destroying user session for stability, a warning will be printed in xensource.log
253225

254226
Note:
255227
- The backend session revalidate check only performs on pool coordinator, thus the backend LDAP(S) query check only on coordinator
256228
- `external_auth_set_ldaps` perform LDAP(S) query check on every host
257-
- All previous AD_DC_LDAP_CHECK warning of a host will be cleaned on a successful LDAP(s) query from that host
258229

259230
## 6. Pool Join/Leave
260231

dune-project

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@
179179
(xapi-types
180180
(= :version))
181181
(xapi-stdext-zerocheck
182+
(= :version))
183+
(xapi-work-queues
182184
(= :version)))
183185
(synopsis "A CLI for xapi storage services")
184186
(description
@@ -191,7 +193,8 @@
191193
(name xapi-schema))
192194

193195
(package
194-
(name xapi-work-queues))
196+
(name xapi-work-queues)
197+
(depends ppx_deriving_rpc xapi-stdext-threads))
195198

196199
(package
197200
(name rrdd-plugin)
@@ -235,6 +238,7 @@
235238
fmt
236239
logs
237240
mtime
241+
rpclib
238242
(xapi-stdext-pervasives (= :version))))
239243

240244
(package
@@ -326,6 +330,7 @@
326330
xapi-stdext-pervasives
327331
xapi-stdext-unix
328332
xapi-stdext-zerocheck
333+
xapi-work-queues
329334
xen-api-client
330335
xen-api-client-lwt
331336
xenctrl
@@ -364,6 +369,7 @@
364369
rrdd-plugin
365370
xapi-stdext-std
366371
xapi-tracing-export
372+
xapi-work-queues
367373
xen-api-client
368374
(alcotest :with-test)
369375
(ppx_deriving_rpc :with-test)
@@ -482,6 +488,8 @@
482488
(= :version))
483489
(xapi-types
484490
(= :version))
491+
(xapi-work-queues
492+
(= :version))
485493
(xen-api-client-lwt
486494
(= :version))
487495
xenctrl ; for quicktest

ocaml/database/dune

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
httpsvr
5454
unix
5555
uuid
56-
backtrace
5756
xapi-datamodel
5857
xapi-log
5958
(re_export xapi-schema)

ocaml/database/parse_db_conf.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,9 @@ let parse_db_conf s =
173173
sanity_check !connections ;
174174
!connections
175175
with exn ->
176+
let bt = Printexc.get_raw_backtrace () in
176177
error "Database config parse failed: %s" (Printexc.to_string exn) ;
177-
Backtrace.reraise exn Cannot_parse_database_config_file
178+
Printexc.raise_with_backtrace Cannot_parse_database_config_file bt
178179

179180
let get_db_conf path =
180181
if Sys.file_exists path then

ocaml/forkexecd/lib/dune

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
rpclib.xml
1313
unix
1414
uuid
15-
backtrace
1615
xapi-log
1716
xapi-stdext-pervasives
1817
xapi-stdext-unix

ocaml/forkexecd/lib/fe_systemctl.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ let start_transient ?env ?properties ?(exec_ty = Type.Simple) ~service cmd args
158158
) ;
159159
try start_transient ?env ?properties ~exec_ty ~service cmd args
160160
with e ->
161-
Backtrace.is_important e ;
161+
let bt = Printexc.get_raw_backtrace () in
162162
(* If start failed we do not know what state the service is in:
163163
* try to stop it and clean up.
164164
* Stopping could fail as well, in which case report the original exception.
@@ -168,4 +168,4 @@ let start_transient ?env ?properties ?(exec_ty = Type.Simple) ~service cmd args
168168
()
169169
with _ -> ()
170170
) ;
171-
raise e
171+
Printexc.raise_with_backtrace e bt

ocaml/gencert/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
rresult
1919
unix
2020
x509
21-
backtrace
21+
xapi-log.backtrace
2222
xapi-consts
2323
xapi-log
2424
xapi-inventory

ocaml/idl/datamodel.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11037,7 +11037,7 @@ let http_actions =
1103711037
; ( "get_vm_rrds"
1103811038
, ( Get
1103911039
, "/vm_rrds"
11040-
, true
11040+
, false
1104111041
, [String_query_arg "uuid"; Bool_query_arg "json"]
1104211042
, _R_READ_ONLY
1104311043
, []
@@ -11054,7 +11054,7 @@ let http_actions =
1105411054
)
1105511055
(* For XC < 8460 compatibility, remove when out of support *)
1105611056
; ( "get_host_rrds"
11057-
, (Get, "/host_rrds", true, [Bool_query_arg "json"], _R_READ_ONLY, [])
11057+
, (Get, "/host_rrds", false, [Bool_query_arg "json"], _R_READ_ONLY, [])
1105811058
)
1105911059
; ( Constants.get_sr_rrd
1106011060
, ( 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 = 794
13+
let schema_minor_vsn = 902
1414

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

0 commit comments

Comments
 (0)