MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / offset_is_cluster_boundary

Function offset_is_cluster_boundary

block/src/qcow/header.rs:600–605  ·  view source on GitHub ↗

Returns an Error if the given offset doesn't align to a cluster boundary.

(offset: u64, cluster_bits: u32)

Source from the content-addressed store, hash-verified

598
599/// Returns an Error if the given offset doesn't align to a cluster boundary.
600pub(super) fn offset_is_cluster_boundary(offset: u64, cluster_bits: u32) -> Result<()> {
601 if offset & ((0x01 << cluster_bits) - 1) != 0 {
602 return Err(Error::InvalidOffset(offset));
603 }
604 Ok(())
605}

Callers 1

parse_qcowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected