Skip to content

Commit

Permalink
New hook to execute before xapi shuts down
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Liu <[email protected]>
  • Loading branch information
Vincent-lau committed Sep 10, 2024
1 parent e72b173 commit ca7a981
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ocaml/xapi/xapi_hooks.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ let scriptname__host_pre_declare_dead = "host-pre-declare-dead"

let scriptname__host_post_declare_dead = "host-post-declare-dead"

let scriptname__xapi_pre_shutdown = "xapi-pre-shutdown"

(* Host Script hook reason codes *)
let reason__fenced = "fenced"

Expand Down Expand Up @@ -127,6 +129,12 @@ let host_pre_declare_dead ~__context ~host ~reason =
()
)

let xapi_pre_shutdown ~__context ~host ~reason =
info "%s Running xapi pre shutdown hooks for %s" __FUNCTION__
(Ref.string_of host) ;
execute_host_hook ~__context ~script_name:scriptname__xapi_pre_shutdown
~reason ~host

(* Called when host died -- !! hook code in here to abort outstanding forwarded ops *)
let internal_host_dead_hook __context host =
info "Running host dead hook for %s" (Ref.string_of host) ;
Expand Down

0 comments on commit ca7a981

Please sign in to comment.