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... #919

Merged
merged 1 commit into from

5 participants

jeromemaloberti Rob Hoes xen-git Jon Ludlam Dave Scott
jeromemaloberti
Collaborator

...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>
8934a9d
Rob Hoes
Owner

I had discussed this patch with @jeromemaloberti, and it looks good to me.

xen-git
Owner

jeromemaloberti/xen-api@8934a9dxapi-project/xen-api@c59b8b5: Build succeeded. Can merge pull request.

Jira ticket CA-94044

Jon Ludlam
Owner

test this please

Dave Scott
Owner
Jon Ludlam
Owner

Heh, no, my request was actioned - hence the green status :-)

Jon Ludlam jonludlam merged commit 67a9db6 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
34 ocaml/xapi/xapi_mgmt_iface.ml
View
@@ -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.