mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block: qcow: Add pread_alloc and decompress_cluster helpers
Add two reusable helpers for the compressed cluster read path: - pread_alloc(fd, offset, len) allocates a buffer and fills it with pread_exact, returning the owned Vec. - decompress_cluster(compressed, cluster_size, decoder) allocates the output buffer, decodes via the Decoder trait, and validates that the decoder produced exactly cluster_size bytes. These will be used by QcowSync, QcowAsync, Qcow2Backing, and the legacy QcowFile. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
78a05ab0c1
commit
d9b188c1be
@@ -5,7 +5,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
|
||||
|
||||
pub(crate) mod backing;
|
||||
mod decoder;
|
||||
pub(crate) mod decoder;
|
||||
mod header;
|
||||
pub(crate) mod metadata;
|
||||
pub(crate) mod qcow_raw_file;
|
||||
|
||||
Reference in New Issue
Block a user