Skip to content

Commit 4752acc

Browse files
authored
Merge pull request #5614 from psafont/topping
2 parents 8de2308 + 1521fa3 commit 4752acc

File tree

142 files changed

+748
-587
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+748
-587
lines changed

dune-project

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
(generate_opam_files true)
55

6+
(name "xapi")
67
(source (github xapi-project/xen-api))
78
(license "LGPL-2.1-only WITH OCaml-LGPL-linking-exception")
89
(authors "xen-api@lists.xen.org")

ocaml/database/block_device_io.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@
9090

9191
open Xapi_stdext_pervasives.Pervasiveext
9292
open Xapi_stdext_unix
93+
module Db_globs = Xapi_database.Db_globs
94+
module Block_device_io_errors = Xapi_database.Block_device_io_errors
9395

9496
let name = "block_device_io"
9597

ocaml/database/database_server_main.ml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let c = Condition.create ()
1717

1818
(** Handler for the remote database access URL *)
1919
let remote_database_access_handler_v1 req bio =
20-
try Db_remote_cache_access_v1.handler req bio
20+
try Xapi_database.Db_remote_cache_access_v1.handler req bio
2121
with e ->
2222
Printf.printf "Caught: %s\n" (Printexc.to_string e) ;
2323
Printexc.print_backtrace stdout ;
@@ -26,14 +26,15 @@ let remote_database_access_handler_v1 req bio =
2626

2727
(** Handler for the remote database access URL *)
2828
let remote_database_access_handler_v2 req bio =
29-
try Db_remote_cache_access_v2.handler req bio
29+
try Xapi_database.Db_remote_cache_access_v2.handler req bio
3030
with e ->
3131
Printf.printf "Caught: %s\n" (Printexc.to_string e) ;
3232
Printexc.print_backtrace stdout ;
3333
flush stdout ;
3434
raise e
3535

36-
module Local_tests = Database_test.Tests (Db_cache_impl)
36+
module Local_tests =
37+
Xapi_database.Database_test.Tests (Xapi_database.Db_cache_impl)
3738

3839
let schema = Test_schemas.schema
3940

@@ -67,6 +68,7 @@ let _ =
6768
| Slave _ ->
6869
failwith "unimplemented"
6970
| Master db_filename ->
71+
let open Xapi_database in
7072
Printf.printf "Database path: %s\n%!" db_filename ;
7173
let db = Parse_db_conf.make db_filename in
7274
Db_conn_store.initialise_db_connections [db] ;

ocaml/database/db_cache_test.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
* GNU Lesser General Public License for more details.
1313
*)
1414

15-
open Db_cache_types
15+
open Xapi_database
16+
open Xapi_database.Db_cache_types
1617

1718
let create_test_db () =
1819
let schema = Test_schemas.many_to_many in

ocaml/database/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
(library
2323
(name xapi_database)
24+
(modes best)
2425
(modules
2526
(:standard \ database_server_main db_cache_test db_names db_exn
2627
block_device_io string_marshall_helper string_unmarshall_helper schema
@@ -48,7 +49,6 @@
4849
xml-light2
4950
xmlm
5051
)
51-
(wrapped false)
5252
(preprocess (pps ppx_deriving_rpc))
5353
)
5454

ocaml/database/unit_test_marshall.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212
* GNU Lesser General Public License for more details.
1313
*)
14-
open Db_rpc_common_v1
15-
open Db_cache_types
16-
open Db_filter_types
14+
open Xapi_database.Db_rpc_common_v1
15+
open Xapi_database.Db_cache_types
16+
open Xapi_database.Db_filter_types
1717

1818
(* Check, for randomly chosen x's, that (unmarshall (marshall x)) = x *)
1919

ocaml/db_process/xapi_db_process.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
module D = Debug.Make (struct let name = "xapi-db-process" end)
1515

1616
open D
17-
open Db_cache_types
17+
open Xapi_database
18+
open Xapi_database.Db_cache_types
1819

1920
let compress = ref false
2021

ocaml/idl/ocaml_backend/gen_db_actions.ml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,14 @@ let ocaml_of_tbl_fields xs =
271271
let open_db_module =
272272
[
273273
"let __t = Context.database_of __context in"
274-
; "let module DB = (val (Db_cache.get __t) : Db_interface.DB_ACCESS) in"
274+
; "let module DB = (val (Xapi_database.Db_cache.get __t) : \
275+
Xapi_database.Db_interface.DB_ACCESS) in"
275276
]
276277

277278
let db_action api : O.Module.t =
278279
let api = make_db_api api in
279280
let expr = "expr" in
280-
let expr_arg = O.Named (expr, "Db_filter_types.expr") in
281+
let expr_arg = O.Named (expr, "Xapi_database.Db_filter_types.expr") in
281282
let get_refs_where (obj : obj) =
282283
let tbl = Escaping.escape_obj obj.DT.name in
283284
let body =
@@ -526,13 +527,13 @@ let db_action api : O.Module.t =
526527
| FromObject GetAllRecords ->
527528
String.concat "\n"
528529
[
529-
"let expr' = Db_filter_types.True in"
530+
"let expr' = Xapi_database.Db_filter_types.True in"
530531
; "get_records_where ~" ^ Gen_common.context ^ " ~expr:expr'"
531532
]
532533
| FromObject GetAllRecordsWhere ->
533534
String.concat "\n"
534535
[
535-
"let expr' = Db_filter.expr_of_string expr in"
536+
"let expr' = Xapi_database.Db_filter.expr_of_string expr in"
536537
; "get_records_where ~" ^ Gen_common.context ^ " ~expr:expr'"
537538
]
538539
| _ ->
@@ -577,7 +578,7 @@ let db_action api : O.Module.t =
577578
O.Module.make ~name:_db_action
578579
~preamble:
579580
[
580-
"open Db_cache_types"
581+
"open Xapi_database.Db_cache_types"
581582
; "module D=Debug.Make(struct let name=\"db\" end)"
582583
; "open D"
583584
]

ocaml/libs/ezxenstore/core/dune

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
(library
22
(name ezxenstore_core)
33
(public_name ezxenstore.core)
4-
(wrapped false)
54
(libraries
65
cmdliner
76
logs

ocaml/libs/ezxenstore/lib_test/main.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ let set_socket_path path = Xs_transport.xenstored_socket := path
66

77
let test socket =
88
set_socket_path socket ;
9-
let open Xenstore in
9+
let open Ezxenstore_core.Xenstore in
1010
if Unix.geteuid () <> 0 then (* non-root won't have access to xenstore *)
1111
`Ok 0
1212
else

0 commit comments

Comments
 (0)