File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -32,9 +32,20 @@ let lvresize copts live (vg_name,lv_opt) real_size percent_size =
3232
3333 let resize_remotely () =
3434 if device_is_active then Devmapper. suspend name;
35- ( match size with
36- | `Absolute size -> Client. resize lv_name size
37- | `IncreaseBy delta -> Client. resize lv_name Int64. (add delta (mul (mul 512L vg.Lvm.Vg. extent_size) (Lvm.Lv. size_in_extents lv))) )
35+ Lwt. catch
36+ (fun () ->
37+ match size with
38+ | `Absolute size -> Client. resize lv_name size
39+ | `IncreaseBy delta -> Client. resize lv_name Int64. (add delta (mul (mul 512L vg.Lvm.Vg. extent_size) (Lvm.Lv. size_in_extents lv)))
40+ ) (function
41+ | Xenvm_interface. Insufficient_free_space (needed , available ) ->
42+ Printf. fprintf Pervasives. stderr " Insufficient free space: %Ld extents needed, but only %Ld available\n %!" needed available;
43+ if device_is_active then Devmapper. resume name;
44+ exit 5
45+ | e ->
46+ if device_is_active then Devmapper. resume name;
47+ fail e
48+ )
3849 >> = fun () ->
3950 if device_is_active then begin
4051 Client. get_lv ~name: lv_name >> = fun (vg , lv ) ->
You can’t perform that action at this time.
0 commit comments