From patchwork Mon Oct 17 13:54:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 683005 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3syKpJ1rMxz9ryv for ; Tue, 18 Oct 2016 01:09:44 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=lt1Br6Fl; dkim-atps=neutral Received: from localhost ([::1]:33318 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw8bl-0007Bt-3c for incoming@patchwork.ozlabs.org; Mon, 17 Oct 2016 10:09:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw8O2-0003Q4-UT for qemu-devel@nongnu.org; Mon, 17 Oct 2016 09:55:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bw8O2-0005PC-Au for qemu-devel@nongnu.org; Mon, 17 Oct 2016 09:55:31 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:36765) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bw8O2-0005P1-7O; Mon, 17 Oct 2016 09:55:30 -0400 Received: by mail-qk0-x242.google.com with SMTP id z190so14146144qkc.3; Mon, 17 Oct 2016 06:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=dD1G3v7rRMJkiXjj26SLTw49QmqzFKvZLQL3KCb31o4=; b=lt1Br6FlsVbAa5TKHnF7mO+3EoGMWYqEPY4BVP98VWNIgI7gu37TDiuA92gZeQDuij jteJX9Q5uI45PhhE3WF77TSL4xkFm0nK/v/ZlRNgFdSeaQXvRU3qqgpcKmkHRfkxbaKB 2iBk60mntl2gMFNafjpIrYFdK4cMSGfbl5V5wzSN0xuPGwNAplQRGJrOD12l8lqwi2/O b4+f5XNDhOK5Ha72ZmRIL4+i4kzf3bxw94+ZVZJ6lxG0qPvIfbhXeXjgE2ZB32ouUCbV Qky8wylQRk2d91I8mBHGHW34fOmy1WftX9I4zLicVScovdNn5vBmS12qZIipLb52VfDx 7BZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=dD1G3v7rRMJkiXjj26SLTw49QmqzFKvZLQL3KCb31o4=; b=CsA7f3s7xyncVN9h6lG9NyoLHWXWEEigpaijrXk0DLrVnLvl1YuNmO8pI3QXZw1rR+ jrJPqSEg+tltdRNwWPD5mfAb+c6zWuSQivrSOt1vtOKmAuDgyFqPMmXrKRrseIE5nkVf ukBEaF8V9yYeNhWzifk6fJkb+4eTHPKr8xD0X2N4g4xTyE1pV8r6xM6pJQ6zz2QbLILI c3WgQGnQeiHzLUufeY72+RpGfEQK6h2kGTOHSKUCoz+YMCL3NSskgfbtMs4RFXcVS3tB d4WkN5bS2p+2cr53NDtJw9BizIjLiD8CdiCRGi/BkPrPa3gqmkPclAW/wPU0HpI4gBaX CqrA== X-Gm-Message-State: AA6/9RnvobG7IMZmE3j74b2Mer8yXjuaGzF9CPpYiu1ZNxIYVdwaVHHsUlsEBMhw+ahFdQ== X-Received: by 10.194.93.101 with SMTP id ct5mr11529776wjb.11.1476712529277; Mon, 17 Oct 2016 06:55:29 -0700 (PDT) Received: from donizetti.lan (94-39-170-54.adsl-ull.clienti.tiscali.it. [94.39.170.54]) by smtp.gmail.com with ESMTPSA id af4sm43814062wjc.17.2016.10.17.06.55.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Oct 2016 06:55:27 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 17 Oct 2016 15:54:25 +0200 Message-Id: <1476712470-11660-16-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476712470-11660-1-git-send-email-pbonzini@redhat.com> References: <1476712470-11660-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 15/20] qemu-io: acquire AioContext 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: kwolf@redhat.com, famz@redhat.com, stefanha@redhat.com, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Paolo Bonzini --- v1->v2: new [qemu-iotests] 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]); }