(
file: fs::File,
options: &DiskOpenOptions<'_>,
)
| 169 | } |
| 170 | |
| 171 | fn open_qcow2( |
| 172 | file: fs::File, |
| 173 | options: &DiskOpenOptions<'_>, |
| 174 | ) -> BlockResult<Box<dyn AsyncFullDiskFile>> { |
| 175 | #[cfg(feature = "io_uring")] |
| 176 | if !options.disable_io_uring { |
| 177 | if io_uring_supported() { |
| 178 | info!("Opening QCOW2 disk file with io_uring backend"); |
| 179 | return Ok(Box::new( |
| 180 | QcowDisk::new( |
| 181 | file, |
| 182 | options.direct, |
| 183 | options.backing_files, |
| 184 | options.sparse, |
| 185 | true, |
| 186 | ) |
| 187 | .map_err(|e| e.with_path(options.path))?, |
| 188 | )); |
| 189 | } |
| 190 | info!("io_uring runtime probe failed for QCOW2, using synchronous backend"); |
| 191 | } |
| 192 | |
| 193 | info!("Opening QCOW2 disk file with synchronous backend"); |
| 194 | Ok(Box::new( |
| 195 | QcowDisk::new( |
| 196 | file, |
| 197 | options.direct, |
| 198 | options.backing_files, |
| 199 | options.sparse, |
| 200 | false, |
| 201 | ) |
| 202 | .map_err(|e| e.with_path(options.path))?, |
| 203 | )) |
| 204 | } |
| 205 | |
| 206 | #[cfg(test)] |
| 207 | mod unit_tests { |
no test coverage detected