]> git.proxmox.com Git - mirror_qemu.git/blobdiff - async.c
qemu-iotests: Allow caller to disable underscore convertion for qmp
[mirror_qemu.git] / async.c
diff --git a/async.c b/async.c
index 572f239e2cf5fbd4cbad63916d4b1b091207cd7c..2be88cc9e9a28093937423fc7e39474c0cd825bb 100644 (file)
--- a/async.c
+++ b/async.c
@@ -44,10 +44,12 @@ struct QEMUBH {
 QEMUBH *aio_bh_new(AioContext *ctx, QEMUBHFunc *cb, void *opaque)
 {
     QEMUBH *bh;
-    bh = g_new0(QEMUBH, 1);
-    bh->ctx = ctx;
-    bh->cb = cb;
-    bh->opaque = opaque;
+    bh = g_new(QEMUBH, 1);
+    *bh = (QEMUBH){
+        .ctx = ctx,
+        .cb = cb,
+        .opaque = opaque,
+    };
     qemu_mutex_lock(&ctx->bh_lock);
     bh->next = ctx->first_bh;
     /* Make sure that the members are ready before putting bh into list */