block: qcow: Add try_clone backend preservation tests

Verify that try_clone preserves the backend dispatch for both
sync and io_uring backends.

Assisted-by: Claude:Opus-4.6
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
Anatol Belski
2026-04-23 21:17:10 +02:00
committed by Rob Bradford
parent 9043098473
commit 5958872943

View File

@@ -237,4 +237,21 @@ mod unit_tests {
let disk = QcowDisk::new(file, false, false, true, true).unwrap();
assert_async_io(&disk, true);
}
#[test]
fn try_clone_preserves_sync_dispatch() {
let file = make_qcow_file();
let disk = QcowDisk::new(file, false, false, true, false).unwrap();
let cloned = disk.try_clone().unwrap();
assert_async_io_from_dyn(cloned.as_ref(), false);
}
#[cfg(feature = "io_uring")]
#[test]
fn try_clone_preserves_io_uring_dispatch() {
let file = make_qcow_file();
let disk = QcowDisk::new(file, false, false, true, true).unwrap();
let cloned = disk.try_clone().unwrap();
assert_async_io_from_dyn(cloned.as_ref(), true);
}
}