Skip to content

CA-400860: make CPU and netdev RRDD plugins pick up changes in domains #6067

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions ocaml/xcp-rrdd/bin/rrdp-cpu/rrdp_cpu.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 _ =
Expand All @@ -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 *)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to add a static number that's correlated with the maximum supported number of VMs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but I was worried that might be a bit too much and would need more testing, this quick fix is probably not the place for it

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)
)
20 changes: 10 additions & 10 deletions ocaml/xcp-rrdd/bin/rrdp-netdev/rrdp_netdev.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Loading