Received: from eggs.gnu.org ([2001:4830:134:3::10]:46619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bziFl-0003VA-IN for qemu-devel@nongnu.org; Thu, 27 Oct 2016 06:49:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bziFk-00048O-Rf for qemu-devel@nongnu.org; Thu, 27 Oct 2016 06:49:45 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:33974) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bziFk-000485-Lp for qemu-devel@nongnu.org; Thu, 27 Oct 2016 06:49:44 -0400 Received: by mail-wm0-x241.google.com with SMTP id y138so2048516wme.1 for ; Thu, 27 Oct 2016 03:49:44 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Thu, 27 Oct 2016 12:49:03 +0200 Message-Id: <1477565348-5458-16-git-send-email-pbonzini@redhat.com> In-Reply-To: <1477565348-5458-1-git-send-email-pbonzini@redhat.com> References: <1477565348-5458-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 15/20] qemu-io: acquire AioContext List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, stefanha@redhat.com Signed-off-by: Paolo Bonzini --- qemu-io-cmds.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c index dbe0413..4750e9a 100644 --- a/qemu-io-cmds.c +++ b/qemu-io-cmds.c @@ -2216,6 +2216,7 @@ static const cmdinfo_t help_cmd = { bool qemuio_command(BlockBackend *blk, const char *cmd) { + AioContext *ctx; char *input; const cmdinfo_t *ct; char **v; @@ -2227,7 +2228,10 @@ bool qemuio_command(BlockBackend *blk, const char *cmd) if (c) { ct = find_command(v[0]); if (ct) { + ctx = blk ? blk_get_aio_context(blk) : qemu_get_aio_context(); + aio_context_acquire(ctx); done = command(blk, ct, c, v); + aio_context_release(ctx); } else { fprintf(stderr, "command \"%s\" not found\n", v[0]); } -- 2.7.4