]> git.proxmox.com Git - mirror_qemu.git/blobdiff - main-loop.c
virtio: decrement vq->inuse in virtqueue_discard()
[mirror_qemu.git] / main-loop.c
index 3a7f4cdbb211d9ed223ca54eef32736dc9daac78..6a7f8d30bd2a87380b928bc084e523bd18d4fb35 100644 (file)
@@ -23,7 +23,8 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "qapi/error.h"
+#include "qemu/cutils.h"
 #include "qemu/timer.h"
 #include "qemu/sockets.h"      // struct in_addr needed for libslirp.h
 #include "sysemu/qtest.h"
@@ -153,11 +154,11 @@ int qemu_init_main_loop(Error **errp)
     }
 
     qemu_aio_context = aio_context_new(&local_error);
-    qemu_notify_bh = qemu_bh_new(notify_event_cb, NULL);
     if (!qemu_aio_context) {
         error_propagate(errp, local_error);
         return -EMFILE;
     }
+    qemu_notify_bh = qemu_bh_new(notify_event_cb, NULL);
     gpollfds = g_array_new(FALSE, FALSE, sizeof(GPollFD));
     src = aio_get_g_source(qemu_aio_context);
     g_source_attach(src, NULL);