From nobody Tue Feb 10 01:16:18 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1611660526; cv=none; d=zohomail.com; s=zohoarc; b=jJmmGGpvbCPhdy1yOVAdku70TAFrBRJ30ruzhyq7eHsVLjV04up7e4iMZ6y3rFiEtPjS1/ngzJ47sSg3jXvoqgstRBP92JjtAHtCnBW0FCAvfVIAtmWEmG0jz0FVyB6puZExUYb7FWaBVTt6R3VWD8xwvzyz1QHX9kdLDtHBk9E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611660526; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=d/Q0U7O65ooTpdPuqUcjsUekDmuc2ItMMBKX7kP5CH0=; b=QUgYgNdqerNlUyR2BV5vaTB3oIsHvR59/eYZqWKC82C0CCiKofnRnUKeSMoTiZT6unRRIPwuAxHkY7O50TOHfQak+e5P/naSdz0CnBd1hyeKHAheKMf72kwiZ1JFgz/b5pyUK0UHtnUZ6SPuRRPNBaJ2RKI9rVeCjfBc8GBwvh4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1611660526783425.8273066548793; Tue, 26 Jan 2021 03:28:46 -0800 (PST) Received: from localhost ([::1]:39364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4MWb-0005VF-KF for importer@patchew.org; Tue, 26 Jan 2021 06:28:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36954) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4MTx-0003kn-30 for qemu-devel@nongnu.org; Tue, 26 Jan 2021 06:26:01 -0500 Received: from kerio.kamp.de ([195.62.97.192]:33548) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4MTo-0002wy-Kn for qemu-devel@nongnu.org; Tue, 26 Jan 2021 06:26:00 -0500 Received: from submission.kamp.de ([195.62.97.28]) by kerio.kamp.de with ESMTPS (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) for qemu-devel@nongnu.org; Tue, 26 Jan 2021 12:25:44 +0100 Received: (qmail 32740 invoked from network); 26 Jan 2021 11:25:47 -0000 Received: from lieven-pc.kamp-intra.net (HELO lieven-pc) (relay@kamp.de@::ffff:172.21.12.60) by submission.kamp.de with ESMTPS (DHE-RSA-AES256-GCM-SHA384 encrypted) ESMTPA; 26 Jan 2021 11:25:47 -0000 Received: by lieven-pc (Postfix, from userid 1060) id D4EAE13DC8A; Tue, 26 Jan 2021 12:25:47 +0100 (CET) X-Footer: a2FtcC5kZQ== From: Peter Lieven To: qemu-block@nongnu.org Subject: [PATCH V2 4/7] block/rbd: add bdrv_attach_aio_context Date: Tue, 26 Jan 2021 12:25:37 +0100 Message-Id: <20210126112540.11880-5-pl@kamp.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210126112540.11880-1-pl@kamp.de> References: <20210126112540.11880-1-pl@kamp.de> Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=195.62.97.192; envelope-from=pl@kamp.de; helo=kerio.kamp.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, Peter Lieven , qemu-devel@nongnu.org, ct@flyingcircus.io, pbonzini@redhat.com, mreitz@redhat.com, dillaman@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Lieven --- block/rbd.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/block/rbd.c b/block/rbd.c index f68ebcf240..7abd0252c9 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -91,6 +91,7 @@ typedef struct BDRVRBDState { char *namespace; uint64_t image_size; uint64_t object_size; + AioContext *aio_context; } BDRVRBDState; =20 static int qemu_rbd_connect(rados_t *cluster, rados_ioctx_t *io_ctx, @@ -749,6 +750,8 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *o= ptions, int flags, } } =20 + s->aio_context =3D bdrv_get_aio_context(bs); + /* When extending regular files, we get zeros from the OS */ bs->supported_truncate_flags =3D BDRV_REQ_ZERO_WRITE; =20 @@ -839,8 +842,7 @@ static void rbd_finish_aiocb(rbd_completion_t c, RADOSC= B *rcb) rcb->ret =3D rbd_aio_get_return_value(c); rbd_aio_release(c); =20 - replay_bh_schedule_oneshot_event(bdrv_get_aio_context(acb->common.bs), - rbd_finish_bh, rcb); + replay_bh_schedule_oneshot_event(acb->s->aio_context, rbd_finish_bh, r= cb); } =20 static BlockAIOCB *rbd_start_aio(BlockDriverState *bs, @@ -1160,6 +1162,13 @@ static const char *const qemu_rbd_strong_runtime_opt= s[] =3D { NULL }; =20 +static void qemu_rbd_attach_aio_context(BlockDriverState *bs, + AioContext *new_context) +{ + BDRVRBDState *s =3D bs->opaque; + s->aio_context =3D new_context; +} + static BlockDriver bdrv_rbd =3D { .format_name =3D "rbd", .instance_size =3D sizeof(BDRVRBDState), @@ -1189,6 +1198,8 @@ static BlockDriver bdrv_rbd =3D { .bdrv_snapshot_goto =3D qemu_rbd_snap_rollback, .bdrv_co_invalidate_cache =3D qemu_rbd_co_invalidate_cache, =20 + .bdrv_attach_aio_context =3D qemu_rbd_attach_aio_context, + .strong_runtime_opts =3D qemu_rbd_strong_runtime_opts, }; =20 --=20 2.17.1