From nobody Tue Nov 18 09:20:13 2025 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=1609088188; cv=none; d=zohomail.com; s=zohoarc; b=czm7Xle9WMfSPZLnPiaJ1cMU/6Y1syKhqRJrqRqBY46Fq30UEN3DvMuDyXI9tXW/KCBTQQCWknVM9Td9feGoZ6GEkbfzCGR+ogC04LiCmvjcyUA+jkW0YkXjuUxLRI09ySxTUwl7I8UVYNgjzUdc5Q2uptzcJIvxixGJnXgPsHI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609088188; 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=JnRp5WLA2tqG76JA+mofnGwkIm1+e4QSIvqQIEhYzio=; b=IIeb92cyQqa6DgSnfOQEG3kOqIXAXOF4avDpJKSRI9HGig7G82IyC1/Qx+hFEs08Fq5y/x2bXEvAaIZv0HvW9bhzOSpxsuNCxobigAF157j168fZnQvHXJsIKQmwtcv0Z51I5xvesolkOHjbQmTPE8HodTZkv+OFp7BV9zqxpn8= 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 1609088188600959.9703159211134; Sun, 27 Dec 2020 08:56:28 -0800 (PST) Received: from localhost ([::1]:49470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ktZLH-00042B-MC for importer@patchew.org; Sun, 27 Dec 2020 11:56:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ktZIt-0002VZ-Nm for qemu-devel@nongnu.org; Sun, 27 Dec 2020 11:53:59 -0500 Received: from kerio.kamp.de ([195.62.97.192]:34019) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ktZIq-0007ZR-Oi for qemu-devel@nongnu.org; Sun, 27 Dec 2020 11:53:59 -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; Sun, 27 Dec 2020 17:42:42 +0100 Received: (qmail 22370 invoked from network); 27 Dec 2020 16:42:44 -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; 27 Dec 2020 16:42:44 -0000 Received: by lieven-pc (Postfix, from userid 1060) id 5FB2B13DD25; Sun, 27 Dec 2020 17:42:44 +0100 (CET) X-Footer: a2FtcC5kZQ== From: Peter Lieven To: qemu-block@nongnu.org Subject: [PATCH 4/7] block/rbd: add bdrv_{attach,detach}_aio_context Date: Sun, 27 Dec 2020 17:42:33 +0100 Message-Id: <20201227164236.10143-5-pl@kamp.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201227164236.10143-1-pl@kamp.de> References: <20201227164236.10143-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=unavailable 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, 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 | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/block/rbd.c b/block/rbd.c index a2da70e37f..27b232f4d8 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, @@ -1151,6 +1153,18 @@ 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 void qemu_rbd_detach_aio_context(BlockDriverState *bs) +{ + +} + static BlockDriver bdrv_rbd =3D { .format_name =3D "rbd", .instance_size =3D sizeof(BDRVRBDState), @@ -1180,6 +1194,9 @@ 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, + .bdrv_detach_aio_context =3D qemu_rbd_detach_aio_context, + .strong_runtime_opts =3D qemu_rbd_strong_runtime_opts, }; =20 --=20 2.17.1