Skip to contentSkip to conversation

live update and gnttab patches

PATCH In review Edwin Török 2 participants 24 messages May 11, 2021 – May 12, 2021

lore
Share & tools
lore
#0 lore raw

v2 cover live update and gnttab patches

These patches have been posted previously.
The gnttab patches (tools/ocaml/libs/mmap) were not applied at the time to avoid conflicts with an in-progress XSA.
The binary format live-update and fuzzing patches were not applied because it was too close to the next Xen release freeze.

The patches depend on each-other: live-update only works correctly when the gnttab patches are taken too (MFN is not part of the binary live-update stream),
so they are included here as a single series.
The gnttab patches replaces one use of libxenctrl with stable interfaces, leaving one unstable libxenctrl interface used by oxenstored.

The 'vendor external dependencies' may be optional, it is useful to be part
of a patchqueue in a specfile so that you can build everything without external dependencies, but might as well commit it so everyone has it easily available not just XenServer.

Note that the live-update fuzz test doesn't yet pass, it is still able to find bugs. However the reduced version with a fixed seed used as a unit test does pass, so it is useful to have it committed, and further improvements can be made later as more bugs are discovered and fixed.

Edwin Török (17):
docs/designs/xenstore-migration.md: clarify that deletes are recursive tools/ocaml: add unit test skeleton with Dune build system tools/ocaml: vendor external dependencies for convenience tools/ocaml/xenstored: implement the live migration binary format tools/ocaml/xenstored: add binary dump format support tools/ocaml/xenstored: add support for binary format tools/ocaml/xenstored: validate config file before live update Add structured fuzzing unit test
tools/ocaml: use common macros for manipulating mmap_interface tools/ocaml/libs/mmap: allocate correct number of bytes tools/ocaml/libs/mmap: Expose stub_mmap_alloc tools/ocaml/libs/mmap: mark mmap/munmap as blocking tools/ocaml/libs/xb: import gnttab stubs from mirage tools/ocaml: safer Xenmmap interface tools/ocaml/xenstored: use gnttab instead of xenctrl's
foreign_map_range
tools/ocaml/xenstored: don't store domU's mfn of ring page tools/ocaml/libs/mmap: Clean up unused read/write

 docs/designs/xenstore-migration.md            |    3 +-
 tools/ocaml/.gitignore                        |    2 +
 tools/ocaml/Makefile                          |   53 +
 tools/ocaml/dune-project                      |    5 +
 tools/ocaml/duniverse/cmdliner/.gitignore     |   10 +
 tools/ocaml/duniverse/cmdliner/.ocp-indent    |    1 +
 tools/ocaml/duniverse/cmdliner/B0.ml          |    9 +
 tools/ocaml/duniverse/cmdliner/CHANGES.md     |  255 +++
 tools/ocaml/duniverse/cmdliner/LICENSE.md     |   13 +
 tools/ocaml/duniverse/cmdliner/Makefile       |   77 +
 tools/ocaml/duniverse/cmdliner/README.md      |   51 +
 tools/ocaml/duniverse/cmdliner/_tags          |    3 +
 tools/ocaml/duniverse/cmdliner/build.ml       |  155 ++
 tools/ocaml/duniverse/cmdliner/cmdliner.opam  |   32 +
 tools/ocaml/duniverse/cmdliner/doc/api.odocl  |    1 +
 tools/ocaml/duniverse/cmdliner/dune-project   |    2 +
 tools/ocaml/duniverse/cmdliner/pkg/META       |    7 +
 tools/ocaml/duniverse/cmdliner/pkg/pkg.ml     |   33 +
 .../ocaml/duniverse/cmdliner/src/cmdliner.ml  |  309 ++++
 .../ocaml/duniverse/cmdliner/src/cmdliner.mli | 1624 +++++++++++++++++
 .../duniverse/cmdliner/src/cmdliner.mllib     |   11 +
 .../duniverse/cmdliner/src/cmdliner_arg.ml    |  356 ++++
 .../duniverse/cmdliner/src/cmdliner_arg.mli   |  111 ++
 .../duniverse/cmdliner/src/cmdliner_base.ml   |  302 +++
 .../duniverse/cmdliner/src/cmdliner_base.mli  |   68 +
 .../duniverse/cmdliner/src/cmdliner_cline.ml  |  199 ++
 .../duniverse/cmdliner/src/cmdliner_cline.mli |   34 +
 .../duniverse/cmdliner/src/cmdliner_docgen.ml |  352 ++++
 .../cmdliner/src/cmdliner_docgen.mli          |   30 +
 .../duniverse/cmdliner/src/cmdliner_info.ml   |  233 +++
 .../duniverse/cmdliner/src/cmdliner_info.mli  |  140 ++
 .../cmdliner/src/cmdliner_manpage.ml          |  502 +++++
 .../cmdliner/src/cmdliner_manpage.mli         |  100 +
 .../duniverse/cmdliner/src/cmdliner_msg.ml    |  116 ++
 .../duniverse/cmdliner/src/cmdliner_msg.mli   |   56 +
 .../cmdliner/src/cmdliner_suggest.ml          |   54 +
 .../cmdliner/src/cmdliner_suggest.mli         |   25 +
 .../duniverse/cmdliner/src/cmdliner_term.ml   |   41 +
 .../duniverse/cmdliner/src/cmdliner_term.mli  |   40 +
 .../duniverse/cmdliner/src/cmdliner_trie.ml   |   97 +
 .../duniverse/cmdliner/src/cmdliner_trie.mli  |   35 +
 tools/ocaml/duniverse/cmdliner/src/dune       |    4 +
 tools/ocaml/duniverse/cmdliner/test/chorus.ml |   31 +
 tools/ocaml/duniverse/cmdliner/test/cp_ex.ml  |   54 +
 .../ocaml/duniverse/cmdliner/test/darcs_ex.ml |  149 ++
 tools/ocaml/duniverse/cmdliner/test/dune      |   12 +
 tools/ocaml/duniverse/cmdliner/test/revolt.ml |    9 +
 tools/ocaml/duniverse/cmdliner/test/rm_ex.ml  |   53 +
 .../ocaml/duniverse/cmdliner/test/tail_ex.ml  |   73 +
 .../ocaml/duniverse/cmdliner/test/test_man.ml |  100 +
 .../duniverse/cmdliner/test/test_man_utf8.ml  |   11 +
 .../duniverse/cmdliner/test/test_opt_req.ml   |   13 +
 .../ocaml/duniverse/cmdliner/test/test_pos.ml |   13 +
 .../duniverse/cmdliner/test/test_pos_all.ml   |   11 +
 .../duniverse/cmdliner/test/test_pos_left.ml  |   11 +
 .../duniverse/cmdliner/test/test_pos_req.ml   |   15 +
 .../duniverse/cmdliner/test/test_pos_rev.ml   |   14 +
 .../duniverse/cmdliner/test/test_term_dups.ml |   19 +
 .../cmdliner/test/test_with_used_args.ml      |   18 +
 tools/ocaml/duniverse/cppo/.gitignore         |    5 +
 tools/ocaml/duniverse/cppo/.ocp-indent        |   22 +
 tools/ocaml/duniverse/cppo/.travis.yml        |   16 +
 tools/ocaml/duniverse/cppo/CODEOWNERS         |    8 +
 tools/ocaml/duniverse/cppo/Changes            |   85 +
 tools/ocaml/duniverse/cppo/INSTALL.md         |   17 +
 tools/ocaml/duniverse/cppo/LICENSE.md         |   24 +
 tools/ocaml/duniverse/cppo/Makefile           |   18 +
 tools/ocaml/duniverse/cppo/README.md          |  521 ++++++
 tools/ocaml/duniverse/cppo/VERSION            |    1 +
 tools/ocaml/duniverse/cppo/appveyor.yml       |   14 +
 tools/ocaml/duniverse/cppo/cppo.opam          |   31 +
 .../ocaml/duniverse/cppo/cppo_ocamlbuild.opam |   27 +
 tools/ocaml/duniverse/cppo/dune-project       |    3 +
 tools/ocaml/duniverse/cppo/examples/Makefile  |    8 +
 tools/ocaml/duniverse/cppo/examples/debug.ml  |    7 +
 tools/ocaml/duniverse/cppo/examples/dune      |   32 +
 tools/ocaml/duniverse/cppo/examples/french.ml |   34 +
 tools/ocaml/duniverse/cppo/examples/lexer.mll |    9 +
 .../duniverse/cppo/ocamlbuild_plugin/_tags    |    1 +
 .../duniverse/cppo/ocamlbuild_plugin/dune     |    6 +
 .../cppo/ocamlbuild_plugin/ocamlbuild_cppo.ml |   35 +
 .../ocamlbuild_plugin/ocamlbuild_cppo.mli     |    9 +
 tools/ocaml/duniverse/cppo/src/compat.ml      |    7 +
 .../ocaml/duniverse/cppo/src/cppo_command.ml  |   63 +
 .../ocaml/duniverse/cppo/src/cppo_command.mli |   11 +
 tools/ocaml/duniverse/cppo/src/cppo_eval.ml   |  697 +++++++
 tools/ocaml/duniverse/cppo/src/cppo_eval.mli  |   29 +
 tools/ocaml/duniverse/cppo/src/cppo_lexer.mll |  721 ++++++++
 tools/ocaml/duniverse/cppo/src/cppo_main.ml   |  230 +++
 .../ocaml/duniverse/cppo/src/cppo_parser.mly  |  266 +++
 tools/ocaml/duniverse/cppo/src/cppo_types.ml  |   98 +
 tools/ocaml/duniverse/cppo/src/cppo_types.mli |   70 +
 .../ocaml/duniverse/cppo/src/cppo_version.mli |    1 +
 tools/ocaml/duniverse/cppo/src/dune           |   21 +
 tools/ocaml/duniverse/cppo/test/capital.cppo  |    6 +
 tools/ocaml/duniverse/cppo/test/capital.ref   |    6 +
 tools/ocaml/duniverse/cppo/test/comments.cppo |    7 +
 tools/ocaml/duniverse/cppo/test/comments.ref  |    8 +
 tools/ocaml/duniverse/cppo/test/cond.cppo     |   47 +
 tools/ocaml/duniverse/cppo/test/cond.ref      |   17 +
 tools/ocaml/duniverse/cppo/test/dune          |  130 ++
 tools/ocaml/duniverse/cppo/test/ext.cppo      |   10 +
 tools/ocaml/duniverse/cppo/test/ext.ref       |   28 +
 tools/ocaml/duniverse/cppo/test/incl.cppo     |    3 +
 tools/ocaml/duniverse/cppo/test/incl2.cppo    |    1 +
 tools/ocaml/duniverse/cppo/test/loc.cppo      |    8 +
 tools/ocaml/duniverse/cppo/test/loc.ref       |   21 +
 .../ocaml/duniverse/cppo/test/paren_arg.cppo  |    3 +
 tools/ocaml/duniverse/cppo/test/paren_arg.ref |    4 +
 tools/ocaml/duniverse/cppo/test/source.sh     |   13 +
 tools/ocaml/duniverse/cppo/test/test.cppo     |  144 ++
 tools/ocaml/duniverse/cppo/test/tuple.cppo    |   38 +
 tools/ocaml/duniverse/cppo/test/tuple.ref     |   20 +
 .../ocaml/duniverse/cppo/test/unmatched.cppo  |   14 +
 tools/ocaml/duniverse/cppo/test/unmatched.ref |   15 +
 tools/ocaml/duniverse/cppo/test/version.cppo  |   30 +
 tools/ocaml/duniverse/crowbar/.gitignore      |    5 +
 tools/ocaml/duniverse/crowbar/CHANGES.md      |    9 +
 tools/ocaml/duniverse/crowbar/LICENSE.md      |    8 +
 tools/ocaml/duniverse/crowbar/README.md       |   82 +
 tools/ocaml/duniverse/crowbar/crowbar.opam    |   33 +
 tools/ocaml/duniverse/crowbar/dune            |    1 +
 tools/ocaml/duniverse/crowbar/dune-project    |    2 +
 .../duniverse/crowbar/examples/.gitignore     |    1 +
 .../duniverse/crowbar/examples/calendar/dune  |    3 +
 .../examples/calendar/test_calendar.ml        |   29 +
 .../duniverse/crowbar/examples/fpath/dune     |    4 +
 .../crowbar/examples/fpath/test_fpath.ml      |   18 +
 .../duniverse/crowbar/examples/input/testcase |    1 +
 .../ocaml/duniverse/crowbar/examples/map/dune |    3 +
 .../crowbar/examples/map/test_map.ml          |   47 +
 .../duniverse/crowbar/examples/pprint/dune    |    3 +
 .../crowbar/examples/pprint/test_pprint.ml    |   39 +
 .../crowbar/examples/serializer/dune          |    3 +
 .../crowbar/examples/serializer/serializer.ml |   34 +
 .../examples/serializer/test_serializer.ml    |   47 +
 .../duniverse/crowbar/examples/uunf/dune      |    3 +
 .../crowbar/examples/uunf/test_uunf.ml        |   75 +
 .../duniverse/crowbar/examples/xmldiff/dune   |    3 +
 .../crowbar/examples/xmldiff/test_xmldiff.ml  |   42 +
 tools/ocaml/duniverse/crowbar/src/crowbar.ml  |  582 ++++++
 tools/ocaml/duniverse/crowbar/src/crowbar.mli |  251 +++
 tools/ocaml/duniverse/crowbar/src/dune        |    3 +
 tools/ocaml/duniverse/crowbar/src/todo        |   16 +
 tools/ocaml/duniverse/csexp/CHANGES.md        |   45 +
 tools/ocaml/duniverse/csexp/LICENSE.md        |   21 +
 tools/ocaml/duniverse/csexp/Makefile          |   23 +
 tools/ocaml/duniverse/csexp/README.md         |   33 +
 .../duniverse/csexp/bench/csexp_bench.ml      |   22 +
 tools/ocaml/duniverse/csexp/bench/dune        |   11 +
 tools/ocaml/duniverse/csexp/bench/main.ml     |    1 +
 tools/ocaml/duniverse/csexp/bench/runner.sh   |    4 +
 tools/ocaml/duniverse/csexp/csexp.opam        |   51 +
 .../ocaml/duniverse/csexp/csexp.opam.template |   14 +
 tools/ocaml/duniverse/csexp/dune-project      |   42 +
 .../ocaml/duniverse/csexp/dune-workspace.dev  |    6 +
 tools/ocaml/duniverse/csexp/src/csexp.ml      |  333 ++++
 tools/ocaml/duniverse/csexp/src/csexp.mli     |  369 ++++
 tools/ocaml/duniverse/csexp/src/dune          |    3 +
 tools/ocaml/duniverse/csexp/test/dune         |    6 +
 tools/ocaml/duniverse/csexp/test/test.ml      |  142 ++
 tools/ocaml/duniverse/dune                    |    4 +
 tools/ocaml/duniverse/fmt/.gitignore          |    8 +
 tools/ocaml/duniverse/fmt/.ocp-indent         |    1 +
 tools/ocaml/duniverse/fmt/CHANGES.md          |   98 +
 tools/ocaml/duniverse/fmt/LICENSE.md          |   13 +
 tools/ocaml/duniverse/fmt/README.md           |   35 +
 tools/ocaml/duniverse/fmt/_tags               |    7 +
 tools/ocaml/duniverse/fmt/doc/api.odocl       |    3 +
 tools/ocaml/duniverse/fmt/doc/index.mld       |   11 +
 tools/ocaml/duniverse/fmt/dune-project        |    2 +
 tools/ocaml/duniverse/fmt/fmt.opam            |   35 +
 tools/ocaml/duniverse/fmt/pkg/META            |   40 +
 tools/ocaml/duniverse/fmt/pkg/pkg.ml          |   18 +
 tools/ocaml/duniverse/fmt/src/dune            |   30 +
 tools/ocaml/duniverse/fmt/src/fmt.ml          |  787 ++++++++
 tools/ocaml/duniverse/fmt/src/fmt.mli         |  689 +++++++
 tools/ocaml/duniverse/fmt/src/fmt.mllib       |    1 +
 tools/ocaml/duniverse/fmt/src/fmt_cli.ml      |   32 +
 tools/ocaml/duniverse/fmt/src/fmt_cli.mli     |   45 +
 tools/ocaml/duniverse/fmt/src/fmt_cli.mllib   |    1 +
 tools/ocaml/duniverse/fmt/src/fmt_top.ml      |   23 +
 tools/ocaml/duniverse/fmt/src/fmt_top.mllib   |    1 +
 tools/ocaml/duniverse/fmt/src/fmt_tty.ml      |   78 +
 tools/ocaml/duniverse/fmt/src/fmt_tty.mli     |   50 +
 tools/ocaml/duniverse/fmt/src/fmt_tty.mllib   |    1 +
 .../duniverse/fmt/src/fmt_tty_top_init.ml     |   23 +
 tools/ocaml/duniverse/fmt/test/test.ml        |  322 ++++
 .../duniverse/ocaml-afl-persistent/.gitignore |    2 +
 .../duniverse/ocaml-afl-persistent/CHANGES.md |   22 +
 .../duniverse/ocaml-afl-persistent/LICENSE.md |    8 +
 .../duniverse/ocaml-afl-persistent/README.md  |   17 +
 .../ocaml-afl-persistent/afl-persistent.opam  |   49 +
 .../afl-persistent.opam.template              |   16 +
 .../aflPersistent.available.ml                |   21 +
 .../ocaml-afl-persistent/aflPersistent.mli    |    1 +
 .../aflPersistent.stub.ml                     |    1 +
 .../duniverse/ocaml-afl-persistent/detect.sh  |   43 +
 .../ocaml/duniverse/ocaml-afl-persistent/dune |   20 +
 .../ocaml-afl-persistent/dune-project         |   23 +
 .../duniverse/ocaml-afl-persistent/test.ml    |    3 +
 .../ocaml-afl-persistent/test/harness.ml      |   22 +
 .../ocaml-afl-persistent/test/test.ml         |   73 +
 .../ocaml-afl-persistent/test/test.sh         |   33 +
 .../ocaml/duniverse/ocplib-endian/.gitignore  |    3 +
 .../ocaml/duniverse/ocplib-endian/.travis.yml |   19 +
 .../ocaml/duniverse/ocplib-endian/CHANGES.md  |   55 +
 .../ocaml/duniverse/ocplib-endian/COPYING.txt |  521 ++++++
 tools/ocaml/duniverse/ocplib-endian/Makefile  |   13 +
 tools/ocaml/duniverse/ocplib-endian/README.md |   16 +
 .../duniverse/ocplib-endian/dune-project      |    2 +
 .../ocplib-endian/ocplib-endian.opam          |   30 +
 .../ocplib-endian/src/be_ocaml_401.ml         |   32 +
 .../duniverse/ocplib-endian/src/common.ml     |   24 +
 .../ocplib-endian/src/common_401.cppo.ml      |  100 +
 .../ocplib-endian/src/common_float.ml         |    5 +
 tools/ocaml/duniverse/ocplib-endian/src/dune  |   75 +
 .../ocplib-endian/src/endianBigstring.cppo.ml |  112 ++
 .../src/endianBigstring.cppo.mli              |  128 ++
 .../ocplib-endian/src/endianBytes.cppo.ml     |  130 ++
 .../ocplib-endian/src/endianBytes.cppo.mli    |  124 ++
 .../ocplib-endian/src/endianString.cppo.ml    |  118 ++
 .../ocplib-endian/src/endianString.cppo.mli   |  121 ++
 .../ocplib-endian/src/le_ocaml_401.ml         |   32 +
 .../ocplib-endian/src/ne_ocaml_401.ml         |   20 +
 .../duniverse/ocplib-endian/tests/bench.ml    |  436 +++++
 .../ocaml/duniverse/ocplib-endian/tests/dune  |   35 +
 .../duniverse/ocplib-endian/tests/test.ml     |   39 +
 .../tests/test_bigstring.cppo.ml              |  191 ++
 .../ocplib-endian/tests/test_bytes.cppo.ml    |  185 ++
 .../ocplib-endian/tests/test_string.cppo.ml   |  185 ++
 tools/ocaml/duniverse/result/CHANGES.md       |   15 +
 tools/ocaml/duniverse/result/LICENSE.md       |   24 +
 tools/ocaml/duniverse/result/Makefile         |   17 +
 tools/ocaml/duniverse/result/README.md        |    5 +
 tools/ocaml/duniverse/result/dune             |   12 +
 tools/ocaml/duniverse/result/dune-project     |    3 +
 .../duniverse/result/result-as-alias-4.08.ml  |    2 +
 .../ocaml/duniverse/result/result-as-alias.ml |    2 +
 .../duniverse/result/result-as-newtype.ml     |    2 +
 tools/ocaml/duniverse/result/result.opam      |   18 +
 tools/ocaml/duniverse/result/which_result.ml  |   14 +
 tools/ocaml/duniverse/stdlib-shims/CHANGES.md |    5 +
 tools/ocaml/duniverse/stdlib-shims/LICENSE    |  203 +++
 tools/ocaml/duniverse/stdlib-shims/README.md  |    2 +
 .../ocaml/duniverse/stdlib-shims/dune-project |    1 +
 .../duniverse/stdlib-shims/dune-workspace.dev |   14 +
 tools/ocaml/duniverse/stdlib-shims/src/dune   |   97 +
 .../duniverse/stdlib-shims/stdlib-shims.opam  |   24 +
 tools/ocaml/duniverse/stdlib-shims/test/dune  |    3 +
 .../ocaml/duniverse/stdlib-shims/test/test.ml |    2 +
 tools/ocaml/libs/eventchn/dune                |    8 +
 tools/ocaml/libs/mmap/Makefile                |   19 +-
 tools/ocaml/libs/mmap/dune                    |   18 +
 tools/ocaml/libs/mmap/gnt.ml                  |   62 +
 tools/ocaml/libs/mmap/gnt.mli                 |   87 +
 tools/ocaml/libs/mmap/gnttab_stubs.c          |  106 ++
 tools/ocaml/libs/mmap/mmap_stubs.h            |   11 +-
 tools/ocaml/libs/mmap/xenmmap.ml              |   17 +-
 tools/ocaml/libs/mmap/xenmmap.mli             |   13 +-
 tools/ocaml/libs/mmap/xenmmap_stubs.c         |   86 +-
 tools/ocaml/libs/xb/dune                      |    7 +
 tools/ocaml/libs/xb/xb.ml                     |   10 +-
 tools/ocaml/libs/xb/xb.mli                    |    4 +-
 tools/ocaml/libs/xb/xs_ring_stubs.c           |   14 +-
 tools/ocaml/libs/xc/dune                      |    9 +
 tools/ocaml/libs/xc/xenctrl.ml                |    6 +-
 tools/ocaml/libs/xc/xenctrl.mli               |    5 +-
 tools/ocaml/libs/xs/dune                      |    4 +
 tools/ocaml/xen.opam                          |    1 +
 tools/ocaml/xen.opam.locked                   |  119 ++
 tools/ocaml/xenstore.opam                     |    1 +
 tools/ocaml/xenstored.opam                    |   21 +
 tools/ocaml/xenstored/Makefile                |    4 +-
 tools/ocaml/xenstored/connection.ml           |   63 +-
 tools/ocaml/xenstored/disk.ml                 |  319 ++++
 tools/ocaml/xenstored/domain.ml               |    9 +-
 tools/ocaml/xenstored/domains.ml              |   13 +-
 tools/ocaml/xenstored/dune                    |   19 +
 tools/ocaml/xenstored/parse_arg.ml            |    6 +-
 tools/ocaml/xenstored/perms.ml                |    2 +
 tools/ocaml/xenstored/poll.ml                 |    3 +-
 tools/ocaml/xenstored/process.ml              |   30 +-
 tools/ocaml/xenstored/store.ml                |    1 +
 tools/ocaml/xenstored/test/dune               |   23 +
 tools/ocaml/xenstored/test/generator.ml       |  189 ++
 tools/ocaml/xenstored/test/gnt.ml             |   52 +
 tools/ocaml/xenstored/test/model.ml           |  253 +++
 tools/ocaml/xenstored/test/old/arbitrary.ml   |  261 +++
 tools/ocaml/xenstored/test/old/gen_paths.ml   |   66 +
 .../xenstored/test/old/xenstored_test.ml      |  527 ++++++
 tools/ocaml/xenstored/test/pathtree.ml        |   40 +
 tools/ocaml/xenstored/test/testable.ml        |  380 ++++
 tools/ocaml/xenstored/test/types.ml           |  437 +++++
 .../xenmmap.mli => xenstored/test/xenctrl.ml} |   40 +-
 tools/ocaml/xenstored/test/xeneventchn.ml     |   50 +
 tools/ocaml/xenstored/test/xenstored_test.ml  |  147 ++
 tools/ocaml/xenstored/test/xs_protocol.ml     |  733 ++++++++
 tools/ocaml/xenstored/transaction.ml          |  119 +-
 tools/ocaml/xenstored/xenstored.ml            |  224 ++-
 tools/ocaml/xenstored/xenstored_main.ml       |    1 +
 301 files changed, 22724 insertions(+), 193 deletions(-)
 create mode 100644 tools/ocaml/.gitignore
 create mode 100644 tools/ocaml/dune-project
 create mode 100644 tools/ocaml/duniverse/cmdliner/.gitignore
 create mode 100644 tools/ocaml/duniverse/cmdliner/.ocp-indent
 create mode 100644 tools/ocaml/duniverse/cmdliner/B0.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/cmdliner/LICENSE.md
 create mode 100644 tools/ocaml/duniverse/cmdliner/Makefile
 create mode 100644 tools/ocaml/duniverse/cmdliner/README.md
 create mode 100644 tools/ocaml/duniverse/cmdliner/_tags
 create mode 100755 tools/ocaml/duniverse/cmdliner/build.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/cmdliner.opam
 create mode 100644 tools/ocaml/duniverse/cmdliner/doc/api.odocl
 create mode 100644 tools/ocaml/duniverse/cmdliner/dune-project
 create mode 100644 tools/ocaml/duniverse/cmdliner/pkg/META
 create mode 100755 tools/ocaml/duniverse/cmdliner/pkg/pkg.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner.mllib
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_arg.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_arg.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_base.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_base.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_cline.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_cline.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_docgen.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_docgen.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_info.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_info.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_manpage.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_manpage.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_msg.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_msg.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_suggest.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_suggest.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_term.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_term.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_trie.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_trie.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/dune
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/chorus.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/cp_ex.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/darcs_ex.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/dune
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/revolt.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/rm_ex.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/tail_ex.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_man.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_man_utf8.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_opt_req.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_pos.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_pos_all.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_pos_left.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_pos_req.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_pos_rev.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_term_dups.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_with_used_args.ml
 create mode 100644 tools/ocaml/duniverse/cppo/.gitignore
 create mode 100644 tools/ocaml/duniverse/cppo/.ocp-indent
 create mode 100644 tools/ocaml/duniverse/cppo/.travis.yml
 create mode 100644 tools/ocaml/duniverse/cppo/CODEOWNERS
 create mode 100644 tools/ocaml/duniverse/cppo/Changes
 create mode 100644 tools/ocaml/duniverse/cppo/INSTALL.md
 create mode 100644 tools/ocaml/duniverse/cppo/LICENSE.md
 create mode 100644 tools/ocaml/duniverse/cppo/Makefile
 create mode 100644 tools/ocaml/duniverse/cppo/README.md
 create mode 100644 tools/ocaml/duniverse/cppo/VERSION
 create mode 100644 tools/ocaml/duniverse/cppo/appveyor.yml
 create mode 100644 tools/ocaml/duniverse/cppo/cppo.opam
 create mode 100644 tools/ocaml/duniverse/cppo/cppo_ocamlbuild.opam
 create mode 100644 tools/ocaml/duniverse/cppo/dune-project
 create mode 100644 tools/ocaml/duniverse/cppo/examples/Makefile
 create mode 100644 tools/ocaml/duniverse/cppo/examples/debug.ml
 create mode 100644 tools/ocaml/duniverse/cppo/examples/dune
 create mode 100644 tools/ocaml/duniverse/cppo/examples/french.ml
 create mode 100644 tools/ocaml/duniverse/cppo/examples/lexer.mll
 create mode 100644 tools/ocaml/duniverse/cppo/ocamlbuild_plugin/_tags
 create mode 100644 tools/ocaml/duniverse/cppo/ocamlbuild_plugin/dune
 create mode 100644 tools/ocaml/duniverse/cppo/ocamlbuild_plugin/ocamlbuild_cppo.ml
 create mode 100644 tools/ocaml/duniverse/cppo/ocamlbuild_plugin/ocamlbuild_cppo.mli
 create mode 100644 tools/ocaml/duniverse/cppo/src/compat.ml
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_command.ml
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_command.mli
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_eval.ml
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_eval.mli
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_lexer.mll
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_main.ml
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_parser.mly
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_types.ml
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_types.mli
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_version.mli
 create mode 100644 tools/ocaml/duniverse/cppo/src/dune
 create mode 100644 tools/ocaml/duniverse/cppo/test/capital.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/capital.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/comments.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/comments.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/cond.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/cond.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/dune
 create mode 100644 tools/ocaml/duniverse/cppo/test/ext.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/ext.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/incl.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/incl2.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/loc.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/loc.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/paren_arg.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/paren_arg.ref
 create mode 100755 tools/ocaml/duniverse/cppo/test/source.sh
 create mode 100644 tools/ocaml/duniverse/cppo/test/test.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/tuple.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/tuple.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/unmatched.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/unmatched.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/version.cppo
 create mode 100644 tools/ocaml/duniverse/crowbar/.gitignore
 create mode 100644 tools/ocaml/duniverse/crowbar/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/crowbar/LICENSE.md
 create mode 100644 tools/ocaml/duniverse/crowbar/README.md
 create mode 100644 tools/ocaml/duniverse/crowbar/crowbar.opam
 create mode 100644 tools/ocaml/duniverse/crowbar/dune
 create mode 100644 tools/ocaml/duniverse/crowbar/dune-project
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/.gitignore
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/calendar/dune
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/calendar/test_calendar.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/fpath/dune
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/fpath/test_fpath.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/input/testcase
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/map/dune
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/map/test_map.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/pprint/dune
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/pprint/test_pprint.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/serializer/dune
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/serializer/serializer.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/serializer/test_serializer.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/uunf/dune
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/uunf/test_uunf.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/xmldiff/dune
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/xmldiff/test_xmldiff.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/src/crowbar.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/src/crowbar.mli
 create mode 100644 tools/ocaml/duniverse/crowbar/src/dune
 create mode 100644 tools/ocaml/duniverse/crowbar/src/todo
 create mode 100644 tools/ocaml/duniverse/csexp/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/csexp/LICENSE.md
 create mode 100644 tools/ocaml/duniverse/csexp/Makefile
 create mode 100644 tools/ocaml/duniverse/csexp/README.md
 create mode 100644 tools/ocaml/duniverse/csexp/bench/csexp_bench.ml
 create mode 100644 tools/ocaml/duniverse/csexp/bench/dune
 create mode 100644 tools/ocaml/duniverse/csexp/bench/main.ml
 create mode 100755 tools/ocaml/duniverse/csexp/bench/runner.sh
 create mode 100644 tools/ocaml/duniverse/csexp/csexp.opam
 create mode 100644 tools/ocaml/duniverse/csexp/csexp.opam.template
 create mode 100644 tools/ocaml/duniverse/csexp/dune-project
 create mode 100644 tools/ocaml/duniverse/csexp/dune-workspace.dev
 create mode 100644 tools/ocaml/duniverse/csexp/src/csexp.ml
 create mode 100644 tools/ocaml/duniverse/csexp/src/csexp.mli
 create mode 100644 tools/ocaml/duniverse/csexp/src/dune
 create mode 100644 tools/ocaml/duniverse/csexp/test/dune
 create mode 100644 tools/ocaml/duniverse/csexp/test/test.ml
 create mode 100644 tools/ocaml/duniverse/dune
 create mode 100644 tools/ocaml/duniverse/fmt/.gitignore
 create mode 100644 tools/ocaml/duniverse/fmt/.ocp-indent
 create mode 100644 tools/ocaml/duniverse/fmt/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/fmt/LICENSE.md
 create mode 100644 tools/ocaml/duniverse/fmt/README.md
 create mode 100644 tools/ocaml/duniverse/fmt/_tags
 create mode 100644 tools/ocaml/duniverse/fmt/doc/api.odocl
 create mode 100644 tools/ocaml/duniverse/fmt/doc/index.mld
 create mode 100644 tools/ocaml/duniverse/fmt/dune-project
 create mode 100644 tools/ocaml/duniverse/fmt/fmt.opam
 create mode 100644 tools/ocaml/duniverse/fmt/pkg/META
 create mode 100755 tools/ocaml/duniverse/fmt/pkg/pkg.ml
 create mode 100644 tools/ocaml/duniverse/fmt/src/dune
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt.ml
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt.mli
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt.mllib
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_cli.ml
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_cli.mli
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_cli.mllib
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_top.ml
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_top.mllib
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_tty.ml
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_tty.mli
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_tty.mllib
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_tty_top_init.ml
 create mode 100644 tools/ocaml/duniverse/fmt/test/test.ml
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/.gitignore
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/LICENSE.md
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/README.md
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/afl-persistent.opam
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/afl-persistent.opam.template
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/aflPersistent.available.ml
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/aflPersistent.mli
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/aflPersistent.stub.ml
 create mode 100755 tools/ocaml/duniverse/ocaml-afl-persistent/detect.sh
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/dune
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/dune-project
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/test.ml
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/test/harness.ml
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/test/test.ml
 create mode 100755 tools/ocaml/duniverse/ocaml-afl-persistent/test/test.sh
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/.gitignore
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/.travis.yml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/COPYING.txt
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/Makefile
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/README.md
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/dune-project
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/ocplib-endian.opam
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/be_ocaml_401.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/common.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/common_401.cppo.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/common_float.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/dune
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/endianBigstring.cppo.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/endianBigstring.cppo.mli
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/endianBytes.cppo.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/endianBytes.cppo.mli
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/endianString.cppo.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/endianString.cppo.mli
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/le_ocaml_401.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/ne_ocaml_401.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/tests/bench.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/tests/dune
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/tests/test.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/tests/test_bigstring.cppo.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/tests/test_bytes.cppo.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/tests/test_string.cppo.ml
 create mode 100755 tools/ocaml/duniverse/result/CHANGES.md
 create mode 100755 tools/ocaml/duniverse/result/LICENSE.md
 create mode 100755 tools/ocaml/duniverse/result/Makefile
 create mode 100755 tools/ocaml/duniverse/result/README.md
 create mode 100755 tools/ocaml/duniverse/result/dune
 create mode 100755 tools/ocaml/duniverse/result/dune-project
 create mode 100755 tools/ocaml/duniverse/result/result-as-alias-4.08.ml
 create mode 100755 tools/ocaml/duniverse/result/result-as-alias.ml
 create mode 100755 tools/ocaml/duniverse/result/result-as-newtype.ml
 create mode 100755 tools/ocaml/duniverse/result/result.opam
 create mode 100755 tools/ocaml/duniverse/result/which_result.ml
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/LICENSE
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/README.md
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/dune-project
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/dune-workspace.dev
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/src/dune
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/stdlib-shims.opam
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/test/dune
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/test/test.ml
 create mode 100644 tools/ocaml/libs/eventchn/dune
 create mode 100644 tools/ocaml/libs/mmap/dune
 create mode 100644 tools/ocaml/libs/mmap/gnt.ml
 create mode 100644 tools/ocaml/libs/mmap/gnt.mli
 create mode 100644 tools/ocaml/libs/mmap/gnttab_stubs.c
 create mode 100644 tools/ocaml/libs/xb/dune
 create mode 100644 tools/ocaml/libs/xc/dune
 create mode 100644 tools/ocaml/libs/xs/dune
 create mode 100644 tools/ocaml/xen.opam
 create mode 100644 tools/ocaml/xen.opam.locked
 create mode 100644 tools/ocaml/xenstore.opam
 create mode 100644 tools/ocaml/xenstored.opam
 create mode 100644 tools/ocaml/xenstored/dune
 create mode 100644 tools/ocaml/xenstored/test/dune
 create mode 100644 tools/ocaml/xenstored/test/generator.ml
 create mode 100644 tools/ocaml/xenstored/test/gnt.ml
 create mode 100644 tools/ocaml/xenstored/test/model.ml
 create mode 100644 tools/ocaml/xenstored/test/old/arbitrary.ml
 create mode 100644 tools/ocaml/xenstored/test/old/gen_paths.ml
 create mode 100644 tools/ocaml/xenstored/test/old/xenstored_test.ml
 create mode 100644 tools/ocaml/xenstored/test/pathtree.ml
 create mode 100644 tools/ocaml/xenstored/test/testable.ml
 create mode 100644 tools/ocaml/xenstored/test/types.ml
 copy tools/ocaml/{libs/mmap/xenmmap.mli => xenstored/test/xenctrl.ml} (54%)
 create mode 100644 tools/ocaml/xenstored/test/xeneventchn.ml
 create mode 100644 tools/ocaml/xenstored/test/xenstored_test.ml
 create mode 100644 tools/ocaml/xenstored/test/xs_protocol.ml
 create mode 100644 tools/ocaml/xenstored/xenstored_main.ml
