Yu Li
e98ea329bf
block: qcow: read from the backing file if present on read miss
...
Reads to qcow files with backing files will fall through to the backing
file if there is no allocated cluster. As of this change, a write will
still trash the cluster and hide any data already present.
This commit is based on crosvm implementation:
https://chromium.googlesource.com/crosvm/crosvm/+/d8144a56e26ca09e2c7ff97ed63c57e7e7965674
Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com >
2023-07-19 13:52:43 +01:00
Yu Li
081a6ebb51
block: qcow: support opening backing files
...
This commit allows opening qcow with a backing file, which supports any
type implementing `BlockBackend`.
This commit is based on crosvm implementation:
https://chromium.googlesource.com/crosvm/crosvm/+/9ca6039b030a5c83062cfec9a5ff52f42814fa13
Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com >
2023-07-19 13:52:43 +01:00
Yu Li
ffe78c98fd
qcow: bugfix: do not write v3 items to qcow header
...
Fixes: 3f02ccaa8
Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com >
2023-07-19 13:52:43 +01:00
Yu Li
741d640330
block: introduce trait BlockBackend for block types
...
This commit introduces the trait `BlockBackend` with generic ops
including read, write and seek, which can be used for common I/O
interfaces for the block types without using `DiskFile` and `AsyncIo`.
Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com >
2023-07-19 13:52:43 +01:00
Yu Li
447cad3861
block: merge qcow, vhdx and block_util into block crate
...
This commit merges crates `qcow`, `vhdx` and `block_util` into the
crate `block`, which can allow `qcow` to use functions from `block_util`
without introducing a circular crate dependency.
This commit is based on crosvm implementation:
https://chromium.googlesource.com/crosvm/crosvm/+/f2eecc4152eca8d395566cffa2c102ec090a152d
Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com >
2023-07-19 13:52:43 +01:00