diff --git a/ocaml/xcp-rrdd/bin/rrdp-cpu/rrdp_cpu.ml b/ocaml/xcp-rrdd/bin/rrdp-cpu/rrdp_cpu.ml index 8b56119a76..7a0db5ec5d 100644 --- a/ocaml/xcp-rrdd/bin/rrdp-cpu/rrdp_cpu.ml +++ b/ocaml/xcp-rrdd/bin/rrdp-cpu/rrdp_cpu.ml @@ -226,7 +226,8 @@ let dss_hostload xc domains = ) ] -let generate_cpu_ds_list xc domains () = +let generate_cpu_ds_list xc () = + let _, domains, _ = Xenctrl_lib.domain_snapshot xc in dss_pcpus xc @ dss_vcpus xc domains @ dss_loadavg () @ dss_hostload xc domains let _ = @@ -236,8 +237,8 @@ let _ = (* Share one page per PCPU and dom each *) let physinfo = Xenctrl.physinfo xc in let shared_page_count = physinfo.Xenctrl.nr_cpus + List.length domains in - + (* TODO: Can run out of pages if a lot of domains are added at runtime *) Process.main_loop ~neg_shift:0.5 ~target:(Reporter.Local shared_page_count) ~protocol:Rrd_interface.V2 - ~dss_f:(generate_cpu_ds_list xc domains) + ~dss_f:(generate_cpu_ds_list xc) ) diff --git a/ocaml/xcp-rrdd/bin/rrdp-netdev/rrdp_netdev.ml b/ocaml/xcp-rrdd/bin/rrdp-netdev/rrdp_netdev.ml index 5b138aebbe..299bb9a97d 100644 --- a/ocaml/xcp-rrdd/bin/rrdp-netdev/rrdp_netdev.ml +++ b/ocaml/xcp-rrdd/bin/rrdp-netdev/rrdp_netdev.ml @@ -131,7 +131,11 @@ let transform_taps devs = ) newdevnames -let generate_netdev_dss doms () = +let generate_netdev_dss () = + let _, doms, _ = + Xenctrl.with_intf (fun xc -> Xenctrl_lib.domain_snapshot xc) + in + let uuid_of_domid domains domid = let _, uuid, _ = try List.find (fun (_, _, domid') -> domid = domid') domains @@ -265,12 +269,8 @@ let generate_netdev_dss doms () = @ dss let _ = - Xenctrl.with_intf (fun xc -> - let _, domains, _ = Xenctrl_lib.domain_snapshot xc in - Process.initialise () ; - (* Share one page per virtual NIC - documentation specifies max is 512 *) - let shared_page_count = 512 in - Process.main_loop ~neg_shift:0.5 - ~target:(Reporter.Local shared_page_count) ~protocol:Rrd_interface.V2 - ~dss_f:(generate_netdev_dss domains) - ) + Process.initialise () ; + (* Share one page per virtual NIC - documentation specifies max is 512 *) + let shared_page_count = 512 in + Process.main_loop ~neg_shift:0.5 ~target:(Reporter.Local shared_page_count) + ~protocol:Rrd_interface.V2 ~dss_f:generate_netdev_dss