@@ -48,11 +48,11 @@ type host_info = {
4848
4949(* * The format of the response looks like
5050 * # xen-livepatch list
51- * ID | status
52- * ----------------------------------------+------------
53- * hp_1_1 | CHECKED
54- * hp_2_1 | APPLIED
55- * hp_3_2 | APPLIED *)
51+ * ID | status | metadata
52+ * ----------------------------------------+------------+---------------
53+ * hp_1_1 | CHECKED |
54+ * hp_2_1 | APPLIED |
55+ * hp_3_2 | APPLIED | *)
5656let make_xen_livepatch_list () =
5757 let lines =
5858 try
@@ -63,8 +63,8 @@ let make_xen_livepatch_list () =
6363 let patches =
6464 List. fold_left
6565 (fun acc l ->
66- match List. map String. trim (Xstringext. String.split ~limit: 2 '|' l) with
67- | [ key; " APPLIED" ] ->
66+ match List. map String. trim (String. split_on_char '|' l) with
67+ | key :: "APPLIED" :: _ ->
6868 key :: acc
6969 | _ ->
7070 acc
@@ -76,10 +76,12 @@ let make_xen_livepatch_list () =
7676(* * The format of the response looks like
7777 * # kpatch list
7878 * Loaded patch modules:
79- * kpatch_hp_1_1
80- * kpatch_hp_2_1
81-
82- * Installed patch modules: *)
79+ * lp_4_19_19__8_0_32_xs8__4_19_19__8_0_33_xs8 [enabled]
80+ * lp_4_19_19__8_0_20_xs8__4_19_19__8_0_21_xs8 [enabled]
81+ *
82+ * Installed patch modules:
83+ *
84+ * Only patch name are returned, status are excluded. *)
8385let make_kpatch_list () =
8486 let start_line = " Loaded patch modules:" in
8587 let end_line = " Installed patch modules:" in
@@ -99,7 +101,14 @@ let make_kpatch_list () =
99101 | line :: rest ->
100102 let line' = String. trim line in
101103 if line' <> " " && started then
102- loop (line' :: acc) true rest
104+ let patch_name =
105+ match String. split_on_char ' ' line' with
106+ | patch :: _ ->
107+ patch
108+ | [] ->
109+ line'
110+ in
111+ loop (patch_name :: acc) true rest
103112 else
104113 loop acc started rest
105114 in
@@ -567,6 +576,7 @@ let create_host_cpu ~__context host_info =
567576 (" cpu_count" , string_of_int cpu_info.cpu_count)
568577 ; (" socket_count" , string_of_int cpu_info.socket_count)
569578 ; (" threads_per_core" , string_of_int cpu_info.threads_per_core)
579+ ; (" nr_nodes" , string_of_int cpu_info.nr_nodes)
570580 ; (" vendor" , cpu_info.vendor)
571581 ; (" speed" , cpu_info.speed)
572582 ; (" modelname" , cpu_info.modelname)
@@ -592,11 +602,12 @@ let create_host_cpu ~__context host_info =
592602 let old_cpu_info = Db.Host. get_cpu_info ~__context ~self: host in
593603 debug
594604 " create_host_cpuinfo: setting host cpuinfo: socket_count=%d, \
595- cpu_count=%d, threads_per_core=%d, features_hvm=%s, features_pv =%s, \
596- features_hvm_host=%s, features_pv_host=%s"
605+ cpu_count=%d, threads_per_core=%d, nr_nodes=%d, features_hvm =%s, \
606+ features_pv=%s, features_hvm_host=%s, features_pv_host=%s"
597607 (Map_check. getf socket_count cpu)
598608 (Map_check. getf cpu_count cpu)
599609 (Map_check. getf threads_per_core cpu)
610+ (Map_check. getf nr_nodes cpu)
600611 (Map_check. getf features_hvm cpu |> CPU_policy. to_string)
601612 (Map_check. getf features_pv cpu |> CPU_policy. to_string)
602613 (Map_check. getf features_hvm_host cpu |> CPU_policy. to_string)
0 commit comments