From: Osier Yang Date: Thu, 28 Apr 2011 06:48:26 +0000 (+0800) Subject: util: Initialize hooks at daemon shutdown if no hooks defined X-Git-Tag: v0.9.1~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32398e128205c92ed72b04b25279c9a4e5cb5e02;p=thirdparty%2Flibvirt.git util: Initialize hooks at daemon shutdown if no hooks defined 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 --- diff --git a/src/util/hooks.c b/src/util/hooks.c index a409d773e1..30e20acc07 100644 --- a/src/util/hooks.c +++ b/src/util/hooks.c @@ -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)