util: Make sure virExec hook failures are raised

With the introduction virDispatchError, hook function errors are
never sent through the error callback, so users will never see
these messages.

Fix this by calling virDispatchError after hook failure.
This commit is contained in:
Cole Robinson 2010-01-13 15:22:28 -05:00
parent 5073aa994a
commit 522776ed4c

View File

@ -557,8 +557,11 @@ __virExec(virConnectPtr conn,
}
if (hook)
if ((hook)(data) != 0)
if ((hook)(data) != 0) {
VIR_DEBUG0("Hook function failed.");
virDispatchError(NULL);
_exit(1);
}
/* The steps above may need todo something privileged, so
* we delay clearing capabilities until the last minute */