From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Markus Armbruster <armbru@redhat.com>,
Luiz Capitulino <lcapitulino@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
"Denis V. Lunev" <den@openvz.org>
Subject: [Qemu-devel] [PULL v2 6/7] monitor: add missed aio_context_acquire into vm_completion call
Date: Mon, 9 Nov 2015 10:08:23 +0000 [thread overview]
Message-ID: <1447063704-24893-7-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1447063704-24893-1-git-send-email-stefanha@redhat.com>
From: "Denis V. Lunev" <den@openvz.org>
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>
---
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
next prev parent reply other threads:[~2015-11-09 10:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-09 10:08 [Qemu-devel] [PULL v2 0/7] Block patches Stefan Hajnoczi
2015-11-09 10:08 ` [Qemu-devel] [PULL v2 1/7] dataplane: simplify indirect descriptor read Stefan Hajnoczi
2015-11-09 10:08 ` [Qemu-devel] [PULL v2 2/7] dataplane: support non-contigious s/g Stefan Hajnoczi
2015-11-09 10:08 ` [Qemu-devel] [PULL v2 3/7] aio: Introduce aio_external_disabled Stefan Hajnoczi
2015-11-09 10:08 ` [Qemu-devel] [PULL v2 4/7] aio: Introduce aio_context_setup Stefan Hajnoczi
2015-11-09 10:08 ` [Qemu-devel] [PULL v2 5/7] aio: Introduce aio-epoll.c Stefan Hajnoczi
2015-11-13 17:09 ` Paolo Bonzini
2015-11-16 6:25 ` Fam Zheng
2015-11-09 10:08 ` Stefan Hajnoczi [this message]
2015-11-09 10:08 ` [Qemu-devel] [PULL v2 7/7] blockdev: acquire AioContext in hmp_commit() Stefan Hajnoczi
2015-11-09 12:51 ` [Qemu-devel] [PULL v2 0/7] Block patches Peter Maydell
2015-11-09 14:30 ` Peter Maydell
2015-11-09 15:09 ` Marc-André Lureau
2015-11-09 15:16 ` Peter Maydell
2015-11-09 17:50 ` Marc-André Lureau
2015-11-10 18:41 ` Peter Maydell
2015-11-11 20:33 ` Peter Maydell
2015-11-11 20:59 ` Marc-André Lureau
2015-11-12 10:12 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1447063704-24893-7-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=armbru@redhat.com \
--cc=den@openvz.org \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).