]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: remove some no-op thread functions
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 16 Sep 2019 16:44:23 +0000 (17:44 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 19 Sep 2019 11:50:21 +0000 (12:50 +0100)
Neither virThreadInitialize or virThreadOnExit do anything since we
dropped the Win32 threads impl, in favour of win-pthreads with:

  commit 0240d94c36c8ce0e7c35b5be430acd9ebf5adcfa
  Author: Daniel P. Berrange <berrange@redhat.com>
  Date:   Wed Jan 22 16:17:10 2014 +0000

      Remove windows thread implementation in favour of pthreads

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
23 files changed:
src/libvirt-admin.c
src/libvirt.c
src/libvirt_private.syms
src/locking/lock_daemon.c
src/logging/log_daemon.c
src/lxc/lxc_controller.c
src/network/leaseshelper.c
src/security/virt-aa-helper.c
src/util/iohelper.c
src/util/virthread.c
src/util/virthread.h
tests/commandtest.c
tests/eventtest.c
tests/qemuagenttest.c
tests/qemucapabilitiestest.c
tests/qemucaps2xmltest.c
tests/qemucapsprobe.c
tests/qemuhotplugtest.c
tests/qemumigparamstest.c
tests/qemumonitorjsontest.c
tests/seclabeltest.c
tests/testutils.c
tests/viratomictest.c

index 9d5c5b1b7b7ac64cd20c4e42d3813c31c914904b..091473e698a378912e67c4f30202875cacbf3fc0 100644 (file)
@@ -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();
index 15917cba6faac2ea0c22060bc09801d62571d011..8aad20e4d40285a4d634b0682b786c5b583320b0 100644 (file)
@@ -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:
index 4865edaf593ae9267bbd861872a5c538a90f3656..9510686ebf47e7dd21f5fc7295645bacbee7cdfb 100644 (file)
@@ -3174,7 +3174,6 @@ virRWLockWrite;
 virThreadCancel;
 virThreadCreateFull;
 virThreadID;
-virThreadInitialize;
 virThreadIsSelf;
 virThreadJoin;
 virThreadSelf;
index edb61d74c08e61408e6d98414f1232294934b950..a5a3a97e99f7c25e772d3fd42c23ea1e354165e7 100644 (file)
@@ -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);
index 85c58aaa7b88ecb4d45360b48f5ffcc7a8682ff1..96217021384e083ce005168b767fd8fca813b02b 100644 (file)
@@ -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);
index c677eb8f6db8071f90486ac1512cc93a8ed609ee..37851bf284e51281e6e35bf99269092d0a134404 100644 (file)
@@ -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);
index 5e04e16171d112f4d8cc60de9fb82823a7ca3973..46482ad3ceed1cd3f5910dc2e4036b19cb37fd77 100644 (file)
@@ -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);
index 326cfaf52a04c4c408b5c8f572abe5b713c43715..ead4eaa236a10c9fdc9af13ef73d3bff40f485de 100644 (file)
@@ -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);
index ddc338b7c7473d94e2d42b04d8067cd915e41e26..f3d45b9c03f330b59cce110bfb7f053938d70263 100644 (file)
@@ -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);
index 05b5572f5f46431d43961c0811b017292d377853..cdc5cab60489be40f74d9fe4927daf460473f274 100644 (file)
 #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);
index 7870340c476370d1a909f8f6f1f4edf38d04bf01..6bbc09fa13df2dfa4063e77d20fb46f6a8f82609 100644 (file)
@@ -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) \
index a382bb6dd2ea2f27fc97453a7dabd96142ad7873..c6fd826003868c18708ce4fe91164fb82429cde4 100644 (file)
@@ -1292,9 +1292,6 @@ mymain(void)
     int timer = -1;
     int virinitret;
 
-    if (virThreadInitialize() < 0)
-        return EXIT_FAILURE;
-
     if (chdir("/tmp") < 0)
         return EXIT_FAILURE;
 
index df7570bac6ad0571f34981b1402b795702f20c49..f426469d213b8777c3d146db238437be6bcc1e3f 100644 (file)
@@ -321,8 +321,6 @@ mymain(void)
         }
     }
 
-    if (virThreadInitialize() < 0)
-        return EXIT_FAILURE;
     char *debugEnv = getenv("LIBVIRT_DEBUG");
     if (debugEnv && *debugEnv &&
         (virLogSetDefaultPriority(virLogParseDefaultPriority(debugEnv)) < 0)) {
index 91f19644d5780239bd2b23ba20668514c074757a..5ae098efa901e5533047754f565c718b50cd2cb0 100644 (file)
@@ -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();
index 67f57a4fdccf5006780b981810bd08474d12c1e5..1a785d8e3938b16ecd366f2166acd5b6f41c6590 100644 (file)
@@ -214,9 +214,6 @@ mymain(void)
     return EXIT_AM_SKIP;
 #endif
 
-    if (virThreadInitialize() < 0)
-        return EXIT_FAILURE;
-
     virEventRegisterDefaultImpl();
 
     if (testQemuDataInit(&data) < 0)
index 3b381251a0e50fbe4bb3cc1ffaffed9c020786af..e36ba06eeb5579724c9e813d36b5ffb3a3fe5148 100644 (file)
@@ -203,9 +203,6 @@ mymain(void)
     return EXIT_AM_SKIP;
 #endif
 
-    if (virThreadInitialize() < 0)
-        return EXIT_FAILURE;
-
     virEventRegisterDefaultImpl();
 
     if (testQemuDataInit(&data) < 0)
index ae016c47c2e11dc2538f7134b12235afa55f2a2a..36af01d561f3c8fbfa2c8213370d7cf3198c2f54 100644 (file)
@@ -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;
     }
index 3c177c6622fd3963f52c0706a4a934fe0a49d02b..76b131295ad74c1af1f5e2ce85c05cae434b4255 100644 (file)
@@ -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();
index dcefde2dbc3fcfc1ca491dec57f81ff50cb753b1..aacb9056396f86a0e4cff156784caa439056a269 100644 (file)
@@ -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();
index af84e0ba0485295dce06c929e1986d067b428a55..d0bbb1f6746d68b6b86ffacaa8f1c150909a15af 100644 (file)
@@ -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();
index a0296c787eed940dccfca7c274b71e1a3ac49599..42dcb8c97ff2f7be2205ec470c760e3ee9f06beb 100644 (file)
@@ -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");
index 064460b4dcbcf16652cf0dc382565d0de30e7317..1b663f9d5d334e34949c5ec33492a9049fba03c6 100644 (file)
@@ -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();
index 52f17154e9d96567df1334c7540a010b04aae5a4..a933ab1cbd686773b4faf460dd648543ca11d1ee 100644 (file)
@@ -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)