Signature · 1 line
2.25.1
#5 lore raw

PATCH v2 5/17 tools/ocaml/xenstored: add binary dump format support

Do not dump -1, it'll trigger an assertion, use 0xFF.. instead.

---
 tools/ocaml/xenstored/connection.ml | 63 +++++++++++++++++++++--------
 tools/ocaml/xenstored/disk.ml       |  3 +-
 2 files changed, 49 insertions(+), 17 deletions(-)
tools/ocaml/xenstored/connection.ml +47 -16
index 65f99ea6f2..7a894a2eb1 100644
@@ -17,6 +17,7 @@
 exception End_of_file
 
 open Stdext
+module LR = Disk.LiveRecord
 
 let xenstore_payload_max = 4096 (* xen/include/public/io/xs_wire.h *)
 
@@ -77,6 +78,10 @@ let number_of_transactions con =
 
 let get_domain con = con.dom
 
+let get_id con = match con.dom with
+| None -> 2*LR.domid_invalid + con.anonid
+| Some dom -> 1 + Domain.get_id dom
+
 let anon_id_next = ref 1
 
 let get_domstr con =
@@ -278,6 +283,9 @@ let end_transaction con tid commit =
 let get_transaction con tid =
 	Hashtbl.find con.transactions tid
 
+let iter_transactions con f =
+	Hashtbl.iter f con.transactions
+
 let do_input con = Xenbus.Xb.input con.xb
 let has_input con = Xenbus.Xb.has_in_packet con.xb
 let has_partial_input con = match con.xb.Xenbus.Xb.partial_in with
@@ -336,22 +344,45 @@ let incr_ops con = con.stat_nb_ops <- con.stat_nb_ops + 1
 let stats con =
 	Hashtbl.length con.watches, con.stat_nb_ops
 
-let dump con chan =
-	let id = match con.dom with
-	| Some dom ->
-		let domid = Domain.get_id dom in
-		(* dump domain *)
-		Domain.dump dom chan;
-		domid
-	| None ->
-		let fd = con |> get_fd |> Utils.FD.to_int in
-		Printf.fprintf chan "socket,%d\n" fd;
-		-fd
-	in
-	(* dump watches *)
-	List.iter (fun (path, token) ->
-		Printf.fprintf chan "watch,%d,%s,%s\n" id (Utils.hexify path) (Utils.hexify token)
-		) (list_watches con)
+let serialize_pkt_in buf xb =
+	let open Xenbus.Xb in
+	Queue.iter (fun p -> Buffer.add_string buf (Packet.to_string p)) xb.pkt_in;
+	match xb.partial_in with
+	| NoHdr (to_read, hdrb) ->
+		(* see Xb.input *)
+		let used = Xenbus.Partial.header_size () - to_read in
+		Buffer.add_subbytes buf hdrb 0 used
+	| HaveHdr p ->
+		p |> Packet.of_partialpkt |> Packet.to_string |> Buffer.add_string buf
+
+let serialize_pkt_out buf xb =
+	let open Xenbus.Xb in
+	Buffer.add_string buf xb.partial_out;
+	Queue.iter (fun p -> Buffer.add_string buf (Packet.to_string p)) xb.pkt_out
+
+let dump con store chan =
+	let conid = get_id con in
+	let conn = match con.dom with
+	| None -> LR.Socket (get_fd con)
+	| Some dom -> LR.Domain {
+		id = Domain.get_id dom;
+		target = LR.domid_invalid;  (* TODO: we do not store this info *)
+		remote_port = Domain.get_remote_port dom
+	} in
+	let pkt_in = Buffer.create 4096 in
+	let pkt_out = Buffer.create 4096 in
+	serialize_pkt_in pkt_in con.xb;
+	serialize_pkt_out pkt_out con.xb;
+	LR.write_connection_data chan ~conid ~conn  pkt_in con.xb.partial_out pkt_out;
+
+	con |> list_watches
+	|> List.rev (* preserve order in dump/reload *)
+	|> List.iter (fun (wpath, token) ->
+		LR.write_watch_data chan ~conid ~wpath ~token
+	);
+	let conpath = get_path con in
+	iter_transactions con (fun _ txn ->
+		 Transaction.dump store conpath ~conid txn chan)
 
 let debug con =
 	let domid = get_domstr con in
tools/ocaml/xenstored/disk.ml +2 -1
index 595fdab54a..59794324e1 100644
@@ -292,7 +292,8 @@ module LiveRecord = struct
 	let write_global_data t ~rw_sock =
 		write_record t Type.global_data 8 @@ fun b ->
 		O.w32 b (FD.to_int rw_sock);
-		O.w32 b (-1)
+                (* TODO: this needs a unit test/live update test too! *)
+		O.w32 b 0xFFFF_FFFF
 
 	let read_global_data t ~len f =
 		read_expect t "global_data" 8 len;
Signature · 1 line
2.25.1
#4 lore raw

PATCH v2 4/17 tools/ocaml/xenstored: implement the live migration binary format

In reply to Edwin Török

This is implemented by C xenstored as live update dump format. oxenstored already has its own (text-based) dump format, but for compatibility implement one compatible with C xenstored.

This will also be useful in the future for non-cooperative guest live migration.

docs/designs/xenstore-migration.md documents the format

For now this always dumps integers in big endian order, because even old versions of OCaml have support for that.
The binary format supports both little and big endian orders, so this should be compatible.

To dump in little endian or native endian order we would require OCaml 4.08+.

---
 tools/ocaml/xenstored/disk.ml | 318 ++++++++++++++++++++++++++++++++++
 1 file changed, 318 insertions(+)
tools/ocaml/xenstored/disk.ml +318 -0
index 4739967b61..595fdab54a 100644
@@ -155,3 +155,321 @@ let write store =
 		Unix.rename tfile xs_daemon_database
 	with exc ->
 		error "caught exn %s" (Printexc.to_string exc)
+
+	module BinaryOut = struct
+		let version = 0x1
+		let endian = 1
+		let padding = String.make 7 '\x00'
+
+		let write_header ch =
+			(* for testing endian order *)
+			output_binary_int ch 0x78656e73;
+			output_binary_int ch 0x746f7265;
+			output_binary_int ch version;
+			output_binary_int ch endian;
+			ch
+
+		let w8 = output_char
+		let w16 ch i =
+			assert (i >= 0 && i lsr 16 = 0);
+			output_byte ch (i lsr 8);
+			output_byte ch i
+
+		let w32 ch v =
+			assert (v >= 0 && v <= 0xFFFF_FFFF);
+			output_binary_int ch v
+
+		let pos = pos_out
+		let wpad ch =
+			let padto = 8 in
+			let padby = (padto - pos ch mod padto) mod padto in
+			if padby > 0 then
+				output_substring ch padding 0 padby
+
+		let wstring = output_string
+	end
+
+	module BinaryIn = struct
+		type t = in_channel
+
+		let read_header t =
+			let h = Bytes.make 8 '\x00' in
+			really_input t h 0 (Bytes.length h);
+			let ver = input_binary_int t in
+			let endian = input_binary_int t in
+			if Bytes.to_string h <> "xenstore" then
+				failwith "Header doesn't begin with 'xenstore'";
+			if ver <> BinaryOut.version then
+				failwith "Incompatible version";
+			if endian <> BinaryOut.endian then
+				failwith "Incompatible endianness"
+
+		let r8 = input_char
+
+		let r16 t = 
+			let r0 = input_byte t in
+			let r1 = input_byte t  in
+			(r0 lsl 8) lor r1
+
+		let r32 t =
+			(* read unsigned 32-bit int *)
+			let r = input_binary_int t land 0xFFFF_FFFF in
+			assert (r >= 0);
+			r
+
+		let rstring = really_input_string
+
+		let rpad t =
+			let padto = 8 in
+			let padby = (padto - pos_in t mod padto) mod padto in
+			if padby > 0 then
+				ignore (really_input_string t padby)
+	end
+
+module FD : sig
+     type t = Unix.file_descr
+     val of_int: int -> t
+     val to_int : t -> int
+end = struct
+    type t = Unix.file_descr
+    (* This is like Obj.magic but just for these types,
+       and relies on Unix.file_descr = int *)
+    external to_int : t -> int = "%identity"
+    external of_int : int -> t = "%identity"
+end
+
+module LiveRecord = struct
+	(* See docs/designs/xenstore-migration.md for binary format *)
+	module Type : sig
+		type t = private int
+		val end_ : t
+		val global_data : t
+		val connection_data : t
+		val watch_data : t
+		val transaction_data : t
+		val node_data: t
+	end = struct
+		type t = int
+		let end_ = 0x0
+		let global_data = 0x01
+		let connection_data = 0x02
+		let watch_data = 0x03
+		let transaction_data = 0x04
+		let node_data = 0x05
+	end
+
+	module I = BinaryIn
+	module O = BinaryOut
+
+	let write_expect msg expected actual =
+		if expected <> actual then
+			let m = Printf.sprintf "expected %d <> %d: %s" expected actual msg in
+			invalid_arg m
+
+	let write_record t (typ: Type.t) len f =
+		assert (O.pos t mod 8 = 0);
+		O.w32 t (typ :> int);
+		O.w32 t len;
+		let p0 = O.pos t in
+		f t;
+		let p1 = O.pos t in
+		write_expect "position and length" len (p1-p0);
+		O.wpad t
+
+	let write_end t =
+		write_record t Type.end_ 0 ignore
+
+	let read_expect t msg expected actual =
+		if expected <> actual then
+			let pos = pos_in t in
+			let m = Printf.sprintf "expected %d <> %d at ~%d: %s" expected actual pos msg in
+			invalid_arg m
+
+	let read_end t ~len f =
+		read_expect t "end" 0 len;
+		f ()
+
+	let write_global_data t ~rw_sock =
+		write_record t Type.global_data 8 @@ fun b ->
+		O.w32 b (FD.to_int rw_sock);
+		O.w32 b (-1)
+
+	let read_global_data t ~len f =
+		read_expect t "global_data" 8 len;
+		let rw_sock = FD.of_int (I.r32 t) in
+		let _ = FD.of_int (I.r32 t) in
+		f ~rw_sock
+
+	let conn_shared_ring = 0x0
+	let conn_socket = 0x1
+	let domid_invalid = 0x7FF4
+
+	(* oxenstored doesn't support readonly sockets yet *)
+	let flags_connection_readonly = 0x1l
+
+	type dom = { id: int; target: int; remote_port: int }
+	type conn = Socket of Unix.file_descr | Domain of dom
+
+	let write_connection_data t ~conid ~conn xb_pktin xb_partialout xb_pktout =
+		let in_data_len = Buffer.length xb_pktin in
+		let out_resp_len = String.length xb_partialout in
+		let out_data_len = Buffer.length xb_pktout in
+		let data_len = in_data_len + out_data_len in
+
+		write_record t Type.connection_data (32 + data_len) @@ fun b ->
+		assert (conid > 0);
+		O.w32 b conid;
+		O.w32 b (match conn with
+		| Socket _ -> conn_socket
+		| Domain _ -> conn_shared_ring
+		);
+		let flags = 0x0 in
+		O.w32 b flags;
+
+		(match conn with
+		| Socket fd ->
+			O.w32 b (FD.to_int fd);
+			O.w32 b 0 (* pad *)
+		| Domain dom ->
+			O.w16 b dom.id;
+			O.w16 b dom.target;
+			O.w32 b dom.remote_port
+			);
+
+		O.w32 b in_data_len;
+		O.w32 b out_resp_len;
+		O.w32 b out_data_len;
+		Buffer.output_buffer b xb_pktin;
+		O.wstring b xb_partialout;
+		Buffer.output_buffer b xb_pktout
+
+	let read_connection_data t ~len f =
+		let conid = I.r32 t in
+		assert (conid > 0);
+		let kind = I.r32 t in
+		let flags = I.r32 t in
+		read_expect t "flags" 0 flags;
+		let conn = (match kind with
+		| x when x = conn_socket ->
+			let fd = FD.of_int (I.r32 t) in
+			I.r32 t |> ignore;
+			Socket fd
+		| x when x = conn_shared_ring ->
+			let id = I.r16 t in
+			let target = I.r16 t in
+			let remote_port = I.r32 t in
+			Domain {id; target; remote_port }
+		| x ->
+			invalid_arg (Printf.sprintf "Unknown connection kind %x" x)
+		) in
+		let in_data_len = I.r32 t in
+		let out_resp_len = I.r32 t in
+		let out_data_len = I.r32 t in
+		let in_data = really_input_string t in_data_len in
+		let out_data = really_input_string t out_data_len in
+		f ~conid ~conn ~in_data ~out_data ~out_resp_len
+
+
+	let write_watch_data t ~conid ~wpath ~token =
+		let wpath_len = String.length wpath in
+		let token_len = String.length token in
+
+		write_record t Type.watch_data (12+wpath_len+token_len) @@ fun b ->
+		O.w32 b conid;
+		O.w32 b (String.length wpath);
+		O.w32 b (String.length token);
+		O.wstring b wpath;
+		O.wstring b token
+
+	let read_watch_data t ~len f =
+		let conid = I.r32 t in
+		let wpathlen = I.r32 t in
+		let tokenlen = I.r32 t in
+		let wpath = I.rstring t wpathlen in
+		let token = I.rstring t tokenlen in
+		f ~conid ~wpath ~token
+
+	let write_transaction_data t ~conid ~txid =
+		write_record t Type.transaction_data 8 @@ fun b ->
+		O.w32 b conid;
+		O.w32 b txid
+
+	let read_transaction_data t ~len f =
+		read_expect t "transaction" 8 len;
+		let conid = I.r32 t in
+		let txid = I.r32 t in
+		f ~conid ~txid
+
+	type access = R | W | RW | Del
+
+	let write_node_data t ~txidaccess ~path ~value ~perms =
+		let path_len = String.length path in
+		let value_len = String.length value in
+		let perms = Perms.Node.acls perms in
+		let len = 24 + (List.length perms)*4 + path_len + value_len in
+
+		write_record t Type.node_data len @@ fun b ->
+		O.w32 b (match txidaccess with None -> 0 | Some (conid, _, _) -> conid);
+		O.w32 b (match txidaccess with None -> 0 | Some (_, txid, _) -> txid);
+		O.w32 b path_len;
+		O.w32 b value_len;
+		O.w32 b (match txidaccess with
+		| None -> 0x0
+		| Some (_, _, Del) -> 0x0
+		| Some (_, _, R) -> 0x1
+		| Some (_, _, W) -> 0x2
+		| Some (_, _, RW) -> 0x3
+		);
+		O.w32 b (List.length perms);
+		List.iter (fun (domid, permty) ->
+			O.w8 b (Perms.char_of_permty permty);
+			O.w8 b '\x00';
+			O.w16 b domid;
+		) perms;
+		O.wstring b path;
+		O.wstring b value
+
+	let read_node_data t ~len f =
+		let conid = I.r32 t in
+		let txid = I.r32 t in
+		let path_len = I.r32 t in
+		let value_len = I.r32 t in
+		let txaccess = match conid, I.r32 t with
+		| 0, _ -> None
+		| _, 0 -> Some (conid, txid, Del)
+		| _, 1 -> Some (conid, txid, R)
+		| _, 2 -> Some (conid, txid, W)
+		| _, 3 -> Some (conid, txid, RW)
+		| _ -> invalid_arg "invalid access flag"
+		in
+		let a = Array.init (I.r32 t) (fun _ ->
+					let perm = Perms.permty_of_char (I.r8 t) in
+					I.r8 t |> ignore;
+					let domid = I.r16 t in
+					domid, perm
+		) in
+		let perms = match Array.to_list a with
+		| [] -> invalid_arg "Permission list cannot be empty";
+		| (owner, other) :: acls ->
+			Perms.Node.create owner other acls
+		in
+		let path = I.rstring t path_len in
+		let value = I.rstring t value_len in
+		f ~txaccess ~perms ~path ~value
+
+	let read_record t ~on_end ~on_global_data ~on_connection_data ~on_watch_data ~on_transaction_data ~on_node_data =
+		I.rpad t; (* if we fail to process a record (e.g. callback raises, ensure we resume at right place *)
+		let typ = I.r32 t in
+		let len = I.r32 t in
+		let p0 = pos_in t in
+		(match typ with
+		| x when x = (Type.end_ :> int) -> read_end t ~len on_end
+		| x when x = (Type.global_data :> int) -> read_global_data t ~len on_global_data
+		| x when x = (Type.connection_data :> int) -> read_connection_data t ~len on_connection_data
+		| x when x = (Type.watch_data :> int) -> read_watch_data t ~len on_watch_data
+		| x when x = (Type.transaction_data :> int) -> read_transaction_data t ~len on_transaction_data
+		| x when x = (Type.node_data :> int) -> read_node_data t ~len on_node_data
+		| x -> failwith (Printf.sprintf "Unknown record type: %x" x));
+		let p1 = pos_in t in
+		read_expect t "record length" len (p1-p0)
+end
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 1/17 docs/designs/xenstore-migration.md: clarify that deletes are recursive

In reply to Edwin Török
---
 docs/designs/xenstore-migration.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
docs/designs/xenstore-migration.md +2 -1
index 5f1155273e..87ef540918 100644
@@ -364,7 +364,8 @@ record previously present).
 |              | 0x0001: read                                   |
 |              | 0x0002: written                                |
 |              |                                                |
-|              | The value will be zero for a deleted node      |
+|              | The value will be zero for a recursively       |
+|              | deleted node                                   |
 |              |                                                |
 | `perm-count` | The number (N) of node permission specifiers   |
 |              | (which will be 0 for a node deleted in a       |
Signature · 1 line
2.25.1
#2 lore raw

PATCH v2 2/17 tools/ocaml: add unit test skeleton with Dune build system

In reply to Edwin Török

Based on initial work by Christian Lindig

Doing oxenstored development, especially fuzzing/unit tests requires an incremental and fast build system.

Dune is the preferred upstream build system for OCaml, and has been in use by the XAPI project for years.
Is is incremental and also generates editor integration files (.merlin).

Usage:
./xs-reconfigure.sh
cd tools/ocaml
make clean
make check

There are some other convenience targets as well:
make dune-clean
make dune-syntax-check
make dune-build-oxenstored

There are some files that are generated by Make, these are created by a 'dune-pre' target, they are too closely tied to make and cannot yet be generated by Dune itself.

The various Makefile targets are used as entrypoints into Dune that set the needed env vars (for C include files and libraries) and ensure that the generated files are available.

The unit tests do not require Xen to be available, so add mock eventchn and xenctrl libraries for the unit test to use, and copy the non-system specific modules from xenstored/ to xenstored/test/.

Xenstored had to be split into Xenstored and Xenstored_main, so that we can use the functions defined in Xenstored without actually starting up the daemon in a unit test.
Similarly argument parsing had to be delayed until after daemon startup.

Also had to disable setrlimit when running as non-root in poll.ml.

---
 tools/ocaml/.gitignore                       |  2 +
 tools/ocaml/Makefile                         | 33 +++++++++++++
 tools/ocaml/dune-project                     |  5 ++
 tools/ocaml/libs/eventchn/dune               |  8 ++++
 tools/ocaml/libs/mmap/dune                   |  8 ++++
 tools/ocaml/libs/xb/dune                     |  7 +++
 tools/ocaml/libs/xc/dune                     |  9 ++++
 tools/ocaml/libs/xs/dune                     |  4 ++
 tools/ocaml/xen.opam                         |  1 +
 tools/ocaml/xenstore.opam                    |  1 +
 tools/ocaml/xenstored.opam                   | 21 ++++++++
 tools/ocaml/xenstored/Makefile               |  3 +-
 tools/ocaml/xenstored/dune                   | 19 ++++++++
 tools/ocaml/xenstored/parse_arg.ml           |  2 +-
 tools/ocaml/xenstored/poll.ml                |  3 +-
 tools/ocaml/xenstored/test/dune              | 11 +++++
 tools/ocaml/xenstored/test/xenctrl.ml        | 48 +++++++++++++++++++
 tools/ocaml/xenstored/test/xeneventchn.ml    | 50 ++++++++++++++++++++
 tools/ocaml/xenstored/test/xenstored_test.ml |  2 +
 tools/ocaml/xenstored/xenstored.ml           |  4 +-
 tools/ocaml/xenstored/xenstored_main.ml      |  1 +
 21 files changed, 237 insertions(+), 5 deletions(-)
 create mode 100644 tools/ocaml/.gitignore
 create mode 100644 tools/ocaml/dune-project
 create mode 100644 tools/ocaml/libs/eventchn/dune
 create mode 100644 tools/ocaml/libs/mmap/dune
 create mode 100644 tools/ocaml/libs/xb/dune
 create mode 100644 tools/ocaml/libs/xc/dune
 create mode 100644 tools/ocaml/libs/xs/dune
 create mode 100644 tools/ocaml/xen.opam
 create mode 100644 tools/ocaml/xenstore.opam
 create mode 100644 tools/ocaml/xenstored.opam
 create mode 100644 tools/ocaml/xenstored/dune
 create mode 100644 tools/ocaml/xenstored/test/dune
 create mode 100644 tools/ocaml/xenstored/test/xenctrl.ml
 create mode 100644 tools/ocaml/xenstored/test/xeneventchn.ml
 create mode 100644 tools/ocaml/xenstored/test/xenstored_test.ml
 create mode 100644 tools/ocaml/xenstored/xenstored_main.ml
tools/ocaml/.gitignore new file +2 -0
new file mode 100644
index 0000000000..655e32b07c
@@ -0,0 +1,2 @@
+_build
+.merlin
tools/ocaml/Makefile +33 -0
index a7c04b6546..53dd0a0f0d 100644
@@ -34,3 +34,36 @@ build-tools-oxenstored:
 	$(MAKE) -s -C libs/xb
 	$(MAKE) -s -C libs/xc
 	$(MAKE) -C xenstored
+
+LIBRARY_PATH=$(XEN_libxenctrl):$(XEN_libxenguest):$(XEN_libxentoollog):$(XEN_libxencall):$(XEN_libxenevtchn):$(XEN_libxenforeignmemory):$(XEN_libxengnttab):$(XEN_libxendevicemodel):$(XEN_libxentoolcore)
+C_INCLUDE_PATH=$(XEN_libxenctrl)/include:$(XEN_libxengnttab)/include:$(XEN_libxenevtchn)/include:$(XEN_libxentoollog)/include:$(XEN_INCLUDE)
+
+# Files generated by the Makefile
+# These cannot be generated from dune, because dune cannot refer to files
+# in the parent directory (so it couldn't copy/use Config.mk)
+.PHONY: dune-pre
+dune-pre:
+	$(MAKE) -s -C ../../ build-tools-public-headers
+	$(MAKE) -s -C libs/xs paths.ml
+	$(MAKE) -s -C libs/xc xenctrl_abi_check.h
+	$(MAKE) -s -C xenstored paths.ml _paths.h
+
+.PHONY: check
+check: dune-pre
+	# --force isn't necessary here if the test is deterministic
+	OCAMLRUNPARAM=b C_INCLUDE_PATH=$(C_INCLUDE_PATH) dune runtest --profile=release --no-buffer --force
+
+# Convenience targets for development
+
+.PHONY: dune-clean
+dune-clean:
+	$(MAKE) clean
+	dune clean
+
+.PHONY: dune-syntax-check
+dune-syntax-check: dune-pre
+	LIBRARY_PATH=$(LIBRARY_PATH) C_INCLUDE_PATH=$(C_INCLUDE_PATH) dune build --profile=release @check
+
+.PHONY: build-oxenstored-dune
+dune-build-oxenstored: dune-pre
+	LD_LIBRARY_PATH=$(LIBRARY_PATH) LIBRARY_PATH=$(LIBRARY_PATH) C_INCLUDE_PATH=$(C_INCLUDE_PATH) dune build --profile=release @all
tools/ocaml/dune-project new file +5 -0
new file mode 100644
index 0000000000..b41cfae68b
@@ -0,0 +1,5 @@
+(lang dune 2.0)
+
+(name xen)
+
+(formatting disabled)
tools/ocaml/libs/eventchn/dune new file +8 -0
new file mode 100644
index 0000000000..e08bc76fdf
@@ -0,0 +1,8 @@
+(library
+ (foreign_stubs
+  (language c)
+  (names xeneventchn_stubs))
+ (name xeneventchn)
+ (public_name xen.eventchn)
+ (libraries unix)
+ (c_library_flags -lxenevtchn))
tools/ocaml/libs/mmap/dune new file +8 -0
new file mode 100644
index 0000000000..a47de44e47
@@ -0,0 +1,8 @@
+(library
+ (foreign_stubs
+  (language c)
+  (names xenmmap_stubs))
+ (name xenmmap)
+ (public_name xen.mmap)
+ (libraries unix)
+ (install_c_headers mmap_stubs))
tools/ocaml/libs/xb/dune new file +7 -0
new file mode 100644
index 0000000000..feb30adc01
@@ -0,0 +1,7 @@
+(library
+ (foreign_stubs
+  (language c)
+  (names xenbus_stubs xs_ring_stubs))
+ (name xenbus)
+ (public_name xen.bus)
+ (libraries unix xenmmap))
tools/ocaml/libs/xc/dune new file +9 -0
new file mode 100644
index 0000000000..fb75ee8ff7
@@ -0,0 +1,9 @@
+(library
+ (foreign_stubs
+  (language c)
+  (names xenctrl_stubs))
+ (name xenctrl)
+ (public_name xen.ctrl)
+ (libraries unix xenmmap)
+ (c_library_flags -lxenctrl -lxenguest -lxencall -lxenforeignmemory
+   -lxengnttab))
tools/ocaml/libs/xs/dune new file +4 -0
new file mode 100644
index 0000000000..c79ea75775
@@ -0,0 +1,4 @@
+(library
+ (name xenstore)
+ (public_name xen.store)
+ (libraries unix xenbus))
tools/ocaml/xen.opam new file +1 -0
new file mode 100644
index 0000000000..013b84db61
@@ -0,0 +1 @@
+opam-version: "2.0"
tools/ocaml/xenstore.opam new file +1 -0
new file mode 100644
index 0000000000..013b84db61
@@ -0,0 +1 @@
+opam-version: "2.0"
tools/ocaml/xenstored.opam new file +21 -0
new file mode 100644
index 0000000000..a226328e43
@@ -0,0 +1,21 @@
+opam-version: "2.0"
+synopsis: "In-memory key-value store for the Xen hypervisor"
+maintainer: "[email protected]"
+authors: "[email protected]"
+license: "LGPL"
+homepage: "https://github.com/lindig/xen-ocaml-tools"
+bug-reports: "https://github.com/lindig/xen-ocaml-tools/issues"
+depends: [
+  "ocaml"
+  "dune" {build}
+  "base-unix"
+
+  "crowbar" {with-test}
+  "fmt" {with-test}
+
+  "crowbar"
+  "fmt"
+]
+build: ["dune" "build" "-p" name "-j" jobs]
+depexts: ["m4" "libxen-dev" "libsystemd-dev"] {os-distribution = "debian"}
+dev-repo: "git+https://github.com/lindig/xen-ocaml-tools.git"
tools/ocaml/xenstored/Makefile +2 -1
index 89ec3ec76a..9d2da206d8 100644
@@ -56,7 +56,8 @@ OBJS = paths \
 	history \
 	parse_arg \
 	process \
-	xenstored
+	xenstored \
+	xenstored_main
 
 INTF = symbol.cmi trie.cmi syslog.cmi systemd.cmi poll.cmi
 
tools/ocaml/xenstored/dune new file +19 -0
new file mode 100644
index 0000000000..714a2ae07e
@@ -0,0 +1,19 @@
+(executable
+ (modes byte exe)
+ (name xenstored_main)
+ (modules (:standard \ syslog systemd))
+ (public_name oxenstored)
+ (package xenstored)
+ (flags (:standard -w -52))
+ (libraries unix xen.bus xen.mmap xen.ctrl xen.eventchn xenstubs))
+
+(library
+ (foreign_stubs
+  (language c)
+  (names syslog_stubs systemd_stubs select_stubs)
+  (flags (-DHAVE_SYSTEMD)))
+ (modules syslog systemd)
+ (name xenstubs)
+ (wrapped false)
+ (libraries unix)
+ (c_library_flags -lsystemd))
tools/ocaml/xenstored/parse_arg.ml +1 -1
index 7c0478e76a..965cb9ebeb 100644
@@ -28,7 +28,7 @@ type config =
 	disable_socket: bool;
 }
 
-let do_argv =
+let do_argv () =
 	let pidfile = ref "" and tracefile = ref "" (* old xenstored compatibility *)
 	and domain_init = ref true
 	and activate_access_log = ref true
tools/ocaml/xenstored/poll.ml +2 -1
index 26f8620dfc..92e0717ed2 100644
@@ -64,4 +64,5 @@ let poll_select in_fds out_fds exc_fds timeout =
 			a r
 
 let () =
-        set_fd_limit (get_sys_fs_nr_open ())
+        if Unix.geteuid () = 0 then
+          set_fd_limit (get_sys_fs_nr_open ())
tools/ocaml/xenstored/test/dune new file +11 -0
new file mode 100644
index 0000000000..2a3eb2b7df
@@ -0,0 +1,11 @@
+(copy_files# ../*.ml{,i})
+
+(test
+ (modes native)
+ (ocamlopt_flags -afl-instrument)
+ (name xenstored_test)
+ (modules (:standard \ syslog systemd))
+ (package xenstored)
+ (flags (:standard -w -52))
+ ;;(action (run %{test} -v --seed 364172147))
+ (libraries unix xen.bus xen.mmap xenstubs crowbar xen.store fmt fmt.tty))
tools/ocaml/xenstored/test/xenctrl.ml new file +48 -0

48 lines not on this page · raw message

tools/ocaml/xenstored/test/xeneventchn.ml new file +50 -0

50 lines not on this page · raw message

tools/ocaml/xenstored/test/xenstored_test.ml new file +2 -0
new file mode 100644
index 0000000000..e86b68e867
@@ -0,0 +1,2 @@
+open Xenstored
+let () = ()
tools/ocaml/xenstored/xenstored.ml +2 -2
index d44ae673c4..ae2eab498a 100644
@@ -265,8 +265,8 @@ let to_file store cons fds file =
 	        (fun () -> close_out channel)
 end
 
-let _ =
-	let cf = do_argv in
+let main () =
+	let cf = do_argv () in
 	let pidfile =
 		if Sys.file_exists (config_filename cf) then
 			parse_config (config_filename cf)
tools/ocaml/xenstored/xenstored_main.ml new file +1 -0
new file mode 100644
index 0000000000..929dd62fb4
@@ -0,0 +1 @@
+let () = Xenstored.main ()
Signature · 1 line
2.25.1
#6 lore raw

PATCH v2 6/17 tools/ocaml/xenstored: add support for binary format

In reply to Edwin Török

oxenstored already had support for loading a partial dump from a text format. Add support for the binary format too.
We no longer dump the text format, but we support loading the text format for backwards compatibility purposes.
(a version of oxenstored supporting live-update with the old text format has been released as part of the security series)

---
 tools/ocaml/xenstored/perms.ml     |   2 +
 tools/ocaml/xenstored/xenstored.ml | 202 ++++++++++++++++++++++++-----
 2 files changed, 174 insertions(+), 30 deletions(-)
tools/ocaml/xenstored/perms.ml +2 -0
index e8a16221f8..61c1c60083 100644
@@ -69,6 +69,8 @@ let remove_domid ~domid perm =
 
 let default0 = create 0 NONE []
 
+let acls t = (t.owner, t.other) :: t.acl
+
 let perm_of_string s =
 	let ty = permty_of_char s.[0]
 	and id = int_of_string (String.sub s 1 (String.length s - 1)) in
tools/ocaml/xenstored/xenstored.ml +172 -30

251 lines not on this page · raw message

Signature · 1 line
2.25.1
#8 lore raw

PATCH v2 8/17 Add structured fuzzing unit test

In reply to Edwin Török

Based on ideas from qcstm, implemented using Crowbar.

Quickcheck-style property tests that uses AFL for quickly exploring various values that trigger bugs in the code.

This is structured/guided fuzzing: we read an arbitrary random number, and use it to generate some valid looking xenstore trees and commands.

There are 2 instances of xenstored: one that runs the live update command, and one that ignores it.
Live-update should be a no-op wrt to xenstored state: this is our quicheck property.

When any mismatch is identified it prints the input (tree+xenstore commands), and a diff of the output:
the internal xenstore tree state + quotas.

afl-cmin can be used to further minimize the testcase. Crowbar (AFL persistent mode Quickcheck integration) is used due to
speed: this very easily gets us a multi-core parallelizable test.

Currently the Transaction tests fail, which is why live updates with active transactions are rejected. These tests are commented out.

There is also some incomplete code here that attempts to find functional bugs in xenstored by interpeting xenstore commands in a simpler way and comparing states.

This will build the fuzzer and run it single core for sanity test:
make container-fuzz-sanity-test

This will run it multicore (requires all dependencies installed on the host, including ocaml-bun, the multi-core AFL runner):
make dune-oxenstored-fuzz

'make check' will also run the fuzzer but with input supplied by OCaml's random number generator, and for a very small number of iterations (few thousand). This doesn't require any external tools (no AFL, bun).

On failure it prints a base64 encoding of the fuzzer state that can be used to reproduce the failure instantly, which is very useful for
debugging: one can iterate on the failed fuzzer state until it is fixed, and then run the fuzzer again to find next failure.

The unit tests here require OCaml 4.06, but the rest of the codebase doesn't (yet).

See https://lore.kernel.org/xen-devel/[email protected]/
for previous discussion of OCaml version.

---
 tools/ocaml/Makefile                          |  19 +
 tools/ocaml/xenstored/process.ml              |  12 +-
 tools/ocaml/xenstored/store.ml                |   1 +
 tools/ocaml/xenstored/test/dune               |  12 +
 tools/ocaml/xenstored/test/generator.ml       | 189 +++++
 tools/ocaml/xenstored/test/model.ml           | 253 ++++++
 tools/ocaml/xenstored/test/old/arbitrary.ml   | 261 +++++++
 tools/ocaml/xenstored/test/old/gen_paths.ml   |  66 ++
 .../xenstored/test/old/xenstored_test.ml      | 527 +++++++++++++
 tools/ocaml/xenstored/test/pathtree.ml        |  40 +
 tools/ocaml/xenstored/test/testable.ml        | 379 +++++++++
 tools/ocaml/xenstored/test/types.ml           | 437 +++++++++++
 tools/ocaml/xenstored/test/xenstored_test.ml  | 149 +++-
 tools/ocaml/xenstored/test/xs_protocol.ml     | 733 ++++++++++++++++++
 tools/ocaml/xenstored/transaction.ml          | 119 ++-
 15 files changed, 3188 insertions(+), 9 deletions(-)
 create mode 100644 tools/ocaml/xenstored/test/generator.ml
 create mode 100644 tools/ocaml/xenstored/test/model.ml
 create mode 100644 tools/ocaml/xenstored/test/old/arbitrary.ml
 create mode 100644 tools/ocaml/xenstored/test/old/gen_paths.ml
 create mode 100644 tools/ocaml/xenstored/test/old/xenstored_test.ml
 create mode 100644 tools/ocaml/xenstored/test/pathtree.ml
 create mode 100644 tools/ocaml/xenstored/test/testable.ml
 create mode 100644 tools/ocaml/xenstored/test/types.ml
 create mode 100644 tools/ocaml/xenstored/test/xs_protocol.ml
tools/ocaml/Makefile +19 -0
index 53dd0a0f0d..de375820a3 100644
@@ -67,3 +67,22 @@ dune-syntax-check: dune-pre
 .PHONY: build-oxenstored-dune
 dune-build-oxenstored: dune-pre
 	LD_LIBRARY_PATH=$(LIBRARY_PATH) LIBRARY_PATH=$(LIBRARY_PATH) C_INCLUDE_PATH=$(C_INCLUDE_PATH) dune build --profile=release @all
+
+.PHONY: oxenstored-fuzz1 oxenstored-fuzz
+dune-oxenstored-fuzz: dune-pre
+	# --force is needed, otherwise it would cache a successful run
+	sh -c '. /etc/profile && C_INCLUDE_PATH=$(C_INCLUDE_PATH) dune build --profile=release --no-buffer --force @fuzz'
+
+dune-oxenstored-fuzz1: dune-pre
+	sh -c '. /etc/profile && C_INCLUDE_PATH=$(C_INCLUDE_PATH) dune build --profile=release --no-buffer --force @fuzz1'
+
+.PHONY: container-fuzz
+container-fuzz-sanity-test:
+	dune clean
+	podman build -t oxenstored-fuzz .
+	# if UID is 0 then we get EPERM on setrlimit from inside the container
+	# use containerize script which ensures that uid is not 0
+	# (podman/docker run would get us a uid of 0)
+	# Only do a sanity test with 1 core, actually doing fuzzing inside a container is a bad idea
+	# due to FUSE overlayfs overhead
+	CONTAINER=oxenstored-fuzz CONTAINER_NO_PULL=1 DOCKER_CMD=podman ../../automation/scripts/containerize make -C tools/ocaml dune-oxenstored-fuzz1
tools/ocaml/xenstored/process.ml +9 -3
index d573c88685..13b7153536 100644
@@ -169,7 +169,7 @@ let parse_live_update args =
 				]
 			(fun x -> raise (Arg.Bad x))
 			"live-update -s" ;
-			debug "Live update process queued" ;
+			(* debug "Live update process queued" ; *)
 				{!state with deadline = Unix.gettimeofday () +. float !timeout
 				; force= !force; pending= true})
 		| _ ->
