with exn ->
warn "exception ignored during cpuid: %s" (Printexc.to_string exn)
+let set_affinity xc domid cfg =
+ try
+ List.iter (fun (id, l) ->
+ let cpumap = Array.make 64 false in
+ (* make the bitmap *)
+ List.iter (fun x ->
+ if x >= 0 && x < 64 then
+ cpumap.(x) <- true
+ ) l;
+ (* and dump in into xen *)
+ Domain.vcpu_affinity_set ~xc domid id cpumap
+ ) cfg.cpus_affinity;
+ with exn ->
+ warn "exception ignored during affinity setting: %s" (Printexc.to_string exn)
+
let do_trigger xc state args =
match args with
| "s3resume" :: _ ->
try
f state cfg;
set_cpuid xc domid cfg;
+ set_affinity xc domid cfg;
add_devices xc xs domid state restore;
with exn ->
warn "receive exception building vm: %s" (Printexc.to_string exn);