From nobody Tue Feb 10 11:16:03 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499206562971181.51538214175855; Tue, 4 Jul 2017 15:16:02 -0700 (PDT) Received: from localhost ([::1]:43175 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSW6z-0001XJ-5L for importer@patchew.org; Tue, 04 Jul 2017 18:16:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSVwg-0008Av-J3 for qemu-devel@nongnu.org; Tue, 04 Jul 2017 18:05:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSVwd-0000Rh-DM for qemu-devel@nongnu.org; Tue, 04 Jul 2017 18:05:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45654) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dSVwZ-0000OQ-DC; Tue, 04 Jul 2017 18:05:15 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 621B47D0EF; Tue, 4 Jul 2017 22:05:14 +0000 (UTC) Received: from localhost (unknown [10.36.112.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 74A8C7053C; Tue, 4 Jul 2017 22:05:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 621B47D0EF Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=marcandre.lureau@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 621B47D0EF From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 00:03:24 +0200 Message-Id: <20170704220346.29244-14-marcandre.lureau@redhat.com> In-Reply-To: <20170704220346.29244-1-marcandre.lureau@redhat.com> References: <20170704220346.29244-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 04 Jul 2017 22:05:14 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 13/35] nbd: mark coroutine_fn 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: Kevin Wolf , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Max Reitz , "open list:Block layer core" , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Eric Blake --- block/nbd-client.h | 10 +++++----- block/nbd-client.c | 24 ++++++++++++++++-------- block/nbd.c | 3 ++- nbd/server.c | 3 ++- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/block/nbd-client.h b/block/nbd-client.h index 49636bc621..473d1f88fd 100644 --- a/block/nbd-client.h +++ b/block/nbd-client.h @@ -42,13 +42,13 @@ int nbd_client_init(BlockDriverState *bs, Error **errp); void nbd_client_close(BlockDriverState *bs); =20 -int nbd_client_co_pdiscard(BlockDriverState *bs, int64_t offset, int bytes= ); -int nbd_client_co_flush(BlockDriverState *bs); -int nbd_client_co_pwritev(BlockDriverState *bs, uint64_t offset, +int coroutine_fn nbd_client_co_pdiscard(BlockDriverState *bs, int64_t offs= et, int bytes); +int coroutine_fn nbd_client_co_flush(BlockDriverState *bs); +int coroutine_fn nbd_client_co_pwritev(BlockDriverState *bs, uint64_t offs= et, uint64_t bytes, QEMUIOVector *qiov, int flags); -int nbd_client_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, +int coroutine_fn nbd_client_co_pwrite_zeroes(BlockDriverState *bs, int64_t= offset, int bytes, BdrvRequestFlags flags); -int nbd_client_co_preadv(BlockDriverState *bs, uint64_t offset, +int coroutine_fn nbd_client_co_preadv(BlockDriverState *bs, uint64_t offse= t, uint64_t bytes, QEMUIOVector *qiov, int flags); =20 void nbd_client_detach_aio_context(BlockDriverState *bs); diff --git a/block/nbd-client.c b/block/nbd-client.c index 02e928142e..63c0210c37 100644 --- a/block/nbd-client.c +++ b/block/nbd-client.c @@ -111,7 +111,8 @@ static coroutine_fn void nbd_read_reply_entry(void *opa= que) s->read_reply_co =3D NULL; } =20 -static int nbd_co_send_request(BlockDriverState *bs, +static int coroutine_fn +nbd_co_send_request(BlockDriverState *bs, NBDRequest *request, QEMUIOVector *qiov) { @@ -158,7 +159,8 @@ static int nbd_co_send_request(BlockDriverState *bs, return rc; } =20 -static void nbd_co_receive_reply(NBDClientSession *s, +static void coroutine_fn +nbd_co_receive_reply(NBDClientSession *s, NBDRequest *request, NBDReply *reply, QEMUIOVector *qiov) @@ -185,7 +187,8 @@ static void nbd_co_receive_reply(NBDClientSession *s, } } =20 -static void nbd_coroutine_end(BlockDriverState *bs, +static void coroutine_fn +nbd_coroutine_end(BlockDriverState *bs, NBDRequest *request) { NBDClientSession *s =3D nbd_get_client_session(bs); @@ -204,7 +207,8 @@ static void nbd_coroutine_end(BlockDriverState *bs, qemu_co_mutex_unlock(&s->send_mutex); } =20 -int nbd_client_co_preadv(BlockDriverState *bs, uint64_t offset, +int coroutine_fn +nbd_client_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) { NBDClientSession *client =3D nbd_get_client_session(bs); @@ -229,7 +233,8 @@ int nbd_client_co_preadv(BlockDriverState *bs, uint64_t= offset, return -reply.error; } =20 -int nbd_client_co_pwritev(BlockDriverState *bs, uint64_t offset, +int coroutine_fn +nbd_client_co_pwritev(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) { NBDClientSession *client =3D nbd_get_client_session(bs); @@ -258,7 +263,8 @@ int nbd_client_co_pwritev(BlockDriverState *bs, uint64_= t offset, return -reply.error; } =20 -int nbd_client_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, +int coroutine_fn +nbd_client_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, int bytes, BdrvRequestFlags flags) { ssize_t ret; @@ -292,7 +298,8 @@ int nbd_client_co_pwrite_zeroes(BlockDriverState *bs, i= nt64_t offset, return -reply.error; } =20 -int nbd_client_co_flush(BlockDriverState *bs) +int coroutine_fn +nbd_client_co_flush(BlockDriverState *bs) { NBDClientSession *client =3D nbd_get_client_session(bs); NBDRequest request =3D { .type =3D NBD_CMD_FLUSH }; @@ -316,7 +323,8 @@ int nbd_client_co_flush(BlockDriverState *bs) return -reply.error; } =20 -int nbd_client_co_pdiscard(BlockDriverState *bs, int64_t offset, int bytes) +int coroutine_fn +nbd_client_co_pdiscard(BlockDriverState *bs, int64_t offset, int bytes) { NBDClientSession *client =3D nbd_get_client_session(bs); NBDRequest request =3D { diff --git a/block/nbd.c b/block/nbd.c index d529305330..8689b27d7d 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -465,7 +465,8 @@ static int nbd_open(BlockDriverState *bs, QDict *option= s, int flags, return ret; } =20 -static int nbd_co_flush(BlockDriverState *bs) +static int coroutine_fn +nbd_co_flush(BlockDriverState *bs) { return nbd_client_co_flush(bs); } diff --git a/nbd/server.c b/nbd/server.c index 8a70c054a6..4112b4b184 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -960,7 +960,8 @@ void nbd_export_close_all(void) } } =20 -static int nbd_co_send_reply(NBDRequestData *req, NBDReply *reply, int len) +static int coroutine_fn +nbd_co_send_reply(NBDRequestData *req, NBDReply *reply, int len) { NBDClient *client =3D req->client; int ret; --=20 2.13.1.395.gf7b71de06