diff --git a/src/libvirt-admin.c b/src/libvirt-admin.c index 9d5c5b1b7b7ac64cd20c4e42d3813c31c914904b..091473e698a378912e67c4f30202875cacbf3fc0 100644 --- a/src/libvirt-admin.c +++ b/src/libvirt-admin.c @@ -52,8 +52,7 @@ virAdmGlobalInit(void) * virAdmConnectOpen first. But we can't rely on VIR_DEBUG working * until after initialization is complete, and since this is * one-shot, we never get here again. */ - if (virThreadInitialize() < 0 || - virErrorInitialize() < 0) + if (virErrorInitialize() < 0) goto error; virLogSetFromEnv(); diff --git a/src/libvirt.c b/src/libvirt.c index 15917cba6faac2ea0c22060bc09801d62571d011..8aad20e4d40285a4d634b0682b786c5b583320b0 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -243,8 +243,7 @@ virGlobalInit(void) * virConnectOpen first. But we can't rely on VIR_DEBUG working * until after initialization is complete, and since this is * one-shot, we never get here again. */ - if (virThreadInitialize() < 0 || - virErrorInitialize() < 0) + if (virErrorInitialize() < 0) goto error; virFileActivateDirOverrideForLib(); @@ -365,12 +364,8 @@ DllMain(HINSTANCE instance ATTRIBUTE_UNUSED, break; case DLL_THREAD_ATTACH: - /* Nothing todo in libvirt yet */ - break; - case DLL_THREAD_DETACH: - /* Release per-thread local data */ - virThreadOnExit(); + /* Nothing todo in libvirt yet */ break; case DLL_PROCESS_DETACH: diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 4865edaf593ae9267bbd861872a5c538a90f3656..9510686ebf47e7dd21f5fc7295645bacbee7cdfb 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3174,7 +3174,6 @@ virRWLockWrite; virThreadCancel; virThreadCreateFull; virThreadID; -virThreadInitialize; virThreadIsSelf; virThreadJoin; virThreadSelf; diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c index edb61d74c08e61408e6d98414f1232294934b950..a5a3a97e99f7c25e772d3fd42c23ea1e354165e7 100644 --- a/src/locking/lock_daemon.c +++ b/src/locking/lock_daemon.c @@ -1124,7 +1124,6 @@ int main(int argc, char **argv) { privileged = geteuid() == 0; if (virGettextInitialize() < 0 || - virThreadInitialize() < 0 || virErrorInitialize() < 0) { fprintf(stderr, _("%s: initialization failed\n"), argv[0]); exit(EXIT_FAILURE); diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c index 85c58aaa7b88ecb4d45360b48f5ffcc7a8682ff1..96217021384e083ce005168b767fd8fca813b02b 100644 --- a/src/logging/log_daemon.c +++ b/src/logging/log_daemon.c @@ -896,7 +896,6 @@ int main(int argc, char **argv) { privileged = geteuid() == 0; if (virGettextInitialize() < 0 || - virThreadInitialize() < 0 || virErrorInitialize() < 0) { fprintf(stderr, _("%s: initialization failed\n"), argv[0]); exit(EXIT_FAILURE); diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index c677eb8f6db8071f90486ac1512cc93a8ed609ee..37851bf284e51281e6e35bf99269092d0a134404 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -2505,7 +2505,6 @@ int main(int argc, char *argv[]) ns_fd[i] = -1; if (virGettextInitialize() < 0 || - virThreadInitialize() < 0 || virErrorInitialize() < 0) { fprintf(stderr, _("%s: initialization failed\n"), argv[0]); exit(EXIT_FAILURE); diff --git a/src/network/leaseshelper.c b/src/network/leaseshelper.c index 5e04e16171d112f4d8cc60de9fb82823a7ca3973..46482ad3ceed1cd3f5910dc2e4036b19cb37fd77 100644 --- a/src/network/leaseshelper.c +++ b/src/network/leaseshelper.c @@ -104,7 +104,6 @@ main(int argc, char **argv) program_name = argv[0]; if (virGettextInitialize() < 0 || - virThreadInitialize() < 0 || virErrorInitialize() < 0) { fprintf(stderr, _("%s: initialization failed\n"), program_name); exit(EXIT_FAILURE); diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 326cfaf52a04c4c408b5c8f572abe5b713c43715..ead4eaa236a10c9fdc9af13ef73d3bff40f485de 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -1421,7 +1421,6 @@ main(int argc, char **argv) char *include_file = NULL; if (virGettextInitialize() < 0 || - virThreadInitialize() < 0 || virErrorInitialize() < 0) { fprintf(stderr, _("%s: initialization failed\n"), argv[0]); exit(EXIT_FAILURE); diff --git a/src/util/iohelper.c b/src/util/iohelper.c index ddc338b7c7473d94e2d42b04d8067cd915e41e26..f3d45b9c03f330b59cce110bfb7f053938d70263 100644 --- a/src/util/iohelper.c +++ b/src/util/iohelper.c @@ -196,7 +196,6 @@ main(int argc, char **argv) program_name = argv[0]; if (virGettextInitialize() < 0 || - virThreadInitialize() < 0 || virErrorInitialize() < 0) { fprintf(stderr, _("%s: initialization failed"), program_name); exit(EXIT_FAILURE); diff --git a/src/util/virthread.c b/src/util/virthread.c index 05b5572f5f46431d43961c0811b017292d377853..cdc5cab60489be40f74d9fe4927daf460473f274 100644 --- a/src/util/virthread.c +++ b/src/util/virthread.c @@ -33,16 +33,6 @@ #include "virthreadjob.h" -/* Nothing special required for pthreads */ -int virThreadInitialize(void) -{ - return 0; -} - -void virThreadOnExit(void) -{ -} - int virOnce(virOnceControlPtr once, virOnceFunc init) { return pthread_once(&once->once, init); diff --git a/src/util/virthread.h b/src/util/virthread.h index 7870340c476370d1a909f8f6f1f4edf38d04bf01..6bbc09fa13df2dfa4063e77d20fb46f6a8f82609 100644 --- a/src/util/virthread.h +++ b/src/util/virthread.h @@ -82,9 +82,6 @@ struct virOnceControl { typedef void (*virOnceFunc)(void); -int virThreadInitialize(void) ATTRIBUTE_RETURN_CHECK; -void virThreadOnExit(void); - typedef void (*virThreadFunc)(void *opaque); #define virThreadCreate(thread, joinable, func, opaque) \ diff --git a/tests/commandtest.c b/tests/commandtest.c index a382bb6dd2ea2f27fc97453a7dabd96142ad7873..c6fd826003868c18708ce4fe91164fb82429cde4 100644 --- a/tests/commandtest.c +++ b/tests/commandtest.c @@ -1292,9 +1292,6 @@ mymain(void) int timer = -1; int virinitret; - if (virThreadInitialize() < 0) - return EXIT_FAILURE; - if (chdir("/tmp") < 0) return EXIT_FAILURE; diff --git a/tests/eventtest.c b/tests/eventtest.c index df7570bac6ad0571f34981b1402b795702f20c49..f426469d213b8777c3d146db238437be6bcc1e3f 100644 --- a/tests/eventtest.c +++ b/tests/eventtest.c @@ -321,8 +321,6 @@ mymain(void) } } - if (virThreadInitialize() < 0) - return EXIT_FAILURE; char *debugEnv = getenv("LIBVIRT_DEBUG"); if (debugEnv && *debugEnv && (virLogSetDefaultPriority(virLogParseDefaultPriority(debugEnv)) < 0)) { diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c index 91f19644d5780239bd2b23ba20668514c074757a..5ae098efa901e5533047754f565c718b50cd2cb0 100644 --- a/tests/qemuagenttest.c +++ b/tests/qemuagenttest.c @@ -1431,8 +1431,7 @@ mymain(void) return EXIT_AM_SKIP; #endif - if (virThreadInitialize() < 0 || - qemuTestDriverInit(&driver) < 0) + if (qemuTestDriverInit(&driver) < 0) return EXIT_FAILURE; virEventRegisterDefaultImpl(); diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index 67f57a4fdccf5006780b981810bd08474d12c1e5..1a785d8e3938b16ecd366f2166acd5b6f41c6590 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -214,9 +214,6 @@ mymain(void) return EXIT_AM_SKIP; #endif - if (virThreadInitialize() < 0) - return EXIT_FAILURE; - virEventRegisterDefaultImpl(); if (testQemuDataInit(&data) < 0) diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c index 3b381251a0e50fbe4bb3cc1ffaffed9c020786af..e36ba06eeb5579724c9e813d36b5ffb3a3fe5148 100644 --- a/tests/qemucaps2xmltest.c +++ b/tests/qemucaps2xmltest.c @@ -203,9 +203,6 @@ mymain(void) return EXIT_AM_SKIP; #endif - if (virThreadInitialize() < 0) - return EXIT_FAILURE; - virEventRegisterDefaultImpl(); if (testQemuDataInit(&data) < 0) diff --git a/tests/qemucapsprobe.c b/tests/qemucapsprobe.c index ae016c47c2e11dc2538f7134b12235afa55f2a2a..36af01d561f3c8fbfa2c8213370d7cf3198c2f54 100644 --- a/tests/qemucapsprobe.c +++ b/tests/qemucapsprobe.c @@ -54,8 +54,7 @@ main(int argc, char **argv) return EXIT_FAILURE; } - if (virThreadInitialize() < 0 || - virInitialize() < 0) { + if (virInitialize() < 0) { fprintf(stderr, "Failed to initialize libvirt"); return EXIT_FAILURE; } diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 3c177c6622fd3963f52c0706a4a934fe0a49d02b..76b131295ad74c1af1f5e2ce85c05cae434b4255 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -614,8 +614,7 @@ mymain(void) return EXIT_AM_SKIP; #endif - if (virThreadInitialize() < 0 || - qemuTestDriverInit(&driver) < 0) + if (qemuTestDriverInit(&driver) < 0) return EXIT_FAILURE; virEventRegisterDefaultImpl(); diff --git a/tests/qemumigparamstest.c b/tests/qemumigparamstest.c index dcefde2dbc3fcfc1ca491dec57f81ff50cb753b1..aacb9056396f86a0e4cff156784caa439056a269 100644 --- a/tests/qemumigparamstest.c +++ b/tests/qemumigparamstest.c @@ -209,8 +209,7 @@ mymain(void) return EXIT_AM_SKIP; #endif - if (virThreadInitialize() < 0 || - qemuTestDriverInit(&driver) < 0) + if (qemuTestDriverInit(&driver) < 0) return EXIT_FAILURE; virEventRegisterDefaultImpl(); diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index af84e0ba0485295dce06c929e1986d067b428a55..d0bbb1f6746d68b6b86ffacaa8f1c150909a15af 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -3019,8 +3019,7 @@ mymain(void) return EXIT_AM_SKIP; #endif - if (virThreadInitialize() < 0 || - qemuTestDriverInit(&driver) < 0) + if (qemuTestDriverInit(&driver) < 0) return EXIT_FAILURE; virEventRegisterDefaultImpl(); diff --git a/tests/seclabeltest.c b/tests/seclabeltest.c index a0296c787eed940dccfca7c274b71e1a3ac49599..42dcb8c97ff2f7be2205ec470c760e3ee9f06beb 100644 --- a/tests/seclabeltest.c +++ b/tests/seclabeltest.c @@ -11,9 +11,6 @@ mymain(void) virSecurityManagerPtr mgr; const char *doi, *model; - if (virThreadInitialize() < 0) - return EXIT_FAILURE; - mgr = virSecurityManagerNew(NULL, "QEMU", VIR_SECURITY_MANAGER_DEFAULT_CONFINED); if (mgr == NULL) { fprintf(stderr, "Failed to start security driver"); diff --git a/tests/testutils.c b/tests/testutils.c index 064460b4dcbcf16652cf0dc382565d0de30e7317..1b663f9d5d334e34949c5ec33492a9049fba03c6 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -877,8 +877,7 @@ int virTestMain(int argc, } fprintf(stderr, "TEST: %s\n", progname); - if (virThreadInitialize() < 0 || - virErrorInitialize() < 0) + if (virErrorInitialize() < 0) return EXIT_FAILURE; virLogSetFromEnv(); diff --git a/tests/viratomictest.c b/tests/viratomictest.c index 52f17154e9d96567df1334c7540a010b04aae5a4..a933ab1cbd686773b4faf460dd648543ca11d1ee 100644 --- a/tests/viratomictest.c +++ b/tests/viratomictest.c @@ -164,9 +164,6 @@ mymain(void) { int ret = 0; - if (virThreadInitialize() < 0) - return -1; - if (virTestRun("types", testTypes, NULL) < 0) ret = -1; if (virTestRun("threads", testThreads, NULL) < 0)