Skip to content

Commit fb812c8

Browse files
author
David Scott
committed
Fake up SR.stat
This is related to xapi-storage#13 Signed-off-by: David Scott <dave.scott@eu.citrix.com>
1 parent bba9370 commit fb812c8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

main.ml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,14 @@ let process root_dir name x =
336336
fork_exec_rpc root_dir (script root_dir name (`Datapath datapath) "Datapath.detach") args' Storage.D.Types.Datapath.Detach.Out.t_of_rpc
337337
>>= fun response ->
338338
Deferred.Result.return (R.success (Args.VDI.Detach.rpc_of_response ()))
339+
| { R.name = "SR.stat"; R.params = [ args ] } ->
340+
let open Deferred.Result.Monad_infix in
341+
let args = Args.SR.Stat.request_of_rpc args in
342+
Attached_SRs.find args.Args.SR.Stat.sr
343+
>>= fun sr ->
344+
(* FIXME: query the datasources xapi-storage#13 *)
345+
let response = { total_space = 0L; free_space = 0L } in
346+
Deferred.Result.return (R.success (Args.SR.Stat.rpc_of_response response))
339347

340348
| { R.name = name } ->
341349
Deferred.return (Error (backend_error "UNIMPLEMENTED" [ name ])))

0 commit comments

Comments
 (0)