From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDXya-0007cl-S2 for qemu-devel@nongnu.org; Thu, 16 Jun 2016 10:09:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDXyY-0000Ml-I0 for qemu-devel@nongnu.org; Thu, 16 Jun 2016 10:08:55 -0400 From: Kevin Wolf Date: Thu, 16 Jun 2016 16:07:56 +0200 Message-Id: <1466086108-24868-8-git-send-email-kwolf@redhat.com> In-Reply-To: <1466086108-24868-1-git-send-email-kwolf@redhat.com> References: <1466086108-24868-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 07/39] hmp: acquire aio_context in hmp_qemu_io List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org 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 Signed-off-by: Kevin Wolf --- hmp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hmp.c b/hmp.c index 4b8e987..30897af 100644 --- a/hmp.c +++ b/hmp.c @@ -1955,7 +1955,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); -- 1.8.3.1