(&self, ring_depth: u32)
| 156 | } |
| 157 | |
| 158 | fn create_async_io(&self, ring_depth: u32) -> BlockResult<Box<dyn AsyncIo>> { |
| 159 | if self.use_io_uring { |
| 160 | #[cfg(feature = "io_uring")] |
| 161 | { |
| 162 | return Ok(Box::new( |
| 163 | QcowAsync::new( |
| 164 | Arc::clone(&self.metadata), |
| 165 | self.data_raw_file.clone(), |
| 166 | self.backing_file.as_ref().map(Arc::clone), |
| 167 | self.sparse, |
| 168 | ring_depth, |
| 169 | ) |
| 170 | .map_err(|e| { |
| 171 | BlockError::new(BlockErrorKind::Io, DiskFileError::NewAsyncIo(e)) |
| 172 | })?, |
| 173 | )); |
| 174 | } |
| 175 | |
| 176 | #[cfg(not(feature = "io_uring"))] |
| 177 | unreachable!("use_io_uring is set but io_uring feature is not enabled"); |
| 178 | } |
| 179 | |
| 180 | let _ = ring_depth; |
| 181 | Ok(Box::new(QcowSync::new( |
| 182 | Arc::clone(&self.metadata), |
| 183 | self.data_raw_file.clone(), |
| 184 | self.backing_file.as_ref().map(Arc::clone), |
| 185 | self.sparse, |
| 186 | ))) |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | #[cfg(test)] |
no test coverage detected