Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ d6ab15362548b8fe270bd14d5153b8d94e1b15c0
b12cf444edea15da6274975e1b2ca6a7fce2a090
364c27f5d18ab9dd31825e67a93efabecad06823
d8b4de9076531dd13bdffa20cc10c72290a52356
bdf06bca7534fbc0c4fc3cee3408a51a22615226

# ocp-indent
d018d26d6acd4707a23288b327b49e44f732725e
Expand Down
32 changes: 16 additions & 16 deletions ocaml/database/db_cache_impl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -482,24 +482,24 @@ let spawn_db_flush_threads () =
try
Thread.delay Db_backend.db_FLUSH_TIMER ;
(* If I have some writing capacity left in this write period then consider doing a write; or
if the connection is not write-limited then consider doing a write too.
We also have to consider doing a write if exit_on_next_flush is set: because when this is
set (by a signal handler) we want to do a flush whether or not our write limit has been
exceeded.
if the connection is not write-limited then consider doing a write too.
We also have to consider doing a write if exit_on_next_flush is set: because when this is
set (by a signal handler) we want to do a flush whether or not our write limit has been
exceeded.
*)
(* always flush straight away; this request is urgent
otherwise, we only write if
(i) "coalesscing period has come to an end"; and
(ii) "write limiting requirements are met": *)
( if
!Db_connections.exit_on_next_flush
(* always flush straight away; this request is urgent *)
|| (* otherwise, we only write if (i) "coalesscing period has come to an end"; and (ii) "write limiting requirements are met": *)
(not (in_coallescing_period ()))
(* see (i) above *)
&& (!my_writes_this_period
< dbconn.Parse_db_conf.write_limit_write_cycles
|| dbconn.Parse_db_conf.mode
= Parse_db_conf.No_limit
(* (ii) above *)
)
then (* debug "[%s] considering flush" db_path; *)
|| (not (in_coallescing_period ()))
&& (!my_writes_this_period
< dbconn.Parse_db_conf.write_limit_write_cycles
|| dbconn.Parse_db_conf.mode
= Parse_db_conf.No_limit
)
then
let was_anything_flushed =
Xapi_stdext_threads.Threadext.Mutex.execute
Db_lock.global_flush_mutex (fun () ->
Expand All @@ -509,7 +509,7 @@ let spawn_db_flush_threads () =
if was_anything_flushed then (
my_writes_this_period := !my_writes_this_period + 1 ;
(* when we do a write, reset the coallesce_period_start to now -- recall that this
variable tracks the time since last write *)
variable tracks the time since last write *)
coallesce_period_start := Unix.gettimeofday ()
)
) ;
Expand Down
8 changes: 4 additions & 4 deletions ocaml/database/db_secret_string.mli
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
*)

(* Prevent direct conversions to string to avoid accidental misuse.
* It is still possible to convert it to Rpc.t and recover it that way,
* it is not a protection against willfully recovering the protected string
* (we do need to send these as parameters in RPCs).
* *)
It is still possible to convert it to Rpc.t and recover it that way,
it is not a protection against willfully recovering the protected string
(we do need to send these as parameters in RPCs).
*)

