aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2020-08-21 21:53:56 +0200
committerKevin Wolf <kwolf@redhat.com>2020-09-07 12:31:30 +0200
commit073a06978c67cbddcaba06f2c4cba28a64a0bd98 (patch)
tree357c4803cc6a2f3ecd0bb909cb54e3e0393eeb4a /block
parent3a6d34d0661d25215ca2bc92fa8aa0dbb22a4e81 (diff)
downloadqemu-073a06978c67cbddcaba06f2c4cba28a64a0bd98.zip
qemu-073a06978c67cbddcaba06f2c4cba28a64a0bd98.tar.gz
qemu-073a06978c67cbddcaba06f2c4cba28a64a0bd98.tar.bz2
block/nvme: Replace BDRV_POLL_WHILE by AIO_WAIT_WHILE
BDRV_POLL_WHILE() is defined as: #define BDRV_POLL_WHILE(bs, cond) ({ \ BlockDriverState *bs_ = (bs); \ AIO_WAIT_WHILE(bdrv_get_aio_context(bs_), \ cond); }) As we will remove the BlockDriverState use in the next commit, start by using the exploded version of BDRV_POLL_WHILE(). Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200821195359.1285345-13-philmd@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/nvme.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/nvme.c b/block/nvme.c
index e04e1fa..b037351 100644
--- a/block/nvme.c
+++ b/block/nvme.c
@@ -493,6 +493,7 @@ static void nvme_cmd_sync_cb(void *opaque, int ret)
static int nvme_cmd_sync(BlockDriverState *bs, NVMeQueuePair *q,
NvmeCmd *cmd)
{
+ AioContext *aio_context = bdrv_get_aio_context(bs);
NVMeRequest *req;
int ret = -EINPROGRESS;
req = nvme_get_free_req(q);
@@ -501,7 +502,7 @@ static int nvme_cmd_sync(BlockDriverState *bs, NVMeQueuePair *q,
}
nvme_submit_command(q, req, cmd, nvme_cmd_sync_cb, &ret);
- BDRV_POLL_WHILE(bs, ret == -EINPROGRESS);
+ AIO_WAIT_WHILE(aio_context, ret == -EINPROGRESS);
return ret;
}