diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index ed73ab0ac7..92fb2bbd1d 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -2250,7 +2250,9 @@ int main(int argc, char *argv[]) if (setlocale(LC_ALL, "") == NULL || bindtextdomain(PACKAGE, LOCALEDIR) == NULL || - textdomain(PACKAGE) == NULL) { + textdomain(PACKAGE) == NULL || + virThreadInitialize() < 0 || + virErrorInitialize() < 0) { fprintf(stderr, _("%s: initialization failed\n"), argv[0]); exit(EXIT_FAILURE); } diff --git a/src/util/virlog.c b/src/util/virlog.c index bf88f26e34..694da89c32 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -547,6 +547,9 @@ virLogDefineFilter(const char *match, virCheckFlags(VIR_LOG_STACK_TRACE, -1); + if (virLogInitialize() < 0) + return -1; + if ((match == NULL) || (priority < VIR_LOG_DEBUG) || (priority > VIR_LOG_ERROR)) return -1; @@ -662,6 +665,9 @@ virLogDefineOutput(virLogOutputFunc f, virCheckFlags(0, -1); + if (virLogInitialize() < 0) + return -1; + if (f == NULL) return -1;