qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

io_uring: use io_uring_cq_ready() to check for ready cqes

In qemu_luring_poll_cb() we are not using the cqe peeked from the
CQ ring. We are using io_uring_peek_cqe() only to see if there
are cqes ready, so we can replace it with io_uring_cq_ready().

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-id: 20200519134942.118178-1-sgarzare@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

authored by

Stefano Garzarella and committed by
Stefan Hajnoczi
769335ec b4e44c99

+3 -6
+3 -6
block/io_uring.c
··· 277 277 static bool qemu_luring_poll_cb(void *opaque) 278 278 { 279 279 LuringState *s = opaque; 280 - struct io_uring_cqe *cqes; 281 280 282 - if (io_uring_peek_cqe(&s->ring, &cqes) == 0) { 283 - if (cqes) { 284 - luring_process_completions_and_submit(s); 285 - return true; 286 - } 281 + if (io_uring_cq_ready(&s->ring)) { 282 + luring_process_completions_and_submit(s); 283 + return true; 287 284 } 288 285 289 286 return false;