qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-block] [RFC PATCH 10/11] block: Replace nested aio_poll with bdrv_


From: Fam Zheng
Subject: [Qemu-block] [RFC PATCH 10/11] block: Replace nested aio_poll with bdrv_aio_poll
Date: Thu, 23 Jul 2015 14:32:17 +0800

Just a manual search and replace. No semantic change here.

Signed-off-by: Fam Zheng <address@hidden>
---
 block.c           |  2 +-
 block/curl.c      |  2 +-
 block/io.c        | 18 +++++++++---------
 block/nfs.c       |  2 +-
 block/qed-table.c |  8 ++++----
 blockjob.c        |  2 +-
 qemu-img.c        |  2 +-
 qemu-io-cmds.c    |  4 ++--
 8 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/block.c b/block.c
index d088ee0..564c43b 100644
--- a/block.c
+++ b/block.c
@@ -371,7 +371,7 @@ int bdrv_create(BlockDriver *drv, const char* filename,
         co = qemu_coroutine_create(bdrv_create_co_entry);
         qemu_coroutine_enter(co, &cco);
         while (cco.ret == NOT_DONE) {
-            aio_poll(qemu_get_aio_context(), true);
+            bdrv_aio_poll(qemu_get_aio_context(), true);
         }
     }
 
diff --git a/block/curl.c b/block/curl.c
index 75d237c..2223091 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -392,7 +392,7 @@ static CURLState *curl_init_state(BlockDriverState *bs, 
BDRVCURLState *s)
             break;
         }
         if (!state) {
-            aio_poll(bdrv_get_aio_context(bs), true);
+            bdrv_aio_poll(bdrv_get_aio_context(bs), true);
         }
     } while(!state);
 
diff --git a/block/io.c b/block/io.c
index fbf9e0f..5f5e575 100644
--- a/block/io.c
+++ b/block/io.c
@@ -251,7 +251,7 @@ void bdrv_drain(BlockDriverState *bs)
         /* Keep iterating */
          bdrv_flush_io_queue(bs);
          busy = bdrv_requests_pending(bs);
-         busy |= aio_poll(bdrv_get_aio_context(bs), busy);
+         busy |= bdrv_aio_poll(bdrv_get_aio_context(bs), busy);
     }
 }
 
@@ -301,11 +301,11 @@ void bdrv_drain_all(void)
                     bdrv_flush_io_queue(bs);
                     if (bdrv_requests_pending(bs)) {
                         busy = true;
-                        aio_poll(aio_context, busy);
+                        bdrv_aio_poll(aio_context, busy);
                     }
                 }
             }
-            busy |= aio_poll(aio_context, false);
+            busy |= bdrv_aio_poll(aio_context, false);
             aio_context_release(aio_context);
         }
     }
@@ -559,7 +559,7 @@ static int bdrv_prwv_co(BlockDriverState *bs, int64_t 
offset,
         co = qemu_coroutine_create(bdrv_rw_co_entry);
         qemu_coroutine_enter(co, &rwco);
         while (rwco.ret == NOT_DONE) {
-            aio_poll(aio_context, true);
+            bdrv_aio_poll(aio_context, true);
         }
     }
     return rwco.ret;
@@ -1594,7 +1594,7 @@ int64_t bdrv_get_block_status_above(BlockDriverState *bs,
         co = qemu_coroutine_create(bdrv_get_block_status_above_co_entry);
         qemu_coroutine_enter(co, &data);
         while (!data.done) {
-            aio_poll(aio_context, true);
+            bdrv_aio_poll(aio_context, true);
         }
     }
     return data.ret;
@@ -1962,9 +1962,9 @@ void bdrv_aio_cancel(BlockAIOCB *acb)
     bdrv_aio_cancel_async(acb);
     while (acb->refcnt > 1) {
         if (acb->aiocb_info->get_aio_context) {
-            aio_poll(acb->aiocb_info->get_aio_context(acb), true);
+            bdrv_aio_poll(acb->aiocb_info->get_aio_context(acb), true);
         } else if (acb->bs) {
-            aio_poll(bdrv_get_aio_context(acb->bs), true);
+            bdrv_aio_poll(bdrv_get_aio_context(acb->bs), true);
         } else {
             abort();
         }
@@ -2376,7 +2376,7 @@ int bdrv_flush(BlockDriverState *bs)
         co = qemu_coroutine_create(bdrv_flush_co_entry);
         qemu_coroutine_enter(co, &rwco);
         while (rwco.ret == NOT_DONE) {
-            aio_poll(aio_context, true);
+            bdrv_aio_poll(aio_context, true);
         }
     }
 
