Skip to content

Conversation

@liuw
Copy link
Member

@liuw liuw commented Dec 24, 2024

There are several issues I discovered while trying to debug the SEG_MAX feature on VHDX.

  1. Cloud Hypervisor cannot open a VHDX image in read-only mode.
  2. Cloud Hypervisor corrupts the VHDX image after it is used once.
  3. VHDX code cannot handle multiple segments.

All are fixed in this series.

I used QEMU as a reference. The image still works with QEMU after it's used by CH.

liuw added 6 commits December 22, 2024 07:37
The original code was buggy. It always attempted to update the header,
even when the file was opened as read-only. That led to an error.

The specification states that the headers should be updated when the
first user visible write happens. We can just drop the incorrect code.

Signed-off-by: Wei Liu <[email protected]>
The checksum field in the original buffer should be zeroed.

The code was zeroing a temporary buffer. That's wrong.

Signed-off-by: Wei Liu <[email protected]>
It doesn't need to be public. None of its code path returns an error.

Signed-off-by: Wei Liu <[email protected]>
It doesn't make sense to open code the same calculation when there is
already a helper function.

Signed-off-by: Wei Liu <[email protected]>
@liuw liuw requested a review from a team as a code owner December 24, 2024 21:54
This is needed to handle multiple reads or writes in a loop.

Signed-off-by: Wei Liu <[email protected]>
Copy link
Member

@rbradford rbradford left a comment

Choose a reason for hiding this comment

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

Thanks!

@rbradford rbradford added this pull request to the merge queue Dec 28, 2024
Merged via the queue into cloud-hypervisor:main with commit ef88b27 Dec 29, 2024
38 checks passed
@likebreath likebreath added the bug-fix Bug fix to include in release notes label Jan 30, 2025
@liuw liuw deleted the fix-vhdx branch July 1, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix Bug fix to include in release notes

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants