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

Function detect_qcow2_image

block/src/factory.rs:249–260  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

247
248 #[test]
249 fn detect_qcow2_image() {
250 let tmp = TempFile::new().unwrap();
251 {
252 let raw = RawFile::new(tmp.as_file().try_clone().unwrap(), false);
253 let mut qcow = QcowFile::new(raw, 3, 100 * 1024 * 1024, true).unwrap();
254 qcow.flush().unwrap();
255 }
256 let path = tmp.as_path().to_owned();
257 let options = default_options(&path);
258 let opened = open_disk(&options).unwrap();
259 assert_eq!(opened.image_type, ImageType::Qcow2);
260 }
261
262 #[test]
263 fn open_readonly() {

Callers

nothing calls this directly

Calls 5

newFunction · 0.85
default_optionsFunction · 0.85
open_diskFunction · 0.85
try_cloneMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected