Get more libvirt errors from virt-aa-helper

Initializing libvirt log in virt-aa-helper and getting it to output
libvirt log to stderr. This will help debugging problems happening in
libvirt functions called from within virt-aa-helper
This commit is contained in:
Cédric Bosdonnat 2015-06-25 10:36:52 +02:00
parent e44bcae9f0
commit a55a5e7cfe
2 changed files with 8 additions and 0 deletions

View File

@ -196,6 +196,10 @@ load_profile(virSecurityManagerPtr mgr,
}
}
virCommandAddEnvFormat(cmd,
"LIBVIRT_LOG_OUTPUTS=%d:stderr",
virLogGetDefaultPriority());
virCommandSetInputBuffer(cmd, xml);
rc = virCommandRun(cmd, NULL);

View File

@ -41,6 +41,7 @@
#include "virbuffer.h"
#include "viralloc.h"
#include "vircommand.h"
#include "virlog.h"
#include "security_driver.h"
#include "security_apparmor.h"
@ -1272,6 +1273,9 @@ main(int argc, char **argv)
exit(EXIT_FAILURE);
}
/* Initialize the log system */
virLogSetFromEnv();
/* clear the environment */
environ = NULL;
if (setenv("PATH", "/sbin:/usr/sbin", 1) != 0)