util: remove some no-op thread functions

Neither virThreadInitialize or virThreadOnExit do anything since we
dropped the Win32 threads impl, in favour of win-pthreads with:

  commit 0240d94c36
  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>
This commit is contained in:
Daniel P. Berrangé 2019-09-16 17:44:23 +01:00
parent f73e62a17c
commit 2c535e50f5
23 changed files with 9 additions and 58 deletions

View 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();

View 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:

View File

@ -3174,7 +3174,6 @@ virRWLockWrite;
virThreadCancel;
virThreadCreateFull;
virThreadID;
virThreadInitialize;
virThreadIsSelf;
virThreadJoin;
virThreadSelf;

View 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);

View 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);

View 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);

View 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);

View 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);

View 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);

View File

@ -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);

View 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) \

View 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;

View 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)) {

View 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();

View File

@ -214,9 +214,6 @@ mymain(void)
return EXIT_AM_SKIP;
#endif
if (virThreadInitialize() < 0)
return EXIT_FAILURE;
virEventRegisterDefaultImpl();
if (testQemuDataInit(&data) < 0)

View File

@ -203,9 +203,6 @@ mymain(void)
return EXIT_AM_SKIP;
#endif
if (virThreadInitialize() < 0)
return EXIT_FAILURE;
virEventRegisterDefaultImpl();
if (testQemuDataInit(&data) < 0)

View 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;
}

View 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();

View 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();

View 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();

View 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");

View 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();

View 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)