Skip to content

Commit e12dd8a

Browse files
committed
xapi_sm: Don't allow host_pending_features that are empty
When none on of the hosts have pending features, a map was produced with all the hosts with an empty value for each after upgrading. Empty the map instead when that occurs. Signed-off-by: Pau Ruiz Safont <pau.safont@vates.tech>
1 parent 4447647 commit e12dd8a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ocaml/xapi/xapi_sm.ml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ let remove_valid_features_from_pending ~__context ~self valid_features =
9595
(h, Listext.List.set_difference pending_features valid_features)
9696
)
9797
in
98+
let new_pending_feature =
99+
if List.for_all (fun (_, v) -> v = []) new_pending_feature then
100+
[]
101+
else
102+
new_pending_feature
103+
in
98104
Db.SM.set_host_pending_features ~__context ~self ~value:new_pending_feature
99105

100106
let update_from_query_result ~__context (self, r) q_result =

0 commit comments

Comments
 (0)