mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
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:
parent
e44bcae9f0
commit
a55a5e7cfe
@ -196,6 +196,10 @@ load_profile(virSecurityManagerPtr mgr,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virCommandAddEnvFormat(cmd,
|
||||||
|
"LIBVIRT_LOG_OUTPUTS=%d:stderr",
|
||||||
|
virLogGetDefaultPriority());
|
||||||
|
|
||||||
virCommandSetInputBuffer(cmd, xml);
|
virCommandSetInputBuffer(cmd, xml);
|
||||||
rc = virCommandRun(cmd, NULL);
|
rc = virCommandRun(cmd, NULL);
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
#include "virbuffer.h"
|
#include "virbuffer.h"
|
||||||
#include "viralloc.h"
|
#include "viralloc.h"
|
||||||
#include "vircommand.h"
|
#include "vircommand.h"
|
||||||
|
#include "virlog.h"
|
||||||
|
|
||||||
#include "security_driver.h"
|
#include "security_driver.h"
|
||||||
#include "security_apparmor.h"
|
#include "security_apparmor.h"
|
||||||
@ -1272,6 +1273,9 @@ main(int argc, char **argv)
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Initialize the log system */
|
||||||
|
virLogSetFromEnv();
|
||||||
|
|
||||||
/* clear the environment */
|
/* clear the environment */
|
||||||
environ = NULL;
|
environ = NULL;
|
||||||
if (setenv("PATH", "/sbin:/usr/sbin", 1) != 0)
|
if (setenv("PATH", "/sbin:/usr/sbin", 1) != 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user