Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Merged
merged 1 commit into from

4 participants

@jeromemaloberti

...e.

It should not try to query the DB, since the master is not accessible.

This commit fixes the problem introduces by the fix for CA-87787,
commit: 8d0adad

Signed-off-by: Jerome Maloberti jerome.maloberti@citrix.com

@jeromemaloberti jeromemaloberti CA-89303: A slave without master cannot bring up its management inter…
…face.

It should not try to query the DB, since the master is not accessible.

This commit fixes the problem introduces by the fix for CA-87787,
commit: 8d0adad

Signed-off-by: Jerome Maloberti <jerome.maloberti@citrix.com>
98ade60
@jeromemaloberti

The testcase TC-8131 passed with this commit.

@xen-git
Owner

jeromemaloberti/xen-api@98ade60xapi-project/xen-api@f0f8d51: Build succeeded. Can merge pull request.

@robhoes robhoes was assigned
@jonludlam
Owner

Assigning to @robhoes for review

@xen-git
Owner

jeromemaloberti/xen-api@98ade60xapi-project/xen-api@0817d46: Build succeeded. Can merge pull request.

@robhoes
Owner

Looks good. I had discussed this with Jerome earlier.

@robhoes
Owner

@xen-git approved.

@xen-git
Owner

jeromemaloberti/xen-api@98ade60xapi-project/xen-api@0817d46: Build succeeded. Pull request merged.

@xen-git xen-git merged commit 98ade60 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 14, 2012
  1. @jeromemaloberti

    CA-89303: A slave without master cannot bring up its management inter…

    jeromemaloberti authored
    …face.
    
    It should not try to query the DB, since the master is not accessible.
    
    This commit fixes the problem introduces by the fix for CA-87787,
    commit: 8d0adad
    
    Signed-off-by: Jerome Maloberti <jerome.maloberti@citrix.com>
This page is out of date. Refresh to see the latest.
Showing with 16 additions and 18 deletions.
  1. +16 −18 ocaml/xapi/xapi_mgmt_iface.ml
View
34 ocaml/xapi/xapi_mgmt_iface.ml
@@ -49,25 +49,23 @@ let stop () =
* the pool master. *)
let start ~__context ?addr () =
debug "Starting new server";
- let localhost = Helpers.get_localhost ~__context in
- let ipv6_pifs = Db.PIF.get_records_where ~__context
- ~expr:(
- And (
- Not (Eq (Field "ipv6_configuration_mode", Literal "None")),
- Eq (Field "host", Literal (Ref.string_of localhost))
- )
- ) in
- let pif_address_type = if ipv6_pifs = [] then `IPv4 else `IPv6 in
- let addr =
- match addr, pif_address_type with
- | None, `IPv4 -> Unix.inet_addr_any
- | None, `IPv6 -> Unix.inet6_addr_any
- | Some ip, _ ->
- debug "Starting new server (listening on HIMN only: %s)" ip;
- himn_only := true;
- Unix.inet_addr_of_string ip
+ let addr, socket =
+ match addr with
+ | None ->
+ begin
+ try (* Is it IPv6 ? *)
+ let addr = Unix.inet6_addr_any in
+ addr, Xapi_http.bind (Unix.ADDR_INET(addr, Xapi_globs.http_port))
+ with _ -> (* No. *)
+ let addr = Unix.inet_addr_any in
+ addr, Xapi_http.bind (Unix.ADDR_INET(addr, Xapi_globs.http_port))
+ end
+ | Some ip ->
+ debug "Starting new server (listening on HIMN only: %s)" ip;
+ himn_only := true;
+ let addr = Unix.inet_addr_of_string ip in
+ addr, Xapi_http.bind (Unix.ADDR_INET(addr, Xapi_globs.http_port))
in
- let socket = Xapi_http.bind (Unix.ADDR_INET(addr, Xapi_globs.http_port)) in
Http_svr.start Xapi_http.server socket;
management_interface_server := Some socket;
Something went wrong with that request. Please try again.