Skip to content

Conversation

@Millefeuille42
Copy link
Contributor

Follow up from #719

Fetch block size from VHD header instead of using a hardcoded value. The default hardcoded value of 2MB is still used when creating or in tests.

def calcOverheadBitmap(virtual_size):
num_blocks = virtual_size // VHD_BLOCK_SIZE
if virtual_size % VHD_BLOCK_SIZE:
def calcOverheadBitmap(virtual_size, block_size):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would probably be better as block_size = DEFAULT_VHD_BLOCKSIZE so that only the call sites that need to pass something other than the default need to be modified. Similarly calcSizeVHDLV in lvhdutil.py should have the same default.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 9cdcf61

Signed-off-by: Mathieu Labourier <mathieu.labourier@vates.tech>
@Millefeuille42 Millefeuille42 force-pushed the upstream-use-vhd-header-for-block-size branch from 0b1884a to 9cdcf61 Compare December 8, 2025 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants