]> xenbits.xensource.com Git - libvirt.git/commitdiff
Dump qemu driver capabilities if test debugging enabled
authorMark McLoughlin <markmc@redhat.com>
Thu, 10 Sep 2009 10:07:20 +0000 (11:07 +0100)
committerMark McLoughlin <markmc@redhat.com>
Thu, 10 Sep 2009 11:37:42 +0000 (12:37 +0100)
* src/testutils.[ch]: make testDebug externally available

* src/testutilsqemu.c: if VIR_TEST_DEBUG is set, dump the qemu
  driver capabilities to stderr

tests/testutils.c
tests/testutils.h
tests/testutilsqemu.c

index 5072fecb6bfe649ac68a4f7fd8314f1ede5ac926..536441a358b47013d47d028a49e0841552afa159 100644 (file)
@@ -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
index 96b246f2a2a8e40b0902bdee099ed167d1f04e89..f036e0f1362e71b6caad3978235414b0d5e5343c 100644 (file)
@@ -43,4 +43,6 @@ int virtTestMain(int argc,
         return virtTestMain(argc,argv, func);   \
     }
 
+extern unsigned int testDebug;
+
 #endif /* __VIT_TEST_UTILS_H__ */
index 58707e17222526dbfd3b4d298791f2ec447bffaa..d8854be863c05d28aae068bde36da0eeae8223aa 100644 (file)
@@ -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: