Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use is_valid_ref rather than comparing with Ref.null

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
  • Loading branch information...
commit c93c5954ccd70227162984fbc283f71c13b9c90d 1 parent f937497
@robhoes authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  ocaml/xapi/helpers.ml
View
3  ocaml/xapi/helpers.ml
@@ -829,7 +829,8 @@ let get_pif_underneath_vlan ~__context vlan_pif_ref =
* network can run on (and be migrated to) any (enabled) host in the pool. *)
let is_network_properly_shared ~__context ~self =
let pifs = Db.Network.get_PIFs ~__context ~self in
- let non_slave_pifs = List.filter (fun pif -> Db.PIF.get_bond_slave_of ~__context ~self:pif = Ref.null) pifs in
+ let non_slave_pifs = List.filter (fun pif ->
+ not (Db.is_valid_ref __context (Db.PIF.get_bond_slave_of ~__context ~self:pif))) pifs in
let hosts_with_pif = List.setify (List.map (fun pif -> Db.PIF.get_host ~__context ~self:pif) non_slave_pifs) in
let all_hosts = Db.Host.get_all ~__context in
let enabled_hosts = List.filter (fun host -> Db.Host.get_enabled ~__context ~self:host) all_hosts in
Please sign in to comment.
Something went wrong with that request. Please try again.