diff --git a/.travis-ci.sh b/.travis-ci.sh deleted file mode 100755 index 2be6255..0000000 --- a/.travis-ci.sh +++ /dev/null @@ -1,39 +0,0 @@ -OPAM_DEPENDS="xapi-idl async async_inotify core message-switch xapi-storage" -case "$OCAML_VERSION,$OPAM_VERSION" in -3.12.1,1.0.0) ppa=avsm/ocaml312+opam10 ;; -3.12.1,1.1.0) ppa=avsm/ocaml312+opam11 ;; -4.00.1,1.0.0) ppa=avsm/ocaml40+opam10 ;; -4.00.1,1.1.0) ppa=avsm/ocaml40+opam11 ;; -4.01.0,1.0.0) ppa=avsm/ocaml41+opam10 ;; -4.01.0,1.1.0) ppa=avsm/ocaml41+opam11 ;; -*) echo Unknown $OCAML_VERSION,$OPAM_VERSION; exit 1 ;; -esac - -echo "yes" | sudo add-apt-repository ppa:$ppa -sudo apt-get update -qq -sudo apt-get install -qq ocaml ocaml-native-compilers camlp4-extra opam - -export OPAMYES=1 -#export OPAMVERBOSE=1 -echo OCaml version -ocaml -version -echo OPAM versions -opam --version -opam --git-version - -opam init -# ocamlscript doesn't read .ocamlinit so the ocamlfind opam workaround breaks. -# This is a workaround workaround: -opam install ocamlfind -sudo mkdir -p $(ocamlc -where) -eval `opam config env` -sudo cp $OCAML_TOPLEVEL_PATH/topfind $(ocamlc -where) - -opam remote add xapi git://github.com/xapi-project/opam-repo-dev -depext=`opam install -e ubuntu $OPAM_DEPENDS` -sudo apt-get install -qq $depext -opam install ${OPAM_DEPENDS} -eval `opam config env` -make -echo Running make test -make test diff --git a/.travis.yml b/.travis.yml index 1957db9..a0a920e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,6 @@ language: c -script: bash -ex .travis-ci.sh +install: wget https://raw.githubusercontent.com/ocaml/ocaml-travisci-skeleton/master/.travis-opam.sh +script: bash -ex .travis-opam.sh +sudo: true env: - - OCAML_VERSION=4.01.0 OPAM_VERSION=1.1.0 + - OCAML_VERSION=4.01 PACKAGE=xapi-storage-script FORK_USER=djs55 EXTRA_REMOTE=git://github.com/xapi-project/opam-repo-dev diff --git a/CHANGES b/CHANGES index b7d405a..c5a6f5f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +0.2.0 (4-Apr-2015) +- Update to SMAPIv2 with o_direct, o_direct_reason +- Update to using json marshalling for exception backtraces +- Use modern travis configuration +- Add opam file for development + 0.1.2 (19-Oct-2014) - Treat VDI.epoch_{begin,end} as no-ops - Write the pidfile when daemonizing diff --git a/VERSION b/VERSION index d917d3e..0ea3a94 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.2 +0.2.0 diff --git a/main.ml b/main.ml index bcae918..21585b3 100644 --- a/main.ml +++ b/main.ml @@ -42,18 +42,10 @@ let backend_error name args = Exception.rpc_of_exnty exnty let backend_backtrace_error name args error = - match List.zip error.files error.lines with - | None -> backend_error "SCRIPT_FAILED" [ "malformed backtrace in error output" ] - | Some pairs -> - let backtrace = - pairs - |> List.map ~f:(fun (filename, line) -> { B.Interop.filename; line }) - |> B.Interop.to_backtrace - |> B.sexp_of_t - |> Sexplib.Sexp.to_string in - let open Storage_interface in - let exnty = Exception.Backend_error_with_backtrace(name, backtrace :: args) in - Exception.rpc_of_exnty exnty + let error = rpc_of_error error |> Jsonrpc.to_string in + let open Storage_interface in + let exnty = Exception.Backend_error_with_backtrace(name, error :: args) in + Exception.rpc_of_exnty exnty let missing_uri () = backend_error "MISSING_URI" [ "Please include a URI in the device-config" ] @@ -361,7 +353,9 @@ let process root_dir name x = | Storage.D.Types.Tapdisk3 p -> "vbd3", p in let attach_info = { params; - xenstore_data = [ "backend-kind", backend ] + xenstore_data = [ "backend-kind", backend ]; + o_direct = true; + o_direct_reason = ""; } in Deferred.Result.return (R.success (Args.VDI.Attach.rpc_of_response attach_info)) | { R.name = "VDI.activate"; R.params = [ args ] } -> diff --git a/opam b/opam new file mode 100644 index 0000000..c032049 --- /dev/null +++ b/opam @@ -0,0 +1,17 @@ +opam-version: "1" +maintainer: "dave.scott@citrix.com" +build: [ + [make] + [make "install" "BINDIR=%{bin}%" "MANDIR=%{man}%"] +] +remove: [ + [make "uninstall" "BINDIR=%{bin}%" "MANDIR=%{man}%"] +] +depends: [ + "xapi-idl" {>= "0.10.0" } + "xapi-storage" + "async" {= "111.25.00" } + "async_inotify" {= "111.28.00" } + "core" + "message-switch" +]