From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63F14C072B5 for ; Fri, 24 May 2019 09:01:36 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3AD1A2175B for ; Fri, 24 May 2019 09:01:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3AD1A2175B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([127.0.0.1]:51254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hU651-0004zH-GM for qemu-devel@archiver.kernel.org; Fri, 24 May 2019 05:01:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hU630-0003f6-F7 for qemu-devel@nongnu.org; Fri, 24 May 2019 04:59:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hU60z-00007z-2a for qemu-devel@nongnu.org; Fri, 24 May 2019 04:57:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54542) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hU60x-000079-Le; Fri, 24 May 2019 04:57:23 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1368E3082132; Fri, 24 May 2019 08:57:22 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-157.ams2.redhat.com [10.36.117.157]) by smtp.corp.redhat.com (Postfix) with ESMTP id 014A15D9D3; Fri, 24 May 2019 08:57:19 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Fri, 24 May 2019 10:57:11 +0200 Message-Id: <20190524085711.17834-1-kwolf@redhat.com> In-Reply-To: <20190523160104.21258-1-kwolf@redhat.com> References: <20190523160104.21258-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 24 May 2019 08:57:23 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1.5/15] nbd-server: Call blk_set_allow_aio_context_change() 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, qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The NBD server uses an AioContext notifier, so it can tolerate that its BlockBackend is switched to a different AioContext. Before we start actually calling bdrv_try_set_aio_context(), which checks for consistency, outside of test cases, we need to make sure that the NBD server actually allows this. Signed-off-by: Kevin Wolf --- nbd/server.c | 1 + tests/qemu-iotests/240 | 21 +++++++++++++++++++++ tests/qemu-iotests/240.out | 13 +++++++++++++ 3 files changed, 35 insertions(+) diff --git a/nbd/server.c b/nbd/server.c index e21bd501dc..d1375350bc 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -1491,6 +1491,7 @@ NBDExport *nbd_export_new(BlockDriverState *bs, uin= t64_t dev_offset, goto fail; } blk_set_enable_write_cache(blk, !writethrough); + blk_set_allow_aio_context_change(blk, true); =20 exp->refcount =3D 1; QTAILQ_INIT(&exp->clients); diff --git a/tests/qemu-iotests/240 b/tests/qemu-iotests/240 index b4cf95096d..5be6b9c0f7 100755 --- a/tests/qemu-iotests/240 +++ b/tests/qemu-iotests/240 @@ -27,6 +27,12 @@ echo "QA output created by $seq" =20 status=3D1 # failure is the default! =20 +_cleanup() +{ + rm -f "$TEST_DIR/nbd" +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + # get standard environment, filters and checks . ./common.rc . ./common.filter @@ -122,6 +128,21 @@ run_qemu <