]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: Initialize hooks at daemon shutdown if no hooks defined
authorOsier Yang <jyang@redhat.com>
Thu, 28 Apr 2011 06:48:26 +0000 (14:48 +0800)
committerOsier Yang <jyang@redhat.com>
Thu, 28 Apr 2011 06:48:26 +0000 (14:48 +0800)
We support to initialize the hooks at daemon reload if there is no
hooks script is defined, we should also support initialize the hooks
at daemon shutdown if no hooks is defined.

To address bz: https://bugzilla.redhat.com/show_bug.cgi?id=688859

src/util/hooks.c

index a409d773e1d40dd8121b04ff7aee2de75d437f9c..30e20acc070bec1ba2ba4122cd4e371fd4f4f966 100644 (file)
@@ -209,7 +209,8 @@ virHookCall(int driver, const char *id, int op, int sub_op, const char *extra,
      */
     if ((virHooksFound == -1) ||
         ((driver == VIR_HOOK_DRIVER_DAEMON) &&
-         (op == VIR_HOOK_DAEMON_OP_RELOAD)))
+         (op == VIR_HOOK_DAEMON_OP_RELOAD ||
+         op == VIR_HOOK_DAEMON_OP_SHUTDOWN)))
         virHookInitialize();
 
     if ((virHooksFound & (1 << driver)) == 0)