mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
Closing an io_uring fd does not synchronously finish requests that already reached the kernel. During block worker teardown this can let an io-wq worker keep using retained guest-memory iovecs after reset. Drain UringDataIo in Drop: retry any published SQEs and wait for CQEs until no retained operation remains. If draining fails, leak retained buffers. Drop QcowAsync's ring before its data fd so retrying published SQEs still uses a valid descriptor. To avoid a potential infinite loop when completions fail to be delivered cap the number of iterations of the loop (2x the number of inflight requests). Assisted-by: Codex:GPT-5 Signed-off-by: Rob Bradford <rbradford@meta.com>