summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2015-11-04 20:19:42 +0300
committerStefan Hajnoczi <stefanha@redhat.com>2015-11-09 10:07:10 +0000
commit6bf1faa84877514971a20bb180b0ae5270bee571 (patch)
treea9912f5be1b9d42cd63d53c844b4cccf7ae9a3cc /monitor.c
parentfbe3fc5cb3cd9f9064e98c549684e821c353fe41 (diff)
downloadqemu-6bf1faa84877514971a20bb180b0ae5270bee571.tar.gz
qemu-6bf1faa84877514971a20bb180b0ae5270bee571.tar.bz2
qemu-6bf1faa84877514971a20bb180b0ae5270bee571.zip
monitor: add missed aio_context_acquire into vm_completion call
Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Stefan Hajnoczi <stefanha@redhat.com> CC: Kevin Wolf <kwolf@redhat.com> CC: Luiz Capitulino <lcapitulino@redhat.com> CC: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c11
1 files changed, 8 insertions, 3 deletions
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;