From e38f00644d247894442402e098435fcccf5ce428 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 17 Apr 2026 09:23:12 +0200 Subject: [PATCH] tests: Replace manual losetup with create_loop_device() call Use the ioctl based create_loop_device() helper instead of shelling out to losetup in the file backed 4K alignment test. Signed-off-by: Anatol Belski --- cloud-hypervisor/tests/integration.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cloud-hypervisor/tests/integration.rs b/cloud-hypervisor/tests/integration.rs index 0e59acbe7..0dc7a8d64 100644 --- a/cloud-hypervisor/tests/integration.rs +++ b/cloud-hypervisor/tests/integration.rs @@ -3529,12 +3529,7 @@ mod common_parallel { "truncate failed" ); - let loop_dev = exec_host_command_output(&format!( - "losetup --find --show --sector-size 4096 {}", - fs_img_path.to_str().unwrap() - )); - assert!(loop_dev.status.success(), "losetup failed"); - let loop_dev_path = String::from_utf8_lossy(&loop_dev.stdout).trim().to_string(); + let loop_dev_path = create_loop_device(fs_img_path.to_str().unwrap(), 4096, 5); assert!( exec_host_command_output(&format!("mkfs.ext4 -q {loop_dev_path}"))