Skip to content

Commit 148f064

Browse files
committed
CA-226241:Stop pool_update.introduce if free disk space not enough
Signed-off-by: Cheng Zhang <[email protected]>
1 parent cb63e8c commit 148f064

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ocaml/xapi/xapi_pool_update.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,10 @@ let create_update_record ~__context ~update ~update_info ~vdi =
347347
~vdi:vdi
348348

349349
let introduce ~__context ~vdi =
350-
let update_info = extract_update_info ~__context ~vdi ~verify in
351350
ignore(Unixext.mkdir_safe Xapi_globs.host_update_dir 0o755);
351+
(*If current disk free space is smaller than 1MB raise exception*)
352+
assert_space_available ~multiplier:1L Xapi_globs.host_update_dir (Int64.mul 1024L 1024L);
353+
let update_info = extract_update_info ~__context ~vdi ~verify in
352354
ignore(assert_space_available Xapi_globs.host_update_dir update_info.installation_size);
353355
try
354356
let update = Db.Pool_update.get_by_uuid ~__context ~uuid:update_info.uuid in

0 commit comments

Comments
 (0)