From nobody Sat May 4 08:09:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1558688509; cv=none; d=zoho.com; s=zohoarc; b=F3y1FHWlTB2uhZIw3UnWTUjyxasqL9SodGD8/dNNDlISKJavGFbpXt21zk4TRnR5hFfUrqk24HmlXUdyFwLptEOJ535/mGOi9VMb/ho4faF2rtlZqCCx26GWrNXefp4J6re9qAAL8LaacExkK1JYg1l1MOod4Hl9TzwqQq8qzfQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558688509; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=EQuN7pgiXKNC4693XRwLHIhb0Rf8qH/hQAkP/ioq3AA=; b=c1L9PjcX2S4zAD/qdIHsg7cuqxLSuNCFmMeuZvxpNhcEADu+ZjdxaogLPDEaWPHjN+PgbaKmGt5AiHKIY7NQj2CyF1WzxySLDE1afucDP7cSwnkvSvwKqLUrGMgdtxg3vkPhrdXFbwV+B3SkReSIuwCyhgXTRkArkKFeGUpKO2A= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558688509961693.6190770597043; Fri, 24 May 2019 02:01:49 -0700 (PDT) Received: from localhost ([127.0.0.1]:51254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hU65A-0004zH-1P for importer@patchew.org; Fri, 24 May 2019 05:01:44 -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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Eric Blake --- 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, uint6= 4_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 <