Skip to content

Commit c7cbd15

Browse files
authored
meta: reformat (#25)
This needed to have a comment to be moved to avoid the ocamlformat from being confused
2 parents b3f6f0a + d941b70 commit c7cbd15

11 files changed

Lines changed: 56 additions & 31 deletions

File tree

oxenstored/config.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ let parse_line stream =
6565
try
6666
let line = trim_spaces (input_line stream) in
6767
if String.length line > 0 && line.[0] <> '#' then
68-
match to_config line with
68+
match
69+
to_config line
70+
with
6971
| None ->
7072
read_filter_line ()
7173
| Some x ->

oxenstored/connection.ml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,9 @@ let lookup_watch_perm path = function
433433
try
434434
Store.Path.apply root path @@ fun parent name ->
435435
Store.Node.get_perms parent
436-
::
437-
( try [Store.Node.get_perms (Store.Node.find parent name)]
438-
with Not_found -> []
439-
)
436+
:: ( try [Store.Node.get_perms (Store.Node.find parent name)]
437+
with Not_found -> []
438+
)
440439
with Define.Invalid_path | Not_found -> []
441440
)
442441

@@ -491,7 +490,9 @@ let fire_single_watch source (oldroot, root) depth watch =
491490
if watch.path.[0] = '@' then
492491
true
493492
else
494-
match watch.depth with
493+
match
494+
watch.depth
495+
with
495496
| None ->
496497
true
497498
| Some x when x >= depth - watch.path_depth ->
@@ -523,14 +524,14 @@ let fire_watch source roots watch path depth =
523524
(* Search for a valid unused transaction id. *)
524525
let rec valid_transaction_id con proposed_id =
525526
(*
526-
* Clip proposed_id to the range [1, 0x3ffffffe]
527-
*
528-
* The chosen id must not trucate when written into the uint32_t tx_id
529-
* field, and needs to fit within the positive range of a 31 bit ocaml
530-
* integer to function when compiled as 32bit.
531-
*
532-
* Oxenstored therefore supports only 1 billion open transactions.
533-
*)
527+
* Clip proposed_id to the range [1, 0x3ffffffe]
528+
*
529+
* The chosen id must not trucate when written into the uint32_t tx_id
530+
* field, and needs to fit within the positive range of a 31 bit ocaml
531+
* integer to function when compiled as 32bit.
532+
*
533+
* Oxenstored therefore supports only 1 billion open transactions.
534+
*)
534535
let id =
535536
if proposed_id <= 0 || proposed_id >= 0x3fffffff then 1 else proposed_id
536537
in

oxenstored/connections.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ let add_watch cons con path token depth =
178178
( if is_special_watch then
179179
(* No depth can be specified for @releaseDomain/domid watches.
180180
Only depth=1 can be specified for other special watches *)
181-
match depth with
181+
match
182+
depth
183+
with
182184
| Some _ when String.starts_with ~prefix:"@releaseDomain/" apath ->
183185
raise
184186
(Invalid_argument

oxenstored/domains.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ let load_plug fname =
2424
let fail_with fmt = Printf.ksprintf failwith fmt in
2525
let fname = Dynlink.adapt_filename fname in
2626
if Sys.file_exists fname then
27-
try Dynlink.loadfile fname with
27+
try
28+
Dynlink.loadfile fname
29+
with
2830
| Dynlink.Error err as e ->
2931
error "ERROR loading plugin '%s': %s\n%!" fname
3032
(Dynlink.error_message err) ;

oxenstored/process.ml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,9 @@ module LiveUpdate = struct
232232
let should_run cons =
233233
let t = !state in
234234
if t.pending then (
235-
match Connections.prevents_quit cons with
235+
match
236+
Connections.prevents_quit cons
237+
with
236238
| [] ->
237239
true
238240
| _ when Unix.gettimeofday () < t.deadline ->
@@ -792,8 +794,9 @@ let do_introduce con t domains cons data =
792794
if Domains.exist domains domid then (
793795
let edom = Domains.find domains domid in
794796
if Domain.get_mfn edom = mfn && Connections.find_domain cons domid != con
795-
then (* Use XS_INTRODUCE for recreating the xenbus event-channel. *)
797+
then
796798
Domain.rebind_evtchn edom remote_port ;
799+
(* Use XS_INTRODUCE for recreating the xenbus event-channel. *)
797800
edom
798801
) else
799802
try

oxenstored/store.ml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,9 @@ module Path = struct
152152
else if s = "/" then
153153
[]
154154
else
155-
match String.split '/' s with
155+
match
156+
String.split '/' s
157+
with
156158
| "" :: path when is_valid path ->
157159
path
158160
| _ ->
@@ -216,7 +218,9 @@ module Path = struct
216218
if path = [] then
217219
Some rnode
218220
else
219-
try Some (lookup_get rnode path) with Define.Doesnt_exist -> None
221+
try
222+
Some (lookup_get rnode path)
223+
with Define.Doesnt_exist -> None
220224

221225
(* get the deepest existing node for this path, return the node and a flag on the existence of the full path *)
222226
let rec get_deepest_existing_node node = function

oxenstored/transaction.ml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,21 @@ let test_coalesce oldroot currentroot optpath =
8383

8484
let can_coalesce oldroot currentroot path =
8585
if !do_coalesce then
86-
try test_coalesce oldroot currentroot path with _ -> false
86+
try
87+
test_coalesce oldroot currentroot path
88+
with _ -> false
8789
else
8890
false
8991

9092
type ty =
9193
| No
92-
| Full of (int * (* Transaction id *)
93-
Store.t * (* Original store *)
94-
Store.t)
94+
| Full of
95+
( int
96+
* (* Transaction id *)
97+
Store.t
98+
* (* Original store *)
99+
Store.t
100+
)
95101
(* A pointer to the canonical store: its root changes on each transaction-commit *)
96102

97103
type t = {

oxenstored/trie.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ let rec map f tree =
6868
tree
6969
|> StringMap.map aux
7070
|> StringMap.filter (fun _ n ->
71-
n.Node.value <> None || not (StringMap.is_empty n.Node.children)
72-
)
71+
n.Node.value <> None || not (StringMap.is_empty n.Node.children)
72+
)
7373

7474
let rec fold f tree acc =
7575
let aux key node accu =

oxenstored/xenstored.ml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,8 @@ module DB = struct
326326
Event.dump evtchn chan ;
327327

328328
(* dump connections related to domains: domid, mfn, eventchn port/ sockets, and watches *)
329-
Connections.iter cons (fun con -> Connection.dump con chan) ;
329+
Connections.iter cons (fun con -> Connection.dump con chan
330+
) ;
330331

331332
(* dump the store *)
332333
Store.dump_fct store (fun path node ->
@@ -660,7 +661,9 @@ let main () =
660661
let elapsed = Unix.gettimeofday () -. now in
661662
debug "periodic_ops took %F seconds." elapsed ;
662663
( if !quit then
663-
match Connections.prevents_quit cons with
664+
match
665+
Connections.prevents_quit cons
666+
with
664667
| [] ->
665668
()
666669
| domains ->

xenbus/xb.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,9 @@ let open_mmap mmap notifyfct ~under_testing =
361361

362362
let close con ~under_testing =
363363
if not under_testing then
364-
match con.backend with
364+
match
365+
con.backend
366+
with
365367
| Fd backend ->
366368
Unix.close backend.fd
367369
| Xenmmap backend ->

0 commit comments

Comments
 (0)