@@ -449,6 +449,8 @@ let transaction_replay c t doms cons =
 		(fun () ->
 			try
 				Logging.start_transaction ~con ~tid;
+				if t.must_fail then
+					raise Transaction_again;
 				List.iter (perform_exn ~wlog:true replay_t) (Transaction.get_operations t); (* May throw EAGAIN *)
 
 				Logging.end_transaction ~con ~tid;
@@ -550,7 +552,7 @@ let do_introduce con t domains cons data =
 		| _                         -> raise Invalid_Cmd_Args;
 		in
 	let dom =
-		if Domains.exist domains domid then
+		if Domains.exist domains domid then begin
 			let edom = Domains.find domains domid in
 			if (Domain.get_mfn edom) = mfn && (Connections.find_domain cons domid) != con then begin
 				(* Use XS_INTRODUCE for recreating the xenbus event-channel. *)
@@ -558,12 +560,16 @@ let do_introduce con t domains cons data =
 				Domain.bind_interdomain edom;
 			end;
 			edom
+		end
 		else try
 			let ndom = Domains.create domains domid mfn port in
 			Connections.add_domain cons ndom;
 			Connections.fire_spec_watches (Transaction.get_root t) cons Store.Path.introduce_domain;
 			ndom
-		with _ -> raise Invalid_Cmd_Args
+		with e ->
+			let bt = Printexc.get_backtrace () in
+			 Logging.debug "process" "do_introduce: %s (%s)" (Printexc.to_string e) bt;
+			 raise Invalid_Cmd_Args
 	in
 	if (Domain.get_remote_port dom) <> port || (Domain.get_mfn dom) <> mfn then
 		raise Domain_not_match
tools/ocaml/xenstored/store.ml +1 -0
index 20e67b1427..85ca3daae9 100644
@@ -133,6 +133,7 @@ let of_path_and_name path name =
 	| _ -> path @ [name]
 
 let create path connection_path =
+	Logging.debug "store" "Path.create %S %S" path connection_path;
 	of_string (Utils.path_validate path connection_path)
 
 let to_string t =
tools/ocaml/xenstored/test/dune +12 -0
index 2a3eb2b7df..cd62926be9 100644
@@ -9,3 +9,15 @@
  (flags (:standard -w -52))
  ;;(action (run %{test} -v --seed 364172147))
  (libraries unix xen.bus xen.mmap xenstubs crowbar xen.store fmt fmt.tty))
+
+(rule
+(alias fuzz1)
+(deps xenstored_test.exe)
+(action (run bun -svv ./xenstored_test.exe))
+)
+
+(rule
+(alias fuzz)
+(deps xenstored_test.exe)
+(action (run bun --no-kill ./xenstored_test.exe))
+)
tools/ocaml/xenstored/test/generator.ml new file +189 -0

189 lines not on this page · raw message

tools/ocaml/xenstored/test/model.ml new file +253 -0

253 lines not on this page · raw message

tools/ocaml/xenstored/test/old/arbitrary.ml new file +261 -0

261 lines not on this page · raw message

tools/ocaml/xenstored/test/old/gen_paths.ml new file +66 -0

66 lines not on this page · raw message

tools/ocaml/xenstored/test/old/xenstored_test.ml new file +527 -0

527 lines not on this page · raw message

tools/ocaml/xenstored/test/pathtree.ml new file +40 -0
new file mode 100644
index 0000000000..50cbb0302d
@@ -0,0 +1,40 @@
+module M = Map.Make(String)
+type 'a t = { data: 'a; children: 'a t M.t }
+
+type 'a tree = 'a t
+let of_data data = { data; children = M.empty }
+
+let update key f t = { t with children = M.update key f t.children }
+let set t data = { t with data }
+
+module Cursor = struct
+  type 'a t = { tree: 'a tree; up: ('a t * M.key) option }
+
+  let of_tree tree = { tree; up = None }
+
+  let create parent key tree = { tree; up = Some (parent, key) }
+
+  let down cur k =
+    M.find_opt k cur.tree.children |> Option.map @@ create cur k
+
+  let down_implicit_create ~implicit cur k =
+    match down cur k with
+    | Some r -> r
+    | None -> cur.tree.data |> implicit |> of_data |> create cur k
+
+  let rec to_tree t = match t.up with
+    | None -> t.tree
+    | Some (parent, key) ->
+        to_tree { parent with tree = update key (fun _ -> Some t.tree) parent.tree }
+
+  let set cur data = { cur with tree = set cur.tree data }
+  let get cur = cur.tree.data
+
+  let rm_child cur key = { cur with tree = update key (fun _ -> None) cur.tree}
+
+  (* TODO: down with implicit create *)
+end
+
+
+
+let rec map f t = { data = f t.data; children = M.map (map f) t.children }
tools/ocaml/xenstored/test/testable.ml new file +379 -0

379 lines not on this page · raw message

tools/ocaml/xenstored/test/types.ml new file +437 -0

437 lines not on this page · raw message

tools/ocaml/xenstored/test/xenstored_test.ml +147 -2

149 lines not on this page · raw message

tools/ocaml/xenstored/test/xs_protocol.ml new file +733 -0

614 lines not on this page · raw message

tools/ocaml/xenstored/transaction.ml +115 -4

119 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.25.1

Part of the diff is not shown here. View the raw message.

#10 lore raw

PATCH v2 9/17 tools/ocaml: use common macros for manipulating mmap_interface

In reply to Edwin Török

Also expose these macros in a header file that can be reused by the upcoming grant table code.

---
 tools/ocaml/libs/mmap/mmap_stubs.h    |  7 +++++++
 tools/ocaml/libs/mmap/xenmmap_stubs.c |  2 --
 tools/ocaml/libs/xb/xs_ring_stubs.c   | 14 +++++---------
 3 files changed, 12 insertions(+), 11 deletions(-)
tools/ocaml/libs/mmap/mmap_stubs.h +7 -0
index 65e4239890..816ba6a724 100644
@@ -30,4 +30,11 @@ struct mmap_interface
 	int len;
 };
 
+#ifndef Data_abstract_val
+#define Data_abstract_val(v) ((void*) Op_val(v))
+#endif
+
+#define Intf_val(a) ((struct mmap_interface *) Data_abstract_val(a))
+#define Intf_data_val(a) (Intf_val(a)->addr)
+
 #endif
tools/ocaml/libs/mmap/xenmmap_stubs.c +0 -2
index e2ce088e25..b811990a89 100644
@@ -28,8 +28,6 @@
 #include <caml/fail.h>
 #include <caml/callback.h>
 
-#define Intf_val(a) ((struct mmap_interface *) a)
-
 static int mmap_interface_init(struct mmap_interface *intf,
                                int fd, int pflag, int mflag,
                                int len, int offset)
tools/ocaml/libs/xb/xs_ring_stubs.c +5 -9
index 7a91fdee75..614c6e371d 100644
@@ -35,8 +35,6 @@
 #include <sys/mman.h>
 #include "mmap_stubs.h"
 
-#define GET_C_STRUCT(a) ((struct mmap_interface *) a)
-
 /*
  * Bytes_val has been introduced by Ocaml 4.06.1. So define our own version
  * if needed.
@@ -52,12 +50,11 @@ CAMLprim value ml_interface_read(value ml_interface,
 	CAMLparam3(ml_interface, ml_buffer, ml_len);
 	CAMLlocal1(ml_result);
 
-	struct mmap_interface *interface = GET_C_STRUCT(ml_interface);
 	unsigned char *buffer = Bytes_val(ml_buffer);
 	int len = Int_val(ml_len);
 	int result;
 
-	struct xenstore_domain_interface *intf = interface->addr;
+	struct xenstore_domain_interface *intf = Intf_data_val(ml_interface);
 	XENSTORE_RING_IDX cons, prod; /* offsets only */
 	int total_data, data;
 	uint32_t connection;
@@ -111,12 +108,11 @@ CAMLprim value ml_interface_write(value ml_interface,
 	CAMLparam3(ml_interface, ml_buffer, ml_len);
 	CAMLlocal1(ml_result);
 
-	struct mmap_interface *interface = GET_C_STRUCT(ml_interface);
 	const unsigned char *buffer = Bytes_val(ml_buffer);
 	int len = Int_val(ml_len);
 	int result;
 
-	struct xenstore_domain_interface *intf = interface->addr;
+	struct xenstore_domain_interface *intf = Intf_data_val(ml_interface);
 	XENSTORE_RING_IDX cons, prod;
 	int total_space, space;
 	uint32_t connection;
@@ -166,7 +162,7 @@ exit:
 CAMLprim value ml_interface_set_server_features(value interface, value v)
 {
 	CAMLparam2(interface, v);
-	struct xenstore_domain_interface *intf = GET_C_STRUCT(interface)->addr;
+	struct xenstore_domain_interface *intf = Intf_data_val(interface);
 	if (intf == (void*)MAP_FAILED)
 		caml_failwith("Interface closed");
 
@@ -178,7 +174,7 @@ CAMLprim value ml_interface_set_server_features(value interface, value v)
 CAMLprim value ml_interface_get_server_features(value interface)
 {
 	CAMLparam1(interface);
-	struct xenstore_domain_interface *intf = GET_C_STRUCT(interface)->addr;
+	struct xenstore_domain_interface *intf = Intf_data_val(interface);
 
 	CAMLreturn(Val_int (intf->server_features));
 }
@@ -186,7 +182,7 @@ CAMLprim value ml_interface_get_server_features(value interface)
 CAMLprim value ml_interface_close(value interface)
 {
 	CAMLparam1(interface);
-	struct xenstore_domain_interface *intf = GET_C_STRUCT(interface)->addr;
+	struct xenstore_domain_interface *intf = Intf_data_val(interface);
 	int i;
 
 	intf->req_cons = intf->req_prod = intf->rsp_cons = intf->rsp_prod = 0;
Signature · 1 line
2.25.1
#7 lore raw

PATCH v2 7/17 tools/ocaml/xenstored: validate config file before live update

In reply to Edwin Török

The configuration file can contain typos or various errors that could prevent live update from succeeding (e.g. a flag only valid on a different version). Unknown entries in the config file would be ignored on startup normally, add a strict --config-test that live-update can use to check that the config file is valid *for the new binary*.

---
 tools/ocaml/xenstored/parse_arg.ml | 4 ++++
 tools/ocaml/xenstored/process.ml   | 2 +-
 tools/ocaml/xenstored/xenstored.ml | 9 +++++++--
 3 files changed, 12 insertions(+), 3 deletions(-)
tools/ocaml/xenstored/parse_arg.ml +4 -0
index 965cb9ebeb..588970825f 100644
@@ -26,6 +26,7 @@ type config =
 	restart: bool;
 	live_reload: bool;
 	disable_socket: bool;
+	config_test: bool;
 }
 
 let do_argv () =
@@ -38,6 +39,7 @@ let do_argv () =
 	and restart = ref false
 	and live_reload = ref false
 	and disable_socket = ref false
+	and config_test = ref false
 	in
 
 	let speclist =
@@ -55,6 +57,7 @@ let do_argv () =
 		  ("-T", Arg.Set_string tracefile, ""); (* for compatibility *)
 		  ("--restart", Arg.Set restart, "Read database on starting");
 		  ("--live", Arg.Set live_reload, "Read live dump on startup");
+		  ("--config-test", Arg.Set config_test, "Test validity of config file");
 		  ("--disable-socket", Arg.Unit (fun () -> disable_socket := true), "Disable socket");
 		] in
 	let usage_msg = "usage : xenstored [--config-file <filename>] [--no-domain-init] [--help] [--no-fork] [--reraise-top-level] [--restart] [--disable-socket]" in
@@ -70,4 +73,5 @@ let do_argv () =
 		restart = !restart;
 		live_reload = !live_reload;
 		disable_socket = !disable_socket;
+		config_test = !config_test;
 	}
tools/ocaml/xenstored/process.ml +1 -1
index 27790d4a5c..d573c88685 100644
@@ -121,7 +121,7 @@ let launch_exn t =
 
 let validate_exn t =
 	(* --help must be last to check validity of earlier arguments *)
-	let t' = {t with cmdline= t.cmdline @ ["--help"]} in
+	let t' = {t with cmdline= t.cmdline @ ["--config-test"]} in
 	let cmd = string_of_t t' in
 	debug "Executing %s" cmd ;
 	match Unix.fork () with
tools/ocaml/xenstored/xenstored.ml +7 -2
index 2aa0dbc0e1..34e706910e 100644
@@ -88,7 +88,7 @@ let default_pidfile = Paths.xen_run_dir ^ "/xenstored.pid"
 
 let ring_scan_interval = ref 20
 
-let parse_config filename =
+let parse_config ?(strict=false) filename =
 	let pidfile = ref default_pidfile in
 	let options = [
 		("merge-activate", Config.Set_bool Transaction.do_coalesce);
@@ -126,11 +126,12 @@ let parse_config filename =
 		("xenstored-port", Config.Set_string Domains.xenstored_port); ] in
 	begin try Config.read filename options (fun _ _ -> raise Not_found)
 	with
