X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=mlvirsh%2Fmlvirsh.ml;fp=mlvirsh%2Fmlvirsh.ml;h=4c77e7f34dc77cab723602f684df6cb6b2d94915;hb=401a26ab4e66a801ba1489ca8302cb7b1a47baeb;hp=6bf695a96f87d94b7c227dc5669eb3d2a89cc73b;hpb=2d54c385902ef411f9329d72bc26910d768937d6;p=ocaml-libvirt.git diff --git a/mlvirsh/mlvirsh.ml b/mlvirsh/mlvirsh.ml index 6bf695a..4c77e7f 100644 --- a/mlvirsh/mlvirsh.ml +++ b/mlvirsh/mlvirsh.ml @@ -454,7 +454,17 @@ let do_command = cmd4 print_string (fun dom path offset size -> let buf = String.create size in - D.block_peek dom path offset size buf 0; + let max_peek = D.max_peek dom in + let rec loop i = + let remaining = size-i in + if remaining > 0 then ( + let size = min remaining max_peek in + D.block_peek dom path + (Int64.add offset (Int64.of_int i)) size buf i; + loop (i+size) + ) + in + loop 0; buf) (arg_readonly_connection domain_of_string) string_of_string Int64.of_string int_of_string, @@ -494,7 +504,17 @@ let do_command = cmd3 print_string (fun dom offset size -> let buf = String.create size in - D.memory_peek dom [D.Virtual] offset size buf 0; + let max_peek = D.max_peek dom in + let rec loop i = + let remaining = size-i in + if remaining > 0 then ( + let size = min remaining max_peek in + D.memory_peek dom [D.Virtual] + (Int64.add offset (Int64.of_int i)) size buf i; + loop (i+size) + ) + in + loop 0; buf) (arg_readonly_connection domain_of_string) Int64.of_string int_of_string,