Message ID | 1446657582-21619-12-git-send-email-den@openvz.org |
---|---|
State | New |
Headers | show |
On Wed, Nov 04, 2015 at 08:19:42PM +0300, Denis V. Lunev wrote: > 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> > --- > monitor.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) Thanks, applied this patch by itself to my block tree: https://github.com/stefanha/qemu/commits/block Stefan
diff --git a/monitor.c b/monitor.c index 6cd747f..3295840 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;
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> --- monitor.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)