File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -769,20 +769,35 @@ let assert_can_be_recovered ~__context ~self ~session_to =
769769
770770let required_list_of_SRs ~__context ~self ~session_to =
771771 let required_SR_list = list_required_SRs ~__context ~self in
772+ let required_SR_uuids = List. map( fun sr ->Db.SR. get_uuid ~__context ~self: sr) required_SR_list
773+ in
772774 try
775+ let sr_uuids_list=
776+ debug " AKSHAY" ;
773777 Server_helpers. exec_with_new_task ~session_id: session_to
774778 " Looking for the required SRs"
775- (fun __context_to -> List. filter
776- ( fun sr_ref ->
777- let pbds = Db.SR. get_PBDs ~__context:__context_to ~self: sr_ref in
779+ (fun __context_to -> List. filter
780+ ( fun sr_uuid ->
781+ try
782+ let sr = Db.SR. get_by_uuid ~__context:__context_to ~uuid: sr_uuid in
783+ let pbds = Db.SR. get_PBDs ~__context:__context_to ~self: sr in
778784 let attached_pbds = List. filter
779785 (fun pbd -> Db.PBD. get_currently_attached ~__context:__context_to ~self: pbd)
780786 pbds
781787 in
782788 if attached_pbds = [] then true else false
789+ with Db_exn. Read_missing_uuid (_ , _ , sr_uuid ) -> true
783790 )
784- required_SR_list)
791+ required_SR_uuids)
792+ in
793+ List. map(fun sr -> Db.SR. get_by_uuid ~__context ~uuid: sr)sr_uuids_list
785794 with e -> raise e;;
795+ (* (* Finally pass a reference of the SRs*)
796+ List.map(fun sr-> Db.SR.get_by_uuid ~__context ~uuid:sr_uuid)required_SR_uuids
797+ with Db_exn.Read_missing_uuid(_ , _ , sr_uuid) ->
798+ (* Add that SR to the required_SR_list*)
799+ List.map(fun sr -> Db.SR.get_by_uuid ~__context ~uuid:sr_uuid)required_SR_uuids*)
800+
786801
787802(* BIOS strings *)
788803
You can’t perform that action at this time.
0 commit comments