Skip to content
Merged
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
25 changes: 13 additions & 12 deletions ocaml/xapi/xapi_sr.ml
Original file line number Diff line number Diff line change
Expand Up @@ -170,20 +170,21 @@ let get_pbds ~__context ~self ~attached ~master_pos =
| `Last -> slave_pbds @ master_pbds

let call_probe ~__context ~host ~device_config ~_type ~sm_config ~f =
debug "SR.probe sm_config=[ %s ]" (String.concat "; " (List.map (fun (k, v) -> k ^ " = " ^ v) sm_config));
let _type = String.lowercase_ascii _type in
let open Storage_interface in
let open Storage_access in
Xapi_clustering.with_clustering_lock_if_needed ~__context ~sr_sm_type:_type
(fun () ->
Xapi_clustering.assert_cluster_host_is_enabled_for_matching_sms ~__context ~host ~sr_sm_type:_type;

let queue = !Storage_interface.queue_name ^ "." ^ _type in
let uri () = Storage_interface.uri () ^ ".d/" ^ _type in
let rpc = external_rpc queue uri in
let module Client = Storage_interface.Client(struct let rpc = rpc end) in
let dbg = Context.string_of_task __context in
debug "SR.probe sm_config=[ %s ]" (String.concat "; " (List.map (fun (k, v) -> k ^ " = " ^ v) sm_config));
let _type = String.lowercase_ascii _type in

transform_storage_exn
(fun () ->
Client.SR.probe ~dbg ~queue ~device_config ~sm_config |> f
let queue = !Storage_interface.queue_name ^ "." ^ _type in
let uri () = Storage_interface.uri () ^ ".d/" ^ _type in
let rpc = Storage_access.external_rpc queue uri in
let module Client = Storage_interface.Client(struct let rpc = rpc end) in
let dbg = Context.string_of_task __context in

Storage_access.transform_storage_exn
(fun () -> Client.SR.probe ~dbg ~queue ~device_config ~sm_config |> f )
)

let probe = call_probe ~f:(
Expand Down