package vhd-format

  1. Overview
  2. Docs
Pure OCaml library to read/write VHD format data

Install

Dune Dependency

Authors

Maintainers

Sources

vhd-format-0.12.3.tbz
sha256=e3da58f79172f7c55d8b07cea100358771248b435baf5fbe941e61e6d0840730
sha512=3af8d9f618266c5bd9c65e1b81c97c6e68c07ab84b8031dbef691ac7775fe7ea308be995dfdba8a785f404aeb44a3e094c78861f1e9f8d8321a1110c1da64fd5

Description

A pure OCaml library to read and write vhd format data, plus a simple command-line tool which allows vhd files to be interrogated, manipulated, format-converted and streamed to and from files and remote servers.

Tags

org:mirage org:xapi-project

Published: 20 Jun 2022

README

ocaml-vhd

A pure OCaml library to read and write vhd format data, plus a simple command-line tool which allows vhd files to be interrogated, manipulated, format-converted and streamed to and from files and remote servers.

Example usage

To initialise your environment in utop:

open Lwt;;
#require "vhd-format";;
#require "vhd-format-lwt";;
module V = Vhd.Make(Vhd_lwt);;

To open a file and read the first sector:

V.Vhd_IO.openfile "foo.vhd" >>= fun f -> V.Vhd_IO.read_sector f 0L;;
- : Cstruct.t option = Some {Cstruct.buffer = <abstr>; off = 0; len = 512}   

To read the vhd file header:

V.Vhd_IO.openfile "89a62601-c82a-447a-a7fd-f7f379195e80.vhd" >>= fun f -> return f.Vhd.Vhd.header;;
- : Vhd.Header.t = {
 Vhd.Header.table_offset = 1536L; max_table_entries = 12288;
 block_size_sectors_shift = 12; checksum = -3001l; parent_unique_id = <abstr>;  
 parent_time_stamp = 0l; parent_unicode_name = [||];
 parent_locators =
  [|{Vhd.Parent_locator.platform_code = Vhd.Platform_code.None;
     platform_data_space = 0l; platform_data_space_original = 0l;
     platform_data_length = 0l; platform_data_offset = 0L;
     platform_data = {Cstruct.buffer = <abstr>; off = 0; len = 0}};
    {Vhd.Parent_locator.platform_code = Vhd.Platform_code.None;
     platform_data_space = 0l; platform_data_space_original = 0l;
     platform_data_length = 0l; platform_data_offset = 0L;
     platform_data = {Cstruct.buffer = <abstr>; off = 0; len = 0}};
    {Vhd.Parent_locator.platform_code = Vhd.Platform_code.None;
     platform_data_space = 0l; platform_data_space_original = 0l;
     platform_data_length = 0l; platform_data_offset = 0L;
     platform_data = {Cstruct.buffer = <abstr>; off = 0; len = 0}};
    {Vhd.Parent_locator.platform_code = Vhd.Platform_code.None;
     platform_data_space = 0l; platform_data_space_original = 0l;
     platform_data_length = 0l; platform_data_offset = 0L;
     platform_data = {Cstruct.buffer = <abstr>; off = 0; len = 0}};
    {Vhd.Parent_locator.platform_code = Vhd.Platform_code.None;
     platform_data_space = 0l; platform_data_space_original = 0l;
     platform_data_length = 0l; platform_data_offset = 0L;
     platform_data = {Cstruct.buffer = <abstr>; off = 0; len = 0}};
    {Vhd.Parent_locator.platform_code = Vhd.Platform_code.None;
     platform_data_space = 0l; platform_data_space_original = 0l;
     platform_data_length = 0l; platform_data_offset = 0L;
     platform_data = {Cstruct.buffer = <abstr>; off = 0; len = 0}};
    {Vhd.Parent_locator.platform_code = Vhd.Platform_code.None;
     platform_data_space = 0l; platform_data_space_original = 0l;
     platform_data_length = 0l; platform_data_offset = 0L;
     platform_data = {Cstruct.buffer = <abstr>; off = 0; len = 0}};
    {Vhd.Parent_locator.platform_code = Vhd.Platform_code.None;
     platform_data_space = 0l; platform_data_space_original = 0l;
     platform_data_length = 0l; platform_data_offset = 0L;
     platform_data = {Cstruct.buffer = <abstr>; off = 0; len = 0}}|]}

Dependencies (8)

  1. ppx_cstruct build & >= "3.0.0"
  2. dune >= "1.0"
  3. stdlib-shims
  4. uuidm >= "0.9.6"
  5. rresult >= "0.3.0"
  6. io-page
  7. cstruct >= "1.9" & < "6.1.0"
  8. ocaml >= "4.03.0"

Dev Dependencies

None

Used by (3)

  1. vhd-format-lwt >= "0.12.0"
  2. vhd-tool >= "0.12.0"
  3. xen-disk

Conflicts

None

OCaml

Innovation. Community. Security.