From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: "Denis V. Lunev" Date: Wed, 8 Jun 2016 12:39:17 +0300 Message-Id: <1465378757-15271-1-git-send-email-den@openvz.org> Subject: [Qemu-devel] [PATCH 1/1] hmp: acquire aio_context in hmp_qemu_io List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: den@openvz.org, Vladimir Sementsov-Ogievskiy , Kevin Wolf , Paolo Bonzini 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); -- 2.1.4