(** a type with no direct conversions to string *)
type t
Expand Down
10 changes: 5 additions & 5 deletions ocaml/forkexecd/lib/fe_systemctl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ let show ~service =
let stop ~service =
action ~service "stop" ;
(* Stopping shouldn't fail because it should fall back to SIGKILL which should almost always work,
* unless there is a kernel bug that keeps a process stuck.
* In the unlikely scenario that this does fail we leave the transient service file behind
* so that the failure can be investigated.
* *)
unless there is a kernel bug that keeps a process stuck.
In the unlikely scenario that this does fail we leave the transient service file behind
so that the failure can be investigated.
*)
let status = show ~service in
(* allow systemd to garbage-collect the status and the unit, preventing leaks.
* See CollectMode in systemd.unit(5) for details. *)
Expand Down Expand Up @@ -162,7 +162,7 @@ let start_transient ?env ?properties ?(exec_ty = Type.Simple) ~service cmd args
(* If start failed we do not know what state the service is in:
* try to stop it and clean up.
* Stopping could fail as well, in which case report the original exception.
* *)
*)
( try
let (_ : status) = stop ~service in
()
Expand Down
2 changes: 1 addition & 1 deletion ocaml/forkexecd/src/child.ml
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ let run state comms_sock fd_sock fd_sock_path =
let (_ : int list) = Unix.sigprocmask Unix.SIG_BLOCK [Sys.sigchld] in

(* First test whether the child has exited - if it has then report this
* via the socket and exit. *)
* via the socket and exit. *)
match Unix.waitpid [Unix.WNOHANG] result with
| pid, status when pid = result ->
report_child_exit comms_sock args result status ;
Expand Down
7 changes: 4 additions & 3 deletions ocaml/libs/pciutil/pciutil.ml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ let parse_from file vendor device =
let vendor_str = ref (unknown_vendor vendor)
and device_str = ref (unknown_device device) in
(* CA-26771: As we parse the file we keep track of the current vendor.
When we find a device match we only accept it if it's from the right vendor; it doesn't make
sense to pair vendor 2's device with vendor 1. *)
When we find a device match we only accept it if it's from the right
vendor; it doesn't make sense to pair vendor 2's device with vendor 1. *)
let current_xvendor = ref "" in
Unixext.readfile_line
(fun line ->
(* ignore subvendors/subdevices, blank lines and comments *)
if line = "" || line.[0] = '#' || (line.[0] = '\t' && line.[1] = '\t')
then (* ignore subvendors/subdevices, blank lines and comments *)
then
()
else if line.[0] = '\t' then (
if
Expand Down
24 changes: 12 additions & 12 deletions ocaml/libs/tracing/tracing_export.mli
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
(*
* Copyright (C) 2024 Cloud Software Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; version 2.1 only. with the special
* exception on linking described in file LICENSE.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*)
* Copyright (C) 2024 Cloud Software Group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; version 2.1 only. with the special
* exception on linking described in file LICENSE.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*)

(** [Tracing_export] is a module dedicated for the creation and management of
threads that export the tracing data.
Expand Down
2 changes: 1 addition & 1 deletion ocaml/networkd/bin/network_monitor_thread.ml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ let get_link_stats () =
in
List.map (fun link -> standardise_name (Link.get_name link)) links
|> (* Only keep interfaces with prefixes on the whitelist, and exclude VLAN
devices (ethx.y). *)
devices (ethx.y). *)
List.filter (fun name -> is_whitelisted name && not (is_vlan name))
in
Cache.free cache ; Socket.close s ; Socket.free s ; links
Expand Down
14 changes: 7 additions & 7 deletions ocaml/xapi-aux/kerberos_encryption_types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
(* Kerberos support several different encrytion types
* winbind support it as strong, legacy and all
* details, https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html
* *)
*)

module Winbind = struct
type t = Strong | Legacy | All

(*
* [X] 0x00000001 DES-CBC-CRC
* [X] 0x00000002 DES-CBC-MD5
* [X] 0x00000004 RC4-HMAC
* [X] 0x00000008 AES128-CTS-HMAC-SHA1-96
* [X] 0x00000010 AES256-CTS-HMAC-SHA1-96
* *)
* [X] 0x00000001 DES-CBC-CRC
* [X] 0x00000002 DES-CBC-MD5
* [X] 0x00000004 RC4-HMAC
* [X] 0x00000008 AES128-CTS-HMAC-SHA1-96
* [X] 0x00000010 AES256-CTS-HMAC-SHA1-96
*)

let des_cbc_crc = 0x1

Expand Down
8 changes: 4 additions & 4 deletions ocaml/xapi-idl/lib/coverage/enabled.ml
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ module Dispatcher = struct
|> (* filter out ourselves *)
List.filter (fun q -> self <> q)
|> (* best-effort: collect and return all non-failed results, log
errors *)
errors *)
List.rev_map (rpc_ignore_err ~t ~body)
|> (* multiple return values converted to a single string, suitable
for use in a command like: mv $(message-cli call
org.xen.xapi.coverage.dispatch --timeout 60 --body 'dump
{jobid}') /tmp/coverage/ *)
for use in a command like: mv $(message-cli call
org.xen.xapi.coverage.dispatch --timeout 60 --body 'dump
{jobid}') /tmp/coverage/ *)
String.concat " "
|> ok
)
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi-types/secretString.mli
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* It is still possible to convert it to Rpc.t and recover it that way,
* it is not a protection against willfully recovering the protected string
* (we do need to send these as parameters in RPCs).
* *)
*)

(** a type with no direct conversions to string *)
type t
Expand Down
16 changes: 8 additions & 8 deletions ocaml/xapi/certificates.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ module D = Debug.Make (struct let name = "certificates" end)
open D

