Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #915 from jonludlam/more-debian-patches

  • Loading branch information...
commit f0f8d51673920e6a541cc0b8694dc5f1772a56c4 2 parents 8cddb3a + 2214a40
xen-git authored
12 Makefile
View
@@ -43,8 +43,12 @@ XHADIR=/opt/xensource/xha
BINDIR=/usr/lib/xcp/bin
SBINDIR=/usr/sbin
UDEVDIR=/lib/udev
+
+OCAMLPATH=/usr/lib/xen-4.1/lib/ocaml:/usr/lib/ocaml/xcp
+EXTRA_INSTALL_PATH=/xcp
+
else
-VARDIR=/var/xapi
+VARDIR=/var/lib/xcp
VARPATCHDIR=/var/patch
ETCDIR=/etc/xensource
OPTDIR=/opt/xensource
@@ -61,10 +65,14 @@ XHADIR=/opt/xensource/xha
BINDIR=/opt/xensource/bin
SBINDIR=/opt/xensource/bin
UDEVDIR=/etc/udev
+
+OCAMLPATH=
+EXTRA_INSTALL_PATH=
+
endif
-export VARDIR ETCDIR OPTDIR PLUGINDIR HOOKSDIR INVENTORY VARPATCHDIR LIBEXECDIR XAPICONF RRDDCONF SCRIPTSDIR SHAREDIR WEBDIR XHADIR BINDIR SBINDIR UDEVDIR
+export VARDIR ETCDIR OPTDIR PLUGINDIR HOOKSDIR INVENTORY VARPATCHDIR LIBEXECDIR XAPICONF RRDDCONF SCRIPTSDIR SHAREDIR WEBDIR XHADIR BINDIR SBINDIR UDEVDIR OCAMLPATH EXTRA_INSTALL_PATH
.PHONY: all
all: version ocaml/fhs.ml
2  OMakefile
View
@@ -47,7 +47,7 @@ if $(not $(defined-env DESTDIR))
if $(not $(defined-env VARDIR))
- VARDIR=/var/xapi
+ VARDIR=/var/lib/xcp
export
if $(not $(defined-env VARPATCHDIR))
VARPATCHDIR=/var/patch
2  ocaml/idl/OMakefile
View
@@ -103,7 +103,7 @@ META: META.in
sed 's/@VERSION@/$(PRODUCT_VERSION)/g' < $< > $@
if $(defined-env DESTDIR)
- INSTALL_PATH = $(DESTDIR)/$(shell ocamlc -where)
+ INSTALL_PATH = $(DESTDIR)/$(shell ocamlc -where)$(EXTRA_INSTALL_PATH)
export
else
INSTALL_PATH = $(shell ocamlfind printconf destdir)
2  ocaml/idl/ocaml_backend/OMakefile
View
@@ -155,7 +155,7 @@ META: META.in
sed 's/@VERSION@/$(PRODUCT_VERSION)/g' < $< > $@
if $(defined-env DESTDIR)
- INSTALL_PATH = $(DESTDIR)/$(shell ocamlc -where)
+ INSTALL_PATH = $(DESTDIR)/$(shell ocamlc -where)$(EXTRA_INSTALL_PATH)
export
else
INSTALL_PATH = $(shell ocamlfind printconf destdir)
15 ocaml/rrdd/rrdd_stats.ml
View
@@ -139,11 +139,20 @@ let print_system_stats () =
let current_offset = Unix.gettimeofday () -. (Int64.to_float (Oclock.gettime Oclock.monotonic) /. 1e9) in
debug "Clock drift: %.0f" (current_offset -. initial_offset)
+let pidof_path =
+ try
+ let path = List.hd (List.filter (fun x -> try ignore (Unix.stat x); true with _ -> false) ["/sbin/pidof";"/bin/pidof"]) in
+ debug "Located pidof: %s" path;
+ Some path
+ with _ ->
+ None
+
+
(* Obtains process IDs for the specified program.
* This should probably be moved into xen-api-libs. *)
let pidof ~(program : string) : int list =
try
- let pidof_path = "/sbin/pidof" in
+ let pidof_path = Opt.unbox pidof_path in
let out, _ = Forkhelpers.execute_command_get_output pidof_path [program] in
let lines = String.split '\n' out in
let get_pids_from_line acc line =
@@ -154,7 +163,9 @@ let pidof ~(program : string) : int list =
acc @ pids
in
List.fold_left get_pids_from_line [] lines
- with Forkhelpers.Spawn_internal_error (_, _, _) -> []
+ with
+ | Forkhelpers.Spawn_internal_error (_, _, _) -> []
+ | Not_found -> []
let print_stats_for ~program =
let pids = pidof ~program in
2  ocaml/xapi/storage_impl.ml
View
@@ -831,7 +831,7 @@ module Local_domain_socket = struct
end
open Xmlrpc_client
-let local_url = Http.Url.(File { path = "/var/xapi/storage" }, { uri = "/"; query_params = [] })
+let local_url = Http.Url.(File { path = Filename.concat Fhs.vardir "storage" }, { uri = "/"; query_params = [] })
let rpc ~srcstr ~dststr url call =
XMLRPC_protocol.rpc ~transport:(transport_of_url url)
2  ocaml/xapi/storage_migrate.ml
View
@@ -24,7 +24,7 @@ open Pervasiveext
open Xmlrpc_client
open Threadext
-let local_url = Http.Url.(File { path = "/var/xapi/storage" }, { uri = "/"; query_params = [] })
+let local_url = Http.Url.(File { path = Filename.concat Fhs.vardir "storage" }, { uri = "/"; query_params = [] })
let remote_url ip = Http.Url.(Http { host=ip; auth=None; port=None; ssl=true }, { uri = "/services/SM"; query_params=["pool_secret",!Xapi_globs.pool_secret] } )
open Storage_interface
6 ocaml/xapi/xapi_services.ml
View
@@ -113,7 +113,7 @@ let post_handler (req: Http.Request.t) s _ =
(fun __context ->
match String.split '/' req.Http.Request.uri with
| "" :: services :: "xenops" :: _ when services = _services ->
- ignore (hand_over_connection req s "/var/xapi/xenopsd.forwarded")
+ ignore (hand_over_connection req s (Filename.concat Fhs.vardir "xenopsd.forwarded"))
| "" :: services :: "plugin" :: name :: _ when services = _services ->
http_proxy_to_plugin req s name
| "" :: services :: "driver" :: uuid :: ty :: instance :: rest when services = _services ->
@@ -127,7 +127,7 @@ let post_handler (req: Http.Request.t) s _ =
let rpc ~srcstr ~dststr call =
- let url = Http.Url.(File { path = "/var/xapi/storage" }, { uri = "/"; query_params = [] }) in
+ let url = Http.Url.(File { path = Filename.concat Fhs.vardir "storage" }, { uri = "/"; query_params = [] }) in
let open Xmlrpc_client in
XMLRPC_protocol.rpc ~transport:(transport_of_url url) ~srcstr ~dststr
~http:(xmlrpc ~version:"1.0" ?auth:(Http.Url.auth_of url) ~query:(Http.Url.get_query_params url) (Http.Url.get_uri url)) call
@@ -139,7 +139,7 @@ let put_handler (req: Http.Request.t) s _ =
(fun __context ->
match String.split '/' req.Http.Request.uri with
| "" :: services :: "xenops" :: _ when services = _services ->
- ignore (hand_over_connection req s "/var/xapi/xenopsd.forwarded")
+ ignore (hand_over_connection req s (Filename.concat Fhs.vardir "xenopsd.forwarded"))
| "" :: services :: "plugin" :: name :: _ when services = _services ->
http_proxy_to_plugin req s name
| "" :: services :: "driver" :: uuid :: ty :: instance :: rest when services = _services ->
2  ocaml/xapi/xapi_vm_migrate.ml
View
@@ -668,7 +668,7 @@ let handler req fd _ =
let memory_limit = free_memory_required_kib |> Memory.bytes_of_kib |> Int64.to_string in
let req = Http.Request.make ~cookie:["dbg", dbg; "instance_id", "upgrade"; "memory_limit", memory_limit]
~user_agent:"xapi" Http.Put uri in
- let path = "/var/xapi/xenopsd.forwarded" in
+ let path = Filename.concat Fhs.vardir "xenopsd.forwarded" in
let response = Xapi_services.hand_over_connection req fd path in
begin match response with
| Some task ->
4 ocaml/xenops-cli/OMakefile
View
@@ -1,5 +1,5 @@
-OCAML_LIBS = ../xenops/xenops_client
-OCAMLINCLUDES = ../xenops ../util
+OCAML_LIBS = ../xenops/xenops_client ../fhs
+OCAMLINCLUDES = ../xenops ../util ..
OCAMLPACKS = xml-light2 stdext stunnel log http-svr oUnit
UseCamlp4(rpc-light.syntax, xn_cfg_types)
2  ocaml/xenops-cli/test.ml
View
@@ -25,7 +25,7 @@ open Fun
open Xmlrpc_client
-let default_path = "/var/xapi/xenopsd"
+let default_path = Filename.concat Fhs.vardir "xenopsd"
let transport = ref (Unix default_path)
open Xenops_interface
2  ocaml/xenops/memory_interface.ml
View
@@ -16,7 +16,7 @@
*)
let service_name = "memory"
-let json_path = "/var/xapi/memory.json"
+let json_path = Filename.concat Fhs.vardir "memory.json"
type reservation_id = string
2  ocaml/xenops/xenops_client.ml
View
@@ -20,7 +20,7 @@ module D = Debug.Debugger(struct let name = "xenops_client" end)
open D
module E = Debug.Debugger(struct let name = "mscgen" end)
-let default_path = "/var/xapi/xenopsd"
+let default_path = "/var/lib/xcp/xenopsd"
let forwarded_path = default_path ^ ".forwarded"
let default_uri = "file:" ^ default_path
2  ocaml/xenops/xenops_migrate.ml
View
@@ -23,7 +23,7 @@ open D
(*
let local_rpc call =
let open Xmlrpc_client in
- XMLRPC_protocol.rpc ~transport:(Unix "/var/xapi/xenopsd") ~http:(xmlrpc ~version:"1.0" "/") call
+ XMLRPC_protocol.rpc ~transport:(Unix "/var/lib/xcp/xenopsd") ~http:(xmlrpc ~version:"1.0" "/") call
let _metadata = "VM.import_metadata"
let _failure = "VM.client_migrate_failed"
2  ocaml/xenops/xenops_server_xen.ml
View
@@ -255,7 +255,7 @@ module Storage = struct
let open Xmlrpc_client in
retry_econnrefused 10
(fun () ->
- XMLRPC_protocol.rpc ~srcstr:"xenops" ~dststr:"smapiv2" ~transport:(Unix "/var/xapi/storage") ~http:(xmlrpc ~version:"1.0" "/") call
+ XMLRPC_protocol.rpc ~srcstr:"xenops" ~dststr:"smapiv2" ~transport:(Unix (Filename.concat Fhs.vardir "storage")) ~http:(xmlrpc ~version:"1.0" "/") call
)
end)
2  ocaml/xenops/xenopsd.ml
View
@@ -77,7 +77,7 @@ let dump_config_file () : unit =
let socket : Http_svr.socket option ref = ref None
let server = Http_svr.Server.empty (Xenops_server.make_context ())
-let path = "/var/xapi/xenopsd"
+let path = Filename.concat Fhs.vardir "xenopsd"
let forwarded_path = path ^ ".forwarded" (* receive an authenticated fd from xapi *)
let json_path = path ^ ".json"
2  scripts/OMakefile
View
@@ -49,7 +49,7 @@ install:
$(IPROG) xapi-logrotate $(DESTDIR)/etc/logrotate.d/xapi
$(IPROG) xapi-wait-init-complete $(DESTDIR)$(BINDIR)
$(IPROG) xapi-autostart-vms $(DESTDIR)$(BINDIR)
- $(IPROG) udhcpd.skel $(DESTDIR)/var/xapi/udhcpd.skel #### FHS_FIXME
+ $(IPROG) udhcpd.skel $(DESTDIR)$(VARDIR)/udhcpd.skel
$(IDATA) xapi.conf $(DESTDIR)$(XAPICONF)
$(IDATA) sparse_dd.conf $(DESTDIR)/etc/sparse_dd.conf
$(IDATA) xcp-rrdd.conf $(DESTDIR)/etc/xcp-rrdd.conf
2  scripts/examples/python/XenAPI.py
View
@@ -199,7 +199,7 @@ def __getattr__(self, name):
return xmlrpclib.ServerProxy.__getattr__(self, name)
def xapi_local():
- return Session("http://_var_xapi_xapi/", transport=UDSTransport())
+ return Session("http://_var_lib_xcp_xapi/", transport=UDSTransport())
def _parse_result(result):
if type(result) != dict or 'Status' not in result:
5 xapi.spec.in
View
@@ -132,6 +132,8 @@ for e in py pyc pyo; do
echo $SITEDIR/rrdd.$e
done > rrdd-files
+ln -s /var/lib/xcp $RPM_BUILD_ROOT/var/xapi
+
%clean
rm -rf $RPM_BUILD_ROOT
@@ -281,9 +283,10 @@ rm -rf $RPM_BUILD_ROOT
@OPTDIR@/libexec/pci-info
@OPTDIR@/packages/post-install-scripts/debian-etch
@OPTDIR@/packages/post-install-scripts/debug
-/var/xapi/udhcpd.skel
+/var/lib/xcp/udhcpd.skel
@OPTDIR@/debug/rbac_static.csv
/etc/xapi.d/host-post-declare-dead/10resetvdis
+/var/xapi
%files xe
%defattr(-,root,root,-)
Please sign in to comment.
Something went wrong with that request. Please try again.