]> xenbits.xensource.com Git - libvirt.git/commitdiff
remote: daemon: Make sure that JSON symbols are properly loaded at startup
authorPeter Krempa <pkrempa@redhat.com>
Wed, 1 Aug 2018 10:51:10 +0000 (12:51 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 1 Aug 2018 12:32:40 +0000 (14:32 +0200)
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>
src/libvirt_private.syms
src/remote/remote_daemon.c

index fc386e1699d334ec8b754ee6c77a70f1f6903ef1..70dfcc5e29546e5215d9c92a47a1ef3d7e25be8f 100644 (file)
@@ -2135,6 +2135,10 @@ virJSONValueObjectStealObject;
 virJSONValueToString;
 
 
+# util/virjsoncompat.h
+virJSONInitialize;
+
+
 # util/virkeycode.h
 virKeycodeSetTypeFromString;
 virKeycodeSetTypeToString;
index 9f3a5f38ad8625569bafe568a044fad0d6b947f7..8bbc3818bb5b99659bf4429f894141359e5f5493 100644 (file)
@@ -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) {