(* Certificate locations:
* a) stunnel external = /etc/xensource/xapi-ssl.pem
* b) stunnel SNI (internal) = /etc/xensource/xapi-pool-tls.pem
* c) user trusted cert folder = /etc/stunnel/certs/
* d) internal trusted cert folder = /etc/stunnel/certs-pool/
* e) appliance trusted bundle = /etc/stunnel/xapi-stunnel-ca-bundle.pem
* f) host-in-pool trusted bundle = /etc/stunnel/xapi-pool-ca-bundle.pem
*
* Note that the bundles (e) and (f) are generated automatically using the contents of (c) and (d) respectively *)
* a) stunnel external = /etc/xensource/xapi-ssl.pem
* b) stunnel SNI (internal) = /etc/xensource/xapi-pool-tls.pem
* c) user trusted cert folder = /etc/stunnel/certs/
* d) internal trusted cert folder = /etc/stunnel/certs-pool/
* e) appliance trusted bundle = /etc/stunnel/xapi-stunnel-ca-bundle.pem
* f) host-in-pool trusted bundle = /etc/stunnel/xapi-pool-ca-bundle.pem
*
* Note that the bundles (e) and (f) are generated automatically using the contents of (c) and (d) respectively *)

type t_trusted = CA_Certificate | CRL

Expand Down
7 changes: 3 additions & 4 deletions ocaml/xapi/extauth_plugin_ADpbis.ml
Original file line number Diff line number Diff line change
Expand Up @@ -942,10 +942,9 @@ module AuthADlw : Auth_signature.AUTH_MODULE = struct
Db.Host.get_external_auth_service_name ~__context ~self:host
)
in
if
List.mem_assoc "domain" config_params
(* legacy test: do we have domain name in config? *)
then (* then config:domain must match service-name *)
(* legacy test: do we have domain name in config?
then config:domain must match service-name *)
if List.mem_assoc "domain" config_params then
let _domain = List.assoc "domain" config_params in
if service_name <> _domain then
raise
Expand Down
10 changes: 5 additions & 5 deletions ocaml/xapi/extauth_plugin_ADwinbind.ml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ module Ldap = struct
(*
* Escape characters according to
* https://docs.microsoft.com/en-gb/windows/win32/adsi/search-filter-syntax?redirectedfrom=MSDN#special-characters
* *)
*)

let reg_star = {|*|} |> Re.str |> Re.compile

