Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CA-89303: A slave without master cannot bring up its management interfac... #919

Merged
merged 1 commit into from Nov 29, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 16 additions & 18 deletions ocaml/xapi/xapi_mgmt_iface.ml
Expand Up @@ -49,25 +49,23 @@ let stop () =
* the pool master. *) * the pool master. *)
let start ~__context ?addr () = let start ~__context ?addr () =
debug "Starting new server"; debug "Starting new server";
let localhost = Helpers.get_localhost ~__context in let addr, socket =
let ipv6_pifs = Db.PIF.get_records_where ~__context match addr with
~expr:( | None ->
And ( begin
Not (Eq (Field "ipv6_configuration_mode", Literal "None")), try (* Is it IPv6 ? *)
Eq (Field "host", Literal (Ref.string_of localhost)) let addr = Unix.inet6_addr_any in
) addr, Xapi_http.bind (Unix.ADDR_INET(addr, Xapi_globs.http_port))
) in with _ -> (* No. *)
let pif_address_type = if ipv6_pifs = [] then `IPv4 else `IPv6 in let addr = Unix.inet_addr_any in
let addr = addr, Xapi_http.bind (Unix.ADDR_INET(addr, Xapi_globs.http_port))
match addr, pif_address_type with end
| None, `IPv4 -> Unix.inet_addr_any | Some ip ->
| None, `IPv6 -> Unix.inet6_addr_any debug "Starting new server (listening on HIMN only: %s)" ip;
| Some ip, _ -> himn_only := true;
debug "Starting new server (listening on HIMN only: %s)" ip; let addr = Unix.inet_addr_of_string ip in
himn_only := true; addr, Xapi_http.bind (Unix.ADDR_INET(addr, Xapi_globs.http_port))
Unix.inet_addr_of_string ip
in in
let socket = Xapi_http.bind (Unix.ADDR_INET(addr, Xapi_globs.http_port)) in
Http_svr.start Xapi_http.server socket; Http_svr.start Xapi_http.server socket;
management_interface_server := Some socket; management_interface_server := Some socket;


Expand Down