Permalink
Browse files

CA-90263: Don't get the SR UUID for each VDI when resynchronising VDI…

… activations.

Signed-off-by: John Else <john.else@citrix.com>
  • Loading branch information...
1 parent 7aa3934 commit e6a4b29b3ed908785fe1fdd6a1cb9740791c8c26 @johnelse johnelse committed with jonludlam Sep 20, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 ocaml/xapi/storage_access.ml
View
3 ocaml/xapi/storage_access.ml
@@ -1075,9 +1075,10 @@ let refresh_local_vdi_activations ~__context =
let dbg = Ref.string_of (Context.get_task_id __context) in
let srs = Client.SR.list dbg in
+ let sr_uuids = List.map (fun sr -> (sr, Db.SR.get_uuid ~__context ~self:sr)) (Db.SR.get_all ~__context) in
List.iter
(fun (vdi_ref, vdi_rec) ->
- let sr = Db.SR.get_uuid ~__context ~self:vdi_rec.API.vDI_SR in
+ let sr = List.assoc vdi_rec.API.vDI_SR sr_uuids in
let vdi = vdi_rec.API.vDI_location in
if List.mem sr srs
then

0 comments on commit e6a4b29

Please sign in to comment.