package qcow
Support for Qcow2 images
Install
Dune Dependency
Authors
Maintainers
Sources
qcow-0.12.1.tbz
sha256=c799f3c2eda00b345d37ccd759bcd7b8be8744216b77a38883ff4cd99727ae37
sha512=2160598f460240f9580991e7f7d69e3ef83a2e6ec62268b711840d359cd303d4e14a5d65d89ceb82a6f77b434d06a01af9daa7780808a885f3307909c11dcfd8
Description
README
Ocaml support for Qcow2 images
Please read the API documentation.
Features
- supports
resize
- exposes sparseness information
- produces files which can be understood by qemu (although not in reverse since we don't support many features)
Example
In a top-level like utop:
# #require "io-page.unix";;
# #require "mirage-block";;
# #require "mirage-block-ramdisk";;
# #require "qcow";;
# #require "lwt.syntax";;
# lwt t_or_error = Ramdisk.create ~name:"hello" ~size_sectors:1024L ~sector_size:512;;
val t_or_error : [ `Error of Ramdisk.error | `Ok of Ramdisk.t ] = `Ok <abstr>
# let t = Mirage_block.Error.ok_exn t_or_error;;
val t : Ramdisk.t = <abstr>
# module Qcow_on_ramdisk = Qcow.Make(Ramdisk);;
module Qcow_on_ramdisk : sig type page_aligned_buffer = Ramdisk.page_aligned_buffer
type error =
[ `Disconnected | `Is_read_only | `Unimplemented | `Unknown of bytes ]
type 'a io = 'a Ramdisk.io
type t = Qcow.Make(Ramdisk).t
type id = Qcow.Make(Ramdisk).id
val disconnect : t -> unit io
type info =
Qcow.Make(Ramdisk).info = {
read_write : bool;
sector_size : int;
size_sectors : int64;
}
val get_info : t -> info io
val read :
t ->
int64 -> page_aligned_buffer list -> [ `Error of error | `Ok of unit ] io
val write :
t ->
int64 -> page_aligned_buffer list -> [ `Error of error | `Ok of unit ] io
val create : Ramdisk.t -> int64 -> [ `Error of error | `Ok of t ] io
val connect : Ramdisk.t -> t io
val resize : t -> int64 -> [ `Error of error | `Ok of unit ] io
val seek_unmapped : t -> int64 -> [ `Error of error | `Ok of int64 ] io
val seek_mapped : t -> int64 -> [ `Error of error | `Ok of int64 ] io
val rebuild_refcount_table : t -> [ `Error of error | `Ok of unit ] io
val header : t -> Qcow.Header.t
module Debug :
sig
type t = Qcow.Make(Ramdisk).t
type error = error
val check_no_overlaps : t -> [ `Error of error | `Ok of unit ] io
val set_next_cluster : t -> int64 -> unit
end
end
# lwt t_or_error = Qcow_on_ramdisk.create t 1048576L;;
val t_or_error : [ `Error of Qcow_on_ramdisk.error | `Ok of Qcow_on_ramdisk.t ]
= `Ok <abstr>
# let t = Mirage_block.Error.ok_exn t_or_error;;
val t : Qcow_on_ramdisk.t = <abstr>
# let page = Io_page.(to_cstruct (get 1));;
val page : Ramdisk.page_aligned_buffer =
{Cstruct.buffer = <abstr>; off = 0; len = 4096}
# lwt result_or_error = Qcow_on_ramdisk.read t 0L [ page ];;
val result_or_error : [ `Error of Ramdisk.error | `Ok of unit ] = `Ok ()
# lwt ok_or_error = Mirage_block.sparse_copy (module Ramdisk) t (module Ramdisk) t;;
val ok_or_error :
[ `Error of [> `Different_sizes | `Is_read_only | `Msg of bytes ]
| `Ok of unit ] = `Ok ()
Limitations
- cluster size is fixed at 64-bits
- no support for snapshots
Dependencies (22)
- ppx_sexp_conv
- ppx_deriving
- sha
- stdlib-shims
- unix-type-representations
- prometheus
- astring
-
fmt
>= "0.8.2"
- logs
- sexplib
- mirage-sleep
- mirage-block-combinators
-
mirage-block-unix
>= "2.5.0"
-
mirage-block
>= "3.0.0"
-
lwt
>= "5.5.0"
-
io-page
>= "2.4.0"
- result
-
cstruct
>= "3.4.0"
- base-bytes
-
qcow-types
= version
-
ocaml
>= "4.12.0"
-
dune
>= "3.18"
Dev Dependencies (4)
-
odoc
with-doc
-
ezjsonm
with-test
-
mirage-block-ramdisk
with-test & >= "0.5"
-
ounit
with-test
Used by (1)
-
qcow-tool
>= "0.12.1"
Conflicts
None
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page