From_file.Vhd_IO
openchain ?path filename
reads the vhd metadata from filename
(and other files on the path from filename
to the root of the tree). If filename
or any of the parent locators have relative paths, then they will be searched for on the ?path.
openfile filename
reads the vhd metadata from filename
, but not any other files on the path to the root of the tree.
val create_dynamic :
filename:string ->
size:int64 ->
?uuid:Uuidm.t ->
?saved_state:bool ->
?features:Feature.t list ->
unit ->
F.fd Vhd.t F.t
create_dynamic ~filename ~size
creates an empty dynamic vhd with virtual size size
bytes and filename filename
.
val create_difference :
filename:string ->
parent:F.fd Vhd.t ->
?relative_path:bool ->
?uuid:Uuidm.t ->
?saved_state:bool ->
?features:Feature.t list ->
unit ->
F.fd Vhd.t F.t
create_difference ~filename ~parent
creates an empty differencing vhd with filename filename
backed by parent parent
.
get_sector_location t sector
returns Some (t', sector')
if the sector
in the virtual disk resides in physical sector'
in the vhd t'
(where t'
may be any vhd on the path from t
to the root of the tree. If no sector is present, this returns None
.
read_sector t sector buffer
: if any data exists at sector
in the virtual disk, reads it into buffer
and returns true. If no data exists (i.e. the data should be interpreted as zeros) the function returns false but does not write into buffer
.