Skip to content

Commit ae9aa67

Browse files
committed
output: Report space on the target filesystem
For output modes which use the common 'create_local_output_disks' function (those that produce '*-sda' files), report how much space is available on the filesystem hosting that output file. This is because we've had failures where there wasn't enough space on the target filesystem, so this just collects the information ahead of time in case we see those kinds of failures again. Thanks: Martin Necas, Alex Kalenyuk
1 parent 0e8ea6b commit ae9aa67

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

output/output.ml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,17 @@ let create_local_output_disks dir
177177
| Sparse -> None in
178178
List.iter (
179179
fun (size, filename) ->
180-
g#disk_create ?preallocation filename output_format size
180+
g#disk_create ?preallocation filename output_format size;
181+
182+
(* We've had issues with there not being enough space to write
183+
* the disk image. Run df on the output filename. df follows
184+
* symlinks and reports the space on the filesystem. But don't
185+
* fail here if df cannot be run.
186+
*)
187+
if verbose () then (
188+
let cmd = sprintf "df %s 1>&2" (quote filename) in
189+
ignore (Sys.command cmd)
190+
)
181191
) (List.combine input_sizes output_disk_names);
182192
183193
let socket = sprintf "%s/out0" dir in

0 commit comments

Comments
 (0)