From 2e8315d0699d051ad77d9c8f667bad7669ead44b Mon Sep 17 00:00:00 2001
Message-Id: <2e8315d0699d051ad77d9c8f667bad7669ead44b.1375465853.git.jdenemar@redhat.com>
From: "Daniel P. Berrange" <berrange@redhat.com>
Date: Fri, 2 Aug 2013 12:15:15 +0100
Subject: [PATCH] Ensure LXC/QEMU APIs set the filename for errors
https://bugzilla.redhat.com/show_bug.cgi?id=991348
The virLibConnError macros in libvirt-lxc.c and
libvirt-qemu.c were passing NULL for the filename.
This causes a crash if the logging code is configured
to use journald.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
(cherry picked from commit cb3868f701bda3e3f71f9161b4a7f19106600fa6)
---
src/libvirt-lxc.c | 6 +++---
src/libvirt-qemu.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/libvirt-lxc.c b/src/libvirt-lxc.c
index da69dce..c8cdcea 100644
--- a/src/libvirt-lxc.c
+++ b/src/libvirt-lxc.c
@@ -35,12 +35,12 @@
#define VIR_FROM_THIS VIR_FROM_NONE
-#define virLibConnError(conn, error, info) \
- virReportErrorHelper(VIR_FROM_NONE, error, NULL, __FUNCTION__, \
+#define virLibConnError(conn, error, info) \
+ virReportErrorHelper(VIR_FROM_NONE, error, __FILE__, __FUNCTION__, \
__LINE__, info)
#define virLibDomainError(domain, error, info) \
- virReportErrorHelper(VIR_FROM_DOM, error, NULL, __FUNCTION__, \
+ virReportErrorHelper(VIR_FROM_DOM, error, __FILE__, __FUNCTION__, \
__LINE__, info)
/**
diff --git a/src/libvirt-qemu.c b/src/libvirt-qemu.c
index 2a1432b..83fb3b3 100644
--- a/src/libvirt-qemu.c
+++ b/src/libvirt-qemu.c
@@ -29,12 +29,12 @@
#define VIR_FROM_THIS VIR_FROM_NONE
-#define virLibConnError(conn, error, info) \
- virReportErrorHelper(VIR_FROM_NONE, error, NULL, __FUNCTION__, \
+#define virLibConnError(conn, error, info) \
+ virReportErrorHelper(VIR_FROM_NONE, error, __FILE__, __FUNCTION__, \
__LINE__, info)
#define virLibDomainError(domain, error, info) \
- virReportErrorHelper(VIR_FROM_DOM, error, NULL, __FUNCTION__, \
+ virReportErrorHelper(VIR_FROM_DOM, error, __FILE__, __FUNCTION__, \
__LINE__, info)
/**
--
1.8.3.2