[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v2 15/15] Add coroutine_fn annotations to nbd_co_* fun
From: |
Charlie Shepherd |
Subject: |
[Qemu-devel] [RFC v2 15/15] Add coroutine_fn annotations to nbd_co_* functions. |
Date: |
Fri, 9 Aug 2013 19:44:05 +0200 |
nbd_co_* are all meant to be only be run in a coroutine context, annotate them
accordingly.
Signed-off-by: Charlie Shepherd <address@hidden>
---
block/nbd.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/block/nbd.c b/block/nbd.c
index a0e3562..3e037ba 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -256,7 +256,7 @@ static int nbd_config(BDRVNBDState *s, QDict *options)
}
-static void nbd_coroutine_start(BDRVNBDState *s, struct nbd_request *request)
+static void coroutine_fn nbd_coroutine_start(BDRVNBDState *s, struct
nbd_request *request)
{
int i;
@@ -334,7 +334,7 @@ static void nbd_restart_write(void *opaque)
qemu_coroutine_enter(s->send_coroutine, NULL);
}
-static int nbd_co_send_request(BDRVNBDState *s, struct nbd_request *request,
+static int coroutine_fn nbd_co_send_request(BDRVNBDState *s, struct
nbd_request *request,
QEMUIOVector *qiov, int offset)
{
int rc, ret;
@@ -368,7 +368,7 @@ static int nbd_co_send_request(BDRVNBDState *s, struct
nbd_request *request,
return rc;
}
-static void nbd_co_receive_reply(BDRVNBDState *s, struct nbd_request *request,
+static void coroutine_fn nbd_co_receive_reply(BDRVNBDState *s, struct
nbd_request *request,
struct nbd_reply *reply,
QEMUIOVector *qiov, int offset)
{
@@ -394,7 +394,7 @@ static void nbd_co_receive_reply(BDRVNBDState *s, struct
nbd_request *request,
}
}
-static void nbd_coroutine_end(BDRVNBDState *s, struct nbd_request *request)
+static void coroutine_fn nbd_coroutine_end(BDRVNBDState *s, struct nbd_request
*request)
{
int i = HANDLE_TO_INDEX(s, request->handle);
s->recv_coroutine[i] = NULL;
@@ -463,7 +463,7 @@ static void nbd_teardown_connection(BlockDriverState *bs)
closesocket(s->sock);
}
-static int nbd_open(BlockDriverState *bs, QDict *options, int flags)
+static int coroutine_fn nbd_co_open(BlockDriverState *bs, QDict *options, int
flags)
{
BDRVNBDState *s = bs->opaque;
int result;
@@ -485,7 +485,7 @@ static int nbd_open(BlockDriverState *bs, QDict *options,
int flags)
return result;
}
-static int nbd_co_readv_1(BlockDriverState *bs, int64_t sector_num,
+static int coroutine_fn nbd_co_readv_1(BlockDriverState *bs, int64_t
sector_num,
int nb_sectors, QEMUIOVector *qiov,
int offset)
{
@@ -510,7 +510,7 @@ static int nbd_co_readv_1(BlockDriverState *bs, int64_t
sector_num,
}
-static int nbd_co_writev_1(BlockDriverState *bs, int64_t sector_num,
+static int coroutine_fn nbd_co_writev_1(BlockDriverState *bs, int64_t
sector_num,
int nb_sectors, QEMUIOVector *qiov,
int offset)
{
@@ -542,7 +542,7 @@ static int nbd_co_writev_1(BlockDriverState *bs, int64_t
sector_num,
* remain aligned to 4K. */
#define NBD_MAX_SECTORS 2040
-static int nbd_co_readv(BlockDriverState *bs, int64_t sector_num,
+static int coroutine_fn nbd_co_readv(BlockDriverState *bs, int64_t sector_num,
int nb_sectors, QEMUIOVector *qiov)
{
int offset = 0;
@@ -559,7 +559,7 @@ static int nbd_co_readv(BlockDriverState *bs, int64_t
sector_num,
return nbd_co_readv_1(bs, sector_num, nb_sectors, qiov, offset);
}
-static int nbd_co_writev(BlockDriverState *bs, int64_t sector_num,
+static int coroutine_fn nbd_co_writev(BlockDriverState *bs, int64_t sector_num,
int nb_sectors, QEMUIOVector *qiov)
{
int offset = 0;
@@ -576,7 +576,7 @@ static int nbd_co_writev(BlockDriverState *bs, int64_t
sector_num,
return nbd_co_writev_1(bs, sector_num, nb_sectors, qiov, offset);
}
-static int nbd_co_flush(BlockDriverState *bs)
+static int coroutine_fn nbd_co_flush(BlockDriverState *bs)
{
BDRVNBDState *s = bs->opaque;
struct nbd_request request;
@@ -606,7 +606,7 @@ static int nbd_co_flush(BlockDriverState *bs)
return -reply.error;
}
-static int nbd_co_discard(BlockDriverState *bs, int64_t sector_num,
+static int coroutine_fn nbd_co_discard(BlockDriverState *bs, int64_t
sector_num,
int nb_sectors)
{
BDRVNBDState *s = bs->opaque;
--
1.8.3.2
- Re: [Qemu-devel] [RFC v2 07/15] Call bdrv->open via a synchronous wrapper in block/snapshot.c, (continued)
- [Qemu-devel] [RFC v2 06/15] Explicitly mark BlockDriver functions .bdrv_write and .bdrv_read as coroutine functions, Charlie Shepherd, 2013/08/09
- [Qemu-devel] [RFC v2 08/15] Convert bdrv_create and associated functions to be coroutine_fn, Charlie Shepherd, 2013/08/09
- [Qemu-devel] [RFC v2 09/15] Add a synchronous wrapper bdrv_sync_rwco, Charlie Shepherd, 2013/08/09
- [Qemu-devel] [RFC v2 11/15] Make bdrv_discard coroutine only and add bdrv_sync_discard, Charlie Shepherd, 2013/08/09
- [Qemu-devel] [RFC v2 12/15] Make bdrv_flush coroutine only and add bdrv_sync_flush, Charlie Shepherd, 2013/08/09
- [Qemu-devel] [RFC v2 10/15] Convert bdrv_read, bdrv_write and associated functions to coroutine functions, Charlie Shepherd, 2013/08/09
- [Qemu-devel] [RFC v2 13/15] Introduce a run_handler function in qemu-img.c, Charlie Shepherd, 2013/08/09
- [Qemu-devel] [RFC v2 15/15] Add coroutine_fn annotations to nbd_co_* functions.,
Charlie Shepherd <=
- [Qemu-devel] [RFC v2 14/15] Add coroutine annotations for qemu_co_rwlock_rdlock and qemu_co_rwlock_wrlock, Charlie Shepherd, 2013/08/09
- Re: [Qemu-devel] [RFC v2 01/15] Add an explanation of when a function should be marked coroutine_fn, Stefan Hajnoczi, 2013/08/14
- Re: [Qemu-devel] [RFC v2 01/15] Add an explanation of when a function should be marked coroutine_fn, Stefan Hajnoczi, 2013/08/29