mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Fix bogus valgrind memory leak warnings in test suite
This commit is contained in:
parent
9322b2e861
commit
ca9af16aa7
@ -1,4 +1,11 @@
|
|||||||
Wed Jan 28 21:33:11 GMT 2009 Daniel P.Berrange <berrange@redhat.com
|
Wed Jan 28 21:53:11 GMT 2009 Daniel P.Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
|
Fix bogus valgrind memory leak warnings
|
||||||
|
* tests/testutils.c: Clear global error upon exit
|
||||||
|
* tests/.valgrind.supp: Ignore memory from thread local
|
||||||
|
error storage
|
||||||
|
|
||||||
|
Wed Jan 28 21:33:11 GMT 2009 Daniel P.Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
Fix RPC portability to Solaris
|
Fix RPC portability to Solaris
|
||||||
* configure.in: s/RPCGEN/HAVE_RPCGEN/ for automake
|
* configure.in: s/RPCGEN/HAVE_RPCGEN/ for automake
|
||||||
|
@ -238,3 +238,18 @@
|
|||||||
fun:virtTestRun
|
fun:virtTestRun
|
||||||
fun:mymain
|
fun:mymain
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
ignoreThreadLocalErrorObject
|
||||||
|
Memcheck:Leak
|
||||||
|
fun:calloc
|
||||||
|
fun:virAlloc
|
||||||
|
fun:virLastErrorObject
|
||||||
|
fun:virRaiseError
|
||||||
|
fun:statsErrorFunc
|
||||||
|
fun:xenLinuxDomainDeviceID
|
||||||
|
fun:testDeviceHelper
|
||||||
|
fun:virtTestRun
|
||||||
|
fun:mymain
|
||||||
|
fun:virtTestMain
|
||||||
|
fun:main
|
||||||
|
}
|
||||||
|
@ -26,6 +26,8 @@
|
|||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#include "threads.h"
|
||||||
|
#include "virterror_internal.h"
|
||||||
|
|
||||||
#if TEST_OOM_TRACE
|
#if TEST_OOM_TRACE
|
||||||
#include <execinfo.h>
|
#include <execinfo.h>
|
||||||
@ -319,8 +321,8 @@ int virtTestMain(int argc,
|
|||||||
int (*func)(int, char **))
|
int (*func)(int, char **))
|
||||||
{
|
{
|
||||||
char *debugStr;
|
char *debugStr;
|
||||||
#if TEST_OOM
|
|
||||||
int ret;
|
int ret;
|
||||||
|
#if TEST_OOM
|
||||||
int approxAlloc = 0;
|
int approxAlloc = 0;
|
||||||
int n;
|
int n;
|
||||||
char *oomStr = NULL;
|
char *oomStr = NULL;
|
||||||
@ -330,6 +332,10 @@ int virtTestMain(int argc,
|
|||||||
int worker = 0;
|
int worker = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (virThreadInitialize() < 0 ||
|
||||||
|
virErrorInitialize() < 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
if ((debugStr = getenv("VIR_TEST_DEBUG")) != NULL) {
|
if ((debugStr = getenv("VIR_TEST_DEBUG")) != NULL) {
|
||||||
if (virStrToLong_ui(debugStr, NULL, 10, &testDebug) < 0)
|
if (virStrToLong_ui(debugStr, NULL, 10, &testDebug) < 0)
|
||||||
testDebug = 0;
|
testDebug = 0;
|
||||||
@ -349,8 +355,10 @@ int virtTestMain(int argc,
|
|||||||
if (getenv("VIR_TEST_MP") != NULL) {
|
if (getenv("VIR_TEST_MP") != NULL) {
|
||||||
mp = sysconf(_SC_NPROCESSORS_ONLN);
|
mp = sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
fprintf(stderr, "Using %d worker processes\n", mp);
|
fprintf(stderr, "Using %d worker processes\n", mp);
|
||||||
if (VIR_ALLOC_N(workers, mp) < 0)
|
if (VIR_ALLOC_N(workers, mp) < 0) {
|
||||||
return EXIT_FAILURE;
|
ret = EXIT_FAILURE;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (testOOM)
|
if (testOOM)
|
||||||
@ -359,7 +367,7 @@ int virtTestMain(int argc,
|
|||||||
/* Run once to count allocs, and ensure it passes :-) */
|
/* Run once to count allocs, and ensure it passes :-) */
|
||||||
ret = (func)(argc, argv);
|
ret = (func)(argc, argv);
|
||||||
if (ret != EXIT_SUCCESS)
|
if (ret != EXIT_SUCCESS)
|
||||||
return EXIT_FAILURE;
|
goto cleanup;
|
||||||
|
|
||||||
#if TEST_OOM_TRACE
|
#if TEST_OOM_TRACE
|
||||||
if (testDebug)
|
if (testDebug)
|
||||||
@ -431,9 +439,11 @@ int virtTestMain(int argc,
|
|||||||
else
|
else
|
||||||
fprintf(stderr, " FAILED\n");
|
fprintf(stderr, " FAILED\n");
|
||||||
}
|
}
|
||||||
return ret;
|
cleanup:
|
||||||
|
|
||||||
#else
|
#else
|
||||||
return (func)(argc, argv);
|
ret = (func)(argc, argv);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
virResetLastError();
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user