SHA256
1
0
forked from pool/libvirt
libvirt/a55a5e7-virt-aa-helper-log.patch
Cédric Bosdonnat 37e0137a03 Accepting request 315860 from home:cbosdonnat:branches:Virtualization
Tue Jul  10 13:29:51 UTC 2015 - cbosdonnat@suse.com
- Fixed virt-aa-helper bugs preventing virt-sandbox to work.
  24f3c2f-virt-aa-helper-fix-caps.patch
  61dab0f-virt-aa-helper-renaming.patch
  a55a5e7-virt-aa-helper-log.patch
  e44bcae-virt-aa-helper-trailing-slash.patch
  bsc#936841
- Fixed crasher due to uninitialized values
  qemu-nbd-cleanup-fix.patch bsc#936841

OBS-URL: https://build.opensuse.org/request/show/315860
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=470
2015-07-10 12:21:25 +00:00

54 lines
1.6 KiB
Diff

From a55a5e7cfed57223820478da89422756121fb37c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <cbosdonnat@suse.com>
Date: Thu, 25 Jun 2015 10:36:52 +0200
Subject: [PATCH 2/5] 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
---
src/security/security_apparmor.c | 4 ++++
src/security/virt-aa-helper.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c
index 4134a17..16b8f87 100644
--- a/src/security/security_apparmor.c
+++ b/src/security/security_apparmor.c
@@ -196,6 +196,10 @@ load_profile(virSecurityManagerPtr mgr,
}
}
+ virCommandAddEnvFormat(cmd,
+ "LIBVIRT_LOG_OUTPUTS=%d:stderr",
+ virLogGetDefaultPriority());
+
virCommandSetInputBuffer(cmd, xml);
rc = virCommandRun(cmd, NULL);
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 18454c8..f8a9cf2 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -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)
--
2.1.4