From 02022d8813f9e8ad544ffaeacbe904e35f2a39e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= Date: Thu, 21 Dec 2023 17:04:37 +0000 Subject: [PATCH] fixup! CP-47001: [xapi-fdcaps]: add operations module and tests --- lib/xapi-fdcaps/operations.ml | 2 +- lib/xapi-fdcaps/operations.mli | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/xapi-fdcaps/operations.ml b/lib/xapi-fdcaps/operations.ml index eb15f1dc..e278a114 100644 --- a/lib/xapi-fdcaps/operations.ml +++ b/lib/xapi-fdcaps/operations.ml @@ -198,7 +198,7 @@ let check_output cmd args = | _ -> failwith (Printf.sprintf "%s exited nonzero" cmd) -let with_temp_blk ?(sector_size = 512) ?delay_read_ms:_ ?delay_write_ms:_ name f +let with_temp_blk ?(sector_size = 512) name f = let blkdev = check_output "losetup" diff --git a/lib/xapi-fdcaps/operations.mli b/lib/xapi-fdcaps/operations.mli index 8e08f5c9..be298901 100644 --- a/lib/xapi-fdcaps/operations.mli +++ b/lib/xapi-fdcaps/operations.mli @@ -225,20 +225,16 @@ val with_tempfile : val with_temp_blk : ?sector_size:int - -> ?delay_read_ms:float - -> ?delay_write_ms:float -> string -> (string * ([> rdwr], [> blk]) make -> 'a) -> 'a -(** [with_temp_blk ?sector_size ?delay_read ?delay_write path f] calls [f (name, fd)] with a name and file descriptor pointing to a block device. +(** [with_temp_blk ?sector_size path f] calls [f (name, fd)] with a name and file descriptor pointing to a block device. The block device is temporarily created on top of [path]. Deletes the block device when [f] finishes. Only works when run as root. @param sector_size between 512 and 4096 - @param delay_read_ms delays read operations by specified milliseconds - @param delay_write_ms delays write operations by specified milliseconds *) (** {1 Operation wrappers}