-	| Config.Error err -> List.iter (fun (k, e) ->
+	| Config.Error err as e -> List.iter (fun (k, e) ->
 		match e with
 		| "unknown key" -> eprintf "config: unknown key %s\n" k
 		| _             -> eprintf "config: %s: %s\n" k e
 		) err;
+		if strict then raise e
 	| Sys_error m -> eprintf "error: config: %s\n" m;
 	end;
 	!pidfile
@@ -408,6 +409,10 @@ end
 
 let main () =
 	let cf = do_argv () in
+	if cf.config_test then begin
+	  let _pidfile:string = parse_config ~strict:true (config_filename cf) in
+	  exit 0
+	end;
 	let pidfile =
 		if Sys.file_exists (config_filename cf) then
 			parse_config (config_filename cf)
Signature · 1 line
2.25.1
#9 lore raw
In reply to Edwin Török
Quoted 1 line · Edwin Török

These patches have been posted previously.

A git tree is available here for easier reviewing:
https://github.com/edwintorok/xen/pull/2

Quoted 711 lines

The gnttab patches (tools/ocaml/libs/mmap) were not applied at the time
to avoid conflicts with an in-progress XSA.
The binary format live-update and fuzzing patches were not applied because it was too close to the next Xen release freeze.

The patches depend on each-other: live-update only works correctly when the gnttab
patches are taken too (MFN is not part of the binary live-update stream),
so they are included here as a single series.
The gnttab patches replaces one use of libxenctrl with stable interfaces, leaving one unstable
libxenctrl interface used by oxenstored.

The 'vendor external dependencies' may be optional, it is useful to be part
of a patchqueue in a specfile so that you can build everything without external dependencies,
but might as well commit it so everyone has it easily available not just XenServer.

Note that the live-update fuzz test doesn't yet pass, it is still able to find bugs.
However the reduced version with a fixed seed used as a unit test does pass,
so it is useful to have it committed, and further improvements can be made later
as more bugs are discovered and fixed.

Edwin Török (17):
docs/designs/xenstore-migration.md: clarify that deletes are
recursive
tools/ocaml: add unit test skeleton with Dune build system tools/ocaml: vendor external dependencies for convenience tools/ocaml/xenstored: implement the live migration binary format tools/ocaml/xenstored: add binary dump format support tools/ocaml/xenstored: add support for binary format tools/ocaml/xenstored: validate config file before live update Add structured fuzzing unit test
tools/ocaml: use common macros for manipulating mmap_interface tools/ocaml/libs/mmap: allocate correct number of bytes tools/ocaml/libs/mmap: Expose stub_mmap_alloc tools/ocaml/libs/mmap: mark mmap/munmap as blocking tools/ocaml/libs/xb: import gnttab stubs from mirage tools/ocaml: safer Xenmmap interface tools/ocaml/xenstored: use gnttab instead of xenctrl's
foreign_map_range
tools/ocaml/xenstored: don't store domU's mfn of ring page tools/ocaml/libs/mmap: Clean up unused read/write

 docs/designs/xenstore-migration.md            |    3 +-
 tools/ocaml/.gitignore                        |    2 +
 tools/ocaml/Makefile                          |   53 +
 tools/ocaml/dune-project                      |    5 +
 tools/ocaml/duniverse/cmdliner/.gitignore     |   10 +
 tools/ocaml/duniverse/cmdliner/.ocp-indent    |    1 +
 tools/ocaml/duniverse/cmdliner/B0.ml          |    9 +
 tools/ocaml/duniverse/cmdliner/CHANGES.md     |  255 +++
 tools/ocaml/duniverse/cmdliner/LICENSE.md     |   13 +
 tools/ocaml/duniverse/cmdliner/Makefile       |   77 +
 tools/ocaml/duniverse/cmdliner/README.md      |   51 +
 tools/ocaml/duniverse/cmdliner/_tags          |    3 +
 tools/ocaml/duniverse/cmdliner/build.ml       |  155 ++
 tools/ocaml/duniverse/cmdliner/cmdliner.opam  |   32 +
 tools/ocaml/duniverse/cmdliner/doc/api.odocl  |    1 +
 tools/ocaml/duniverse/cmdliner/dune-project   |    2 +
 tools/ocaml/duniverse/cmdliner/pkg/META       |    7 +
 tools/ocaml/duniverse/cmdliner/pkg/pkg.ml     |   33 +
 .../ocaml/duniverse/cmdliner/src/cmdliner.ml  |  309 ++++
 .../ocaml/duniverse/cmdliner/src/cmdliner.mli | 1624
+++++++++++++++++
 .../duniverse/cmdliner/src/cmdliner.mllib     |   11 +
 .../duniverse/cmdliner/src/cmdliner_arg.ml    |  356 ++++
 .../duniverse/cmdliner/src/cmdliner_arg.mli   |  111 ++
 .../duniverse/cmdliner/src/cmdliner_base.ml   |  302 +++
 .../duniverse/cmdliner/src/cmdliner_base.mli  |   68 +
 .../duniverse/cmdliner/src/cmdliner_cline.ml  |  199 ++
 .../duniverse/cmdliner/src/cmdliner_cline.mli |   34 +
 .../duniverse/cmdliner/src/cmdliner_docgen.ml |  352 ++++
 .../cmdliner/src/cmdliner_docgen.mli          |   30 +
 .../duniverse/cmdliner/src/cmdliner_info.ml   |  233 +++
 .../duniverse/cmdliner/src/cmdliner_info.mli  |  140 ++
 .../cmdliner/src/cmdliner_manpage.ml          |  502 +++++
 .../cmdliner/src/cmdliner_manpage.mli         |  100 +
 .../duniverse/cmdliner/src/cmdliner_msg.ml    |  116 ++
 .../duniverse/cmdliner/src/cmdliner_msg.mli   |   56 +
 .../cmdliner/src/cmdliner_suggest.ml          |   54 +
 .../cmdliner/src/cmdliner_suggest.mli         |   25 +
 .../duniverse/cmdliner/src/cmdliner_term.ml   |   41 +
 .../duniverse/cmdliner/src/cmdliner_term.mli  |   40 +
 .../duniverse/cmdliner/src/cmdliner_trie.ml   |   97 +
 .../duniverse/cmdliner/src/cmdliner_trie.mli  |   35 +
 tools/ocaml/duniverse/cmdliner/src/dune       |    4 +
 tools/ocaml/duniverse/cmdliner/test/chorus.ml |   31 +
 tools/ocaml/duniverse/cmdliner/test/cp_ex.ml  |   54 +
 .../ocaml/duniverse/cmdliner/test/darcs_ex.ml |  149 ++
 tools/ocaml/duniverse/cmdliner/test/dune      |   12 +
 tools/ocaml/duniverse/cmdliner/test/revolt.ml |    9 +
 tools/ocaml/duniverse/cmdliner/test/rm_ex.ml  |   53 +
 .../ocaml/duniverse/cmdliner/test/tail_ex.ml  |   73 +
 .../ocaml/duniverse/cmdliner/test/test_man.ml |  100 +
 .../duniverse/cmdliner/test/test_man_utf8.ml  |   11 +
 .../duniverse/cmdliner/test/test_opt_req.ml   |   13 +
 .../ocaml/duniverse/cmdliner/test/test_pos.ml |   13 +
 .../duniverse/cmdliner/test/test_pos_all.ml   |   11 +
 .../duniverse/cmdliner/test/test_pos_left.ml  |   11 +
 .../duniverse/cmdliner/test/test_pos_req.ml   |   15 +
 .../duniverse/cmdliner/test/test_pos_rev.ml   |   14 +
 .../duniverse/cmdliner/test/test_term_dups.ml |   19 +
 .../cmdliner/test/test_with_used_args.ml      |   18 +
 tools/ocaml/duniverse/cppo/.gitignore         |    5 +
 tools/ocaml/duniverse/cppo/.ocp-indent        |   22 +
 tools/ocaml/duniverse/cppo/.travis.yml        |   16 +
 tools/ocaml/duniverse/cppo/CODEOWNERS         |    8 +
 tools/ocaml/duniverse/cppo/Changes            |   85 +
 tools/ocaml/duniverse/cppo/INSTALL.md         |   17 +
 tools/ocaml/duniverse/cppo/LICENSE.md         |   24 +
 tools/ocaml/duniverse/cppo/Makefile           |   18 +
 tools/ocaml/duniverse/cppo/README.md          |  521 ++++++
 tools/ocaml/duniverse/cppo/VERSION            |    1 +
 tools/ocaml/duniverse/cppo/appveyor.yml       |   14 +
 tools/ocaml/duniverse/cppo/cppo.opam          |   31 +
 .../ocaml/duniverse/cppo/cppo_ocamlbuild.opam |   27 +
 tools/ocaml/duniverse/cppo/dune-project       |    3 +
 tools/ocaml/duniverse/cppo/examples/Makefile  |    8 +
 tools/ocaml/duniverse/cppo/examples/debug.ml  |    7 +
 tools/ocaml/duniverse/cppo/examples/dune      |   32 +
 tools/ocaml/duniverse/cppo/examples/french.ml |   34 +
 tools/ocaml/duniverse/cppo/examples/lexer.mll |    9 +
 .../duniverse/cppo/ocamlbuild_plugin/_tags    |    1 +
 .../duniverse/cppo/ocamlbuild_plugin/dune     |    6 +
 .../cppo/ocamlbuild_plugin/ocamlbuild_cppo.ml |   35 +
 .../ocamlbuild_plugin/ocamlbuild_cppo.mli     |    9 +
 tools/ocaml/duniverse/cppo/src/compat.ml      |    7 +
 .../ocaml/duniverse/cppo/src/cppo_command.ml  |   63 +
 .../ocaml/duniverse/cppo/src/cppo_command.mli |   11 +
 tools/ocaml/duniverse/cppo/src/cppo_eval.ml   |  697 +++++++
 tools/ocaml/duniverse/cppo/src/cppo_eval.mli  |   29 +
 tools/ocaml/duniverse/cppo/src/cppo_lexer.mll |  721 ++++++++
 tools/ocaml/duniverse/cppo/src/cppo_main.ml   |  230 +++
 .../ocaml/duniverse/cppo/src/cppo_parser.mly  |  266 +++
 tools/ocaml/duniverse/cppo/src/cppo_types.ml  |   98 +
 tools/ocaml/duniverse/cppo/src/cppo_types.mli |   70 +
 .../ocaml/duniverse/cppo/src/cppo_version.mli |    1 +
 tools/ocaml/duniverse/cppo/src/dune           |   21 +
 tools/ocaml/duniverse/cppo/test/capital.cppo  |    6 +
 tools/ocaml/duniverse/cppo/test/capital.ref   |    6 +
 tools/ocaml/duniverse/cppo/test/comments.cppo |    7 +
 tools/ocaml/duniverse/cppo/test/comments.ref  |    8 +
 tools/ocaml/duniverse/cppo/test/cond.cppo     |   47 +
 tools/ocaml/duniverse/cppo/test/cond.ref      |   17 +
 tools/ocaml/duniverse/cppo/test/dune          |  130 ++
 tools/ocaml/duniverse/cppo/test/ext.cppo      |   10 +
 tools/ocaml/duniverse/cppo/test/ext.ref       |   28 +
 tools/ocaml/duniverse/cppo/test/incl.cppo     |    3 +
 tools/ocaml/duniverse/cppo/test/incl2.cppo    |    1 +
 tools/ocaml/duniverse/cppo/test/loc.cppo      |    8 +
 tools/ocaml/duniverse/cppo/test/loc.ref       |   21 +
 .../ocaml/duniverse/cppo/test/paren_arg.cppo  |    3 +
 tools/ocaml/duniverse/cppo/test/paren_arg.ref |    4 +
 tools/ocaml/duniverse/cppo/test/source.sh     |   13 +
 tools/ocaml/duniverse/cppo/test/test.cppo     |  144 ++
 tools/ocaml/duniverse/cppo/test/tuple.cppo    |   38 +
 tools/ocaml/duniverse/cppo/test/tuple.ref     |   20 +
 .../ocaml/duniverse/cppo/test/unmatched.cppo  |   14 +
 tools/ocaml/duniverse/cppo/test/unmatched.ref |   15 +
 tools/ocaml/duniverse/cppo/test/version.cppo  |   30 +
 tools/ocaml/duniverse/crowbar/.gitignore      |    5 +
 tools/ocaml/duniverse/crowbar/CHANGES.md      |    9 +
 tools/ocaml/duniverse/crowbar/LICENSE.md      |    8 +
 tools/ocaml/duniverse/crowbar/README.md       |   82 +
 tools/ocaml/duniverse/crowbar/crowbar.opam    |   33 +
 tools/ocaml/duniverse/crowbar/dune            |    1 +
 tools/ocaml/duniverse/crowbar/dune-project    |    2 +
 .../duniverse/crowbar/examples/.gitignore     |    1 +
 .../duniverse/crowbar/examples/calendar/dune  |    3 +
 .../examples/calendar/test_calendar.ml        |   29 +
 .../duniverse/crowbar/examples/fpath/dune     |    4 +
 .../crowbar/examples/fpath/test_fpath.ml      |   18 +
 .../duniverse/crowbar/examples/input/testcase |    1 +
 .../ocaml/duniverse/crowbar/examples/map/dune |    3 +
 .../crowbar/examples/map/test_map.ml          |   47 +
 .../duniverse/crowbar/examples/pprint/dune    |    3 +
 .../crowbar/examples/pprint/test_pprint.ml    |   39 +
 .../crowbar/examples/serializer/dune          |    3 +
 .../crowbar/examples/serializer/serializer.ml |   34 +
 .../examples/serializer/test_serializer.ml    |   47 +
 .../duniverse/crowbar/examples/uunf/dune      |    3 +
 .../crowbar/examples/uunf/test_uunf.ml        |   75 +
 .../duniverse/crowbar/examples/xmldiff/dune   |    3 +
 .../crowbar/examples/xmldiff/test_xmldiff.ml  |   42 +
 tools/ocaml/duniverse/crowbar/src/crowbar.ml  |  582 ++++++
 tools/ocaml/duniverse/crowbar/src/crowbar.mli |  251 +++
 tools/ocaml/duniverse/crowbar/src/dune        |    3 +
 tools/ocaml/duniverse/crowbar/src/todo        |   16 +
 tools/ocaml/duniverse/csexp/CHANGES.md        |   45 +
 tools/ocaml/duniverse/csexp/LICENSE.md        |   21 +
 tools/ocaml/duniverse/csexp/Makefile          |   23 +
 tools/ocaml/duniverse/csexp/README.md         |   33 +
 .../duniverse/csexp/bench/csexp_bench.ml      |   22 +
 tools/ocaml/duniverse/csexp/bench/dune        |   11 +
 tools/ocaml/duniverse/csexp/bench/main.ml     |    1 +
 tools/ocaml/duniverse/csexp/bench/runner.sh   |    4 +
 tools/ocaml/duniverse/csexp/csexp.opam        |   51 +
 .../ocaml/duniverse/csexp/csexp.opam.template |   14 +
 tools/ocaml/duniverse/csexp/dune-project      |   42 +
 .../ocaml/duniverse/csexp/dune-workspace.dev  |    6 +
 tools/ocaml/duniverse/csexp/src/csexp.ml      |  333 ++++
 tools/ocaml/duniverse/csexp/src/csexp.mli     |  369 ++++
 tools/ocaml/duniverse/csexp/src/dune          |    3 +
 tools/ocaml/duniverse/csexp/test/dune         |    6 +
 tools/ocaml/duniverse/csexp/test/test.ml      |  142 ++
 tools/ocaml/duniverse/dune                    |    4 +
 tools/ocaml/duniverse/fmt/.gitignore          |    8 +
 tools/ocaml/duniverse/fmt/.ocp-indent         |    1 +
 tools/ocaml/duniverse/fmt/CHANGES.md          |   98 +
 tools/ocaml/duniverse/fmt/LICENSE.md          |   13 +
 tools/ocaml/duniverse/fmt/README.md           |   35 +
 tools/ocaml/duniverse/fmt/_tags               |    7 +
 tools/ocaml/duniverse/fmt/doc/api.odocl       |    3 +
 tools/ocaml/duniverse/fmt/doc/index.mld       |   11 +
 tools/ocaml/duniverse/fmt/dune-project        |    2 +
 tools/ocaml/duniverse/fmt/fmt.opam            |   35 +
 tools/ocaml/duniverse/fmt/pkg/META            |   40 +
 tools/ocaml/duniverse/fmt/pkg/pkg.ml          |   18 +
 tools/ocaml/duniverse/fmt/src/dune            |   30 +
 tools/ocaml/duniverse/fmt/src/fmt.ml          |  787 ++++++++
 tools/ocaml/duniverse/fmt/src/fmt.mli         |  689 +++++++
 tools/ocaml/duniverse/fmt/src/fmt.mllib       |    1 +
 tools/ocaml/duniverse/fmt/src/fmt_cli.ml      |   32 +
 tools/ocaml/duniverse/fmt/src/fmt_cli.mli     |   45 +
 tools/ocaml/duniverse/fmt/src/fmt_cli.mllib   |    1 +
 tools/ocaml/duniverse/fmt/src/fmt_top.ml      |   23 +
 tools/ocaml/duniverse/fmt/src/fmt_top.mllib   |    1 +
 tools/ocaml/duniverse/fmt/src/fmt_tty.ml      |   78 +
 tools/ocaml/duniverse/fmt/src/fmt_tty.mli     |   50 +
 tools/ocaml/duniverse/fmt/src/fmt_tty.mllib   |    1 +
 .../duniverse/fmt/src/fmt_tty_top_init.ml     |   23 +
 tools/ocaml/duniverse/fmt/test/test.ml        |  322 ++++
 .../duniverse/ocaml-afl-persistent/.gitignore |    2 +
 .../duniverse/ocaml-afl-persistent/CHANGES.md |   22 +
 .../duniverse/ocaml-afl-persistent/LICENSE.md |    8 +
 .../duniverse/ocaml-afl-persistent/README.md  |   17 +
 .../ocaml-afl-persistent/afl-persistent.opam  |   49 +
 .../afl-persistent.opam.template              |   16 +
 .../aflPersistent.available.ml                |   21 +
 .../ocaml-afl-persistent/aflPersistent.mli    |    1 +
 .../aflPersistent.stub.ml                     |    1 +
 .../duniverse/ocaml-afl-persistent/detect.sh  |   43 +
 .../ocaml/duniverse/ocaml-afl-persistent/dune |   20 +
 .../ocaml-afl-persistent/dune-project         |   23 +
 .../duniverse/ocaml-afl-persistent/test.ml    |    3 +
 .../ocaml-afl-persistent/test/harness.ml      |   22 +
 .../ocaml-afl-persistent/test/test.ml         |   73 +
 .../ocaml-afl-persistent/test/test.sh         |   33 +
 .../ocaml/duniverse/ocplib-endian/.gitignore  |    3 +
 .../ocaml/duniverse/ocplib-endian/.travis.yml |   19 +
 .../ocaml/duniverse/ocplib-endian/CHANGES.md  |   55 +
 .../ocaml/duniverse/ocplib-endian/COPYING.txt |  521 ++++++
 tools/ocaml/duniverse/ocplib-endian/Makefile  |   13 +
 tools/ocaml/duniverse/ocplib-endian/README.md |   16 +
 .../duniverse/ocplib-endian/dune-project      |    2 +
 .../ocplib-endian/ocplib-endian.opam          |   30 +
 .../ocplib-endian/src/be_ocaml_401.ml         |   32 +
 .../duniverse/ocplib-endian/src/common.ml     |   24 +
 .../ocplib-endian/src/common_401.cppo.ml      |  100 +
 .../ocplib-endian/src/common_float.ml         |    5 +
 tools/ocaml/duniverse/ocplib-endian/src/dune  |   75 +
 .../ocplib-endian/src/endianBigstring.cppo.ml |  112 ++
 .../src/endianBigstring.cppo.mli              |  128 ++
 .../ocplib-endian/src/endianBytes.cppo.ml     |  130 ++
 .../ocplib-endian/src/endianBytes.cppo.mli    |  124 ++
 .../ocplib-endian/src/endianString.cppo.ml    |  118 ++
 .../ocplib-endian/src/endianString.cppo.mli   |  121 ++
 .../ocplib-endian/src/le_ocaml_401.ml         |   32 +
 .../ocplib-endian/src/ne_ocaml_401.ml         |   20 +
 .../duniverse/ocplib-endian/tests/bench.ml    |  436 +++++
 .../ocaml/duniverse/ocplib-endian/tests/dune  |   35 +
 .../duniverse/ocplib-endian/tests/test.ml     |   39 +
 .../tests/test_bigstring.cppo.ml              |  191 ++
 .../ocplib-endian/tests/test_bytes.cppo.ml    |  185 ++
 .../ocplib-endian/tests/test_string.cppo.ml   |  185 ++
 tools/ocaml/duniverse/result/CHANGES.md       |   15 +
 tools/ocaml/duniverse/result/LICENSE.md       |   24 +
 tools/ocaml/duniverse/result/Makefile         |   17 +
 tools/ocaml/duniverse/result/README.md        |    5 +
 tools/ocaml/duniverse/result/dune             |   12 +
 tools/ocaml/duniverse/result/dune-project     |    3 +
 .../duniverse/result/result-as-alias-4.08.ml  |    2 +
 .../ocaml/duniverse/result/result-as-alias.ml |    2 +
 .../duniverse/result/result-as-newtype.ml     |    2 +
 tools/ocaml/duniverse/result/result.opam      |   18 +
 tools/ocaml/duniverse/result/which_result.ml  |   14 +
 tools/ocaml/duniverse/stdlib-shims/CHANGES.md |    5 +
 tools/ocaml/duniverse/stdlib-shims/LICENSE    |  203 +++
 tools/ocaml/duniverse/stdlib-shims/README.md  |    2 +
 .../ocaml/duniverse/stdlib-shims/dune-project |    1 +
 .../duniverse/stdlib-shims/dune-workspace.dev |   14 +
 tools/ocaml/duniverse/stdlib-shims/src/dune   |   97 +
 .../duniverse/stdlib-shims/stdlib-shims.opam  |   24 +
 tools/ocaml/duniverse/stdlib-shims/test/dune  |    3 +
 .../ocaml/duniverse/stdlib-shims/test/test.ml |    2 +
 tools/ocaml/libs/eventchn/dune                |    8 +
 tools/ocaml/libs/mmap/Makefile                |   19 +-
 tools/ocaml/libs/mmap/dune                    |   18 +
 tools/ocaml/libs/mmap/gnt.ml                  |   62 +
 tools/ocaml/libs/mmap/gnt.mli                 |   87 +
 tools/ocaml/libs/mmap/gnttab_stubs.c          |  106 ++
 tools/ocaml/libs/mmap/mmap_stubs.h            |   11 +-
 tools/ocaml/libs/mmap/xenmmap.ml              |   17 +-
 tools/ocaml/libs/mmap/xenmmap.mli             |   13 +-
 tools/ocaml/libs/mmap/xenmmap_stubs.c         |   86 +-
 tools/ocaml/libs/xb/dune                      |    7 +
 tools/ocaml/libs/xb/xb.ml                     |   10 +-
 tools/ocaml/libs/xb/xb.mli                    |    4 +-
 tools/ocaml/libs/xb/xs_ring_stubs.c           |   14 +-
 tools/ocaml/libs/xc/dune                      |    9 +
 tools/ocaml/libs/xc/xenctrl.ml                |    6 +-
 tools/ocaml/libs/xc/xenctrl.mli               |    5 +-
 tools/ocaml/libs/xs/dune                      |    4 +
 tools/ocaml/xen.opam                          |    1 +
 tools/ocaml/xen.opam.locked                   |  119 ++
 tools/ocaml/xenstore.opam                     |    1 +
 tools/ocaml/xenstored.opam                    |   21 +
 tools/ocaml/xenstored/Makefile                |    4 +-
 tools/ocaml/xenstored/connection.ml           |   63 +-
 tools/ocaml/xenstored/disk.ml                 |  319 ++++
 tools/ocaml/xenstored/domain.ml               |    9 +-
 tools/ocaml/xenstored/domains.ml              |   13 +-
 tools/ocaml/xenstored/dune                    |   19 +
 tools/ocaml/xenstored/parse_arg.ml            |    6 +-
 tools/ocaml/xenstored/perms.ml                |    2 +
 tools/ocaml/xenstored/poll.ml                 |    3 +-
 tools/ocaml/xenstored/process.ml              |   30 +-
 tools/ocaml/xenstored/store.ml                |    1 +
 tools/ocaml/xenstored/test/dune               |   23 +
 tools/ocaml/xenstored/test/generator.ml       |  189 ++
 tools/ocaml/xenstored/test/gnt.ml             |   52 +
 tools/ocaml/xenstored/test/model.ml           |  253 +++
 tools/ocaml/xenstored/test/old/arbitrary.ml   |  261 +++
 tools/ocaml/xenstored/test/old/gen_paths.ml   |   66 +
 .../xenstored/test/old/xenstored_test.ml      |  527 ++++++
 tools/ocaml/xenstored/test/pathtree.ml        |   40 +
 tools/ocaml/xenstored/test/testable.ml        |  380 ++++
 tools/ocaml/xenstored/test/types.ml           |  437 +++++
 .../xenmmap.mli => xenstored/test/xenctrl.ml} |   40 +-
 tools/ocaml/xenstored/test/xeneventchn.ml     |   50 +
 tools/ocaml/xenstored/test/xenstored_test.ml  |  147 ++
 tools/ocaml/xenstored/test/xs_protocol.ml     |  733 ++++++++
 tools/ocaml/xenstored/transaction.ml          |  119 +-
 tools/ocaml/xenstored/xenstored.ml            |  224 ++-
 tools/ocaml/xenstored/xenstored_main.ml       |    1 +
 301 files changed, 22724 insertions(+), 193 deletions(-)
 create mode 100644 tools/ocaml/.gitignore
 create mode 100644 tools/ocaml/dune-project
 create mode 100644 tools/ocaml/duniverse/cmdliner/.gitignore
 create mode 100644 tools/ocaml/duniverse/cmdliner/.ocp-indent
 create mode 100644 tools/ocaml/duniverse/cmdliner/B0.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/cmdliner/LICENSE.md
 create mode 100644 tools/ocaml/duniverse/cmdliner/Makefile
 create mode 100644 tools/ocaml/duniverse/cmdliner/README.md
 create mode 100644 tools/ocaml/duniverse/cmdliner/_tags
 create mode 100755 tools/ocaml/duniverse/cmdliner/build.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/cmdliner.opam
 create mode 100644 tools/ocaml/duniverse/cmdliner/doc/api.odocl
 create mode 100644 tools/ocaml/duniverse/cmdliner/dune-project
 create mode 100644 tools/ocaml/duniverse/cmdliner/pkg/META
 create mode 100755 tools/ocaml/duniverse/cmdliner/pkg/pkg.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner.mllib
 create mode 100644
tools/ocaml/duniverse/cmdliner/src/cmdliner_arg.ml
 create mode 100644
tools/ocaml/duniverse/cmdliner/src/cmdliner_arg.mli
 create mode 100644
tools/ocaml/duniverse/cmdliner/src/cmdliner_base.ml
 create mode 100644
tools/ocaml/duniverse/cmdliner/src/cmdliner_base.mli
 create mode 100644
tools/ocaml/duniverse/cmdliner/src/cmdliner_cline.ml
 create mode 100644
tools/ocaml/duniverse/cmdliner/src/cmdliner_cline.mli
 create mode 100644
tools/ocaml/duniverse/cmdliner/src/cmdliner_docgen.ml
 create mode 100644
tools/ocaml/duniverse/cmdliner/src/cmdliner_docgen.mli
 create mode 100644
tools/ocaml/duniverse/cmdliner/src/cmdliner_info.ml
 create mode 100644
tools/ocaml/duniverse/cmdliner/src/cmdliner_info.mli
 create mode 100644
tools/ocaml/duniverse/cmdliner/src/cmdliner_manpage.ml
 create mode 100644
tools/ocaml/duniverse/cmdliner/src/cmdliner_manpage.mli
 create mode 100644
tools/ocaml/duniverse/cmdliner/src/cmdliner_msg.ml
 create mode 100644
tools/ocaml/duniverse/cmdliner/src/cmdliner_msg.mli
 create mode 100644
tools/ocaml/duniverse/cmdliner/src/cmdliner_suggest.ml
 create mode 100644
tools/ocaml/duniverse/cmdliner/src/cmdliner_suggest.mli
 create mode 100644
tools/ocaml/duniverse/cmdliner/src/cmdliner_term.ml
 create mode 100644
tools/ocaml/duniverse/cmdliner/src/cmdliner_term.mli
 create mode 100644
tools/ocaml/duniverse/cmdliner/src/cmdliner_trie.ml
 create mode 100644
tools/ocaml/duniverse/cmdliner/src/cmdliner_trie.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/dune
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/chorus.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/cp_ex.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/darcs_ex.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/dune
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/revolt.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/rm_ex.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/tail_ex.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_man.ml
 create mode 100644
tools/ocaml/duniverse/cmdliner/test/test_man_utf8.ml
 create mode 100644
tools/ocaml/duniverse/cmdliner/test/test_opt_req.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_pos.ml
 create mode 100644
tools/ocaml/duniverse/cmdliner/test/test_pos_all.ml
 create mode 100644
tools/ocaml/duniverse/cmdliner/test/test_pos_left.ml
 create mode 100644
tools/ocaml/duniverse/cmdliner/test/test_pos_req.ml
 create mode 100644
tools/ocaml/duniverse/cmdliner/test/test_pos_rev.ml
 create mode 100644
tools/ocaml/duniverse/cmdliner/test/test_term_dups.ml
 create mode 100644
tools/ocaml/duniverse/cmdliner/test/test_with_used_args.ml
 create mode 100644 tools/ocaml/duniverse/cppo/.gitignore
 create mode 100644 tools/ocaml/duniverse/cppo/.ocp-indent
 create mode 100644 tools/ocaml/duniverse/cppo/.travis.yml
 create mode 100644 tools/ocaml/duniverse/cppo/CODEOWNERS
 create mode 100644 tools/ocaml/duniverse/cppo/Changes
 create mode 100644 tools/ocaml/duniverse/cppo/INSTALL.md
 create mode 100644 tools/ocaml/duniverse/cppo/LICENSE.md
 create mode 100644 tools/ocaml/duniverse/cppo/Makefile
 create mode 100644 tools/ocaml/duniverse/cppo/README.md
 create mode 100644 tools/ocaml/duniverse/cppo/VERSION
 create mode 100644 tools/ocaml/duniverse/cppo/appveyor.yml
 create mode 100644 tools/ocaml/duniverse/cppo/cppo.opam
 create mode 100644 tools/ocaml/duniverse/cppo/cppo_ocamlbuild.opam
 create mode 100644 tools/ocaml/duniverse/cppo/dune-project
 create mode 100644 tools/ocaml/duniverse/cppo/examples/Makefile
 create mode 100644 tools/ocaml/duniverse/cppo/examples/debug.ml
 create mode 100644 tools/ocaml/duniverse/cppo/examples/dune
 create mode 100644 tools/ocaml/duniverse/cppo/examples/french.ml
 create mode 100644 tools/ocaml/duniverse/cppo/examples/lexer.mll
 create mode 100644
tools/ocaml/duniverse/cppo/ocamlbuild_plugin/_tags
 create mode 100644 tools/ocaml/duniverse/cppo/ocamlbuild_plugin/dune
 create mode 100644
tools/ocaml/duniverse/cppo/ocamlbuild_plugin/ocamlbuild_cppo.ml
 create mode 100644
tools/ocaml/duniverse/cppo/ocamlbuild_plugin/ocamlbuild_cppo.mli
 create mode 100644 tools/ocaml/duniverse/cppo/src/compat.ml
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_command.ml
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_command.mli
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_eval.ml
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_eval.mli
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_lexer.mll
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_main.ml
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_parser.mly
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_types.ml
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_types.mli
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_version.mli
 create mode 100644 tools/ocaml/duniverse/cppo/src/dune
 create mode 100644 tools/ocaml/duniverse/cppo/test/capital.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/capital.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/comments.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/comments.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/cond.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/cond.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/dune
 create mode 100644 tools/ocaml/duniverse/cppo/test/ext.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/ext.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/incl.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/incl2.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/loc.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/loc.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/paren_arg.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/paren_arg.ref
 create mode 100755 tools/ocaml/duniverse/cppo/test/source.sh
 create mode 100644 tools/ocaml/duniverse/cppo/test/test.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/tuple.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/tuple.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/unmatched.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/unmatched.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/version.cppo
 create mode 100644 tools/ocaml/duniverse/crowbar/.gitignore
 create mode 100644 tools/ocaml/duniverse/crowbar/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/crowbar/LICENSE.md
 create mode 100644 tools/ocaml/duniverse/crowbar/README.md
 create mode 100644 tools/ocaml/duniverse/crowbar/crowbar.opam
 create mode 100644 tools/ocaml/duniverse/crowbar/dune
 create mode 100644 tools/ocaml/duniverse/crowbar/dune-project
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/.gitignore
 create mode 100644
tools/ocaml/duniverse/crowbar/examples/calendar/dune
 create mode 100644
tools/ocaml/duniverse/crowbar/examples/calendar/test_calendar.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/fpath/dune
 create mode 100644
tools/ocaml/duniverse/crowbar/examples/fpath/test_fpath.ml
 create mode 100644
tools/ocaml/duniverse/crowbar/examples/input/testcase
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/map/dune
 create mode 100644
