From 6af1a94b4237f9df6e51d7ee66a230ea533c06b7 Mon Sep 17 00:00:00 2001 From: Pau Ruiz Safont Date: Tue, 8 Oct 2024 13:50:51 +0100 Subject: [PATCH] fixup! maintenance: avoid deprecated bindings in uuidm 0.9.9 --- ocaml/libs/vhd/vhd_format/f.ml | 2 +- ocaml/libs/xapi-inventory/lib/inventory.ml | 2 +- ocaml/xapi-guard/test/cache_test.ml | 4 +++- ocaml/xapi-guard/test/xapi_guard_test.ml | 2 +- ocaml/xapi-idl/lib/uuidm_rpc_type.ml | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ocaml/libs/vhd/vhd_format/f.ml b/ocaml/libs/vhd/vhd_format/f.ml index 233ccba7808..ff9c48ff672 100644 --- a/ocaml/libs/vhd/vhd_format/f.ml +++ b/ocaml/libs/vhd/vhd_format/f.ml @@ -102,7 +102,7 @@ let _gib_shift = 30 let blank_uuid = Uuidm.nil -let new_uuid = Uuidm.v4_gen (Random.get_state ()) +let new_uuid = Uuidm.v4_gen (Random.State.make_self_init ()) module Feature = struct type t = Temporary diff --git a/ocaml/libs/xapi-inventory/lib/inventory.ml b/ocaml/libs/xapi-inventory/lib/inventory.ml index 7c25e93fdc3..cbaf739f9dd 100644 --- a/ocaml/libs/xapi-inventory/lib/inventory.ml +++ b/ocaml/libs/xapi-inventory/lib/inventory.ml @@ -52,7 +52,7 @@ let inventory = Hashtbl.create 10 let inventory_m = Mutex.create () -let new_uuid = Uuidm.v4_gen (Random.get_state ()) +let new_uuid = Uuidm.v4_gen (Random.State.make_self_init ()) (* Compute the minimum necessary inventory file contents *) let minimum_default_entries () = diff --git a/ocaml/xapi-guard/test/cache_test.ml b/ocaml/xapi-guard/test/cache_test.ml index 6c9adea22fb..6a29e00b32a 100644 --- a/ocaml/xapi-guard/test/cache_test.ml +++ b/ocaml/xapi-guard/test/cache_test.ml @@ -180,7 +180,9 @@ let to_cache with_read_writes = let* () = Lwt.pause () in loop_and_stop f name uuid max sent in - let vms = List.init 4 (fun _ -> Uuidm.v4_gen (Random.get_state ()) ()) in + let vms = + List.init 4 (fun _ -> Uuidm.v4_gen (Random.State.make_self_init ()) ()) + in List.concat [ diff --git a/ocaml/xapi-guard/test/xapi_guard_test.ml b/ocaml/xapi-guard/test/xapi_guard_test.ml index 683cf863897..280d9f4d627 100644 --- a/ocaml/xapi-guard/test/xapi_guard_test.ml +++ b/ocaml/xapi-guard/test/xapi_guard_test.ml @@ -60,7 +60,7 @@ let xapi_rpc call = | _ -> Fmt.failwith "XAPI RPC call %s not expected in test" call.Rpc.name -let vm_uuid = Uuidm.v4_gen (Random.get_state ()) () +let vm_uuid = Uuidm.v4_gen (Random.State.make_self_init ()) () let vm_uuid_str = Uuidm.to_string vm_uuid diff --git a/ocaml/xapi-idl/lib/uuidm_rpc_type.ml b/ocaml/xapi-idl/lib/uuidm_rpc_type.ml index 24a93fa13b6..90acf208bc6 100644 --- a/ocaml/xapi-idl/lib/uuidm_rpc_type.ml +++ b/ocaml/xapi-idl/lib/uuidm_rpc_type.ml @@ -6,7 +6,7 @@ module Uuidm = struct Rpc.Types.Abstract { aname= "uuid" - ; test_data= [Uuidm.v4_gen (Random.get_state ()) ()] + ; test_data= [Uuidm.v4_gen (Random.State.make_self_init ()) ()] ; rpc_of= (fun t -> Rpc.String (Uuidm.to_string t)) ; of_rpc= (function