Skip to content

Commit 5a50d0c

Browse files
author
David Scott
committed
SR.ls: filter out Volumes which are the clone-on-boot temporary clones
Signed-off-by: David Scott <[email protected]>
1 parent 92c0a70 commit 5a50d0c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

main.ml

+7
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,13 @@ let process root_dir name x =
400400
let args = Storage.Volume.Types.SR.Ls.In.rpc_of_t args in
401401
fork_exec_rpc root_dir (script root_dir name `Volume "SR.ls") args Storage.Volume.Types.SR.Ls.Out.t_of_rpc
402402
>>= fun response ->
403+
(* Filter out volumes which are clone-on-boot transients *)
404+
let transients = List.fold ~f:(fun set x ->
405+
match List.Assoc.find x.Storage.Volume.Types.keys _clone_on_boot_key with
406+
| None -> set
407+
| Some transient -> Set.add set transient
408+
) ~init:(Set.empty ~comparator:String.comparator) response in
409+
let response = List.filter ~f:(fun x -> not(Set.mem transients x.Storage.Volume.Types.key)) response in
403410
let response = List.map ~f:vdi_of_volume response in
404411
Deferred.Result.return (R.success (Args.SR.Scan.rpc_of_response response))
405412
| { R.name = "VDI.create"; R.params = [ args ] } ->

0 commit comments

Comments
 (0)