tools/ocaml/duniverse/crowbar/examples/map/test_map.ml
 create mode 100644
tools/ocaml/duniverse/crowbar/examples/pprint/dune
 create mode 100644
tools/ocaml/duniverse/crowbar/examples/pprint/test_pprint.ml
 create mode 100644
tools/ocaml/duniverse/crowbar/examples/serializer/dune
 create mode 100644
tools/ocaml/duniverse/crowbar/examples/serializer/serializer.ml
 create mode 100644
tools/ocaml/duniverse/crowbar/examples/serializer/test_serializer.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/uunf/dune
 create mode 100644
tools/ocaml/duniverse/crowbar/examples/uunf/test_uunf.ml
 create mode 100644
tools/ocaml/duniverse/crowbar/examples/xmldiff/dune
 create mode 100644
tools/ocaml/duniverse/crowbar/examples/xmldiff/test_xmldiff.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/src/crowbar.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/src/crowbar.mli
 create mode 100644 tools/ocaml/duniverse/crowbar/src/dune
 create mode 100644 tools/ocaml/duniverse/crowbar/src/todo
 create mode 100644 tools/ocaml/duniverse/csexp/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/csexp/LICENSE.md
 create mode 100644 tools/ocaml/duniverse/csexp/Makefile
 create mode 100644 tools/ocaml/duniverse/csexp/README.md
 create mode 100644 tools/ocaml/duniverse/csexp/bench/csexp_bench.ml
 create mode 100644 tools/ocaml/duniverse/csexp/bench/dune
 create mode 100644 tools/ocaml/duniverse/csexp/bench/main.ml
 create mode 100755 tools/ocaml/duniverse/csexp/bench/runner.sh
 create mode 100644 tools/ocaml/duniverse/csexp/csexp.opam
 create mode 100644 tools/ocaml/duniverse/csexp/csexp.opam.template
 create mode 100644 tools/ocaml/duniverse/csexp/dune-project
 create mode 100644 tools/ocaml/duniverse/csexp/dune-workspace.dev
 create mode 100644 tools/ocaml/duniverse/csexp/src/csexp.ml
 create mode 100644 tools/ocaml/duniverse/csexp/src/csexp.mli
 create mode 100644 tools/ocaml/duniverse/csexp/src/dune
 create mode 100644 tools/ocaml/duniverse/csexp/test/dune
 create mode 100644 tools/ocaml/duniverse/csexp/test/test.ml
 create mode 100644 tools/ocaml/duniverse/dune
 create mode 100644 tools/ocaml/duniverse/fmt/.gitignore
 create mode 100644 tools/ocaml/duniverse/fmt/.ocp-indent
 create mode 100644 tools/ocaml/duniverse/fmt/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/fmt/LICENSE.md
 create mode 100644 tools/ocaml/duniverse/fmt/README.md
 create mode 100644 tools/ocaml/duniverse/fmt/_tags
 create mode 100644 tools/ocaml/duniverse/fmt/doc/api.odocl
 create mode 100644 tools/ocaml/duniverse/fmt/doc/index.mld
 create mode 100644 tools/ocaml/duniverse/fmt/dune-project
 create mode 100644 tools/ocaml/duniverse/fmt/fmt.opam
 create mode 100644 tools/ocaml/duniverse/fmt/pkg/META
 create mode 100755 tools/ocaml/duniverse/fmt/pkg/pkg.ml
 create mode 100644 tools/ocaml/duniverse/fmt/src/dune
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt.ml
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt.mli
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt.mllib
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_cli.ml
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_cli.mli
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_cli.mllib
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_top.ml
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_top.mllib
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_tty.ml
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_tty.mli
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_tty.mllib
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_tty_top_init.ml
 create mode 100644 tools/ocaml/duniverse/fmt/test/test.ml
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-
persistent/.gitignore
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-
persistent/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-
persistent/LICENSE.md
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-
persistent/README.md
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/afl-
persistent.opam
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/afl-
persistent.opam.template
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-
persistent/aflPersistent.available.ml
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-
persistent/aflPersistent.mli
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-
persistent/aflPersistent.stub.ml
 create mode 100755 tools/ocaml/duniverse/ocaml-afl-
persistent/detect.sh
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/dune
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/dune-
project
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-
persistent/test.ml
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-
persistent/test/harness.ml
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-
persistent/test/test.ml
 create mode 100755 tools/ocaml/duniverse/ocaml-afl-
persistent/test/test.sh
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/.gitignore
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/.travis.yml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/COPYING.txt
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/Makefile
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/README.md
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/dune-project
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/ocplib-
endian.opam
 create mode 100644 tools/ocaml/duniverse/ocplib-
endian/src/be_ocaml_401.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/common.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-
endian/src/common_401.cppo.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-
endian/src/common_float.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/dune
 create mode 100644 tools/ocaml/duniverse/ocplib-
endian/src/endianBigstring.cppo.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-
endian/src/endianBigstring.cppo.mli
 create mode 100644 tools/ocaml/duniverse/ocplib-
endian/src/endianBytes.cppo.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-
endian/src/endianBytes.cppo.mli
 create mode 100644 tools/ocaml/duniverse/ocplib-
endian/src/endianString.cppo.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-
endian/src/endianString.cppo.mli
 create mode 100644 tools/ocaml/duniverse/ocplib-
endian/src/le_ocaml_401.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-
endian/src/ne_ocaml_401.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-
endian/tests/bench.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/tests/dune
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/tests/test.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-
endian/tests/test_bigstring.cppo.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-
endian/tests/test_bytes.cppo.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-
endian/tests/test_string.cppo.ml
 create mode 100755 tools/ocaml/duniverse/result/CHANGES.md
 create mode 100755 tools/ocaml/duniverse/result/LICENSE.md
 create mode 100755 tools/ocaml/duniverse/result/Makefile
 create mode 100755 tools/ocaml/duniverse/result/README.md
 create mode 100755 tools/ocaml/duniverse/result/dune
 create mode 100755 tools/ocaml/duniverse/result/dune-project
 create mode 100755 tools/ocaml/duniverse/result/result-as-alias-
4.08.ml
 create mode 100755 tools/ocaml/duniverse/result/result-as-alias.ml
 create mode 100755 tools/ocaml/duniverse/result/result-as-newtype.ml
 create mode 100755 tools/ocaml/duniverse/result/result.opam
 create mode 100755 tools/ocaml/duniverse/result/which_result.ml
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/LICENSE
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/README.md
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/dune-project
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/dune-
workspace.dev
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/src/dune
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/stdlib-
shims.opam
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/test/dune
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/test/test.ml
 create mode 100644 tools/ocaml/libs/eventchn/dune
 create mode 100644 tools/ocaml/libs/mmap/dune
 create mode 100644 tools/ocaml/libs/mmap/gnt.ml
 create mode 100644 tools/ocaml/libs/mmap/gnt.mli
 create mode 100644 tools/ocaml/libs/mmap/gnttab_stubs.c
 create mode 100644 tools/ocaml/libs/xb/dune
 create mode 100644 tools/ocaml/libs/xc/dune
 create mode 100644 tools/ocaml/libs/xs/dune
 create mode 100644 tools/ocaml/xen.opam
 create mode 100644 tools/ocaml/xen.opam.locked
 create mode 100644 tools/ocaml/xenstore.opam
 create mode 100644 tools/ocaml/xenstored.opam
 create mode 100644 tools/ocaml/xenstored/dune
 create mode 100644 tools/ocaml/xenstored/test/dune
 create mode 100644 tools/ocaml/xenstored/test/generator.ml
 create mode 100644 tools/ocaml/xenstored/test/gnt.ml
 create mode 100644 tools/ocaml/xenstored/test/model.ml
 create mode 100644 tools/ocaml/xenstored/test/old/arbitrary.ml
 create mode 100644 tools/ocaml/xenstored/test/old/gen_paths.ml
 create mode 100644 tools/ocaml/xenstored/test/old/xenstored_test.ml
 create mode 100644 tools/ocaml/xenstored/test/pathtree.ml
 create mode 100644 tools/ocaml/xenstored/test/testable.ml
 create mode 100644 tools/ocaml/xenstored/test/types.ml
 copy tools/ocaml/{libs/mmap/xenmmap.mli =>
xenstored/test/xenctrl.ml} (54%)
 create mode 100644 tools/ocaml/xenstored/test/xeneventchn.ml
 create mode 100644 tools/ocaml/xenstored/test/xenstored_test.ml
 create mode 100644 tools/ocaml/xenstored/test/xs_protocol.ml
 create mode 100644 tools/ocaml/xenstored/xenstored_main.ml
#17 lore raw

PATCH v2 16/17 tools/ocaml/xenstored: don't store domU's mfn of ring page

In reply to Edwin Török

This is a port of the following C xenstored commit 122b52230aa5b79d65e18b8b77094027faa2f8e2 tools/xenstore: don't store domU's mfn of ring page in xenstored

Backwards compat: accept a domain dump both with and without MFN.

---
 tools/ocaml/xenstored/domain.ml  |  7 ++-----
 tools/ocaml/xenstored/domains.ml |  6 +++---
 tools/ocaml/xenstored/process.ml | 16 +++++-----------
 3 files changed, 10 insertions(+), 19 deletions(-)
