Skip to content

Commit 0edc07e

Browse files
committed
nbd: use URI type for /var/xapi/xapi socket
Signed-off-by: Christian Pardillo Laursen <[email protected]>
1 parent a09f75b commit 0edc07e

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

ocaml/nbd/lib/consts.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
(** Xapi's local Unix domain socket *)
2-
let xapi_unix_domain_socket_uri = "file:///var/xapi/xapi"
2+
let xapi_unix_domain_socket_uri =
3+
Uri.make ~scheme:"file" ~path:"/var/xapi/xapi" ()
34

45
(** Location of the xensource-inventory file on XenServer *)
56
let xensource_inventory_filename = "/etc/xensource-inventory"

ocaml/nbd/lib/dune

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(library
22
(name consts)
33
(modes best)
4+
(libraries uri)
45
(modules consts)
56
)
67

ocaml/xapi-guard/test/xapi_guard_test.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ let with_rpc f switch () =
8686
Server_interface.make_server_varstored push_nothing ~cache path vm_uuid
8787
in
8888
(* rpc simulates what varstored would do *)
89-
let uri = Uri.make ~scheme:"file" ~path () |> Uri.to_string in
90-
D.debug "Connecting to %s" uri ;
89+
let uri = Uri.make ~scheme:"file" ~path () in
90+
D.debug "Connecting to %s" (Uri.to_string uri) ;
9191
let rpc = make uri in
9292
Lwt.finalize
9393
(fun () ->

ocaml/xen-api-client/lwt/xen_api_lwt_unix.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ let exn_to_string = function
129129
Printexc.to_string e
130130

131131
let do_it uri string =
132-
let uri = Uri.of_string uri in
133132
let connection = M.make uri in
134133
Lwt.finalize
135134
(fun () ->
@@ -179,7 +178,7 @@ module SessionCache = struct
179178

180179
let make_rpc ?timeout target =
181180
let uri = Uri.with_path target "/jsonrpc" in
182-
make_json ?timeout @@ Uri.to_string @@ uri
181+
make_json ?timeout uri
183182

184183
let create_rpc ?timeout rpc ~uname ~pwd ~version ~originator () =
185184
let acquire () =

ocaml/xen-api-client/lwt/xen_api_lwt_unix.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
* GNU Lesser General Public License for more details.
1313
*)
1414

15-
val make : ?timeout:float -> string -> Rpc.call -> Rpc.response Lwt.t
15+
val make : ?timeout:float -> Uri.t -> Rpc.call -> Rpc.response Lwt.t
1616
(** [make ?timeout uri] returns an 'rpc' function which can be
1717
passed to Client.* functions *)
1818

19-
val make_json : ?timeout:float -> string -> Rpc.call -> Rpc.response Lwt.t
19+
val make_json : ?timeout:float -> Uri.t -> Rpc.call -> Rpc.response Lwt.t
2020
(** [make ?timeout uri] returns an 'rpc' function which can be
2121
passed to Client.* functions *)
2222

0 commit comments

Comments
 (0)