MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / wait_for_completion

Function wait_for_completion

block/src/qcow_async.rs:590–603  ·  view source on GitHub ↗
(async_io: &mut dyn AsyncIo)

Source from the content-addressed store, hash-verified

588 }
589
590 fn wait_for_completion(async_io: &mut dyn AsyncIo) -> (u64, i32) {
591 loop {
592 if let Some(c) = async_io.next_completed_request() {
593 return c;
594 }
595 // Block until the eventfd is signaled (io_uring or synthetic).
596 let fd = async_io.notifier().as_raw_fd();
597 let mut val = 0u64;
598 // SAFETY: reading 8 bytes from a valid eventfd.
599 unsafe {
600 libc::read(fd, (&raw mut val).cast(), 8);
601 }
602 }
603 }
604
605 fn async_write(disk: &QcowDisk, offset: u64, data: &[u8]) {
606 let mut async_io = disk.create_async_io(1).unwrap();

Callers 5

async_writeFunction · 0.85
async_readFunction · 0.85

Calls 4

readFunction · 0.85
as_raw_fdMethod · 0.45
notifierMethod · 0.45