Expand Down Expand Up @@ -402,7 +402,7 @@ module Ldap = struct
let* stdout =
try
(* Query KDC instead of use domain here
* Just in case cannot resolve domain name from DNS *)
* Just in case cannot resolve domain name from DNS *)
let args =
[
"ads"
Expand Down Expand Up @@ -553,7 +553,7 @@ module Wbinfo = struct
* Name : UCC
* Alt_Name : ucc.local
* SID : S-1-5-21-2850064427-2368465266-4270348630
* *)
*)
let args = ["--domain-info"; from_name] in
let* stdout = call_wbinfo args in
let key =
Expand Down Expand Up @@ -614,7 +614,7 @@ module Wbinfo = struct
* CHILD1
* GRANDCHILD
* UDDCHILD1
* *)
*)
let args = ["--all-domains"] in
let* stdout = call_wbinfo args in
Ok
Expand Down Expand Up @@ -1655,7 +1655,7 @@ module AuthADWinbind : Auth_signature.AUTH_MODULE = struct
* the joined domain (with 1 way trust ) , just return the default value
* This is NOT a regression issue of PBIS
* PBIS cannot handle such case neither
* *)
*)
debug "Fallback to default value as no DC info in xapi database" ;
Ok default_account
in
Expand Down
4 changes: 2 additions & 2 deletions ocaml/xapi/message_forwarding.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2579,7 +2579,7 @@ functor
forward_vm_op ~local_fn ~__context ~vm
~remote_fn:(fun ~rpc ~session_id ->
(* try InternalAsync.VM.migrate_send first to avoid long running idle stunnel connection
* fall back on Async.VM.migrate_send if slave doesn't support InternalAsync *)
* fall back on Async.VM.migrate_send if slave doesn't support InternalAsync *)
Helpers.try_internal_async ~__context API.ref_VM_of_rpc
(fun () ->
Client.InternalAsync.VM.migrate_send ~rpc ~session_id ~vm
Expand Down Expand Up @@ -6410,7 +6410,7 @@ functor
let remote_fn = Client.Cluster_host.forget ~self in
(* We need to ask another host that has a cluster host to mark it as dead.
* We might've run force destroy and this host would no longer have a cluster host
* *)
*)
let other_hosts =
Db.Cluster.get_cluster_hosts ~__context ~self:cluster
|> List.filter (( <> ) self)
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/vm_evacuation.ml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ let ensure_no_vms ~__context ~rpc ~session_id ~evacuate_timeout =
let shutdown vms =
log_and_ignore_exn (fun () -> clean_shutdown vms) ;
(* We can unplug the PBD if a VM is suspended or halted, but not if
* it is running or paused, i.e. "live" *)
* it is running or paused, i.e. "live" *)
vms
|> List.filter (fun self ->
Xapi_vm_lifecycle_helpers.is_live ~__context ~self
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/xapi_clustering.ml
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ let assert_cluster_host_quorate ~__context ~self =
* achieved quorum yet if we have just booted and haven't seen enough hosts.
* Do this via an API call rather than reading a field in the database, because the field in the
* database could be out of date.
* *)
*)
let result =
Cluster_client.LocalClient.diagnostics (rpc ~__context)
"assert_cluster_host_quorate"
Expand Down
4 changes: 2 additions & 2 deletions ocaml/xapi/xapi_guest_agent.ml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ let ( // ) = Filename.concat
*
* Add support for SR-IOV VF, so there are two kinds of vif_type, either to be
* `vif` or `net-sriov-vf`
* *)
*)
let networks path vif_type (list : string -> string list) =
(* Find all ipv6 addresses under a path. *)
let find_ipv6 path prefix =
Expand Down Expand Up @@ -488,7 +488,7 @@ let all (lookup : string -> string option) (list : string -> string list)
|| guest_metrics_cached.can_use_hotplug_vif <> can_use_hotplug_vif
(* Nb. we're ignoring the memory updates as far as the VM_guest_metrics API object is concerned. We are putting them into an RRD instead *)
(* ||
guest_metrics_cached.memory <> memory)*)
guest_metrics_cached.memory <> memory)*)
then (
let gm =
let existing = Db.VM.get_guest_metrics ~__context ~self in
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/xapi_ha_vm_failover.ml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ end = struct
k x
| Task (task, next) ->
(* similar reasoning as above, when we get the result we need to chain the computations,
* refer to http://okmij.org/ftp/Computation/free-monad.html for a deeper theoretical explanation *)
* refer to http://okmij.org/ftp/Computation/free-monad.html for a deeper theoretical explanation *)
Task (task, fun x -> next x >>= k)
end

Expand Down
6 changes: 3 additions & 3 deletions ocaml/xapi/xapi_host.ml
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,8 @@ let compute_evacuation_plan_wlb ~__context ~self =
if
Db.Host.get_control_domain ~__context ~self:target_host <> v
&& Db.Host.get_uuid ~__context ~self:resident_h = target_uuid
then (* resident host and migration host are the same. Reject this plan *)
(* resident host and migration host are the same. Reject this plan *)
then
raise
(Api_errors.Server_error
( Api_errors.wlb_malformed_response
Expand Down Expand Up @@ -1782,7 +1783,6 @@ let enable_external_auth ~__context ~host ~config ~service_name ~auth_type =
raise (Api_errors.Server_error (Api_errors.auth_unknown_type, [msg]))
) else
(* if no auth_type is currently defined (it is an empty string), then we can set up a new one *)

(* we try to use the configuration to set up the new external authentication service *)

(* we persist as much set up configuration now as we can *)
Expand Down Expand Up @@ -2847,7 +2847,7 @@ let set_iscsi_iqn ~__context ~host ~value =
* when you update the `iscsi_iqn` field we want to update `other_config`,
* but when updating `other_config` we want to update `iscsi_iqn` too.
* we have to be careful not to introduce an infinite loop of updates.
* *)
*)
Db.Host.set_iscsi_iqn ~__context ~self:host ~value ;
Db.Host.add_to_other_config ~__context ~self:host ~key:"iscsi_iqn" ~value ;
Xapi_host_helpers.Configuration.set_initiator_name value
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/xapi_pif.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ let start_of_day_best_effort_bring_up ~__context () =
debug "Configured network backend: %s"
(Network_interface.string_of_kind (Net.Bridge.get_kind dbg ())) ;
(* Clear the state of the network daemon, before refreshing it by plugging
* the most important PIFs (see above). *)
* the most important PIFs (see above). *)
Net.clear_state () ;
List.iter
(fun (pif, pifr) ->
Expand Down
Loading
Loading