mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
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:
parent
f73e62a17c
commit
2c535e50f5
@ -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();
|
||||
|
@ -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:
|
||||
|
@ -3174,7 +3174,6 @@ virRWLockWrite;
|
||||
virThreadCancel;
|
||||
virThreadCreateFull;
|
||||
virThreadID;
|
||||
virThreadInitialize;
|
||||
virThreadIsSelf;
|
||||
virThreadJoin;
|
||||
virThreadSelf;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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) \
|
||||
|
@ -1292,9 +1292,6 @@ mymain(void)
|
||||
int timer = -1;
|
||||
int virinitret;
|
||||
|
||||
if (virThreadInitialize() < 0)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
if (chdir("/tmp") < 0)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
|
@ -321,8 +321,6 @@ mymain(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (virThreadInitialize() < 0)
|
||||
return EXIT_FAILURE;
|
||||
char *debugEnv = getenv("LIBVIRT_DEBUG");
|
||||
if (debugEnv && *debugEnv &&
|
||||
(virLogSetDefaultPriority(virLogParseDefaultPriority(debugEnv)) < 0)) {
|
||||
|
@ -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();
|
||||
|
@ -214,9 +214,6 @@ mymain(void)
|
||||
return EXIT_AM_SKIP;
|
||||
#endif
|
||||
|
||||
if (virThreadInitialize() < 0)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
virEventRegisterDefaultImpl();
|
||||
|
||||
if (testQemuDataInit(&data) < 0)
|
||||
|
@ -203,9 +203,6 @@ mymain(void)
|
||||
return EXIT_AM_SKIP;
|
||||
#endif
|
||||
|
||||
if (virThreadInitialize() < 0)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
virEventRegisterDefaultImpl();
|
||||
|
||||
if (testQemuDataInit(&data) < 0)
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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");
|
||||
|
@ -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();
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user