From: Cole Robinson Date: Wed, 13 Jan 2010 20:22:28 +0000 (-0500) Subject: util: Make sure virExec hook failures are raised X-Git-Tag: v0.7.6~189 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=522776ed4c082e9443b6005b15c23c59de716bba;p=thirdparty%2Flibvirt.git 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. --- diff --git a/src/util/util.c b/src/util/util.c index ba6b0dbbca..45ca65750a 100644 --- a/src/util/util.c +++ b/src/util/util.c @@ -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 */