@@ -2489,7 +2489,7 @@ int bdrv_discard(BlockDriverState *bs, int64_t 
sector_num, int nb_sectors)
         co = qemu_coroutine_create(bdrv_discard_co_entry);
         qemu_coroutine_enter(co, &rwco);
         while (rwco.ret == NOT_DONE) {
-            aio_poll(aio_context, true);
+            bdrv_aio_poll(aio_context, true);
         }
     }
 
diff --git a/block/nfs.c b/block/nfs.c
index 4d12067..6740661 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -469,7 +469,7 @@ static int64_t nfs_get_allocated_file_size(BlockDriverState 
*bs)
 
     while (!task.complete) {
         nfs_set_events(client);
-        aio_poll(client->aio_context, true);
+        bdrv_aio_poll(client->aio_context, true);
     }
 
     return (task.ret < 0 ? task.ret : st.st_blocks * st.st_blksize);
diff --git a/block/qed-table.c b/block/qed-table.c
index 513aa87..6421ce7 100644
--- a/block/qed-table.c
+++ b/block/qed-table.c
@@ -173,7 +173,7 @@ int qed_read_l1_table_sync(BDRVQEDState *s)
     qed_read_table(s, s->header.l1_table_offset,
                    s->l1_table, qed_sync_cb, &ret);
     while (ret == -EINPROGRESS) {
-        aio_poll(bdrv_get_aio_context(s->bs), true);
+        bdrv_aio_poll(bdrv_get_aio_context(s->bs), true);
     }
 
     return ret;
@@ -194,7 +194,7 @@ int qed_write_l1_table_sync(BDRVQEDState *s, unsigned int 
index,
 
     qed_write_l1_table(s, index, n, qed_sync_cb, &ret);
     while (ret == -EINPROGRESS) {
-        aio_poll(bdrv_get_aio_context(s->bs), true);
+        bdrv_aio_poll(bdrv_get_aio_context(s->bs), true);
     }
 
     return ret;
@@ -267,7 +267,7 @@ int qed_read_l2_table_sync(BDRVQEDState *s, QEDRequest 
*request, uint64_t offset
 
     qed_read_l2_table(s, request, offset, qed_sync_cb, &ret);
     while (ret == -EINPROGRESS) {
-        aio_poll(bdrv_get_aio_context(s->bs), true);
+        bdrv_aio_poll(bdrv_get_aio_context(s->bs), true);
     }
 
     return ret;
@@ -289,7 +289,7 @@ int qed_write_l2_table_sync(BDRVQEDState *s, QEDRequest 
*request,
 
     qed_write_l2_table(s, request, index, n, flush, qed_sync_cb, &ret);
     while (ret == -EINPROGRESS) {
-        aio_poll(bdrv_get_aio_context(s->bs), true);
+        bdrv_aio_poll(bdrv_get_aio_context(s->bs), true);
     }
 
     return ret;
diff --git a/blockjob.c b/blockjob.c
index 62bb906..4e52652 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -210,7 +210,7 @@ static int block_job_finish_sync(BlockJob *job,
         return -EBUSY;
     }
     while (data.ret == -EINPROGRESS) {
-        aio_poll(bdrv_get_aio_context(bs), true);
+        bdrv_aio_poll(bdrv_get_aio_context(bs), true);
     }
     return (data.cancelled && data.ret == 0) ? -ECANCELED : data.ret;
 }
diff --git a/qemu-img.c b/qemu-img.c
index 75f4ee4..5c0f73b 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -654,7 +654,7 @@ static void run_block_job(BlockJob *job, Error **errp)
     AioContext *aio_context = bdrv_get_aio_context(job->bs);
 
     do {
-        aio_poll(aio_context, true);
+        bdrv_aio_poll(aio_context, true);
         qemu_progress_print((float)job->offset / job->len * 100.f, 0);
     } while (!job->ready);
 
diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
index 53477e1..b7c0e64 100644
--- a/qemu-io-cmds.c
+++ b/qemu-io-cmds.c
@@ -478,7 +478,7 @@ static int do_co_write_zeroes(BlockBackend *blk, int64_t 
offset, int count,
     co = qemu_coroutine_create(co_write_zeroes_entry);
     qemu_coroutine_enter(co, &data);
     while (!data.done) {
-        aio_poll(blk_get_aio_context(blk), true);
+        bdrv_aio_poll(blk_get_aio_context(blk), true);
     }
     if (data.ret < 0) {
         return data.ret;
@@ -2046,7 +2046,7 @@ static const cmdinfo_t resume_cmd = {
 static int wait_break_f(BlockBackend *blk, int argc, char **argv)
 {
     while (!bdrv_debug_is_suspended(blk_bs(blk), argv[1])) {
-        aio_poll(blk_get_aio_context(blk), true);
+        bdrv_aio_poll(blk_get_aio_context(blk), true);
     }
 
     return 0;
-- 
2.4.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]