From patchwork Wed Jun 8 09:39:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis V. Lunev" X-Patchwork-Id: 9164095 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5F9B460467 for ; Wed, 8 Jun 2016 09:58:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5097928397 for ; Wed, 8 Jun 2016 09:58:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45616283A0; Wed, 8 Jun 2016 09:58:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E21BD28397 for ; Wed, 8 Jun 2016 09:58:57 +0000 (UTC) Received: from localhost ([::1]:55651 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAaGG-0007ab-UX for patchwork-qemu-devel@patchwork.kernel.org; Wed, 08 Jun 2016 05:58:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAZxU-0006tN-Vi for qemu-devel@nongnu.org; Wed, 08 Jun 2016 05:39:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAZxQ-0006gY-Rx for qemu-devel@nongnu.org; Wed, 08 Jun 2016 05:39:31 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:46806 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAZxQ-0006fq-F0 for qemu-devel@nongnu.org; Wed, 08 Jun 2016 05:39:28 -0400 Received: from irbis.sw.ru ([10.30.2.139]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id u589dHKJ014206; Wed, 8 Jun 2016 12:39:19 +0300 (MSK) From: "Denis V. Lunev" To: qemu-devel@nongnu.org Date: Wed, 8 Jun 2016 12:39:17 +0300 Message-Id: <1465378757-15271-1-git-send-email-den@openvz.org> X-Mailer: git-send-email 2.1.4 X-detected-operating-system: by eggs.gnu.org: OpenBSD 3.x X-Received-From: 195.214.232.25 Subject: [Qemu-devel] [PATCH 1/1] hmp: acquire aio_context in hmp_qemu_io X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , den@openvz.org, Vladimir Sementsov-Ogievskiy , Paolo Bonzini Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Vladimir Sementsov-Ogievskiy Acquire aio context before run command, this is mandatory for unit tests. Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Paolo Bonzini --- hmp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hmp.c b/hmp.c index a4b1d3d..36df0a7 100644 --- a/hmp.c +++ b/hmp.c @@ -1951,7 +1951,12 @@ void hmp_qemu_io(Monitor *mon, const QDict *qdict) blk = blk_by_name(device); if (blk) { + AioContext *aio_context = blk_get_aio_context(blk); + aio_context_acquire(aio_context); + qemuio_command(blk, command); + + aio_context_release(aio_context); } else { error_set(&err, ERROR_CLASS_DEVICE_NOT_FOUND, "Device '%s' not found", device);