mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
Dump qemu driver capabilities if test debugging enabled
* src/testutils.[ch]: make testDebug externally available * src/testutilsqemu.c: if VIR_TEST_DEBUG is set, dump the qemu driver capabilities to stderr
This commit is contained in:
parent
3fa4a82e6f
commit
d7ed2c18e1
@ -45,8 +45,9 @@
|
||||
((((int) ((T)->tv_sec - (U)->tv_sec)) * 1000000.0 + \
|
||||
((int) ((T)->tv_usec - (U)->tv_usec))) / 1000.0)
|
||||
|
||||
unsigned int testDebug = 0;
|
||||
|
||||
static unsigned int testOOM = 0;
|
||||
static unsigned int testDebug = 0;
|
||||
static unsigned int testCounter = 0;
|
||||
|
||||
double
|
||||
|
@ -43,4 +43,6 @@ int virtTestMain(int argc,
|
||||
return virtTestMain(argc,argv, func); \
|
||||
}
|
||||
|
||||
extern unsigned int testDebug;
|
||||
|
||||
#endif /* __VIT_TEST_UTILS_H__ */
|
||||
|
@ -4,6 +4,8 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "testutilsqemu.h"
|
||||
#include "testutils.h"
|
||||
#include "memory.h"
|
||||
|
||||
virCapsPtr testQemuCapsInit(void) {
|
||||
struct utsname utsname;
|
||||
@ -84,6 +86,18 @@ virCapsPtr testQemuCapsInit(void) {
|
||||
NULL) == NULL)
|
||||
goto cleanup;
|
||||
|
||||
if (testDebug) {
|
||||
char *caps_str;
|
||||
|
||||
caps_str = virCapabilitiesFormatXML(caps);
|
||||
if (!caps_str)
|
||||
goto cleanup;
|
||||
|
||||
fprintf(stderr, "QEMU driver capabilities:\n%s", caps_str);
|
||||
|
||||
VIR_FREE(caps_str);
|
||||
}
|
||||
|
||||
return caps;
|
||||
|
||||
cleanup:
|
||||
|
Loading…
x
Reference in New Issue
Block a user