From 522776ed4c082e9443b6005b15c23c59de716bba Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 13 Jan 2010 15:22:28 -0500 Subject: [PATCH] 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. --- src/util/util.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 */ -- GitLab