aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2013-11-26 16:18:01 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2013-12-06 16:53:51 +0100
commitd3fa923044321b2ccc12bbdedd582d2c49d958aa (patch)
tree47145dfcfa7f48ef385c1393a38c3496da8bae71 /tests
parent0b06ef3bdd17742ae50c0662d3fe8ed944648890 (diff)
downloadqemu-d3fa923044321b2ccc12bbdedd582d2c49d958aa.zip
qemu-d3fa923044321b2ccc12bbdedd582d2c49d958aa.tar.gz
qemu-d3fa923044321b2ccc12bbdedd582d2c49d958aa.tar.bz2
aio: make aio_poll(ctx, true) block with no fds
This patch drops a special case where aio_poll(ctx, true) returns false instead of blocking if no file descriptors are waiting on I/O. Now it is possible to block in aio_poll() to wait for aio_notify(). This change eliminates busy waiting. bdrv_drain_all() used to rely on busy waiting to completed throttled I/O requests but this is no longer required so we can simplify aio_poll(). Note that aio_poll() still returns false when aio_notify() was used. In other words, stopping a blocking aio_poll() wait is not considered making progress. Adjust test-aio /aio/bh/callback-delete/one which assumed aio_poll(ctx, true) would immediately return false instead of blocking. Reviewed-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test-aio.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/tests/test-aio.c b/tests/test-aio.c
index c4fe0fc..592721e 100644
--- a/tests/test-aio.c
+++ b/tests/test-aio.c
@@ -195,7 +195,6 @@ static void test_bh_delete_from_cb(void)
g_assert(data1.bh == NULL);
g_assert(!aio_poll(ctx, false));
- g_assert(!aio_poll(ctx, true));
}
static void test_bh_delete_from_cb_many(void)