diff --git a/ocaml/xapi/xapi_globs.ml b/ocaml/xapi/xapi_globs.ml index 3fbe0d36b4..1b0d7c9bdd 100644 --- a/ocaml/xapi/xapi_globs.ml +++ b/ocaml/xapi/xapi_globs.ml @@ -1055,6 +1055,8 @@ let disable_webserver = ref false let reuse_pool_sessions = ref true +let validate_reusable_pool_session = ref false + let test_open = ref 0 let xapi_globs_spec = @@ -1625,6 +1627,11 @@ let other_options = , (fun () -> string_of_bool !reuse_pool_sessions) , "Enable the reuse of pool sessions" ) + ; ( "validate-reusable-pool-session" + , Arg.Set validate_reusable_pool_session + , (fun () -> string_of_bool !validate_reusable_pool_session) + , "Enable the reuse of pool sessions" + ) ] (* The options can be set with the variable xapiflags in /etc/sysconfig/xapi. diff --git a/ocaml/xapi/xapi_session.ml b/ocaml/xapi/xapi_session.ml index abced81ca4..bd981cb369 100644 --- a/ocaml/xapi/xapi_session.ml +++ b/ocaml/xapi/xapi_session.ml @@ -701,7 +701,9 @@ let login_no_password_common ~__context ~uname ~originator ~host ~pool with_lock reusable_pool_session_lock (fun () -> if !reusable_pool_session <> Ref.null - && is_valid_session !reusable_pool_session + && ((not !Xapi_globs.validate_reusable_pool_session) + || is_valid_session !reusable_pool_session + ) then !reusable_pool_session else