Skip to content

Commit

Permalink
userspace: Io_page.get takes pages, not bytes
Browse files Browse the repository at this point in the history
Listing domains in batches of 512 should be adequate (not batches of
2M)

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
  • Loading branch information
David Scott committed Nov 21, 2014
1 parent 069afbe commit 2abc1ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion userspace/domains.ml
Expand Up @@ -31,11 +31,12 @@ open Lwt
let batch_size = 512 (* number of domains to query in one hypercall *)

let sizeof = stub_sizeof_domaininfo_t ()
let getdomaininfo_buf = Cstruct.of_bigarray (Io_page.get (batch_size * sizeof))
let getdomaininfo_buf = Cstruct.of_bigarray (Io_page.get (batch_size * sizeof / 4096))

let domain_getinfolist lowest_domid =
let number_found = stub_domain_getinfolist lowest_domid batch_size getdomaininfo_buf in
let rec parse buf n acc =
Printf.fprintf stderr "len(buf) = %d sizeof = %d number_found = %d n = %d %b\n%!" (Cstruct.len buf) sizeof number_found n (n = number_found);
if n = number_found
then acc
else parse (Cstruct.shift buf sizeof) (n + 1) (stub_domaininfo_t_parse buf :: acc) in
Expand Down

0 comments on commit 2abc1ac

Please sign in to comment.