Skip to content

Commit

Permalink
Merge pull request #4927 from robhoes/smapi
Browse files Browse the repository at this point in the history
CA-375427: Make DP.destroy idempotent again
  • Loading branch information
robhoes authored Mar 8, 2023
2 parents a5b1dfc + 9193b45 commit d7f2f6d
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions ocaml/xapi/storage_mux.ml
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,14 @@ module Mux = struct

let destroy _context ~dbg ~dp ~allow_leak =
info "DP.destroy dbg:%s dp:%s allow_leak:%b" dbg dp allow_leak ;
let sr, vdi, vm =
let open DP_info in
match read dp with
| Some x ->
(x.sr, x.vdi, x.vm)
| None ->
failwith "DP not found"
in
destroy2 _context ~dbg ~dp ~sr ~vdi ~vm ~allow_leak
let open DP_info in
match read dp with
| Some {sr; vdi; vm; _} ->
destroy2 _context ~dbg ~dp ~sr ~vdi ~vm ~allow_leak
| None ->
info
"dp %s is not associated with a locally attached VDI; nothing to do"
dp

let diagnostics () = Storage_smapiv1_wrapper.Impl.DP.diagnostics ()

Expand Down

0 comments on commit d7f2f6d

Please sign in to comment.