tools/ocaml/xenstored/domain.ml +2 -5
index 82d7b1a7ef..960ebef218 100644
@@ -22,7 +22,6 @@ let warn  fmt = Logging.warn  "domain" fmt
 type t =
 {
 	id: Xenctrl.domid;
-	mfn: nativeint;
 	interface: Xenmmap.t;
 	eventchn: Event.t;
 	mutable remote_port: int;
@@ -40,7 +39,6 @@ type t =
 let is_dom0 d = d.id = 0
 let get_id domain = domain.id
 let get_interface d = d.interface
-let get_mfn d = d.mfn
 let get_remote_port d = d.remote_port
 let get_port d = d.port
 
@@ -61,7 +59,7 @@ let string_of_port = function
 | Some x -> string_of_int (Xeneventchn.to_int x)
 
 let dump d chan =
-	fprintf chan "dom,%d,%nd,%d\n" d.id d.mfn d.remote_port
+	fprintf chan "dom,%d,%d\n" d.id d.remote_port
 
 let notify dom = match dom.port with
 | None ->
@@ -87,9 +85,8 @@ let close dom =
 	Xenmmap.unmap dom.interface;
 	()
 
-let make id mfn remote_port interface eventchn = {
+let make id remote_port interface eventchn = {
 	id = id;
-	mfn = mfn;
 	remote_port = remote_port;
 	interface = interface;
 	eventchn = eventchn;
tools/ocaml/xenstored/domains.ml +3 -3
index d9cb693751..0dfeed193a 100644
@@ -124,10 +124,10 @@ let cleanup doms =
 let resume _doms _domid =
 	()
 
-let create doms domid mfn port =
+let create doms domid port =
 	let mapping = Gnt.(Gnttab.map_exn doms.gnttab { domid; ref = xenstore} true) in
 	let interface = Gnt.Gnttab.Local_mapping.to_pages doms.gnttab mapping in
-	let dom = Domain.make domid mfn port interface doms.eventchn in
+	let dom = Domain.make domid port interface doms.eventchn in
 	Hashtbl.add doms.table domid dom;
 	Domain.bind_interdomain dom;
 	dom
@@ -147,7 +147,7 @@ let create0 doms =
 			port, interface
 		)
 		in
-	let dom = Domain.make 0 Nativeint.zero port interface doms.eventchn in
+	let dom = Domain.make 0 port interface doms.eventchn in
 	Hashtbl.add doms.table 0 dom;
 	Domain.bind_interdomain dom;
 	Domain.notify dom;
tools/ocaml/xenstored/process.ml +5 -11
index 13b7153536..890970b8c5 100644
@@ -235,10 +235,6 @@ let do_debug con t _domains cons data =
 	| "watches" :: _ ->
 		let watches = Connections.debug cons in
 		Some (watches ^ "\000")
-	| "mfn" :: domid :: _ ->
-		let domid = int_of_string domid in
-		let con = Connections.find_domain cons domid in
-		may (fun dom -> Printf.sprintf "%nd\000" (Domain.get_mfn dom)) (Connection.get_domain con)
 	| _ -> None
 	with _ -> None
 
@@ -554,15 +550,13 @@ let do_introduce con t domains cons data =
 	let dom =
 		if Domains.exist domains domid then begin
 			let edom = Domains.find domains domid in
-			if (Domain.get_mfn edom) = mfn && (Connections.find_domain cons domid) != con then begin
-				(* Use XS_INTRODUCE for recreating the xenbus event-channel. *)
-				edom.remote_port <- port;
-				Domain.bind_interdomain edom;
-			end;
+			(* Use XS_INTRODUCE for recreating the xenbus event-channel. *)
+			edom.remote_port <- port;
+			Domain.bind_interdomain edom;
 			edom
 		end
 		else try
-			let ndom = Domains.create domains domid mfn port in
+			let ndom = Domains.create domains domid port in
 			Connections.add_domain cons ndom;
 			Connections.fire_spec_watches (Transaction.get_root t) cons Store.Path.introduce_domain;
 			ndom
@@ -571,7 +565,7 @@ let do_introduce con t domains cons data =
 			 Logging.debug "process" "do_introduce: %s (%s)" (Printexc.to_string e) bt;
 			 raise Invalid_Cmd_Args
 	in
-	if (Domain.get_remote_port dom) <> port || (Domain.get_mfn dom) <> mfn then
+	if (Domain.get_remote_port dom) <> port then
 		raise Domain_not_match
 
 let do_release con t domains cons data =
Signature · 1 line
2.25.1
#18 lore raw

PATCH v2 17/17 tools/ocaml/libs/mmap: Clean up unused read/write

In reply to Edwin Török

Xenmmap is only modified by the ring functions,
these functions are unused.

---
 tools/ocaml/libs/mmap/xenmmap.ml      |  5 ----
 tools/ocaml/libs/mmap/xenmmap.mli     |  4 ---
 tools/ocaml/libs/mmap/xenmmap_stubs.c | 41 ---------------------------
 3 files changed, 50 deletions(-)
tools/ocaml/libs/mmap/xenmmap.ml +0 -5
index af258942a0..e17a62e607 100644
@@ -24,11 +24,6 @@ type mmap_map_flag = SHARED | PRIVATE
 (* mmap: fd -> prot_flag -> map_flag -> length -> offset -> interface *)
 external mmap': Unix.file_descr -> mmap_prot_flag -> mmap_map_flag
 		-> int -> int -> mmap_interface = "stub_mmap_init"
-(* read: interface -> start -> length -> data *)
-external read: mmap_interface -> int -> int -> string = "stub_mmap_read"
-(* write: interface -> data -> start -> length -> unit *)
-external write: mmap_interface -> string -> int -> int -> unit = "stub_mmap_write"
-(* getpagesize: unit -> size of page *)
 external unmap': mmap_interface -> unit = "stub_mmap_final"
 (* getpagesize: unit -> size of page *)
 let make ?(unmap=unmap') interface = interface, unmap
tools/ocaml/libs/mmap/xenmmap.mli +0 -4
index 075b24eab4..abf2a50131 100644
@@ -19,10 +19,6 @@ type mmap_interface
 type mmap_prot_flag = RDONLY | WRONLY | RDWR
 type mmap_map_flag = SHARED | PRIVATE
 
-external read : mmap_interface -> int -> int -> string = "stub_mmap_read"
-external write : mmap_interface -> string -> int -> int -> unit
-               = "stub_mmap_write"
-
 val mmap : Unix.file_descr -> mmap_prot_flag -> mmap_map_flag -> int -> int -> t
 val unmap : t -> unit
 
tools/ocaml/libs/mmap/xenmmap_stubs.c +0 -41

47 lines not on this page · raw message

Signature · 1 line
2.25.1
#13 lore raw

PATCH v2 12/17 tools/ocaml/libs/mmap: mark mmap/munmap as blocking

In reply to Edwin Török

These functions can potentially take some time, so allow other OCaml code to proceed meanwhile (if any).

---
 tools/ocaml/libs/mmap/xenmmap_stubs.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
tools/ocaml/libs/mmap/xenmmap_stubs.c +10 -2
index d7a97c76f5..e8d2d6add5 100644
@@ -28,6 +28,7 @@
 #include <caml/fail.h>
 #include <caml/callback.h>
 #include <caml/unixsupport.h>
+#include <caml/signals.h>
 
 #define Wsize_bsize_round(n) (Wsize_bsize( (n) + sizeof(value) - 1 ))
 
@@ -69,7 +70,9 @@ CAMLprim value stub_mmap_init(value fd, value pflag, value mflag,
 		caml_invalid_argument("negative offset");
 	length = Int_val(len);
 
+	caml_enter_blocking_section();
 	addr = mmap(NULL, length, c_pflag, c_mflag, Int_val(fd), Int_val(offset));
+	caml_leave_blocking_section();
 	if (MAP_FAILED == addr)
 		uerror("mmap", Nothing);
 
@@ -80,10 +83,15 @@ CAMLprim value stub_mmap_init(value fd, value pflag, value mflag,
 CAMLprim value stub_mmap_final(value intf)
 {
 	CAMLparam1(intf);
+	struct mmap_interface interface = *Intf_val(intf);
 
-	if (Intf_val(intf)->addr != MAP_FAILED)
-		munmap(Intf_val(intf)->addr, Intf_val(intf)->len);
+	/* mark it as freed, in case munmap below fails, so we don't retry it */
 	Intf_val(intf)->addr = MAP_FAILED;
+	if (interface.addr != MAP_FAILED) {
+		caml_enter_blocking_section();
+		munmap(interface.addr, interface.len);
+		caml_leave_blocking_section();
+	}
 
 	CAMLreturn(Val_unit);
 }
Signature · 1 line
2.25.1
#16 lore raw

PATCH v2 15/17 tools/ocaml/xenstored: use gnttab instead of xenctrl's foreign_map_range

In reply to Edwin Török

This is an oxenstored port of the following C xenstored commit:
38eeb3864de40aa568c48f9f26271c141c62b50b tools/xenstored: Drop mapping of the ring via foreign map

Now only Xenctrl.domain_getinfo remains as the last use of unstable xenctrl interface in oxenstored.

Depends on: tools/ocaml: safer Xenmmap interface
(without it the code would build but the wrong unmap function would get
called on domain destruction)

---
 tools/ocaml/xenstored/domains.ml   | 7 +++++--
 tools/ocaml/xenstored/xenstored.ml | 3 ++-
 2 files changed, 7 insertions(+), 3 deletions(-)
tools/ocaml/xenstored/domains.ml +5 -2
index 17fe2fa257..d9cb693751 100644
@@ -22,6 +22,7 @@ let xc = Xenctrl.interface_open ()
 
 type domains = {
 	eventchn: Event.t;
+	gnttab: Gnt.Gnttab.interface;
 	table: (Xenctrl.domid, Domain.t) Hashtbl.t;
 
 	(* N.B. the Queue module is not thread-safe but oxenstored is single-threaded. *)
@@ -42,8 +43,9 @@ type domains = {
 	mutable n_penalised: int; (* Number of domains with less than maximum credit *)
 }
 
-let init eventchn on_first_conflict_pause = {
+let init eventchn gnttab on_first_conflict_pause = {
 	eventchn = eventchn;
+	gnttab;
 	table = Hashtbl.create 10;
 	doms_conflict_paused = Queue.create ();
 	doms_with_conflict_penalty = Queue.create ();
@@ -123,7 +125,8 @@ let resume _doms _domid =
 	()
 
 let create doms domid mfn port =
-	let interface = Xenctrl.map_foreign_range xc domid (Xenmmap.getpagesize()) mfn in
+	let mapping = Gnt.(Gnttab.map_exn doms.gnttab { domid; ref = xenstore} true) in
+	let interface = Gnt.Gnttab.Local_mapping.to_pages doms.gnttab mapping in
 	let dom = Domain.make domid mfn port interface doms.eventchn in
 	Hashtbl.add doms.table domid dom;
 	Domain.bind_interdomain dom;
tools/ocaml/xenstored/xenstored.ml +2 -1
index a6b86b167c..75c35107d5 100644
@@ -446,6 +446,7 @@ let main () =
 
 	let store = Store.create () in
 	let eventchn = Event.init () in
+	let gnttab = Gnt.Gnttab.interface_open () in
 	let next_frequent_ops = ref 0. in
 	let advance_next_frequent_ops () =
 		next_frequent_ops := (Unix.gettimeofday () +. !Define.conflict_max_history_seconds)
@@ -453,7 +454,7 @@ let main () =
 	let delay_next_frequent_ops_by duration =
 		next_frequent_ops := !next_frequent_ops +. duration
 	in
-	let domains = Domains.init eventchn advance_next_frequent_ops in
+	let domains = Domains.init eventchn gnttab advance_next_frequent_ops in
 
 	(* For things that need to be done periodically but more often
 	 * than the periodic_ops function *)
Signature · 1 line
2.25.1
#14 lore raw

PATCH v2 13/17 tools/ocaml/libs/xb: import gnttab stubs from mirage

In reply to Edwin Török

Upstream URL: https://github.com/mirage/ocaml-gnt
Mirage is part of the Xen project and the license is compatible, copyright headers are retained.

Changes from upstream:
* cut down dependencies: dropped Lwt, replaced Io_page with Xenmmap
* only import Gnttab and not Gntshr

This is for xenstored's use only which needs a way to grant map the xenstore ring without using xenctrl.

The gnt code is added into libs/mmap because it uses mmap_stubs.h. Also this makes it possible to mock out gnttab in the unit tests:
replace it with code that just mmaps /dev/zero.
For the mocking to work gnt.ml needs to be in a dir other than xenstored/.

---
 tools/ocaml/Makefile                   |   1 +
 tools/ocaml/libs/mmap/Makefile         |  19 +++--
 tools/ocaml/libs/mmap/dune             |  10 +++
 tools/ocaml/libs/mmap/gnt.ml           |  60 ++++++++++++++
 tools/ocaml/libs/mmap/gnt.mli          |  86 ++++++++++++++++++++
 tools/ocaml/libs/mmap/gnttab_stubs.c   | 106 +++++++++++++++++++++++++
 tools/ocaml/xenstored/Makefile         |   1 +
 tools/ocaml/xenstored/dune             |   6 +-
 tools/ocaml/xenstored/test/gnt.ml      |  52 ++++++++++++
 tools/ocaml/xenstored/test/testable.ml |   3 +-
 tools/ocaml/xenstored/xenstored.ml     |  10 +--
 11 files changed, 339 insertions(+), 15 deletions(-)
 create mode 100644 tools/ocaml/libs/mmap/gnt.ml
 create mode 100644 tools/ocaml/libs/mmap/gnt.mli
 create mode 100644 tools/ocaml/libs/mmap/gnttab_stubs.c
 create mode 100644 tools/ocaml/xenstored/test/gnt.ml
tools/ocaml/Makefile +1 -0
index de375820a3..1236b0e584 100644
@@ -43,6 +43,7 @@ C_INCLUDE_PATH=$(XEN_libxenctrl)/include:$(XEN_libxengnttab)/include:$(XEN_libxe
 # in the parent directory (so it couldn't copy/use Config.mk)
 .PHONY: dune-pre
 dune-pre:
+	$(MAKE) clean
 	$(MAKE) -s -C ../../ build-tools-public-headers
 	$(MAKE) -s -C libs/xs paths.ml
 	$(MAKE) -s -C libs/xc xenctrl_abi_check.h
tools/ocaml/libs/mmap/Makefile +14 -5
index df45819df5..ed4903b48a 100644
@@ -2,9 +2,7 @@ TOPLEVEL=$(CURDIR)/../..
 XEN_ROOT=$(TOPLEVEL)/../..
 include $(TOPLEVEL)/common.make
 
-OBJS = xenmmap
 INTF = $(foreach obj, $(OBJS),$(obj).cmi)
-LIBS = xenmmap.cma xenmmap.cmxa
 
 all: $(INTF) $(LIBS) $(PROGRAMS)
 
@@ -12,15 +10,26 @@ bins: $(PROGRAMS)
 
 libs: $(LIBS)
 
-xenmmap_OBJS = $(OBJS)
+# gnt is an internal library, not installed
+gnt_OBJS = gnt
+gnt_C_OBJS = gnttab_stubs
+gnt_LIBS = gnt.cma gnt.cmxa
+LIBS_gnt = $(LDLIBS_libxengnttab)
+CFLAGS += $(CFLAGS_libxengnttab)
+
+xenmmap_OBJS = xenmmap
 xenmmap_C_OBJS = xenmmap_stubs
-OCAML_LIBRARY = xenmmap
+xenmmap_LIBS = xenmmap.cma xenmmap.cmxa
+
+OCAML_LIBRARY = xenmmap gnt
+OBJS = $(xenmmap_OBJS) $(gnt_OBJS)
+LIBS = $(xenmmap_LIBS) $(gnt_LIBS)
 
 .PHONY: install
 install: $(LIBS) META
 	mkdir -p $(OCAMLDESTDIR)
 	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenmmap
-	$(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xenmmap META $(INTF) $(LIBS) *.a *.so *.cmx
+	$(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xenmmap META *xenmmap*.cmi $(xenmmap_LIBS) *xenmmap*.a *xenmmap*.so *xenmmap*.cmx
 
 .PHONY: uninstall
 uninstall:
tools/ocaml/libs/mmap/dune +10 -0
index a47de44e47..f4c98153c4 100644
@@ -3,6 +3,16 @@
   (language c)
   (names xenmmap_stubs))
  (name xenmmap)
+ (modules xenmmap)
  (public_name xen.mmap)
  (libraries unix)
  (install_c_headers mmap_stubs))
+
+(library
+ (foreign_stubs
+  (language c)
+  (names gnttab_stubs))
+ (name xengnt)
+ (modules gnt)
+ (wrapped false) 
+ (libraries unix xen.mmap))
tools/ocaml/libs/mmap/gnt.ml new file +60 -0

60 lines not on this page · raw message

tools/ocaml/libs/mmap/gnt.mli new file +86 -0

86 lines not on this page · raw message

tools/ocaml/libs/mmap/gnttab_stubs.c new file +106 -0

106 lines not on this page · raw message

tools/ocaml/xenstored/Makefile +1 -0
index 9d2da206d8..689a8fb07d 100644
@@ -67,6 +67,7 @@ XENSTOREDLIBS = \
 	-ccopt -L -ccopt . systemd.cmxa \
 	-ccopt -L -ccopt . poll.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/mmap $(OCAML_TOPLEVEL)/libs/mmap/xenmmap.cmxa \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/mmap $(OCAML_TOPLEVEL)/libs/mmap/gnt.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/eventchn $(OCAML_TOPLEVEL)/libs/eventchn/xeneventchn.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xc $(OCAML_TOPLEVEL)/libs/xc/xenctrl.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xb $(OCAML_TOPLEVEL)/libs/xb/xenbus.cmxa \
tools/ocaml/xenstored/dune +3 -3
index 714a2ae07e..81a6bf7a4a 100644
@@ -1,17 +1,17 @@
 (executable
- (modes byte exe)
+ (modes exe)
  (name xenstored_main)
  (modules (:standard \ syslog systemd))
  (public_name oxenstored)
  (package xenstored)
  (flags (:standard -w -52))
- (libraries unix xen.bus xen.mmap xen.ctrl xen.eventchn xenstubs))
+ (libraries unix xen.bus xen.mmap xen.ctrl xen.eventchn xenstubs xengnt))
 
 (library
  (foreign_stubs
   (language c)
   (names syslog_stubs systemd_stubs select_stubs)
-  (flags (-DHAVE_SYSTEMD)))
+  (flags (-DHAVE_SYSTEMD -I../libs/mmap/)))
  (modules syslog systemd)
  (name xenstubs)
  (wrapped false)
tools/ocaml/xenstored/test/gnt.ml new file +52 -0

52 lines not on this page · raw message

tools/ocaml/xenstored/test/testable.ml +2 -1
index 2fa749fbb3..37042356b8 100644
@@ -169,7 +169,8 @@ let () =
 let create ?(live_update = false) () =
   let store = Store.create () in
   let cons = Connections.create () in
-  let doms = Domains.init (Event.init ()) ignore in
+  let gnt = Gnt.Gnttab.interface_open () in (* dummy *)
+  let doms = Domains.init (Event.init ()) gnt ignore in
   let dom0 = Domains.create0 doms in
   let txidtbl = Hashtbl.create 47 in
   Connections.add_domain cons dom0 ;
tools/ocaml/xenstored/xenstored.ml +4 -6
index 34e706910e..a6b86b167c 100644
@@ -166,9 +166,8 @@ let from_channel_f_compat chan global_f socket_f domain_f watch_f store_f =
 					global_f ~rw
 				| "socket" :: fd :: [] ->
 					socket_f ~fd:(int_of_string fd)
-				| "dom" :: domid :: mfn :: port :: []->
+				| "dom" :: domid :: _mfn :: port :: []->
 					domain_f (int_of_string domid)
-					         (Nativeint.of_string mfn)
 					         (int_of_string port)
 				| "watch" :: domid :: path :: token :: [] ->
 					watch_f (int_of_string domid)
@@ -208,10 +207,10 @@ let from_channel_compat ~live store cons doms chan =
 		else
 			warn "Ignoring invalid socket FD %d" fd
 	in
-	let domain_f domid mfn port =
+	let domain_f domid port =
 		let ndom =
 			if domid > 0 then
-				Domains.create doms domid mfn port
+				Domains.create doms domid port
 			else
 				Domains.create0 doms
 			in
@@ -270,8 +269,7 @@ let from_channel_bin ~live store cons doms chan =
 			Connections.find_domain cons 0
 		| LR.Domain d ->
 			debug "Recreating domain %d, port %d" d.id d.remote_port; 
-			(* FIXME: gnttab *)
-			Domains.create doms d.id 0n d.remote_port
+			Domains.create doms d.id d.remote_port
 			|> Connections.add_domain cons;
 			Connections.find_domain cons d.id
 		| LR.Socket fd ->
Signature · 1 line
2.25.1
#11 lore raw

PATCH v2 10/17 tools/ocaml/libs/mmap: allocate correct number of bytes

In reply to Edwin Török

OCaml memory allocation functions use words as units, unless explicitly documented otherwise.
Thus we were allocating more memory than necessary, caml_alloc should've been called with the parameter '2', but was called with a lot more.
To account for future changes in the struct keep using sizeof, but round up and convert to number of words.

For OCaml 1 word = sizeof(value)

The Wsize_bsize macro converts bytes to words.

---
 tools/ocaml/libs/mmap/xenmmap_stubs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/ocaml/libs/mmap/xenmmap_stubs.c +3 -1
index b811990a89..4d09c5a6e6 100644
@@ -28,6 +28,8 @@
 #include <caml/fail.h>
 #include <caml/callback.h>
 
+#define Wsize_bsize_round(n) (Wsize_bsize( (n) + sizeof(value) - 1 ))
+
 static int mmap_interface_init(struct mmap_interface *intf,
                                int fd, int pflag, int mflag,
                                int len, int offset)
@@ -57,7 +59,7 @@ CAMLprim value stub_mmap_init(value fd, value pflag, value mflag,
 	default: caml_invalid_argument("maptype");
 	}
 
-	result = caml_alloc(sizeof(struct mmap_interface), Abstract_tag);
+	result = caml_alloc(Wsize_bsize_round(sizeof(struct mmap_interface)), Abstract_tag);
 
 	if (mmap_interface_init(Intf_val(result), Int_val(fd),
 	                        c_pflag, c_mflag,
Signature · 1 line
2.25.1
#12 lore raw

PATCH v2 11/17 tools/ocaml/libs/mmap: Expose stub_mmap_alloc

In reply to Edwin Török

This also handles mmap errors better by using the uerror helper to raise a proper exception using errno.

Changed type of len from int to size_t: at construction time we ensure the length is >= 0, so we can reflect this by using an unsigned type. The type is unsigned at the C API level, and a negative integer would just get translated to a very large unsigned number otherwise.

mmap also takes off_t and size_t, so using int64 would be more generic here, however we only ever use this interface to map rings, so keeping the int sizes is fine.
OCaml itself only uses ints for mapping bigarrays, and int64 for just the offset.

---
 tools/ocaml/libs/mmap/mmap_stubs.h    |  4 +++-
 tools/ocaml/libs/mmap/xenmmap_stubs.c | 31 +++++++++++++++++----------
 2 files changed, 23 insertions(+), 12 deletions(-)
tools/ocaml/libs/mmap/mmap_stubs.h +3 -1
index 816ba6a724..3352594e38 100644
@@ -27,7 +27,7 @@
 struct mmap_interface
 {
 	void *addr;
-	int len;
+	size_t len;
 };
 
 #ifndef Data_abstract_val
@@ -37,4 +37,6 @@ struct mmap_interface
 #define Intf_val(a) ((struct mmap_interface *) Data_abstract_val(a))
 #define Intf_data_val(a) (Intf_val(a)->addr)
 
+value stub_mmap_alloc(void *addr, size_t len);
+
 #endif
tools/ocaml/libs/mmap/xenmmap_stubs.c +20 -11
index 4d09c5a6e6..d7a97c76f5 100644
@@ -27,16 +27,18 @@
 #include <caml/custom.h>
 #include <caml/fail.h>
 #include <caml/callback.h>
+#include <caml/unixsupport.h>
 
 #define Wsize_bsize_round(n) (Wsize_bsize( (n) + sizeof(value) - 1 ))
 
-static int mmap_interface_init(struct mmap_interface *intf,
-                               int fd, int pflag, int mflag,
-                               int len, int offset)
+value stub_mmap_alloc(void *addr, size_t len)
 {
-	intf->len = len;
-	intf->addr = mmap(NULL, len, pflag, mflag, fd, offset);
-	return (intf->addr == MAP_FAILED) ? errno : 0;
+	CAMLparam0();
+	CAMLlocal1(result);
+	result = caml_alloc(Wsize_bsize_round(sizeof(struct mmap_interface)), Abstract_tag);
+	Intf_val(result)->addr = addr;
+	Intf_val(result)->len = len;
+	CAMLreturn(result);
 }
 
 CAMLprim value stub_mmap_init(value fd, value pflag, value mflag,
@@ -45,6 +47,8 @@ CAMLprim value stub_mmap_init(value fd, value pflag, value mflag,
 	CAMLparam5(fd, pflag, mflag, len, offset);
 	CAMLlocal1(result);
 	int c_pflag, c_mflag;
+	void* addr;
+	size_t length;
 
 	switch (Int_val(pflag)) {
 	case 0: c_pflag = PROT_READ; break;
@@ -59,12 +63,17 @@ CAMLprim value stub_mmap_init(value fd, value pflag, value mflag,
 	default: caml_invalid_argument("maptype");
 	}
 
-	result = caml_alloc(Wsize_bsize_round(sizeof(struct mmap_interface)), Abstract_tag);
+	if (Int_val(len) < 0)
+		caml_invalid_argument("negative size");
+	if (Int_val(offset) < 0)
+		caml_invalid_argument("negative offset");
+	length = Int_val(len);
 
-	if (mmap_interface_init(Intf_val(result), Int_val(fd),
-	                        c_pflag, c_mflag,
-	                        Int_val(len), Int_val(offset)))
-		caml_failwith("mmap");
+	addr = mmap(NULL, length, c_pflag, c_mflag, Int_val(fd), Int_val(offset));
+	if (MAP_FAILED == addr)
+		uerror("mmap", Nothing);
+
+	result = stub_mmap_alloc(addr, length);
 	CAMLreturn(result);
 }
 
Signature · 1 line
2.25.1
#15 lore raw

PATCH v2 14/17 tools/ocaml: safer Xenmmap interface

In reply to Edwin Török

Xenmmap.mmap_interface is created from multiple places:
* via mmap(), which needs to be unmap()-ed
* xc_map_foreign_range
* xengnttab_map_grant_ref

---
 tools/ocaml/libs/mmap/gnt.ml      | 14 ++++++++------
 tools/ocaml/libs/mmap/gnt.mli     |  3 ++-
 tools/ocaml/libs/mmap/xenmmap.ml  | 14 ++++++++++++--
 tools/ocaml/libs/mmap/xenmmap.mli | 11 ++++++++---
 tools/ocaml/libs/xb/xb.ml         | 10 +++++-----
 tools/ocaml/libs/xb/xb.mli        |  4 ++--
 tools/ocaml/libs/xc/xenctrl.ml    |  6 ++++--
 tools/ocaml/libs/xc/xenctrl.mli   |  5 ++---
 tools/ocaml/xenstored/domain.ml   |  2 +-
 9 files changed, 44 insertions(+), 25 deletions(-)
tools/ocaml/libs/mmap/gnt.ml +8 -6
index 65f0334b7c..bef2d3e850 100644
@@ -45,16 +45,18 @@ module Gnttab = struct
     ref: gntref;
   }
 
+  external unmap_exn : interface -> Xenmmap.mmap_interface -> unit = "stub_gnttab_unmap"
+
+  external map_fresh_exn: interface -> gntref -> domid -> bool -> Xenmmap.mmap_interface = "stub_gnttab_map_fresh"
+
   module Local_mapping = struct
     type t = Xenmmap.mmap_interface
 
-    let to_pages t = t
+    let to_pages interface t =
+      Xenmmap.make t ~unmap:(unmap_exn interface)
   end
 
-  external unmap_exn : interface -> Local_mapping.t -> unit = "stub_gnttab_unmap"
-
-  external map_fresh_exn: interface -> gntref -> domid -> bool -> Local_mapping.t = "stub_gnttab_map_fresh"
-
   let map_exn interface grant writable =
-      map_fresh_exn interface grant.ref grant.domid writable
+    map_fresh_exn interface grant.ref grant.domid writable
+
 end
tools/ocaml/libs/mmap/gnt.mli +2 -1
index 302e13b05d..13ab4c7ead 100644
@@ -53,6 +53,7 @@ module Gnttab : sig
     ref: gntref;
     (** id which identifies the specific export in the foreign domain *)
   }
+
   (** A foreign domain must explicitly "grant" us memory and send us the
       "reference". The pair of (foreign domain id, reference) uniquely
       identifies the block of memory. This pair ("grant") is transmitted
@@ -63,7 +64,7 @@ module Gnttab : sig
     type t
     (** Abstract type representing a locally-mapped shared memory page *)
 
-    val to_pages: t -> Xenmmap.mmap_interface
+    val to_pages: interface -> t -> Xenmmap.t
   end
 
   val map_exn : interface -> grant -> bool -> Local_mapping.t
tools/ocaml/libs/mmap/xenmmap.ml +12 -2
index 44b67c89d2..af258942a0 100644
@@ -15,17 +15,27 @@
  *)
 
 type mmap_interface
+type t = mmap_interface * (mmap_interface -> unit)
+
 
 type mmap_prot_flag = RDONLY | WRONLY | RDWR
 type mmap_map_flag = SHARED | PRIVATE
 
 (* mmap: fd -> prot_flag -> map_flag -> length -> offset -> interface *)
-external mmap: Unix.file_descr -> mmap_prot_flag -> mmap_map_flag
+external mmap': Unix.file_descr -> mmap_prot_flag -> mmap_map_flag
 		-> int -> int -> mmap_interface = "stub_mmap_init"
-external unmap: mmap_interface -> unit = "stub_mmap_final"
 (* read: interface -> start -> length -> data *)
 external read: mmap_interface -> int -> int -> string = "stub_mmap_read"
 (* write: interface -> data -> start -> length -> unit *)
 external write: mmap_interface -> string -> int -> int -> unit = "stub_mmap_write"
 (* getpagesize: unit -> size of page *)
+external unmap': mmap_interface -> unit = "stub_mmap_final"
+(* getpagesize: unit -> size of page *)
+let make ?(unmap=unmap') interface = interface, unmap
 external getpagesize: unit -> int = "stub_mmap_getpagesize"
+
+let to_interface (intf, _) = intf
+let mmap fd prot_flag map_flag length offset =
+	let map = mmap' fd prot_flag map_flag length offset in
+	make map ~unmap:unmap'
+let unmap (map, do_unmap) = do_unmap map
tools/ocaml/libs/mmap/xenmmap.mli +8 -3
index 8f92ed6310..075b24eab4 100644
@@ -14,15 +14,20 @@
  * GNU Lesser General Public License for more details.
  *)
 
+type t
 type mmap_interface
 type mmap_prot_flag = RDONLY | WRONLY | RDWR
 type mmap_map_flag = SHARED | PRIVATE
 
-external mmap : Unix.file_descr -> mmap_prot_flag -> mmap_map_flag -> int -> int
-             -> mmap_interface = "stub_mmap_init"
-external unmap : mmap_interface -> unit = "stub_mmap_final"
 external read : mmap_interface -> int -> int -> string = "stub_mmap_read"
 external write : mmap_interface -> string -> int -> int -> unit
                = "stub_mmap_write"
 
+val mmap : Unix.file_descr -> mmap_prot_flag -> mmap_map_flag -> int -> int -> t
+val unmap : t -> unit
+
+val make: ?unmap:(mmap_interface -> unit) -> mmap_interface -> t 
+
+val to_interface: t -> mmap_interface
+
 external getpagesize : unit -> int = "stub_mmap_getpagesize"
tools/ocaml/libs/xb/xb.ml +5 -5
index 104d319d77..4ddf741420 100644
@@ -28,7 +28,7 @@ let _ =
 
 type backend_mmap =
 {
-	mmap: Xenmmap.mmap_interface;     (* mmaped interface = xs_ring *)
+	mmap: Xenmmap.t;     (* mmaped interface = xs_ring *)
 	eventchn_notify: unit -> unit; (* function to notify through eventchn *)
 	mutable work_again: bool;
 }
@@ -59,7 +59,7 @@ let reconnect t = match t.backend with
 		(* should never happen, so close the connection *)
 		raise End_of_file
 	| Xenmmap backend ->
-		Xs_ring.close backend.mmap;
+		Xs_ring.close Xenmmap.(to_interface backend.mmap);
 		backend.eventchn_notify ();
 		(* Clear our old connection state *)
 		Queue.clear t.pkt_in;
@@ -77,7 +77,7 @@ let read_fd back _con b len =
 
 let read_mmap back _con b len =
 	let s = Bytes.make len '\000' in
-	let rd = Xs_ring.read back.mmap s len in
+	let rd = Xs_ring.read Xenmmap.(to_interface back.mmap) s len in
 	Bytes.blit s 0 b 0 rd;
 	back.work_again <- (rd > 0);
 	if rd > 0 then
@@ -93,7 +93,7 @@ let write_fd back _con b len =
 	Unix.write_substring back.fd b 0 len
 
 let write_mmap back _con s len =
-	let ws = Xs_ring.write_substring back.mmap s len in
+	let ws = Xs_ring.write_substring Xenmmap.(to_interface back.mmap) s len in
 	if ws > 0 then
 		back.eventchn_notify ();
 	ws
@@ -167,7 +167,7 @@ let open_fd fd = newcon (Fd { fd = fd; })
 
 let open_mmap mmap notifyfct =
 	(* Advertise XENSTORE_SERVER_FEATURE_RECONNECTION *)
-	Xs_ring.set_server_features mmap (Xs_ring.Server_features.singleton Xs_ring.Server_feature.Reconnection);
+	Xs_ring.set_server_features (Xenmmap.to_interface mmap) (Xs_ring.Server_features.singleton Xs_ring.Server_feature.Reconnection);
 	newcon (Xenmmap {
 		mmap = mmap;
 		eventchn_notify = notifyfct;
tools/ocaml/libs/xb/xb.mli +2 -2
index 3a00da6cdd..0184d77ffc 100644
@@ -59,7 +59,7 @@ exception Noent
 exception Invalid
 exception Reconnect
 type backend_mmap = {
-  mmap : Xenmmap.mmap_interface;
+  mmap : Xenmmap.t;
   eventchn_notify : unit -> unit;
   mutable work_again : bool;
 }
@@ -86,7 +86,7 @@ val output : t -> bool
 val input : t -> bool
 val newcon : backend -> t
 val open_fd : Unix.file_descr -> t
-val open_mmap : Xenmmap.mmap_interface -> (unit -> unit) -> t
+val open_mmap : Xenmmap.t -> (unit -> unit) -> t
 val close : t -> unit
 val is_fd : t -> bool
 val is_mmap : t -> bool
tools/ocaml/libs/xc/xenctrl.ml +4 -2
index a5588c643f..49950c368a 100644
@@ -265,9 +265,11 @@ external domain_set_memmap_limit: handle -> domid -> int64 -> unit
 external domain_memory_increase_reservation: handle -> domid -> int64 -> unit
        = "stub_xc_domain_memory_increase_reservation"
 
-external map_foreign_range: handle -> domid -> int
+external map_foreign_range': handle -> domid -> int
                          -> nativeint -> Xenmmap.mmap_interface
-       = "stub_map_foreign_range"
+			 = "stub_map_foreign_range"
+let map_foreign_range handle domid port mfn =
+	Xenmmap.make (map_foreign_range' handle domid port mfn)
 
 external domain_assign_device: handle -> domid -> (int * int * int * int) -> unit
        = "stub_xc_domain_assign_device"
tools/ocaml/libs/xc/xenctrl.mli +2 -3
index 6e94940a8a..ad9d07e7a0 100644
@@ -202,9 +202,8 @@ external domain_set_memmap_limit : handle -> domid -> int64 -> unit
 external domain_memory_increase_reservation :
   handle -> domid -> int64 -> unit
   = "stub_xc_domain_memory_increase_reservation"
-external map_foreign_range :
-  handle -> domid -> int -> nativeint -> Xenmmap.mmap_interface
-  = "stub_map_foreign_range"
+val map_foreign_range :
+  handle -> domid -> int -> nativeint -> Xenmmap.t
 
 external domain_assign_device: handle -> domid -> (int * int * int * int) -> unit
        = "stub_xc_domain_assign_device"
tools/ocaml/xenstored/domain.ml +1 -1
index 81cb59b8f1..82d7b1a7ef 100644
@@ -23,7 +23,7 @@ type t =
 {
 	id: Xenctrl.domid;
 	mfn: nativeint;
-	interface: Xenmmap.mmap_interface;
+	interface: Xenmmap.t;
 	eventchn: Event.t;
 	mutable remote_port: int;
 	mutable port: Xeneventchn.t option;
Signature · 1 line
2.25.1
#3 lore raw

PATCH v2 3/17 tools/ocaml: vendor external dependencies for convenience

In reply to Edwin Török

To run the unit tests these dependencies need to be available. The developer can either install them themselves using opam, or we can add them as subdirs here.

Dune will automatically pick the libraries from the system or build it from the subdir as needed, no changes to the dune files are needed.

The duniverse/ subdir was generated by using the 'opam monorepo' command:
https://github.com/ocamllabs/opam-monorepo

This wrote a lockfile (xen.opam.locked) containing tarball sources and hashes, and then opam monorepo pull downloaded the sources.

---
 tools/ocaml/duniverse/cmdliner/.gitignore     |   10 +
 tools/ocaml/duniverse/cmdliner/.ocp-indent    |    1 +
 tools/ocaml/duniverse/cmdliner/B0.ml          |    9 +
 tools/ocaml/duniverse/cmdliner/CHANGES.md     |  255 +++
 tools/ocaml/duniverse/cmdliner/LICENSE.md     |   13 +
 tools/ocaml/duniverse/cmdliner/Makefile       |   77 +
 tools/ocaml/duniverse/cmdliner/README.md      |   51 +
 tools/ocaml/duniverse/cmdliner/_tags          |    3 +
 tools/ocaml/duniverse/cmdliner/build.ml       |  155 ++
 tools/ocaml/duniverse/cmdliner/cmdliner.opam  |   32 +
 tools/ocaml/duniverse/cmdliner/doc/api.odocl  |    1 +
 tools/ocaml/duniverse/cmdliner/dune-project   |    2 +
 tools/ocaml/duniverse/cmdliner/pkg/META       |    7 +
 tools/ocaml/duniverse/cmdliner/pkg/pkg.ml     |   33 +
 .../ocaml/duniverse/cmdliner/src/cmdliner.ml  |  309 ++++
 .../ocaml/duniverse/cmdliner/src/cmdliner.mli | 1624 +++++++++++++++++
 .../duniverse/cmdliner/src/cmdliner.mllib     |   11 +
 .../duniverse/cmdliner/src/cmdliner_arg.ml    |  356 ++++
 .../duniverse/cmdliner/src/cmdliner_arg.mli   |  111 ++
 .../duniverse/cmdliner/src/cmdliner_base.ml   |  302 +++
 .../duniverse/cmdliner/src/cmdliner_base.mli  |   68 +
 .../duniverse/cmdliner/src/cmdliner_cline.ml  |  199 ++
 .../duniverse/cmdliner/src/cmdliner_cline.mli |   34 +
 .../duniverse/cmdliner/src/cmdliner_docgen.ml |  352 ++++
 .../cmdliner/src/cmdliner_docgen.mli          |   30 +
 .../duniverse/cmdliner/src/cmdliner_info.ml   |  233 +++
 .../duniverse/cmdliner/src/cmdliner_info.mli  |  140 ++
 .../cmdliner/src/cmdliner_manpage.ml          |  502 +++++
 .../cmdliner/src/cmdliner_manpage.mli         |  100 +
 .../duniverse/cmdliner/src/cmdliner_msg.ml    |  116 ++
 .../duniverse/cmdliner/src/cmdliner_msg.mli   |   56 +
 .../cmdliner/src/cmdliner_suggest.ml          |   54 +
 .../cmdliner/src/cmdliner_suggest.mli         |   25 +
 .../duniverse/cmdliner/src/cmdliner_term.ml   |   41 +
 .../duniverse/cmdliner/src/cmdliner_term.mli  |   40 +
 .../duniverse/cmdliner/src/cmdliner_trie.ml   |   97 +
 .../duniverse/cmdliner/src/cmdliner_trie.mli  |   35 +
 tools/ocaml/duniverse/cmdliner/src/dune       |    4 +
 tools/ocaml/duniverse/cmdliner/test/chorus.ml |   31 +
 tools/ocaml/duniverse/cmdliner/test/cp_ex.ml  |   54 +
 .../ocaml/duniverse/cmdliner/test/darcs_ex.ml |  149 ++
 tools/ocaml/duniverse/cmdliner/test/dune      |   12 +
 tools/ocaml/duniverse/cmdliner/test/revolt.ml |    9 +
 tools/ocaml/duniverse/cmdliner/test/rm_ex.ml  |   53 +
 .../ocaml/duniverse/cmdliner/test/tail_ex.ml  |   73 +
 .../ocaml/duniverse/cmdliner/test/test_man.ml |  100 +
 .../duniverse/cmdliner/test/test_man_utf8.ml  |   11 +
 .../duniverse/cmdliner/test/test_opt_req.ml   |   13 +
 .../ocaml/duniverse/cmdliner/test/test_pos.ml |   13 +
 .../duniverse/cmdliner/test/test_pos_all.ml   |   11 +
 .../duniverse/cmdliner/test/test_pos_left.ml  |   11 +
 .../duniverse/cmdliner/test/test_pos_req.ml   |   15 +
 .../duniverse/cmdliner/test/test_pos_rev.ml   |   14 +
 .../duniverse/cmdliner/test/test_term_dups.ml |   19 +
 .../cmdliner/test/test_with_used_args.ml      |   18 +
 tools/ocaml/duniverse/cppo/.gitignore         |    5 +
 tools/ocaml/duniverse/cppo/.ocp-indent        |   22 +
 tools/ocaml/duniverse/cppo/.travis.yml        |   16 +
 tools/ocaml/duniverse/cppo/CODEOWNERS         |    8 +
 tools/ocaml/duniverse/cppo/Changes            |   85 +
 tools/ocaml/duniverse/cppo/INSTALL.md         |   17 +
 tools/ocaml/duniverse/cppo/LICENSE.md         |   24 +
 tools/ocaml/duniverse/cppo/Makefile           |   18 +
 tools/ocaml/duniverse/cppo/README.md          |  521 ++++++
 tools/ocaml/duniverse/cppo/VERSION            |    1 +
 tools/ocaml/duniverse/cppo/appveyor.yml       |   14 +
 tools/ocaml/duniverse/cppo/cppo.opam          |   31 +
 .../ocaml/duniverse/cppo/cppo_ocamlbuild.opam |   27 +
 tools/ocaml/duniverse/cppo/dune-project       |    3 +
 tools/ocaml/duniverse/cppo/examples/Makefile  |    8 +
 tools/ocaml/duniverse/cppo/examples/debug.ml  |    7 +
 tools/ocaml/duniverse/cppo/examples/dune      |   32 +
 tools/ocaml/duniverse/cppo/examples/french.ml |   34 +
 tools/ocaml/duniverse/cppo/examples/lexer.mll |    9 +
 .../duniverse/cppo/ocamlbuild_plugin/_tags    |    1 +
 .../duniverse/cppo/ocamlbuild_plugin/dune     |    6 +
 .../cppo/ocamlbuild_plugin/ocamlbuild_cppo.ml |   35 +
 .../ocamlbuild_plugin/ocamlbuild_cppo.mli     |    9 +
 tools/ocaml/duniverse/cppo/src/compat.ml      |    7 +
 .../ocaml/duniverse/cppo/src/cppo_command.ml  |   63 +
 .../ocaml/duniverse/cppo/src/cppo_command.mli |   11 +
 tools/ocaml/duniverse/cppo/src/cppo_eval.ml   |  697 +++++++
 tools/ocaml/duniverse/cppo/src/cppo_eval.mli  |   29 +
 tools/ocaml/duniverse/cppo/src/cppo_lexer.mll |  721 ++++++++
 tools/ocaml/duniverse/cppo/src/cppo_main.ml   |  230 +++
 .../ocaml/duniverse/cppo/src/cppo_parser.mly  |  266 +++
 tools/ocaml/duniverse/cppo/src/cppo_types.ml  |   98 +
 tools/ocaml/duniverse/cppo/src/cppo_types.mli |   70 +
 .../ocaml/duniverse/cppo/src/cppo_version.mli |    1 +
 tools/ocaml/duniverse/cppo/src/dune           |   21 +
 tools/ocaml/duniverse/cppo/test/capital.cppo  |    6 +
 tools/ocaml/duniverse/cppo/test/capital.ref   |    6 +
 tools/ocaml/duniverse/cppo/test/comments.cppo |    7 +
 tools/ocaml/duniverse/cppo/test/comments.ref  |    8 +
 tools/ocaml/duniverse/cppo/test/cond.cppo     |   47 +
 tools/ocaml/duniverse/cppo/test/cond.ref      |   17 +
 tools/ocaml/duniverse/cppo/test/dune          |  130 ++
 tools/ocaml/duniverse/cppo/test/ext.cppo      |   10 +
 tools/ocaml/duniverse/cppo/test/ext.ref       |   28 +
 tools/ocaml/duniverse/cppo/test/incl.cppo     |    3 +
 tools/ocaml/duniverse/cppo/test/incl2.cppo    |    1 +
 tools/ocaml/duniverse/cppo/test/loc.cppo      |    8 +
 tools/ocaml/duniverse/cppo/test/loc.ref       |   21 +
 .../ocaml/duniverse/cppo/test/paren_arg.cppo  |    3 +
 tools/ocaml/duniverse/cppo/test/paren_arg.ref |    4 +
 tools/ocaml/duniverse/cppo/test/source.sh     |   13 +
 tools/ocaml/duniverse/cppo/test/test.cppo     |  144 ++
 tools/ocaml/duniverse/cppo/test/tuple.cppo    |   38 +
 tools/ocaml/duniverse/cppo/test/tuple.ref     |   20 +
 .../ocaml/duniverse/cppo/test/unmatched.cppo  |   14 +
 tools/ocaml/duniverse/cppo/test/unmatched.ref |   15 +
 tools/ocaml/duniverse/cppo/test/version.cppo  |   30 +
 tools/ocaml/duniverse/crowbar/.gitignore      |    5 +
 tools/ocaml/duniverse/crowbar/CHANGES.md      |    9 +
 tools/ocaml/duniverse/crowbar/LICENSE.md      |    8 +
 tools/ocaml/duniverse/crowbar/README.md       |   82 +
 tools/ocaml/duniverse/crowbar/crowbar.opam    |   33 +
 tools/ocaml/duniverse/crowbar/dune            |    1 +
 tools/ocaml/duniverse/crowbar/dune-project    |    2 +
 .../duniverse/crowbar/examples/.gitignore     |    1 +
 .../duniverse/crowbar/examples/calendar/dune  |    3 +
 .../examples/calendar/test_calendar.ml        |   29 +
 .../duniverse/crowbar/examples/fpath/dune     |    4 +
 .../crowbar/examples/fpath/test_fpath.ml      |   18 +
 .../duniverse/crowbar/examples/input/testcase |    1 +
 .../ocaml/duniverse/crowbar/examples/map/dune |    3 +
 .../crowbar/examples/map/test_map.ml          |   47 +
 .../duniverse/crowbar/examples/pprint/dune    |    3 +
 .../crowbar/examples/pprint/test_pprint.ml    |   39 +
 .../crowbar/examples/serializer/dune          |    3 +
 .../crowbar/examples/serializer/serializer.ml |   34 +
 .../examples/serializer/test_serializer.ml    |   47 +
 .../duniverse/crowbar/examples/uunf/dune      |    3 +
 .../crowbar/examples/uunf/test_uunf.ml        |   75 +
 .../duniverse/crowbar/examples/xmldiff/dune   |    3 +
 .../crowbar/examples/xmldiff/test_xmldiff.ml  |   42 +
 tools/ocaml/duniverse/crowbar/src/crowbar.ml  |  582 ++++++
 tools/ocaml/duniverse/crowbar/src/crowbar.mli |  251 +++
 tools/ocaml/duniverse/crowbar/src/dune        |    3 +
 tools/ocaml/duniverse/crowbar/src/todo        |   16 +
 tools/ocaml/duniverse/csexp/CHANGES.md        |   45 +
 tools/ocaml/duniverse/csexp/LICENSE.md        |   21 +
 tools/ocaml/duniverse/csexp/Makefile          |   23 +
 tools/ocaml/duniverse/csexp/README.md         |   33 +
 .../duniverse/csexp/bench/csexp_bench.ml      |   22 +
 tools/ocaml/duniverse/csexp/bench/dune        |   11 +
 tools/ocaml/duniverse/csexp/bench/main.ml     |    1 +
 tools/ocaml/duniverse/csexp/bench/runner.sh   |    4 +
 tools/ocaml/duniverse/csexp/csexp.opam        |   51 +
 .../ocaml/duniverse/csexp/csexp.opam.template |   14 +
 tools/ocaml/duniverse/csexp/dune-project      |   42 +
 .../ocaml/duniverse/csexp/dune-workspace.dev  |    6 +
 tools/ocaml/duniverse/csexp/src/csexp.ml      |  333 ++++
 tools/ocaml/duniverse/csexp/src/csexp.mli     |  369 ++++
 tools/ocaml/duniverse/csexp/src/dune          |    3 +
 tools/ocaml/duniverse/csexp/test/dune         |    6 +
 tools/ocaml/duniverse/csexp/test/test.ml      |  142 ++
 tools/ocaml/duniverse/dune                    |    4 +
 tools/ocaml/duniverse/fmt/.gitignore          |    8 +
 tools/ocaml/duniverse/fmt/.ocp-indent         |    1 +
 tools/ocaml/duniverse/fmt/CHANGES.md          |   98 +
 tools/ocaml/duniverse/fmt/LICENSE.md          |   13 +
 tools/ocaml/duniverse/fmt/README.md           |   35 +
 tools/ocaml/duniverse/fmt/_tags               |    7 +
 tools/ocaml/duniverse/fmt/doc/api.odocl       |    3 +
 tools/ocaml/duniverse/fmt/doc/index.mld       |   11 +
 tools/ocaml/duniverse/fmt/dune-project        |    2 +
 tools/ocaml/duniverse/fmt/fmt.opam            |   35 +
 tools/ocaml/duniverse/fmt/pkg/META            |   40 +
 tools/ocaml/duniverse/fmt/pkg/pkg.ml          |   18 +
 tools/ocaml/duniverse/fmt/src/dune            |   30 +
 tools/ocaml/duniverse/fmt/src/fmt.ml          |  787 ++++++++
 tools/ocaml/duniverse/fmt/src/fmt.mli         |  689 +++++++
 tools/ocaml/duniverse/fmt/src/fmt.mllib       |    1 +
 tools/ocaml/duniverse/fmt/src/fmt_cli.ml      |   32 +
 tools/ocaml/duniverse/fmt/src/fmt_cli.mli     |   45 +
 tools/ocaml/duniverse/fmt/src/fmt_cli.mllib   |    1 +
 tools/ocaml/duniverse/fmt/src/fmt_top.ml      |   23 +
 tools/ocaml/duniverse/fmt/src/fmt_top.mllib   |    1 +
 tools/ocaml/duniverse/fmt/src/fmt_tty.ml      |   78 +
 tools/ocaml/duniverse/fmt/src/fmt_tty.mli     |   50 +
 tools/ocaml/duniverse/fmt/src/fmt_tty.mllib   |    1 +
 .../duniverse/fmt/src/fmt_tty_top_init.ml     |   23 +
 tools/ocaml/duniverse/fmt/test/test.ml        |  322 ++++
 .../duniverse/ocaml-afl-persistent/.gitignore |    2 +
 .../duniverse/ocaml-afl-persistent/CHANGES.md |   22 +
 .../duniverse/ocaml-afl-persistent/LICENSE.md |    8 +
 .../duniverse/ocaml-afl-persistent/README.md  |   17 +
 .../ocaml-afl-persistent/afl-persistent.opam  |   49 +
 .../afl-persistent.opam.template              |   16 +
 .../aflPersistent.available.ml                |   21 +
 .../ocaml-afl-persistent/aflPersistent.mli    |    1 +
 .../aflPersistent.stub.ml                     |    1 +
 .../duniverse/ocaml-afl-persistent/detect.sh  |   43 +
 .../ocaml/duniverse/ocaml-afl-persistent/dune |   20 +
 .../ocaml-afl-persistent/dune-project         |   23 +
 .../duniverse/ocaml-afl-persistent/test.ml    |    3 +
 .../ocaml-afl-persistent/test/harness.ml      |   22 +
 .../ocaml-afl-persistent/test/test.ml         |   73 +
 .../ocaml-afl-persistent/test/test.sh         |   33 +
 .../ocaml/duniverse/ocplib-endian/.gitignore  |    3 +
 .../ocaml/duniverse/ocplib-endian/.travis.yml |   19 +
 .../ocaml/duniverse/ocplib-endian/CHANGES.md  |   55 +
 .../ocaml/duniverse/ocplib-endian/COPYING.txt |  521 ++++++
 tools/ocaml/duniverse/ocplib-endian/Makefile  |   13 +
 tools/ocaml/duniverse/ocplib-endian/README.md |   16 +
 .../duniverse/ocplib-endian/dune-project      |    2 +
 .../ocplib-endian/ocplib-endian.opam          |   30 +
 .../ocplib-endian/src/be_ocaml_401.ml         |   32 +
 .../duniverse/ocplib-endian/src/common.ml     |   24 +
 .../ocplib-endian/src/common_401.cppo.ml      |  100 +
 .../ocplib-endian/src/common_float.ml         |    5 +
 tools/ocaml/duniverse/ocplib-endian/src/dune  |   75 +
 .../ocplib-endian/src/endianBigstring.cppo.ml |  112 ++
 .../src/endianBigstring.cppo.mli              |  128 ++
 .../ocplib-endian/src/endianBytes.cppo.ml     |  130 ++
 .../ocplib-endian/src/endianBytes.cppo.mli    |  124 ++
 .../ocplib-endian/src/endianString.cppo.ml    |  118 ++
 .../ocplib-endian/src/endianString.cppo.mli   |  121 ++
 .../ocplib-endian/src/le_ocaml_401.ml         |   32 +
 .../ocplib-endian/src/ne_ocaml_401.ml         |   20 +
 .../duniverse/ocplib-endian/tests/bench.ml    |  436 +++++
 .../ocaml/duniverse/ocplib-endian/tests/dune  |   35 +
 .../duniverse/ocplib-endian/tests/test.ml     |   39 +
 .../tests/test_bigstring.cppo.ml              |  191 ++
 .../ocplib-endian/tests/test_bytes.cppo.ml    |  185 ++
 .../ocplib-endian/tests/test_string.cppo.ml   |  185 ++
 tools/ocaml/duniverse/result/CHANGES.md       |   15 +
 tools/ocaml/duniverse/result/LICENSE.md       |   24 +
 tools/ocaml/duniverse/result/Makefile         |   17 +
 tools/ocaml/duniverse/result/README.md        |    5 +
 tools/ocaml/duniverse/result/dune             |   12 +
 tools/ocaml/duniverse/result/dune-project     |    3 +
 .../duniverse/result/result-as-alias-4.08.ml  |    2 +
 .../ocaml/duniverse/result/result-as-alias.ml |    2 +
 .../duniverse/result/result-as-newtype.ml     |    2 +
 tools/ocaml/duniverse/result/result.opam      |   18 +
 tools/ocaml/duniverse/result/which_result.ml  |   14 +
 tools/ocaml/duniverse/stdlib-shims/CHANGES.md |    5 +
 tools/ocaml/duniverse/stdlib-shims/LICENSE    |  203 +++
 tools/ocaml/duniverse/stdlib-shims/README.md  |    2 +
 .../ocaml/duniverse/stdlib-shims/dune-project |    1 +
 .../duniverse/stdlib-shims/dune-workspace.dev |   14 +
 tools/ocaml/duniverse/stdlib-shims/src/dune   |   97 +
 .../duniverse/stdlib-shims/stdlib-shims.opam  |   24 +
 tools/ocaml/duniverse/stdlib-shims/test/dune  |    3 +
 .../ocaml/duniverse/stdlib-shims/test/test.ml |    2 +
 tools/ocaml/xen.opam.locked                   |  119 ++
 248 files changed, 18334 insertions(+)
 create mode 100644 tools/ocaml/duniverse/cmdliner/.gitignore
 create mode 100644 tools/ocaml/duniverse/cmdliner/.ocp-indent
 create mode 100644 tools/ocaml/duniverse/cmdliner/B0.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/cmdliner/LICENSE.md
 create mode 100644 tools/ocaml/duniverse/cmdliner/Makefile
 create mode 100644 tools/ocaml/duniverse/cmdliner/README.md
 create mode 100644 tools/ocaml/duniverse/cmdliner/_tags
 create mode 100755 tools/ocaml/duniverse/cmdliner/build.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/cmdliner.opam
 create mode 100644 tools/ocaml/duniverse/cmdliner/doc/api.odocl
 create mode 100644 tools/ocaml/duniverse/cmdliner/dune-project
 create mode 100644 tools/ocaml/duniverse/cmdliner/pkg/META
 create mode 100755 tools/ocaml/duniverse/cmdliner/pkg/pkg.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner.mllib
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_arg.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_arg.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_base.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_base.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_cline.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_cline.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_docgen.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_docgen.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_info.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_info.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_manpage.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_manpage.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_msg.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_msg.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_suggest.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_suggest.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_term.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_term.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_trie.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/cmdliner_trie.mli
 create mode 100644 tools/ocaml/duniverse/cmdliner/src/dune
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/chorus.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/cp_ex.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/darcs_ex.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/dune
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/revolt.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/rm_ex.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/tail_ex.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_man.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_man_utf8.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_opt_req.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_pos.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_pos_all.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_pos_left.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_pos_req.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_pos_rev.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_term_dups.ml
 create mode 100644 tools/ocaml/duniverse/cmdliner/test/test_with_used_args.ml
 create mode 100644 tools/ocaml/duniverse/cppo/.gitignore
 create mode 100644 tools/ocaml/duniverse/cppo/.ocp-indent
 create mode 100644 tools/ocaml/duniverse/cppo/.travis.yml
 create mode 100644 tools/ocaml/duniverse/cppo/CODEOWNERS
 create mode 100644 tools/ocaml/duniverse/cppo/Changes
 create mode 100644 tools/ocaml/duniverse/cppo/INSTALL.md
 create mode 100644 tools/ocaml/duniverse/cppo/LICENSE.md
 create mode 100644 tools/ocaml/duniverse/cppo/Makefile
 create mode 100644 tools/ocaml/duniverse/cppo/README.md
 create mode 100644 tools/ocaml/duniverse/cppo/VERSION
 create mode 100644 tools/ocaml/duniverse/cppo/appveyor.yml
 create mode 100644 tools/ocaml/duniverse/cppo/cppo.opam
 create mode 100644 tools/ocaml/duniverse/cppo/cppo_ocamlbuild.opam
 create mode 100644 tools/ocaml/duniverse/cppo/dune-project
 create mode 100644 tools/ocaml/duniverse/cppo/examples/Makefile
 create mode 100644 tools/ocaml/duniverse/cppo/examples/debug.ml
 create mode 100644 tools/ocaml/duniverse/cppo/examples/dune
 create mode 100644 tools/ocaml/duniverse/cppo/examples/french.ml
 create mode 100644 tools/ocaml/duniverse/cppo/examples/lexer.mll
 create mode 100644 tools/ocaml/duniverse/cppo/ocamlbuild_plugin/_tags
 create mode 100644 tools/ocaml/duniverse/cppo/ocamlbuild_plugin/dune
 create mode 100644 tools/ocaml/duniverse/cppo/ocamlbuild_plugin/ocamlbuild_cppo.ml
 create mode 100644 tools/ocaml/duniverse/cppo/ocamlbuild_plugin/ocamlbuild_cppo.mli
 create mode 100644 tools/ocaml/duniverse/cppo/src/compat.ml
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_command.ml
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_command.mli
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_eval.ml
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_eval.mli
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_lexer.mll
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_main.ml
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_parser.mly
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_types.ml
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_types.mli
 create mode 100644 tools/ocaml/duniverse/cppo/src/cppo_version.mli
 create mode 100644 tools/ocaml/duniverse/cppo/src/dune
 create mode 100644 tools/ocaml/duniverse/cppo/test/capital.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/capital.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/comments.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/comments.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/cond.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/cond.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/dune
 create mode 100644 tools/ocaml/duniverse/cppo/test/ext.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/ext.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/incl.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/incl2.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/loc.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/loc.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/paren_arg.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/paren_arg.ref
 create mode 100755 tools/ocaml/duniverse/cppo/test/source.sh
 create mode 100644 tools/ocaml/duniverse/cppo/test/test.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/tuple.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/tuple.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/unmatched.cppo
 create mode 100644 tools/ocaml/duniverse/cppo/test/unmatched.ref
 create mode 100644 tools/ocaml/duniverse/cppo/test/version.cppo
 create mode 100644 tools/ocaml/duniverse/crowbar/.gitignore
 create mode 100644 tools/ocaml/duniverse/crowbar/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/crowbar/LICENSE.md
 create mode 100644 tools/ocaml/duniverse/crowbar/README.md
 create mode 100644 tools/ocaml/duniverse/crowbar/crowbar.opam
 create mode 100644 tools/ocaml/duniverse/crowbar/dune
 create mode 100644 tools/ocaml/duniverse/crowbar/dune-project
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/.gitignore
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/calendar/dune
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/calendar/test_calendar.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/fpath/dune
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/fpath/test_fpath.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/input/testcase
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/map/dune
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/map/test_map.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/pprint/dune
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/pprint/test_pprint.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/serializer/dune
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/serializer/serializer.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/serializer/test_serializer.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/uunf/dune
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/uunf/test_uunf.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/xmldiff/dune
 create mode 100644 tools/ocaml/duniverse/crowbar/examples/xmldiff/test_xmldiff.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/src/crowbar.ml
 create mode 100644 tools/ocaml/duniverse/crowbar/src/crowbar.mli
 create mode 100644 tools/ocaml/duniverse/crowbar/src/dune
 create mode 100644 tools/ocaml/duniverse/crowbar/src/todo
 create mode 100644 tools/ocaml/duniverse/csexp/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/csexp/LICENSE.md
 create mode 100644 tools/ocaml/duniverse/csexp/Makefile
 create mode 100644 tools/ocaml/duniverse/csexp/README.md
 create mode 100644 tools/ocaml/duniverse/csexp/bench/csexp_bench.ml
 create mode 100644 tools/ocaml/duniverse/csexp/bench/dune
 create mode 100644 tools/ocaml/duniverse/csexp/bench/main.ml
 create mode 100755 tools/ocaml/duniverse/csexp/bench/runner.sh
 create mode 100644 tools/ocaml/duniverse/csexp/csexp.opam
 create mode 100644 tools/ocaml/duniverse/csexp/csexp.opam.template
 create mode 100644 tools/ocaml/duniverse/csexp/dune-project
 create mode 100644 tools/ocaml/duniverse/csexp/dune-workspace.dev
 create mode 100644 tools/ocaml/duniverse/csexp/src/csexp.ml
 create mode 100644 tools/ocaml/duniverse/csexp/src/csexp.mli
 create mode 100644 tools/ocaml/duniverse/csexp/src/dune
 create mode 100644 tools/ocaml/duniverse/csexp/test/dune
 create mode 100644 tools/ocaml/duniverse/csexp/test/test.ml
 create mode 100644 tools/ocaml/duniverse/dune
 create mode 100644 tools/ocaml/duniverse/fmt/.gitignore
 create mode 100644 tools/ocaml/duniverse/fmt/.ocp-indent
 create mode 100644 tools/ocaml/duniverse/fmt/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/fmt/LICENSE.md
 create mode 100644 tools/ocaml/duniverse/fmt/README.md
 create mode 100644 tools/ocaml/duniverse/fmt/_tags
 create mode 100644 tools/ocaml/duniverse/fmt/doc/api.odocl
 create mode 100644 tools/ocaml/duniverse/fmt/doc/index.mld
 create mode 100644 tools/ocaml/duniverse/fmt/dune-project
 create mode 100644 tools/ocaml/duniverse/fmt/fmt.opam
 create mode 100644 tools/ocaml/duniverse/fmt/pkg/META
 create mode 100755 tools/ocaml/duniverse/fmt/pkg/pkg.ml
 create mode 100644 tools/ocaml/duniverse/fmt/src/dune
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt.ml
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt.mli
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt.mllib
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_cli.ml
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_cli.mli
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_cli.mllib
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_top.ml
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_top.mllib
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_tty.ml
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_tty.mli
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_tty.mllib
 create mode 100644 tools/ocaml/duniverse/fmt/src/fmt_tty_top_init.ml
 create mode 100644 tools/ocaml/duniverse/fmt/test/test.ml
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/.gitignore
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/LICENSE.md
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/README.md
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/afl-persistent.opam
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/afl-persistent.opam.template
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/aflPersistent.available.ml
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/aflPersistent.mli
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/aflPersistent.stub.ml
 create mode 100755 tools/ocaml/duniverse/ocaml-afl-persistent/detect.sh
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/dune
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/dune-project
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/test.ml
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/test/harness.ml
 create mode 100644 tools/ocaml/duniverse/ocaml-afl-persistent/test/test.ml
 create mode 100755 tools/ocaml/duniverse/ocaml-afl-persistent/test/test.sh
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/.gitignore
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/.travis.yml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/COPYING.txt
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/Makefile
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/README.md
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/dune-project
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/ocplib-endian.opam
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/be_ocaml_401.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/common.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/common_401.cppo.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/common_float.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/dune
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/endianBigstring.cppo.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/endianBigstring.cppo.mli
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/endianBytes.cppo.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/endianBytes.cppo.mli
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/endianString.cppo.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/endianString.cppo.mli
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/le_ocaml_401.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/src/ne_ocaml_401.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/tests/bench.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/tests/dune
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/tests/test.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/tests/test_bigstring.cppo.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/tests/test_bytes.cppo.ml
 create mode 100644 tools/ocaml/duniverse/ocplib-endian/tests/test_string.cppo.ml
 create mode 100755 tools/ocaml/duniverse/result/CHANGES.md
 create mode 100755 tools/ocaml/duniverse/result/LICENSE.md
 create mode 100755 tools/ocaml/duniverse/result/Makefile
 create mode 100755 tools/ocaml/duniverse/result/README.md
 create mode 100755 tools/ocaml/duniverse/result/dune
 create mode 100755 tools/ocaml/duniverse/result/dune-project
 create mode 100755 tools/ocaml/duniverse/result/result-as-alias-4.08.ml
 create mode 100755 tools/ocaml/duniverse/result/result-as-alias.ml
 create mode 100755 tools/ocaml/duniverse/result/result-as-newtype.ml
 create mode 100755 tools/ocaml/duniverse/result/result.opam
 create mode 100755 tools/ocaml/duniverse/result/which_result.ml
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/CHANGES.md
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/LICENSE
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/README.md
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/dune-project
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/dune-workspace.dev
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/src/dune
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/stdlib-shims.opam
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/test/dune
 create mode 100644 tools/ocaml/duniverse/stdlib-shims/test/test.ml
 create mode 100644 tools/ocaml/xen.opam.locked
tools/ocaml/duniverse/cmdliner/.gitignore new file +10 -0
new file mode 100644
index 0000000000..2b7712335b
@@ -0,0 +1,10 @@
+_build
+_b0
+tmp
+*~
+\.\#*
+\#*#
+*.byte
+*.native
+cmdliner.install
+src/.merlin
tools/ocaml/duniverse/cmdliner/.ocp-indent new file +1 -0
new file mode 100644
index 0000000000..ad2fbcbfa5
@@ -0,0 +1 @@
+strict_with=always,match_clause=4,strict_else=never
\ No newline at end of file
tools/ocaml/duniverse/cmdliner/B0.ml new file +9 -0
new file mode 100644
index 0000000000..ddeb802719
@@ -0,0 +1,9 @@
+open B0
+
+let cmdliner = "cmdliner"
+let doc = "Declarative definition of command line interfaces for OCaml"
+
+let pkg = Pkg.create cmdliner ~doc
+let lib =
+  let srcs = (`Src_dirs [Fpath.v "src"]) in
+  B0_ocaml.Unit.lib ~pkg cmdliner srcs ~doc
tools/ocaml/duniverse/cmdliner/CHANGES.md new file +255 -0

255 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/LICENSE.md new file +13 -0
new file mode 100644
index 0000000000..90fca24d71
@@ -0,0 +1,13 @@
+Copyright (c) 2011 Daniel C. Bünzli
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
tools/ocaml/duniverse/cmdliner/Makefile new file +77 -0

77 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/README.md new file +51 -0

51 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/_tags new file +3 -0
new file mode 100644
index 0000000000..71bfd61d91
@@ -0,0 +1,3 @@
+true : bin_annot, safe_string
+<src> : include
+<test> : include
\ No newline at end of file
tools/ocaml/duniverse/cmdliner/build.ml new file +155 -0

155 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/cmdliner.opam new file +32 -0
new file mode 100644
index 0000000000..cb958e70d2
@@ -0,0 +1,32 @@
+opam-version: "2.0"
+maintainer: "Daniel Bünzli <daniel.buenzl [email protected]>"
+authors: ["Daniel Bünzli <daniel.buenzl [email protected]>"]
+homepage: "http://erratique.ch/software/cmdliner"
+doc: "http://erratique.ch/software/cmdliner/doc/Cmdliner"
+dev-repo: "git+https://github.com/dune-universe/cmdliner.git"
+bug-reports: "https://github.com/dbuenzli/cmdliner/issues"
+tags: [ "cli" "system" "declarative" "org:erratique" ]
+license: "ISC"
+depends: [
+  "dune" "ocaml" {>= "4.03.0"} ]
+synopsis: """Declarative definition of command line interfaces for OCaml"""
+description: """\
+
+Cmdliner allows the declarative definition of command line interfaces
+for OCaml.
+
+It provides a simple and compositional mechanism to convert command
+line arguments to OCaml values and pass them to your functions. The
+module automatically handles syntax errors, help messages and UNIX man
+page generation. It supports programs with single or multiple commands
+and respects most of the [POSIX][1] and [GNU][2] conventions.
+
+Cmdliner has no dependencies and is distributed under the ISC license.
+
+[1]: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html
+[2]: http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
+"""
+build: [[ "dune" "build" "-p" name ]]
+url {
+  src: "git://github.com/dune-universe/cmdliner.git#duniverse-v1.0.4"
+}
tools/ocaml/duniverse/cmdliner/doc/api.odocl new file +1 -0
new file mode 100644
index 0000000000..58711c53d9
@@ -0,0 +1 @@
+Cmdliner
tools/ocaml/duniverse/cmdliner/dune-project new file +2 -0
new file mode 100644
index 0000000000..f4beddd4f7
@@ -0,0 +1,2 @@
+(lang dune 1.4)
+(name cmdliner)
\ No newline at end of file
tools/ocaml/duniverse/cmdliner/pkg/META new file +7 -0
new file mode 100644
index 0000000000..81671c5328
@@ -0,0 +1,7 @@
+version = "%%VERSION%%"
+description = "Declarative definition of command line interfaces"
+requires = ""
+archive(byte) = "cmdliner.cma"
+archive(native) = "cmdliner.cmxa"
+plugin(byte) = "cmdliner.cma"
+plugin(native) = "cmdliner.cmxs"
\ No newline at end of file
tools/ocaml/duniverse/cmdliner/pkg/pkg.ml new file +33 -0
new file mode 100755
index 0000000000..7d3982ac9e
@@ -0,0 +1,33 @@
+#!/usr/bin/env ocaml
+#use "topfind"
+#require "topkg"
+open Topkg
+
+let test t = Pkg.flatten [ Pkg.test ~run:false t; Pkg.doc (t ^ ".ml")]
+
+let distrib =
+  let exclude_paths () = Ok [".git";".gitignore";".gitattributes";"_build"] in
+  Pkg.distrib ~exclude_paths ()
+
+let opams =
+  [Pkg.opam_file "cmdliner.opam"]
+
+let () =
+  Pkg.describe ~distrib "cmdliner" ~opams @@ fun c ->
+  Ok [ Pkg.mllib ~api:["Cmdliner"] "src/cmdliner.mllib";
+       test "test/chorus";
+       test "test/cp_ex";
+       test "test/darcs_ex";
+       test "test/revolt";
+       test "test/rm_ex";
+       test "test/tail_ex";
+       Pkg.test ~run:false "test/test_man";
+       Pkg.test ~run:false "test/test_man_utf8";
+       Pkg.test ~run:false "test/test_pos";
+       Pkg.test ~run:false "test/test_pos_rev";
+       Pkg.test ~run:false "test/test_pos_all";
+       Pkg.test ~run:false "test/test_pos_left";
+       Pkg.test ~run:false "test/test_pos_req";
+       Pkg.test ~run:false "test/test_opt_req";
+       Pkg.test ~run:false "test/test_term_dups";
+       Pkg.test ~run:false "test/test_with_used_args"; ]
tools/ocaml/duniverse/cmdliner/src/cmdliner.ml new file +309 -0

309 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/src/cmdliner.mli new file +1624 -0

1,624 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/src/cmdliner.mllib new file +11 -0
new file mode 100644
index 0000000000..f1ec5a3ad4
@@ -0,0 +1,11 @@
+Cmdliner_suggest
+Cmdliner_trie
+Cmdliner_base
+Cmdliner_manpage
+Cmdliner_info
+Cmdliner_docgen
+Cmdliner_msg
+Cmdliner_cline
+Cmdliner_arg
+Cmdliner_term
+Cmdliner
tools/ocaml/duniverse/cmdliner/src/cmdliner_arg.ml new file +356 -0

356 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/src/cmdliner_arg.mli new file +111 -0

47 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/src/cmdliner_base.ml new file +302 -0

302 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/src/cmdliner_base.mli new file +68 -0

68 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/src/cmdliner_cline.ml new file +199 -0

199 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/src/cmdliner_cline.mli new file +34 -0
new file mode 100644
index 0000000000..63dad28acc

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cmdliner/src/cmdliner_docgen.ml new file +352 -0

352 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/src/cmdliner_docgen.mli new file +30 -0
new file mode 100644
index 0000000000..05fb6a9187

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cmdliner/src/cmdliner_info.ml new file +233 -0

233 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/src/cmdliner_info.mli new file +140 -0

140 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/src/cmdliner_manpage.ml new file +502 -0

502 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/src/cmdliner_manpage.mli new file +100 -0

100 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/src/cmdliner_msg.ml new file +116 -0

116 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/src/cmdliner_msg.mli new file +56 -0

56 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/src/cmdliner_suggest.ml new file +54 -0

54 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/src/cmdliner_suggest.mli new file +25 -0
new file mode 100644
index 0000000000..70fa815661

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cmdliner/src/cmdliner_term.ml new file +41 -0

41 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/src/cmdliner_term.mli new file +40 -0
new file mode 100644
index 0000000000..e9472f75aa

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cmdliner/src/cmdliner_trie.ml new file +97 -0

97 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/src/cmdliner_trie.mli new file +35 -0
new file mode 100644
index 0000000000..01d4029177

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cmdliner/src/dune new file +4 -0
new file mode 100644
index 0000000000..b9ef5c9a15

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cmdliner/test/chorus.ml new file +31 -0
new file mode 100644
index 0000000000..5cf4c20ca9

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cmdliner/test/cp_ex.ml new file +54 -0

54 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/test/darcs_ex.ml new file +149 -0

149 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/test/dune new file +12 -0
new file mode 100644
index 0000000000..012c36aebf

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cmdliner/test/revolt.ml new file +9 -0
new file mode 100644
index 0000000000..f372e1d497

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cmdliner/test/rm_ex.ml new file +53 -0

53 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/test/tail_ex.ml new file +73 -0

73 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/test/test_man.ml new file +100 -0

100 lines not on this page · raw message

tools/ocaml/duniverse/cmdliner/test/test_man_utf8.ml new file +11 -0
new file mode 100644
index 0000000000..e4112a9caf

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cmdliner/test/test_opt_req.ml new file +13 -0
new file mode 100644
index 0000000000..4cb525deba

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cmdliner/test/test_pos.ml new file +13 -0
new file mode 100644
index 0000000000..fd6e101f48

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cmdliner/test/test_pos_all.ml new file +11 -0
new file mode 100644
index 0000000000..b5dc7082a8

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cmdliner/test/test_pos_left.ml new file +11 -0
new file mode 100644
index 0000000000..90e4fbe13c

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cmdliner/test/test_pos_req.ml new file +15 -0
new file mode 100644
index 0000000000..282a77a877

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cmdliner/test/test_pos_rev.ml new file +14 -0
new file mode 100644
index 0000000000..d8321aa861

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cmdliner/test/test_term_dups.ml new file +19 -0
new file mode 100644
index 0000000000..c6462761c7

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cmdliner/test/test_with_used_args.ml new file +18 -0
new file mode 100644
index 0000000000..0a45d07775

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/.gitignore new file +5 -0
new file mode 100644
index 0000000000..1d0dd35c65

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/.ocp-indent new file +22 -0
new file mode 100644
index 0000000000..fb580a5b4b

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/.travis.yml new file +16 -0
new file mode 100644
index 0000000000..1f17d1158d

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/CODEOWNERS new file +8 -0
new file mode 100644
index 0000000000..2a7c825096

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/Changes new file +85 -0

85 lines not on this page · raw message

tools/ocaml/duniverse/cppo/INSTALL.md new file +17 -0
new file mode 100644
index 0000000000..ce1da139a0

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/LICENSE.md new file +24 -0
new file mode 100644
index 0000000000..f1725ba4ef

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/Makefile new file +18 -0
new file mode 100644
index 0000000000..c69d27e470

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/README.md new file +521 -0

521 lines not on this page · raw message

tools/ocaml/duniverse/cppo/VERSION new file +1 -0
new file mode 100644
index 0000000000..ec70f75560

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/appveyor.yml new file +14 -0
new file mode 100644
index 0000000000..456a4cc206

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/cppo.opam new file +31 -0
new file mode 100644
index 0000000000..33258eb4c9

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/cppo_ocamlbuild.opam new file +27 -0
new file mode 100644
index 0000000000..22fa8ce630

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/dune-project new file +3 -0
new file mode 100644
index 0000000000..3f91b7266a

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/examples/Makefile new file +8 -0
new file mode 100644
index 0000000000..f9dd33fbfd

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/examples/debug.ml new file +7 -0
new file mode 100644
index 0000000000..d47b512224

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/examples/dune new file +32 -0
new file mode 100644
index 0000000000..f4d9de7c6f

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/examples/french.ml new file +34 -0
new file mode 100644
index 0000000000..e173a1fe1c

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/examples/lexer.mll new file +9 -0
new file mode 100644
index 0000000000..446e8eef28

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/ocamlbuild_plugin/_tags new file +1 -0
new file mode 100644
index 0000000000..dc946a1c24

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/ocamlbuild_plugin/dune new file +6 -0
new file mode 100644
index 0000000000..b512a12f29

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/ocamlbuild_plugin/ocamlbuild_cppo.ml new file +35 -0
new file mode 100644
index 0000000000..f301c36240

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/ocamlbuild_plugin/ocamlbuild_cppo.mli new file +9 -0
new file mode 100644
index 0000000000..212435857f

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/src/compat.ml new file +7 -0
new file mode 100644
index 0000000000..5cd4a1b58d

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/src/cppo_command.ml new file +63 -0

63 lines not on this page · raw message

tools/ocaml/duniverse/cppo/src/cppo_command.mli new file +11 -0
new file mode 100644
index 0000000000..af57d8cbfc

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/src/cppo_eval.ml new file +697 -0

697 lines not on this page · raw message

tools/ocaml/duniverse/cppo/src/cppo_eval.mli new file +29 -0
new file mode 100644
index 0000000000..d4302f02d5

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/src/cppo_lexer.mll new file +721 -0

721 lines not on this page · raw message

tools/ocaml/duniverse/cppo/src/cppo_main.ml new file +230 -0

230 lines not on this page · raw message

tools/ocaml/duniverse/cppo/src/cppo_parser.mly new file +266 -0

266 lines not on this page · raw message

tools/ocaml/duniverse/cppo/src/cppo_types.ml new file +98 -0

98 lines not on this page · raw message

tools/ocaml/duniverse/cppo/src/cppo_types.mli new file +70 -0

70 lines not on this page · raw message

tools/ocaml/duniverse/cppo/src/cppo_version.mli new file +1 -0
new file mode 100644
index 0000000000..7d20f68da6

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/src/dune new file +21 -0
new file mode 100644
index 0000000000..8cf871b460

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/test/capital.cppo new file +6 -0
new file mode 100644
index 0000000000..fa85caae4e

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/test/capital.ref new file +6 -0
new file mode 100644
index 0000000000..adcc26e251

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/test/comments.cppo new file +7 -0
new file mode 100644
index 0000000000..5e335f1c3b

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/test/comments.ref new file +8 -0
new file mode 100644
index 0000000000..1d0dd1db64

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/test/cond.cppo new file +47 -0

47 lines not on this page · raw message

tools/ocaml/duniverse/cppo/test/cond.ref new file +17 -0
new file mode 100644
index 0000000000..a21ea217bf

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/test/dune new file +130 -0

130 lines not on this page · raw message

tools/ocaml/duniverse/cppo/test/ext.cppo new file +10 -0
new file mode 100644
index 0000000000..cb32573f67

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/test/ext.ref new file +28 -0
new file mode 100644
index 0000000000..4626b21481

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/test/incl.cppo new file +3 -0
new file mode 100644
index 0000000000..a2ce8dbb36

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/test/incl2.cppo new file +1 -0
new file mode 100644
index 0000000000..9766475a41

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/test/loc.cppo new file +8 -0
new file mode 100644
index 0000000000..d7c2c521f3

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/test/loc.ref new file +21 -0
new file mode 100644
index 0000000000..78bbfb72bd

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/test/paren_arg.cppo new file +3 -0
new file mode 100644
index 0000000000..f4c4803eb4

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/test/paren_arg.ref new file +4 -0
new file mode 100644
index 0000000000..6555ca0569

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/test/source.sh new file +13 -0
new file mode 100755
index 0000000000..660d161ab2

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/test/test.cppo new file +144 -0

144 lines not on this page · raw message

tools/ocaml/duniverse/cppo/test/tuple.cppo new file +38 -0
new file mode 100644
index 0000000000..57423b89a9

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/test/tuple.ref new file +20 -0
new file mode 100644
index 0000000000..58df976ef5

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/test/unmatched.cppo new file +14 -0
new file mode 100644
index 0000000000..470cbd44be

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/test/unmatched.ref new file +15 -0
new file mode 100644
index 0000000000..ff2356a57d

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/cppo/test/version.cppo new file +30 -0
new file mode 100644
index 0000000000..ee4e429b6a

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/.gitignore new file +5 -0
new file mode 100644
index 0000000000..ffee22e516

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/CHANGES.md new file +9 -0
new file mode 100644
index 0000000000..df24660c5e

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/LICENSE.md new file +8 -0
new file mode 100644
index 0000000000..848fd3e059

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/README.md new file +82 -0

82 lines not on this page · raw message

tools/ocaml/duniverse/crowbar/crowbar.opam new file +33 -0
new file mode 100644
index 0000000000..bff15f564a

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/dune new file +1 -0
new file mode 100644
index 0000000000..8daec202b7

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/dune-project new file +2 -0
new file mode 100644
index 0000000000..12d75f30c8

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/examples/.gitignore new file +1 -0
new file mode 100644
index 0000000000..53752db253

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/examples/calendar/dune new file +3 -0
new file mode 100644
index 0000000000..e5fdd8f1df

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/examples/calendar/test_calendar.ml new file +29 -0
new file mode 100644
index 0000000000..788e96a7dc

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/examples/fpath/dune new file +4 -0
new file mode 100644
index 0000000000..b6050be6f7

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/examples/fpath/test_fpath.ml new file +18 -0
new file mode 100644
index 0000000000..242ffc399d

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/examples/input/testcase new file +1 -0
new file mode 100644
index 0000000000..8bd6648ed1

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/examples/map/dune new file +3 -0
new file mode 100644
index 0000000000..04fa46113b

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/examples/map/test_map.ml new file +47 -0

47 lines not on this page · raw message

tools/ocaml/duniverse/crowbar/examples/pprint/dune new file +3 -0
new file mode 100644
index 0000000000..7c4d9127c0

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/examples/pprint/test_pprint.ml new file +39 -0
new file mode 100644
index 0000000000..77789ef00f

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/examples/serializer/dune new file +3 -0
new file mode 100644
index 0000000000..f1f0c6b64b

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/examples/serializer/serializer.ml new file +34 -0
new file mode 100644
index 0000000000..bb1ee2b4c2

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/examples/serializer/test_serializer.ml new file +47 -0

47 lines not on this page · raw message

tools/ocaml/duniverse/crowbar/examples/uunf/dune new file +3 -0
new file mode 100644
index 0000000000..35850fa034

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/examples/uunf/test_uunf.ml new file +75 -0

75 lines not on this page · raw message

tools/ocaml/duniverse/crowbar/examples/xmldiff/dune new file +3 -0
new file mode 100644
index 0000000000..46d7ceef19

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/examples/xmldiff/test_xmldiff.ml new file +42 -0

42 lines not on this page · raw message

tools/ocaml/duniverse/crowbar/src/crowbar.ml new file +582 -0

582 lines not on this page · raw message

tools/ocaml/duniverse/crowbar/src/crowbar.mli new file +251 -0

251 lines not on this page · raw message

tools/ocaml/duniverse/crowbar/src/dune new file +3 -0
new file mode 100644
index 0000000000..ed5173287b

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/crowbar/src/todo new file +16 -0
new file mode 100644
index 0000000000..087141682b

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/csexp/CHANGES.md new file +45 -0

45 lines not on this page · raw message

tools/ocaml/duniverse/csexp/LICENSE.md new file +21 -0
new file mode 100644
index 0000000000..06829595d1

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/csexp/Makefile new file +23 -0
new file mode 100644
index 0000000000..a0d0ec8317

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/csexp/README.md new file +33 -0
new file mode 100644
index 0000000000..b6c13631b7

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/csexp/bench/csexp_bench.ml new file +22 -0
new file mode 100644
index 0000000000..8f5c5b6ace

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/csexp/bench/dune new file +11 -0
new file mode 100644
index 0000000000..42b95aed93

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/csexp/bench/main.ml new file +1 -0
new file mode 100644
index 0000000000..88e7fe25cd

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/csexp/bench/runner.sh new file +4 -0
new file mode 100755
index 0000000000..0089cf7f7a

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/csexp/csexp.opam new file +51 -0

51 lines not on this page · raw message

tools/ocaml/duniverse/csexp/csexp.opam.template new file +14 -0
new file mode 100644
index 0000000000..d7691b5d65

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/csexp/dune-project new file +42 -0

42 lines not on this page · raw message

tools/ocaml/duniverse/csexp/dune-workspace.dev new file +6 -0
new file mode 100644
index 0000000000..b8b97992ba

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/csexp/src/csexp.ml new file +333 -0

333 lines not on this page · raw message

tools/ocaml/duniverse/csexp/src/csexp.mli new file +369 -0

369 lines not on this page · raw message

tools/ocaml/duniverse/csexp/src/dune new file +3 -0
new file mode 100644
index 0000000000..bd4b3b7ea6

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/csexp/test/dune new file +6 -0
new file mode 100644
index 0000000000..3284f4b3ca

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/csexp/test/test.ml new file +142 -0

142 lines not on this page · raw message

tools/ocaml/duniverse/dune new file +4 -0
new file mode 100644
index 0000000000..ad2ec9467e

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/fmt/.gitignore new file +8 -0
new file mode 100644
index 0000000000..10916e3a45

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/fmt/.ocp-indent new file +1 -0
new file mode 100644
index 0000000000..ad2fbcbfa5

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/fmt/CHANGES.md new file +98 -0

98 lines not on this page · raw message

tools/ocaml/duniverse/fmt/LICENSE.md new file +13 -0
new file mode 100644
index 0000000000..52fe16df4b

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/fmt/README.md new file +35 -0
new file mode 100644
index 0000000000..4809210590

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/fmt/_tags new file +7 -0
new file mode 100644
index 0000000000..729441abb9

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/fmt/doc/api.odocl new file +3 -0
new file mode 100644
index 0000000000..f6608c354b

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/fmt/doc/index.mld new file +11 -0
new file mode 100644
index 0000000000..eb2c91cbbd

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/fmt/dune-project new file +2 -0
new file mode 100644
index 0000000000..c9c5bebf07

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/fmt/fmt.opam new file +35 -0
new file mode 100644
index 0000000000..2cce5b7136

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/fmt/pkg/META new file +40 -0
new file mode 100644
index 0000000000..e379f4ed88

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/fmt/pkg/pkg.ml new file +18 -0
new file mode 100755
index 0000000000..959b02242c

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/fmt/src/dune new file +30 -0
new file mode 100644
index 0000000000..ece3f9958b

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/fmt/src/fmt.ml new file +787 -0

787 lines not on this page · raw message

tools/ocaml/duniverse/fmt/src/fmt.mli new file +689 -0

689 lines not on this page · raw message

tools/ocaml/duniverse/fmt/src/fmt.mllib new file +1 -0
new file mode 100644
index 0000000000..977dbb9876

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/fmt/src/fmt_cli.ml new file +32 -0
new file mode 100644
index 0000000000..0376806759

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/fmt/src/fmt_cli.mli new file +45 -0

45 lines not on this page · raw message

tools/ocaml/duniverse/fmt/src/fmt_cli.mllib new file +1 -0
new file mode 100644
index 0000000000..6a0743e652

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/fmt/src/fmt_top.ml new file +23 -0
new file mode 100644
index 0000000000..7bcf4b2062

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/fmt/src/fmt_top.mllib new file +1 -0
new file mode 100644
index 0000000000..49c6b94c54

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/fmt/src/fmt_tty.ml new file +78 -0

78 lines not on this page · raw message

tools/ocaml/duniverse/fmt/src/fmt_tty.mli new file +50 -0

50 lines not on this page · raw message

tools/ocaml/duniverse/fmt/src/fmt_tty.mllib new file +1 -0
new file mode 100644
index 0000000000..4e15d82115

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/fmt/src/fmt_tty_top_init.ml new file +23 -0
new file mode 100644
index 0000000000..3309166c5e

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/fmt/test/test.ml new file +322 -0

322 lines not on this page · raw message

tools/ocaml/duniverse/ocaml-afl-persistent/.gitignore new file +2 -0
new file mode 100644
index 0000000000..655e32b07c

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocaml-afl-persistent/CHANGES.md new file +22 -0
new file mode 100644
index 0000000000..da38d286bc

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocaml-afl-persistent/LICENSE.md new file +8 -0
new file mode 100644
index 0000000000..89cbf71481

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocaml-afl-persistent/README.md new file +17 -0
new file mode 100644
index 0000000000..2ed9916c9f

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocaml-afl-persistent/afl-persistent.opam new file +49 -0

49 lines not on this page · raw message

tools/ocaml/duniverse/ocaml-afl-persistent/afl-persistent.opam.template new file +16 -0
new file mode 100644
index 0000000000..a9787ebc62

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocaml-afl-persistent/aflPersistent.available.ml new file +21 -0
new file mode 100644
index 0000000000..351e16c2a6

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocaml-afl-persistent/aflPersistent.mli new file +1 -0
new file mode 100644
index 0000000000..f446ddd605

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocaml-afl-persistent/aflPersistent.stub.ml new file +1 -0
new file mode 100644
index 0000000000..2fd679dc1f

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocaml-afl-persistent/detect.sh new file +43 -0

43 lines not on this page · raw message

tools/ocaml/duniverse/ocaml-afl-persistent/dune new file +20 -0
new file mode 100644
index 0000000000..ce3be53ec1

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocaml-afl-persistent/dune-project new file +23 -0
new file mode 100644
index 0000000000..2d79209635

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocaml-afl-persistent/test.ml new file +3 -0
new file mode 100644
index 0000000000..1d12af1877

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocaml-afl-persistent/test/harness.ml new file +22 -0
new file mode 100644
index 0000000000..dbcbebf0b1

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocaml-afl-persistent/test/test.ml new file +73 -0

73 lines not on this page · raw message

tools/ocaml/duniverse/ocaml-afl-persistent/test/test.sh new file +33 -0
new file mode 100755
index 0000000000..32044dffa7

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocplib-endian/.gitignore new file +3 -0
new file mode 100644
index 0000000000..f06221ceba

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocplib-endian/.travis.yml new file +19 -0
new file mode 100644
index 0000000000..0e2ae0b572

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocplib-endian/CHANGES.md new file +55 -0

55 lines not on this page · raw message

tools/ocaml/duniverse/ocplib-endian/COPYING.txt new file +521 -0

521 lines not on this page · raw message

tools/ocaml/duniverse/ocplib-endian/Makefile new file +13 -0
new file mode 100644
index 0000000000..63fb0da7f0

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocplib-endian/README.md new file +16 -0
new file mode 100644
index 0000000000..095959be94

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocplib-endian/dune-project new file +2 -0
new file mode 100644
index 0000000000..ae33d72195

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocplib-endian/ocplib-endian.opam new file +30 -0
new file mode 100644
index 0000000000..642829c51b

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocplib-endian/src/be_ocaml_401.ml new file +32 -0
new file mode 100644
index 0000000000..38de28c1ca

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocplib-endian/src/common.ml new file +24 -0
new file mode 100644
index 0000000000..54df23effa

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocplib-endian/src/common_401.cppo.ml new file +100 -0

100 lines not on this page · raw message

tools/ocaml/duniverse/ocplib-endian/src/common_float.ml new file +5 -0
new file mode 100644
index 0000000000..3d28d2da1f

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocplib-endian/src/dune new file +75 -0

75 lines not on this page · raw message

tools/ocaml/duniverse/ocplib-endian/src/endianBigstring.cppo.ml new file +112 -0

112 lines not on this page · raw message

tools/ocaml/duniverse/ocplib-endian/src/endianBigstring.cppo.mli new file +128 -0

128 lines not on this page · raw message

tools/ocaml/duniverse/ocplib-endian/src/endianBytes.cppo.ml new file +130 -0

130 lines not on this page · raw message

tools/ocaml/duniverse/ocplib-endian/src/endianBytes.cppo.mli new file +124 -0

124 lines not on this page · raw message

tools/ocaml/duniverse/ocplib-endian/src/endianString.cppo.ml new file +118 -0

118 lines not on this page · raw message

tools/ocaml/duniverse/ocplib-endian/src/endianString.cppo.mli new file +121 -0

121 lines not on this page · raw message

tools/ocaml/duniverse/ocplib-endian/src/le_ocaml_401.ml new file +32 -0
new file mode 100644
index 0000000000..b65184ca8d

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocplib-endian/src/ne_ocaml_401.ml new file +20 -0
new file mode 100644
index 0000000000..2348135809

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocplib-endian/tests/bench.ml new file +436 -0

436 lines not on this page · raw message

tools/ocaml/duniverse/ocplib-endian/tests/dune new file +35 -0
new file mode 100644
index 0000000000..e3e0f17940

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocplib-endian/tests/test.ml new file +39 -0
new file mode 100644
index 0000000000..387fcc16b3

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/ocplib-endian/tests/test_bigstring.cppo.ml new file +191 -0

191 lines not on this page · raw message

tools/ocaml/duniverse/ocplib-endian/tests/test_bytes.cppo.ml new file +185 -0

185 lines not on this page · raw message

tools/ocaml/duniverse/ocplib-endian/tests/test_string.cppo.ml new file +185 -0

185 lines not on this page · raw message

tools/ocaml/duniverse/result/CHANGES.md new file +15 -0
new file mode 100755
index 0000000000..fc04a554f5

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/result/LICENSE.md new file +24 -0
new file mode 100755
index 0000000000..42d16a9902

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/result/Makefile new file +17 -0
new file mode 100755
index 0000000000..f5dd44305e

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/result/README.md new file +5 -0
new file mode 100755
index 0000000000..ade131944c

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/result/dune new file +12 -0
new file mode 100755
index 0000000000..8b7ef9b882

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/result/dune-project new file +3 -0
new file mode 100755
index 0000000000..377a3f80cb

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/result/result-as-alias-4.08.ml new file +2 -0
new file mode 100755
index 0000000000..a654b7438a

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/result/result-as-alias.ml new file +2 -0
new file mode 100755
index 0000000000..5d695816c2

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/result/result-as-newtype.ml new file +2 -0
new file mode 100755
index 0000000000..275c663883

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/result/result.opam new file +18 -0
new file mode 100755
index 0000000000..11e41c9468

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/result/which_result.ml new file +14 -0
new file mode 100755
index 0000000000..7c40c21d2e

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/stdlib-shims/CHANGES.md new file +5 -0
new file mode 100644
index 0000000000..de768873cc

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/stdlib-shims/LICENSE new file +203 -0

203 lines not on this page · raw message

tools/ocaml/duniverse/stdlib-shims/README.md new file +2 -0
new file mode 100644
index 0000000000..79890c2d8f

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/stdlib-shims/dune-project new file +1 -0
new file mode 100644
index 0000000000..de4fc20920

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/stdlib-shims/dune-workspace.dev new file +14 -0
new file mode 100644
index 0000000000..c793fa1927

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/stdlib-shims/src/dune new file +97 -0

97 lines not on this page · raw message

tools/ocaml/duniverse/stdlib-shims/stdlib-shims.opam new file +24 -0
new file mode 100644
index 0000000000..c4e1fb9d86

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/stdlib-shims/test/dune new file +3 -0
new file mode 100644
index 0000000000..f31738ad94

Lines of this file are not shown. View the raw message.

tools/ocaml/duniverse/stdlib-shims/test/test.ml new file +2 -0
new file mode 100644
index 0000000000..1f0e4941b6

Lines of this file are not shown. View the raw message.

tools/ocaml/xen.opam.locked new file +119 -0

119 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.25.1

Part of the diff is not shown here. View the raw message.

#20 lore raw
In reply to Edwin Török
Quoted 32 lines · Edwin Török

These patches have been posted previously.
The gnttab patches (tools/ocaml/libs/mmap) were not applied at the time to avoid conflicts with an in-progress XSA.
The binary format live-update and fuzzing patches were not applied because it was too close to the next Xen release freeze.

The patches depend on each-other: live-update only works correctly when the gnttab patches are taken too (MFN is not part of the binary live-update stream),
so they are included here as a single series.
The gnttab patches replaces one use of libxenctrl with stable interfaces, leaving one unstable libxenctrl interface used by oxenstored.

The 'vendor external dependencies' may be optional, it is useful to be part
of a patchqueue in a specfile so that you can build everything without external dependencies, but might as well commit it so everyone has it easily available not just XenServer.

Note that the live-update fuzz test doesn't yet pass, it is still able to find bugs. However the reduced version with a fixed seed used as a unit test does pass, so it is useful to have it committed, and further improvements can be made later as more bugs are discovered and fixed.

Edwin Török (17):
docs/designs/xenstore-migration.md: clarify that deletes are recursive tools/ocaml: add unit test skeleton with Dune build system tools/ocaml: vendor external dependencies for convenience tools/ocaml/xenstored: implement the live migration binary format tools/ocaml/xenstored: add binary dump format support tools/ocaml/xenstored: add support for binary format tools/ocaml/xenstored: validate config file before live update Add structured fuzzing unit test
tools/ocaml: use common macros for manipulating mmap_interface tools/ocaml/libs/mmap: allocate correct number of bytes

Quoted 8 lines

tools/ocaml/libs/mmap: Expose stub_mmap_alloc tools/ocaml/libs/mmap: mark mmap/munmap as blocking tools/ocaml/libs/xb: import gnttab stubs from mirage tools/ocaml: safer Xenmmap interface tools/ocaml/xenstored: use gnttab instead of xenctrl's
foreign_map_range
tools/ocaml/xenstored: don't store domU's mfn of ring page tools/ocaml/libs/mmap: Clean up unused read/write

Gitlab CI reports failures across the board in Debian Stretch 32-bit builds.  All logs
https://gitlab.com/xen-project/patchew/xen/-/pipelines/301146112 but the tl;dr seems to be:

File "disk.ml", line 179, characters 26-37:
Error: Integer literal exceeds the range of representable integers of type int

~Andrew

#21 lore raw
Quoted 59 lines · Andrew Cooper
Quoted 43 lines · Edwin Török

These patches have been posted previously.
The gnttab patches (tools/ocaml/libs/mmap) were not applied at the time
to avoid conflicts with an in-progress XSA.
The binary format live-update and fuzzing patches were not applied because it was too close to the next Xen release freeze.

The patches depend on each-other: live-update only works correctly when the gnttab
patches are taken too (MFN is not part of the binary live-update stream),
so they are included here as a single series.
The gnttab patches replaces one use of libxenctrl with stable interfaces, leaving one unstable
libxenctrl interface used by oxenstored.

The 'vendor external dependencies' may be optional, it is useful to be part
of a patchqueue in a specfile so that you can build everything without external dependencies,
but might as well commit it so everyone has it easily available not just XenServer.

Note that the live-update fuzz test doesn't yet pass, it is still able to find bugs.
However the reduced version with a fixed seed used as a unit test does pass,
so it is useful to have it committed, and further improvements can be made later
as more bugs are discovered and fixed.

Edwin Török (17):
docs/designs/xenstore-migration.md: clarify that deletes are
recursive
tools/ocaml: add unit test skeleton with Dune build system tools/ocaml: vendor external dependencies for convenience tools/ocaml/xenstored: implement the live migration binary format tools/ocaml/xenstored: add binary dump format support tools/ocaml/xenstored: add support for binary format tools/ocaml/xenstored: validate config file before live update Add structured fuzzing unit test
tools/ocaml: use common macros for manipulating mmap_interface tools/ocaml/libs/mmap: allocate correct number of bytes

Quoted 8 lines

tools/ocaml/libs/mmap: Expose stub_mmap_alloc tools/ocaml/libs/mmap: mark mmap/munmap as blocking tools/ocaml/libs/xb: import gnttab stubs from mirage tools/ocaml: safer Xenmmap interface tools/ocaml/xenstored: use gnttab instead of xenctrl's
foreign_map_range
tools/ocaml/xenstored: don't store domU's mfn of ring page tools/ocaml/libs/mmap: Clean up unused read/write

Gitlab CI reports failures across the board in Debian Stretch 32-bit builds. All logs
https://gitlab.com/xen-project/patchew/xen/-/pipelines/301146112 but the
tl;dr seems to be:

Quoted 3 lines

File "disk.ml", line 179, characters 26-37:
Error: Integer literal exceeds the range of representable integers of type int

Thanks, this should fix it, I refreshed my git tree (there is also a fix there for the older version of Make):
https://gitlab.com/xen-project/patchew/xen/-/pipelines/301146112

Not sure whether it is worth continuing to support 32-bit i686 builds, any modern Intel/AMD CPU would be 64-bit capable, but perhaps 32-bit is still popular in the ARM world and keeping 32-bit Intel supported is the easiest way to build-test it?

(quoted diff) +0 -0

b/tools/ocaml/xenstored/disk.ml
index 59794324e1..b7678af87f 100644

tools/ocaml/xenstored/disk.ml +2 -2
@@ -176,7 +176,7 @@ let write store =
            output_byte ch i
 
        let w32 ch v =
-           assert (v >= 0 && v <= 0xFFFF_FFFF);
+           assert (v >= 0 && Int64.of_int v <= 0xFFFF_FFFFL);
            output_binary_int ch v
 
        let pos = pos_out
@@ -213,7 +213,7 @@ let write store =
 
        let r32 t =
            (* read unsigned 32-bit int *)
-           let r = input_binary_int t land 0xFFFF_FFFF in
+           let r = Int64.logand (Int64.of_int (input_binary_int t))

0xFFFF_FFFFL |> Int64.to_int in

            assert (r >= 0);
            r

@@ -293,7 +293,7 @@ module LiveRecord = struct

        write_record t Type.global_data 8 @@ fun b ->
        O.w32 b (FD.to_int rw_sock);
                 (* TODO: this needs a unit test/live update test too!

*)
- O.w32 b 0xFFFF_FFFF
+ O.w32 b 0x3FFF_FFFF

let read_global_data t ~len f =
read_expect t "global_data" 8 len;

Quoted 2 lines

~Andrew

#22 lore raw
Quoted 62 lines · Edwin Torok
Quoted 58 lines · Andrew Cooper
Quoted 43 lines · Edwin Török

These patches have been posted previously.
The gnttab patches (tools/ocaml/libs/mmap) were not applied at the time
to avoid conflicts with an in-progress XSA.
The binary format live-update and fuzzing patches were not applied because it was too close to the next Xen release freeze.

The patches depend on each-other: live-update only works correctly when the gnttab
patches are taken too (MFN is not part of the binary live-update stream),
so they are included here as a single series.
The gnttab patches replaces one use of libxenctrl with stable interfaces, leaving one unstable
libxenctrl interface used by oxenstored.

The 'vendor external dependencies' may be optional, it is useful to be part
of a patchqueue in a specfile so that you can build everything without external dependencies,
but might as well commit it so everyone has it easily available not just XenServer.

Note that the live-update fuzz test doesn't yet pass, it is still able to find bugs.
However the reduced version with a fixed seed used as a unit test does pass,
so it is useful to have it committed, and further improvements can be made later
as more bugs are discovered and fixed.

Edwin Török (17):
docs/designs/xenstore-migration.md: clarify that deletes are
recursive
tools/ocaml: add unit test skeleton with Dune build system tools/ocaml: vendor external dependencies for convenience tools/ocaml/xenstored: implement the live migration binary format tools/ocaml/xenstored: add binary dump format support tools/ocaml/xenstored: add support for binary format tools/ocaml/xenstored: validate config file before live update Add structured fuzzing unit test
tools/ocaml: use common macros for manipulating mmap_interface tools/ocaml/libs/mmap: allocate correct number of bytes

Quoted 8 lines

tools/ocaml/libs/mmap: Expose stub_mmap_alloc tools/ocaml/libs/mmap: mark mmap/munmap as blocking tools/ocaml/libs/xb: import gnttab stubs from mirage tools/ocaml: safer Xenmmap interface tools/ocaml/xenstored: use gnttab instead of xenctrl's
foreign_map_range
tools/ocaml/xenstored: don't store domU's mfn of ring page tools/ocaml/libs/mmap: Clean up unused read/write

Gitlab CI reports failures across the board in Debian Stretch 32-bit builds. All logs
https://gitlab.com/xen-project/patchew/xen/-/pipelines/301146112 but the
tl;dr seems to be:

Quoted 3 lines

File "disk.ml", line 179, characters 26-37:
Error: Integer literal exceeds the range of representable integers of type int

Quoted 8 lines

Thanks, this should fix it, I refreshed my git tree (there is also a fix there for the older version of Make):
https://gitlab.com/xen-project/patchew/xen/-/pipelines/301146112

Not sure whether it is worth continuing to support 32-bit i686 builds, any modern Intel/AMD CPU would be 64-bit capable, but perhaps 32-bit is still popular in the ARM world and keeping 32-bit Intel supported is the easiest way to build-test it?

Yes - arm32 is very much a thing, and currently 32bit userspace on x86 is a supported configuration.

tools/ocaml/xenstored/disk.ml let write store = · line 179

Quoted 12 lines
tools/ocaml/xenstored/disk.ml +1 -1
index 59794324e1..b7678af87f 100644
@@ -176,7 +176,7 @@ let write store =
            output_byte ch i
 
        let w32 ch v =
-           assert (v >= 0 && v <= 0xFFFF_FFFF);
+           assert (v >= 0 && Int64.of_int v <= 0xFFFF_FFFFL);

In the case that v is 32 bits wide, it will underflow and fail the v >= 0 check, before the upcast to Int64.

~Andrew

#19 lore raw

Re: [PATCH v2 17/17] tools/ocaml/libs/mmap: Clean up unused read/write

In reply to Edwin Török
Quoted 6 lines · Edwin Török
tools/ocaml/libs/mmap/xenmmap.ml +0 -0
index af258942a0..e17a62e607 100644
@@ -24,11 +24,6 @@ type mmap_map_flag = SHARED | PRIVATE
 (* mmap: fd -> prot_flag -> map_flag -> length -> offset -> interface *)

tools/ocaml/libs/mmap/xenmmap.ml type mmap_map_flag = SHARED | PRIVATE · line 29

Quoted 10 lines
tools/ocaml/libs/mmap/xenmmap.ml +0 -5
 external mmap': Unix.file_descr -> mmap_prot_flag -> mmap_map_flag
 		-> int -> int -> mmap_interface = "stub_mmap_init"
-(* read: interface -> start -> length -> data *)
-external read: mmap_interface -> int -> int -> string = "stub_mmap_read"
-(* write: interface -> data -> start -> length -> unit *)
-external write: mmap_interface -> string -> int -> int -> unit = "stub_mmap_write"
-(* getpagesize: unit -> size of page *)
 external unmap': mmap_interface -> unit = "stub_mmap_final"
 (* getpagesize: unit -> size of page *)
 let make ?(unmap=unmap') interface = interface, unmap

Are comments supposed to be above or below the declaration?  The double getpagesize and missing unmap comment looks like a copy&paste mistake in the past.

~Andrew

#23 lore raw
In reply to Andrew Cooper
Quoted 11 lines · Andrew Cooper
Quoted 10 lines · Edwin Torok
Quoted 1 line · Andrew Cooper
tools/ocaml/xenstored/disk.ml +0 -0
index 59794324e1..b7678af87f 100644
@@ -176,7 +176,7 @@ let write store =
            output_byte ch i
 
Quoted 7 lines

tools/ocaml/xenstored/disk.ml let write store = · line 179

Quoted 3 lines
tools/ocaml/xenstored/disk.ml +1 -1
        let w32 ch v =
-           assert (v >= 0 && v <= 0xFFFF_FFFF);
+           assert (v >= 0 && Int64.of_int v <= 0xFFFF_FFFFL);

In the case that v is 32 bits wide, it will underflow and fail the v

Quoted 1 line

=

0 check, before the upcast to Int64.

I'll have to review the callers of this, I think my intention was to forbid dumping negative values because it is ambigous what it means. In case you are running on 64-bit that is most likely a bug because I think most 32-bit values were defined as unsigned in the migration spec or in the original xen public headers (I'll have to double check).

However in case of a 32-bit system we can have negative values where an otherwise unsigned 32-bit quantity in xen is represented as an ocaml int, or even silently truncated (if the xen value actually uses all 32- bits, because OCaml ints are only 31-bits on 32-bit systems, one would have to use the int32 type to get true 32-bit quantities in ocaml but that comes with additional boxing and a more complicated syntax, so in most places in Xen I see the difference just being ignored).

Perhaps this should forbid negative values only on 64-bit systems (where that would be a bug), and allow it on 32-bit systems (where a negative value might be legitimate or a bug, we can't tell). Checking Sys.word_size should tell us what system we are on.

Best regards,
--Edwin