From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zu1j8-0005be-Df for qemu-devel@nongnu.org; Wed, 04 Nov 2015 12:20:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zu1j7-0003c0-C9 for qemu-devel@nongnu.org; Wed, 04 Nov 2015 12:20:02 -0500 Received: from mailhub.sw.ru ([195.214.232.25]:38258 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zu1j7-0003bf-0G for qemu-devel@nongnu.org; Wed, 04 Nov 2015 12:20:01 -0500 From: "Denis V. Lunev" Date: Wed, 4 Nov 2015 20:19:42 +0300 Message-Id: <1446657582-21619-12-git-send-email-den@openvz.org> In-Reply-To: <1446657582-21619-1-git-send-email-den@openvz.org> References: <1446657582-21619-1-git-send-email-den@openvz.org> Subject: [Qemu-devel] [PATCH 11/11] monitor: add missed aio_context_acquire into vm_completion call List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Markus Armbruster , qemu-devel@nongnu.org, Stefan Hajnoczi , "Denis V. Lunev" , Luiz Capitulino Signed-off-by: Denis V. Lunev CC: Stefan Hajnoczi CC: Kevin Wolf CC: Luiz Capitulino CC: Markus Armbruster --- monitor.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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; -- 2.5.0