]> git.proxmox.com Git - mirror_qemu.git/blobdiff - tests/test-aio.c
async: aio_context_new(): Handle event_notifier_init failure
[mirror_qemu.git] / tests / test-aio.c
index c6a8713e83064f10765461f28d9278ce5419b07b..a7cb5c99152233b1d94480083f874faf8554eb68 100644 (file)
@@ -14,6 +14,7 @@
 #include "block/aio.h"
 #include "qemu/timer.h"
 #include "qemu/sockets.h"
+#include "qemu/error-report.h"
 
 static AioContext *ctx;
 
@@ -810,11 +811,18 @@ static void test_source_timer_schedule(void)
 
 int main(int argc, char **argv)
 {
+    Error *local_error = NULL;
     GSource *src;
 
     init_clocks();
 
-    ctx = aio_context_new();
+    ctx = aio_context_new(&local_error);
+    if (!ctx) {
+        error_report("Failed to create AIO Context: '%s'",
+                     error_get_pretty(local_error));
+        error_free(local_error);
+        exit(1);
+    }
     src = aio_get_g_source(ctx);
     g_source_attach(src, NULL);
     g_source_unref(src);