Skip to content

Commit

Permalink
Merge pull request xapi-project#3284 from edwintorok/is-valid-ref-no-…
Browse files Browse the repository at this point in the history
…rpc-null

CA-267946: Avoid Db.is_valid_ref RPC call when Ref is NULL
  • Loading branch information
robhoes committed Oct 26, 2017
2 parents 5d3f9af + ecf8dd1 commit a52bace
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ocaml/xapi/db.ml
Expand Up @@ -17,6 +17,8 @@

include Db_actions.DB_Action
let is_valid_ref __context r =
let t = Context.database_of __context in
let module DB = (val (Db_cache.get t) : Db_interface.DB_ACCESS) in
DB.is_valid_ref t (Ref.string_of r)
if r = Ref.null then false
else
let t = Context.database_of __context in
let module DB = (val (Db_cache.get t) : Db_interface.DB_ACCESS) in
DB.is_valid_ref t (Ref.string_of r)

0 comments on commit a52bace

Please sign in to comment.