diff options
-rw-r--r-- | block/qapi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/block/qapi.c b/block/qapi.c index aeabaaf85c..f44f6b4012 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -360,7 +360,11 @@ BlockStatsList *qmp_query_blockstats(Error **errp) while ((bs = bdrv_next(bs))) { BlockStatsList *info = g_malloc0(sizeof(*info)); + AioContext *ctx = bdrv_get_aio_context(bs); + + aio_context_acquire(ctx); info->value = bdrv_query_stats(bs); + aio_context_release(ctx); *p_next = info; p_next = &info->next; |