X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=monitor.c;h=32958407dde54f423032de318f4669ad6eec5d0e;hb=cffc331a3156870d54883bc79e4278472ffd8f1d;hp=6cd747f4f96cc77d785f65f93c21be37d7d93890;hpb=7de0be6573afc9dcfb6aa0ded167ad6a8730f727;p=mirror_qemu.git diff --git a/monitor.c b/monitor.c index 6cd747f4f9..32958407dd 100644 --- a/monitor.c +++ b/monitor.c @@ -3408,13 +3408,18 @@ static void vm_completion(ReadLineState *rs, const char *str) readline_set_completion_index(rs, len); while ((bs = bdrv_next(bs))) { SnapshotInfoList *snapshots, *snapshot; + AioContext *ctx = bdrv_get_aio_context(bs); + bool ok = false; - if (!bdrv_can_snapshot(bs)) { - continue; + aio_context_acquire(ctx); + if (bdrv_can_snapshot(bs)) { + ok = bdrv_query_snapshot_info_list(bs, &snapshots, NULL) == 0; } - if (bdrv_query_snapshot_info_list(bs, &snapshots, NULL)) { + aio_context_release(ctx); + if (!ok) { continue; } + snapshot = snapshots; while (snapshot) { char *completion = snapshot->value->name;