(
file: fs::File,
options: &DiskOpenOptions<'_>,
)
| 140 | } |
| 141 | |
| 142 | fn open_raw( |
| 143 | file: fs::File, |
| 144 | options: &DiskOpenOptions<'_>, |
| 145 | ) -> BlockResult<Box<dyn AsyncFullDiskFile>> { |
| 146 | if !options.readonly && !options.sparse { |
| 147 | preallocate_disk(&file, options.path); |
| 148 | } |
| 149 | |
| 150 | #[cfg(feature = "io_uring")] |
| 151 | if !options.disable_io_uring { |
| 152 | if io_uring_supported() { |
| 153 | info!("Opening RAW disk file with io_uring backend"); |
| 154 | return Ok(Box::new(RawDisk::new(file, RawBackend::IoUring))); |
| 155 | } |
| 156 | info!("io_uring runtime probe failed for RAW, trying next backend"); |
| 157 | } |
| 158 | |
| 159 | if !options.disable_aio { |
| 160 | if aio_supported() { |
| 161 | info!("Opening RAW disk file with AIO backend"); |
| 162 | return Ok(Box::new(RawDisk::new(file, RawBackend::Aio))); |
| 163 | } |
| 164 | info!("AIO runtime probe failed for RAW, using synchronous backend"); |
| 165 | } |
| 166 | |
| 167 | info!("Opening RAW disk file with synchronous backend"); |
| 168 | Ok(Box::new(RawDisk::new(file, RawBackend::Sync))) |
| 169 | } |
| 170 | |
| 171 | fn open_qcow2( |
| 172 | file: fs::File, |
no test coverage detected