File tree Expand file tree Collapse file tree 9 files changed +26
-1
lines changed Expand file tree Collapse file tree 9 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -1190,6 +1190,12 @@ module StorageAPI (R : RPC) = struct
11901190 in
11911191 declare " DATA.MIRROR.is_mirror_failed" []
11921192 (dbg_p @-> id_p @-> sr_p @-> returning mirror_failed_p err)
1193+
1194+ let list =
1195+ let result_p =
1196+ Param. mk ~name: " mirrors" TypeCombinators. (list (pair Mirror. (id, t)))
1197+ in
1198+ declare " DATA.MIRROR.list" [] (dbg_p @-> returning result_p err)
11931199 end
11941200 end
11951201
@@ -1302,6 +1308,8 @@ module type MIRROR = sig
13021308
13031309 val is_mirror_failed :
13041310 context -> dbg :debug_info -> mirror_id :Mirror .id -> sr :Sr .t -> bool
1311+
1312+ val list : context -> dbg :debug_info -> (Mirror .id * Mirror .t ) list
13051313end
13061314
13071315module type Server_impl = sig
@@ -1782,6 +1790,7 @@ module Server (Impl : Server_impl) () = struct
17821790 S.DATA.MIRROR. is_mirror_failed (fun dbg mirror_id sr ->
17831791 Impl.DATA.MIRROR. is_mirror_failed () ~dbg ~mirror_id ~sr
17841792 ) ;
1793+ S.DATA.MIRROR. list (fun dbg -> Impl.DATA.MIRROR. list () ~dbg ) ;
17851794 S.DATA. import_activate (fun dbg dp sr vdi vm ->
17861795 Impl.DATA. import_activate () ~dbg ~dp ~sr ~vdi ~vm
17871796 ) ;
Original file line number Diff line number Diff line change @@ -188,6 +188,8 @@ module DATA = struct
188188
189189 let is_mirror_failed ctx ~dbg ~mirror_id ~sr =
190190 u " DATA.MIRROR.is_mirror_failed"
191+
192+ let list ctx ~dbg = u " DATA.MIRROR.list"
191193 end
192194end
193195
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ let string_of_file filename =
149149
150150let mirror_list common_opts =
151151 wrap common_opts (fun () ->
152- let list = Storage_migrate. list ~ dbg in
152+ let list = Client.DATA.MIRROR. list dbg in
153153 List. iter
154154 (fun (id , status ) -> Printf. printf " %s" (string_of_mirror id status))
155155 list
Original file line number Diff line number Diff line change @@ -1929,6 +1929,7 @@ let bind ~volume_script_dir =
19291929 S.DATA.MIRROR. receive_cancel2 (u " DATA.MIRROR.receive_cancel2" ) ;
19301930 S.DATA.MIRROR. pre_deactivate_hook (u " DATA.MIRROR.pre_deactivate_hook" ) ;
19311931 S.DATA.MIRROR. is_mirror_failed (u " DATA.MIRROR.is_mirror_failed" ) ;
1932+ S.DATA.MIRROR. list (u " DATA.MIRROR.list" ) ;
19321933 S.DP. create (u " DP.create" ) ;
19331934 S.TASK. cancel (u " TASK.cancel" ) ;
19341935 S.TASK. list (u " TASK.list" ) ;
Original file line number Diff line number Diff line change @@ -863,6 +863,11 @@ module Mux = struct
863863
864864 let is_mirror_failed _ctx ~dbg :_ ~mirror_id :_ ~sr :_ =
865865 u " DATA.MIRROR.is_mirror_failed"
866+
867+ let list () ~dbg =
868+ with_dbg ~name: " DATA.MIRROR.list" ~dbg @@ fun di ->
869+ info " %s dbg: %s" __FUNCTION__ dbg ;
870+ Storage_migrate. list ~dbg: di.log
866871 end
867872 end
868873
Original file line number Diff line number Diff line change @@ -1161,6 +1161,8 @@ module SMAPIv1 : Server_impl = struct
11611161 let pre_deactivate_hook _context ~dbg :_ ~dp :_ ~sr :_ ~vdi :_ = assert false
11621162
11631163 let is_mirror_failed _context ~dbg :_ ~mirror_id :_ ~sr :_ = assert false
1164+
1165+ let list _context ~dbg :_ = assert false
11641166 end
11651167 end
11661168
Original file line number Diff line number Diff line change @@ -825,4 +825,6 @@ module MIRROR : SMAPIv2_MIRROR = struct
825825 )
826826 | _ ->
827827 false
828+
829+ let list _ctx = u __FUNCTION__
828830end
Original file line number Diff line number Diff line change @@ -1224,6 +1224,8 @@ functor
12241224 u __FUNCTION__
12251225
12261226 let is_mirror_failed _context ~dbg :_ ~mirror_id :_ ~sr :_ = u __FUNCTION__
1227+
1228+ let list _context ~dbg :_ = u __FUNCTION__
12271229 end
12281230 end
12291231
Original file line number Diff line number Diff line change @@ -42,4 +42,6 @@ module MIRROR : SMAPIv2_MIRROR = struct
4242 let is_mirror_failed _ctx = u __FUNCTION__
4343
4444 let pre_deactivate_hook _ctx = u __FUNCTION__
45+
46+ let list _ctx = u __FUNCTION__
4547end
You can’t perform that action at this time.
0 commit comments