提交 d7ed2c18 编写于 作者: M Mark McLoughlin

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
上级 3fa4a82e
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册