diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2020-03-23 20:54:24 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2020-03-23 20:54:24 +0000 |
commit | f1e748d27996e0cd8269db837a32e453dd55930a (patch) | |
tree | 23301194ddf6bd18423b3651c196526caf27f9a4 | |
parent | c532b954d96f96d361ca31308f75f1b95bd4df76 (diff) | |
parent | ff807d559205a434fd37d3343f01a0ab128bd190 (diff) | |
download | qemu-f1e748d27996e0cd8269db837a32e453dd55930a.zip qemu-f1e748d27996e0cd8269db837a32e453dd55930a.tar.gz qemu-f1e748d27996e0cd8269db837a32e453dd55930a.tar.bz2 |
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Pull request
# gpg: Signature made Mon 23 Mar 2020 19:24:02 GMT
# gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
# gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8
* remotes/stefanha/tags/block-pull-request:
aio-posix: fix io_uring with external events
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | util/fdmon-io_uring.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/util/fdmon-io_uring.c b/util/fdmon-io_uring.c index 893b79b..7e143ef 100644 --- a/util/fdmon-io_uring.c +++ b/util/fdmon-io_uring.c @@ -290,7 +290,18 @@ static int fdmon_io_uring_wait(AioContext *ctx, AioHandlerList *ready_list, static bool fdmon_io_uring_need_wait(AioContext *ctx) { - return io_uring_cq_ready(&ctx->fdmon_io_uring); + /* Have io_uring events completed? */ + if (io_uring_cq_ready(&ctx->fdmon_io_uring)) { + return true; + } + + /* Do we need to submit new io_uring sqes? */ + if (!QSLIST_EMPTY_RCU(&ctx->submit_list)) { + return true; + } + + /* Are we falling back to fdmon-poll? */ + return atomic_read(&ctx->external_disable_cnt); } static const FDMonOps fdmon_io_uring_ops = { |