From 1cf232715485bf95d4d20176ee6a622f9b6a6b9f Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Fri, 1 Nov 2019 12:04:18 +0100 Subject: [PATCH 1/2] adapt to mirage-block 2.0.0 API --- .travis.yml | 5 ++--- lib/back/blkback.ml | 2 +- lib/back/dune | 2 +- lib/front/blkfront.ml | 4 ---- lib/front/blkfront.mli | 2 +- lib/front/dune | 2 +- mirage-block-xen.opam | 4 ++-- 7 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6507830..a9b41d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,6 @@ env: global: - PACKAGE="mirage-block-xen" matrix: - - DISTRO="alpine" OCAML_VERSION="4.04" - - DISTRO="alpine" OCAML_VERSION="4.05" - DISTRO="alpine" OCAML_VERSION="4.06" - - DISTRO="ubuntu" OCAML_VERSION="4.07" + - DISTRO="alpine" OCAML_VERSION="4.07" + - DISTRO="ubuntu" OCAML_VERSION="4.08" diff --git a/lib/back/blkback.ml b/lib/back/blkback.ml index 7bff30f..c666476 100644 --- a/lib/back/blkback.ml +++ b/lib/back/blkback.ml @@ -102,7 +102,7 @@ let is_writable req = match req.Req.op with Log.err (fun f -> f "FATAL: unhandled request type %s" (Req.string_of_op op)); failwith "unhandled request type" -module Make(A: ACTIVATIONS)(X: Xs_client_lwt.S)(B: Mirage_block_lwt.S) = struct +module Make(A: ACTIVATIONS)(X: Xs_client_lwt.S)(B: Mirage_block.S) = struct module BlockError = struct open Lwt diff --git a/lib/back/dune b/lib/back/dune index 18d1830..e868502 100644 --- a/lib/back/dune +++ b/lib/back/dune @@ -5,5 +5,5 @@ (flags :standard -w -3) (libraries logs lwt cstruct io-page shared-memory-ring shared-memory-ring-lwt mirage-block-xen xen-evtchn xenstore - xenstore.client mirage-block-lwt rresult mirage-xen) + xenstore.client mirage-block rresult mirage-xen) (wrapped false)) diff --git a/lib/front/blkfront.ml b/lib/front/blkfront.ml index e514e16..a1a9718 100644 --- a/lib/front/blkfront.ml +++ b/lib/front/blkfront.ml @@ -27,10 +27,6 @@ let src = Logs.Src.create "blkfront" ~doc:"Mirage Xen blkfront" module Log = (val Logs.src_log src : Logs.LOG) -type 'a io = 'a Lwt.t - -type page_aligned_buffer = Cstruct.t - type transport = { backend_id: int; backend: string; diff --git a/lib/front/blkfront.mli b/lib/front/blkfront.mli index 5d87048..b3ecd2e 100644 --- a/lib/front/blkfront.mli +++ b/lib/front/blkfront.mli @@ -13,5 +13,5 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *) -include Mirage_block_lwt.S +include Mirage_block.S val connect : string -> t Lwt.t diff --git a/lib/front/dune b/lib/front/dune index 5aa0641..bcb1781 100644 --- a/lib/front/dune +++ b/lib/front/dune @@ -2,7 +2,7 @@ (name mirage_block_xen_front) (public_name mirage-block-xen.front) (modules Blkfront Block) - (libraries logs stringext lwt cstruct mirage-block-lwt io-page + (libraries logs stringext lwt cstruct mirage-block io-page io-page-xen shared-memory-ring shared-memory-ring-lwt mirage-block-xen xen-evtchn mirage-xen) (wrapped false)) diff --git a/mirage-block-xen.opam b/mirage-block-xen.opam index 29c26b1..7689b0b 100644 --- a/mirage-block-xen.opam +++ b/mirage-block-xen.opam @@ -7,7 +7,7 @@ homepage: "https://github.com/mirage/mirage-block-xen" doc: "https://mirage.github.io/mirage-block-xen/" bug-reports: "https://github.com/mirage/mirage-block-xen/issues" depends: [ - "ocaml" {>= "4.02.0"} + "ocaml" {>= "4.06.0"} "dune" "cmdliner" "logs" @@ -16,7 +16,7 @@ depends: [ "cstruct" {>= "1.9.0"} "ppx_cstruct" {build & >= "3.6.0"} "shared-memory-ring-lwt" - "mirage-block-lwt" {>= "1.0.0"} + "mirage-block" {>= "2.0.0"} "ipaddr" "io-page-xen" {>= "2.0.0"} "mirage-xen" {>= "4.0.0"} From 11479f7fbd54654d45212c56454735778bbe2507 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Fri, 1 Nov 2019 12:04:24 +0100 Subject: [PATCH 2/2] mirage-xen 5.0.0 updates --- lib/back/blkback.ml | 3 +-- lib/core/blkproto.ml | 2 -- lib/core/blkproto.mli | 2 +- lib/core/dune | 2 +- lib/front/blkfront.ml | 4 +--- mirage-block-xen.opam | 2 +- 6 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/back/blkback.ml b/lib/back/blkback.ml index c666476..df06a3e 100644 --- a/lib/back/blkback.ml +++ b/lib/back/blkback.ml @@ -44,7 +44,6 @@ end open Lwt open Blkproto -module OS = Os_xen module Gntref = OS.Xen.Gntref type ops = { @@ -307,7 +306,7 @@ let init xe domid ring_info ops = on_cancel th (fun () -> let counter = ref 0 in Ring.Rpc.Back.ack_requests ring (fun _ -> incr counter); - if !counter <> 0 then Log.err (fun f-> f "FATAL: before unmapping, there were %d outstanding requests on the ring. Events lOSt?" !(counter)); + if !counter <> 0 then Log.err (fun f-> f "FATAL: before unmapping, there were %d outstanding requests on the ring. Events lost?" !(counter)); let () = OS.Xen.Import.Local_mapping.unmap_exn mapping in () ); th, stats diff --git a/lib/core/blkproto.ml b/lib/core/blkproto.ml index 7dd5c89..ccb781a 100644 --- a/lib/core/blkproto.ml +++ b/lib/core/blkproto.ml @@ -15,8 +15,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *) -module OS = Os_xen - let ( >>= ) x f = match x with | Error _ as y -> y | Ok x -> f x diff --git a/lib/core/blkproto.mli b/lib/core/blkproto.mli index e2a6fdf..bd823e2 100644 --- a/lib/core/blkproto.mli +++ b/lib/core/blkproto.mli @@ -57,7 +57,7 @@ end module Req : sig type seg = { - gref : Os_xen.Xen.Gntref.t; + gref : OS.Xen.Gntref.t; first_sector : int; last_sector : int; } diff --git a/lib/core/dune b/lib/core/dune index a88ac48..ee6d34e 100644 --- a/lib/core/dune +++ b/lib/core/dune @@ -2,7 +2,7 @@ (name mirage_block_xen) (public_name mirage-block-xen) (modules Blkproto Device_number) - (libraries cstruct io-page mirage-xen.internals) + (libraries cstruct io-page mirage-xen) (wrapped false) (preprocess (pps ppx_cstruct))) diff --git a/lib/front/blkfront.ml b/lib/front/blkfront.ml index a1a9718..9009695 100644 --- a/lib/front/blkfront.ml +++ b/lib/front/blkfront.ml @@ -19,9 +19,7 @@ open Lwt open Printf open Mirage_block open Blkproto -open Os_xen - -module OS = Os_xen +open OS let src = Logs.Src.create "blkfront" ~doc:"Mirage Xen blkfront" diff --git a/mirage-block-xen.opam b/mirage-block-xen.opam index 7689b0b..222341a 100644 --- a/mirage-block-xen.opam +++ b/mirage-block-xen.opam @@ -19,7 +19,7 @@ depends: [ "mirage-block" {>= "2.0.0"} "ipaddr" "io-page-xen" {>= "2.0.0"} - "mirage-xen" {>= "4.0.0"} + "mirage-xen" {>= "5.0.0"} "rresult" ] build: [