Skip to content

Commit

Permalink
fixup! CP-47001: [xapi-fdcaps]: add operations module and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edwintorok committed Dec 21, 2023
1 parent a719cd2 commit 02022d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/xapi-fdcaps/operations.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 1 addition & 5 deletions lib/xapi-fdcaps/operations.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 02022d8

Please sign in to comment.