Skip to content

Commit

Permalink
Rename version.ml -> xapi_version.ml to prevent conflicts with newer …
Browse files Browse the repository at this point in the history
…OCaml

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
  • Loading branch information
jonludlam committed Feb 8, 2017
1 parent 8da516b commit af61b21
Show file tree
Hide file tree
Showing 20 changed files with 50 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ ocaml/templates/templateLexer.ml
ocaml/templates/templateParser.ml
ocaml/templates/templateParser.mli
ocaml/xapi/storage_impl_test
ocaml/util/version.ml
ocaml/util/xapi_version.ml

zurich/java/com/xensource/autogen/*.java
js/api.js
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ clean:
omake clean
omake lib-uninstall
rm -rf dist/staging
rm -f .omakedb .omakedb.lock xapi.spec version.ml
rm -f .omakedb .omakedb.lock xapi.spec xapi_version.ml
find -name '*.omc' -delete

.PHONY: otags
Expand Down Expand Up @@ -126,7 +126,7 @@ version:
let build_number () = Inventory.lookup ~default:\"$(BUILD_NUMBER)\" \"BUILD_NUMBER\" \n \
let xapi_version_major = $(shell cut -d. -f1 VERSION) \n \
let xapi_version_minor = $(shell cut -d. -f2 VERSION) \n" \
> ocaml/util/version.ml
> ocaml/util/xapi_version.ml

.PHONY: clean
clean:
Expand All @@ -143,7 +143,7 @@ srpm: xapi.spec
cp $(JQUERY) $(JQUERY_TREEVIEW) $(RPM_SOURCESDIR)
make -C $(REPO) version
rm -f $(RPM_SOURCESDIR)/xapi-version.patch
(cd $(REPO); diff -u /dev/null ocaml/util/version.ml > $(RPM_SOURCESDIR)/xapi-version.patch) || true
(cd $(REPO); diff -u /dev/null ocaml/util/xapi_version.ml > $(RPM_SOURCESDIR)/xapi-version.patch) || true
rm -f $(RPM_SOURCESDIR)/0001-Workaround-for-NVIDIA-330.patch
cp scripts/0001-Workaround-for-NVIDIA-330.patch $(RPM_SOURCESDIR)/0001-Workaround-for-NVIDIA-330.patch
cp -f xapi.spec $(RPM_SPECSDIR)/
Expand Down
2 changes: 1 addition & 1 deletion ocaml/OMakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# You must set your XEN_ROOT env var before building
XEN_CFLAGS = -I$(XEN_ROOT)/usr/include
OCAMLINCLUDES = $(ROOT)/ocaml/idl +ocamldoc
OCAML_LIBS = $(ROOT)/ocaml/util/version $(ROOT)/ocaml/util/stats
OCAML_LIBS = $(ROOT)/ocaml/util/xapi_version $(ROOT)/ocaml/util/stats
OCAMLPACKS = stdext uuid gzip

.SUBDIRS: \
Expand Down
2 changes: 1 addition & 1 deletion ocaml/cdrommon/OMakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
OCAML_LIBS = ../util/version
OCAML_LIBS = ../util/xapi_version
OCAMLPACKS += unix cdrom xcp-inventory

OCamlProgram(cdrommon, cdrommon)
Expand Down
5 changes: 2 additions & 3 deletions ocaml/database/OMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ section:
OCAML_LIBS += ../xapi-types/xapi-types
OCamlProgram(block_device_io, $(BLOCK_DEVICE_IO_FILES))

DATABASE_SERVER_FILES = database_server_main test_schemas ../autogen/db_actions
DATABASE_SERVER_FILES = database_server_main test_schemas ../autogen/db_actions
DATABASE_TEST_FILES = db_cache_test test_schemas
section:
#XXX there are lots of interdependencies which we should be aim to remove
OCAML_LIBS += xapi-database ../util/version ../xapi-types/xapi-types ../xapi-client/xapi-client ../xapi-consts/xapi-consts ../util/stats
OCAML_LIBS += xapi-database ../util/xapi_version ../xapi-types/xapi-types ../xapi-client/xapi-client ../xapi-consts/xapi-consts ../util/stats
OCamlProgram(database_server, $(DATABASE_SERVER_FILES))
OCamlProgram(database_test, $(DATABASE_TEST_FILES))

Expand All @@ -46,4 +46,3 @@ install:
clean:
rm -f $(CLEAN_OBJS) xenEnterpriseAPI* gen gen.opt db_filter_parse.ml db_filter_parse.mli db_filter_lex.ml
rm -f block_device_io unit_test_marshall block_device_io.opt unit_test_marshall.opt database_test

2 changes: 1 addition & 1 deletion ocaml/db_process/OMakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
OCAML_LIBS = ../util/version ../database/xapi-database
OCAML_LIBS = ../util/xapi_version ../database/xapi-database
OCAMLINCLUDES = ../database
OCAMLPACKS = xml-light2 uuid sexpr xcp stunnel http-svr gzip uuid xcp-inventory

Expand Down
2 changes: 1 addition & 1 deletion ocaml/events/OMakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
OCAML_LIBS = ../util/version ../xapi-consts/xapi-consts ../xapi-types/xapi-types ../xapi-client/xapi-client
OCAML_LIBS = ../util/xapi_version ../xapi-consts/xapi-consts ../xapi-types/xapi-types ../xapi-client/xapi-client
OCAMLINCLUDES = ../xapi-types ../xapi-client ../xapi-consts
OCAMLPACKS = xml-light2 stdext stunnel http-svr xcp rpclib uuid

Expand Down
2 changes: 1 addition & 1 deletion ocaml/graph/OMakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
OCAML_LIBS = ../util/version ../xapi-consts/xapi-consts ../idl/xapi-datamodel ../xapi-types/xapi-types ../xapi-client/xapi-client
OCAML_LIBS = ../util/xapi_version ../xapi-consts/xapi-consts ../idl/xapi-datamodel ../xapi-types/xapi-types ../xapi-client/xapi-client
OCAMLINCLUDES = ../xapi-types ../xapi-client ../idl ../xapi-consts
OCAMLPACKS = xml-light2 stdext stunnel http-svr xcp rpclib uuid

Expand Down
2 changes: 1 addition & 1 deletion ocaml/license/OMakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
OCAML_LIBS = ../util/version ../xapi-consts/xapi-consts ../xapi-types/xapi-types ../xapi-client/xapi-client
OCAML_LIBS = ../util/xapi_version ../xapi-consts/xapi-consts ../xapi-types/xapi-types ../xapi-client/xapi-client
OCAMLINCLUDES = ../idl ../xapi-consts ../util ../xapi-types ../xapi-client
OCAMLPACKS = xml-light2 stdext stunnel http-svr xcp rpclib uuid systemd

Expand Down
2 changes: 1 addition & 1 deletion ocaml/mpathalert/OMakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
OCAML_LIBS = ../util/version ../xapi-consts/xapi-consts ../xapi-types/xapi-types ../xapi-client/xapi-client
OCAML_LIBS = ../util/xapi_version ../xapi-consts/xapi-consts ../xapi-types/xapi-types ../xapi-client/xapi-client
OCAMLINCLUDES = ../idl ../xapi-types ../xapi-client ../xapi-consts
OCAMLPACKS = xml-light2 stdext stunnel http-svr xcp rpclib uuid

Expand Down
2 changes: 1 addition & 1 deletion ocaml/perftest/OMakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
OCAML_LIBS = ../util/version ../xapi-consts/xapi-consts ../xapi-types/xapi-types ../xapi-client/xapi-client
OCAML_LIBS = ../util/xapi_version ../xapi-consts/xapi-consts ../xapi-types/xapi-types ../xapi-client/xapi-client
OCAMLINCLUDES = ../idl ../xapi-consts ../xapi-client ../xapi-types
OCAMLPACKS = xml-light2 stdext stunnel http-svr xcp rpclib uuid xcp-inventory

Expand Down
4 changes: 2 additions & 2 deletions ocaml/util/OMakefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
OCAMLPACKS = http-svr xcp uuid xcp-inventory

OCamlLibrary(version, version)
OCamlLibrary(xapi_version, xapi_version)
OCamlLibrary(stats, stats)
OCamlLibrary(ocamltest, ocamltest)

.PHONY: clean
clean:
rm -f $(CLEAN_OBJS)
rm -f version.ml
rm -f xapi_version.ml

.PHONY: install
install:
12 changes: 0 additions & 12 deletions ocaml/util/version.mli

This file was deleted.

2 changes: 1 addition & 1 deletion ocaml/xapi/OMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ OCAMLPACKS = oclock xml-light2 cdrom pciutil sexpr xcp stunnel \
xcp.xen xcp.memory xcp.v6 tar tar.unix oPasswd xcp-inventory \
rrdd-plugin rrd-transport pci

OCAML_LIBS = ../util/version ../util/stats \
OCAML_LIBS = ../util/xapi_version ../util/stats \
../xapi-consts/xapi-consts ../idl/xapi-datamodel ../xapi-types/xapi-types ../xapi-client/xapi-client ../database/xapi-database ../util/ocamltest ../xapi-cli-protocol/xapi-cli-protocol
OCAMLINCLUDES = ../idl ../idl/ocaml_backend \
../database/ \
Expand Down
4 changes: 2 additions & 2 deletions ocaml/xapi/db_gc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ let check_host_liveness ~__context =
with _ -> 0.0 (* never *)
in
let old_heartbeat_time =
if rum && (Version.platform_version () <> (Helpers.version_string_of ~__context (Helpers.LocalObject host))) then
if rum && (Xapi_version.platform_version () <> (Helpers.version_string_of ~__context (Helpers.LocalObject host))) then
(debug "Host %s considering using metrics last update time as heartbeat" (Ref.string_of host);
Date.to_float (Db.Host_metrics.get_last_updated ~__context ~self:hmetric))
else 0.0 in
Expand Down Expand Up @@ -498,7 +498,7 @@ let detect_rolling_upgrade ~__context =
if actually_in_progress <> pool_says_in_progress then begin
let platform_versions = List.map (fun host -> Helpers.version_string_of ~__context (Helpers.LocalObject host)) (Db.Host.get_all ~__context) in
debug "xapi platform version = %s; host platform versions = [ %s ]"
(Version.platform_version ()) (String.concat "; " platform_versions);
(Xapi_version.platform_version ()) (String.concat "; " platform_versions);

warn "Pool thinks rolling upgrade%s in progress but Host version numbers indicate otherwise; correcting"
(if pool_says_in_progress then "" else " not");
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/helpers.ml
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ let assert_host_has_highest_version_in_pool : __context:Context.t -> host:API.re
let pool_has_different_host_platform_versions ~__context =
let all_hosts = Db.Host.get_all ~__context in
let platform_versions = List.map (fun host -> version_string_of ~__context (LocalObject host)) all_hosts in
let is_different_to_me platform_version = platform_version <> Version.platform_version () in
let is_different_to_me platform_version = platform_version <> Xapi_version.platform_version () in
List.fold_left (||) false (List.map is_different_to_me platform_versions)

let get_vm_metrics ~__context ~self =
Expand Down
10 changes: 5 additions & 5 deletions ocaml/xapi/importexport.ml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ let obj_of_xmlrpc x =
let this_version __context =
let host = Helpers.get_localhost ~__context in
let (_: API.host_t) = Db.Host.get_record ~__context ~self:host in
{ hostname = Version.hostname;
date = Version.date;
product_version = Version.product_version ();
product_brand = Version.product_brand ();
build_number = Version.build_number ();
{ hostname = Xapi_version.hostname;
date = Xapi_version.date;
product_version = Xapi_version.product_version ();
product_brand = Xapi_version.product_brand ();
build_number = Xapi_version.build_number ();
xapi_vsn_major = Xapi_globs.version_major;
xapi_vsn_minor = Xapi_globs.version_minor;
export_vsn = Xapi_globs.export_vsn;
Expand Down
12 changes: 6 additions & 6 deletions ocaml/xapi/xapi.ml
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@ let debug_dummy_data = ref false

let show_version () =
List.iter (fun (x, y) -> printf "%s=%s\n" x y)
[ "git_id", Version.git_id;
"hostname", Version.hostname;
"date", Version.date;
"PRODUCT_VERSION", Version.product_version ();
"PRODUCT_BRAND", Version.product_brand ();
"BUILD_NUMBER", Version.build_number ()];
[ "git_id", Xapi_version.git_id;
"hostname", Xapi_version.hostname;
"date", Xapi_version.date;
"PRODUCT_VERSION", Xapi_version.product_version ();
"PRODUCT_BRAND", Xapi_version.product_brand ();
"BUILD_NUMBER", Xapi_version.build_number ()];
exit 0

let init_args() =
Expand Down
12 changes: 6 additions & 6 deletions ocaml/xapi/xapi_config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ let log_if_not_empty format_string value =

let dump_config () =
debug "Server configuration:";
log_if_not_empty "product_version: %s" (Version.product_version ());
log_if_not_empty "product_brand: %s" (Version.product_brand ());
debug "platform_version: %s" (Version.platform_version ());
debug "platform_name: %s" (Version.platform_name ());
debug "build_number: %s" (Version.build_number ());
debug "git changeset: %s" Version.git_id;
log_if_not_empty "product_version: %s" (Xapi_version.product_version ());
log_if_not_empty "product_brand: %s" (Xapi_version.product_brand ());
debug "platform_version: %s" (Xapi_version.platform_version ());
debug "platform_name: %s" (Xapi_version.platform_name ());
debug "build_number: %s" (Xapi_version.build_number ());
debug "git changeset: %s" Xapi_version.git_id;
debug "version: %d.%d" version_major version_minor;
(* debug "License filename: %s" !License_file.filename *)
26 changes: 13 additions & 13 deletions ocaml/xapi/xapi_globs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ let pool_secret = ref ""
let localhost_ref : [`host] Ref.t ref = ref Ref.null

(* xapi version *)
let version_major = Version.xapi_version_major
let version_minor = Version.xapi_version_minor
let version_major = Xapi_version.xapi_version_major
let version_minor = Xapi_version.xapi_version_minor
let xapi_user_agent = "xapi/"^(string_of_int version_major)^"."^(string_of_int version_minor)

(* api version *)
Expand Down Expand Up @@ -141,16 +141,16 @@ let export_vsn = 2
let software_version () =
(* In the case of XCP, all product_* fields will be blank. *)
List.filter (fun (_, value) -> value <> "")
[_product_version, Version.product_version ();
_product_version_text, Version.product_version_text ();
_product_version_text_short, Version.product_version_text_short ();
_platform_name, Version.platform_name ();
_platform_version, Version.platform_version ();
_product_brand, Version.product_brand ();
_build_number, Version.build_number ();
_git_id, Version.git_id;
_hostname, Version.hostname;
_date, Version.date]
[_product_version, Xapi_version.product_version ();
_product_version_text, Xapi_version.product_version_text ();
_product_version_text_short, Xapi_version.product_version_text_short ();
_platform_name, Xapi_version.platform_name ();
_platform_version, Xapi_version.platform_version ();
_product_brand, Xapi_version.product_brand ();
_build_number, Xapi_version.build_number ();
_git_id, Xapi_version.git_id;
_hostname, Xapi_version.hostname;
_date, Xapi_version.date]

let pygrub_path = "/usr/bin/pygrub"
let eliloader_path = "/usr/bin/eliloader"
Expand Down Expand Up @@ -202,7 +202,7 @@ let grant_api_access = "grant_api_access"
(* other-config key for backwards compat. *)
let tools_sr_tag = "xenserver_tools_sr"

let tools_sr_name () = Version.product_brand () ^ " Tools"
let tools_sr_name () = Xapi_version.product_brand () ^ " Tools"
let tools_sr_description () = tools_sr_name () ^ " ISOs"

let tools_sr_dir = ref "/opt/xensource/packages/iso"
Expand Down

0 comments on commit af61b21

Please sign in to comment.