[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] Ensure LXC/QEMU APIs set the filename for errors



From: "Daniel P. Berrange" <berrange redhat com>

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>
---
 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.1.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]