summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Krempa <pkrempa@redhat.com>2018-08-01 12:51:10 +0200
committerPeter Krempa <pkrempa@redhat.com>2018-08-01 14:32:40 +0200
commit3251fc9c9b9639c3fec3181530599415523d671a (patch)
treebaf0578131d5bd52504381bcc3aef11a1366cc6d
parent9e44c2db8ad94d3c20acc1d081538c280af198b4 (diff)
downloadlibvirt-3251fc9c9b9639c3fec3181530599415523d671a.tar.gz
remote: daemon: Make sure that JSON symbols are properly loaded at startup
Explicitly call virJSONInitialize at startup of the libvirt daemon so that we are sure that the symbols in the compat library are properly loaded. This will prevent any random failure from happening later on when the daemon would want to use the JSON parser. Signed-off-by: Peter Krempa <pkrempa@redhat.com>
-rw-r--r--src/libvirt_private.syms4
-rw-r--r--src/remote/remote_daemon.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index fc386e1699..70dfcc5e29 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -2135,6 +2135,10 @@ virJSONValueObjectStealObject;
virJSONValueToString;
+# util/virjsoncompat.h
+virJSONInitialize;
+
+
# util/virkeycode.h
virKeycodeSetTypeFromString;
virKeycodeSetTypeToString;
diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c
index 9f3a5f38ad..8bbc3818bb 100644
--- a/src/remote/remote_daemon.c
+++ b/src/remote/remote_daemon.c
@@ -59,6 +59,7 @@
#include "virutil.h"
#include "virgettext.h"
#include "util/virnetdevopenvswitch.h"
+#include "virjsoncompat.h"
#include "driver.h"
@@ -1183,6 +1184,9 @@ int main(int argc, char **argv) {
exit(EXIT_FAILURE);
}
+ if (virJSONInitialize() < 0)
+ exit(EXIT_FAILURE);
+
daemonSetupNetDevOpenvswitch(config);
if (daemonSetupAccessManager(config) < 0) {