Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add more resiliency to disk image format handling - #7728

Merged
likebreath merged 4 commits into
cloud-hypervisor:mainfrom
rbradford:202602/image-type-resiliency
Feb 19, 2026
Merged

likebreath merged 4 commits into
cloud-hypervisor:mainfrom
rbradford:202602/image-type-resiliency

Conversation

@rbradford

Copy link
Copy Markdown
Member
  • vmm: Improve resiliency of image type handling
  • vmm, virtio-devices: Deny zero sector writes for autodetected raw images
  • vhost_user_blk: Disable use of backing files in test implementation
  • virtio-devices, block: Reject sector 0 discard/"write zeroes" requests

@rbradford
rbradford requested a review from a team as a code owner February 19, 2026 20:13
@likebreath
likebreath force-pushed the 202602/image-type-resiliency branch 2 times, most recently from 1a11d53 to 3cb6aac Compare February 19, 2026 21:10
Add an image_type to DiskConfig to specify the image type. If none is
specified autodetect the image type but disable potentially unsafe
behaviour in the QCOW2 backend by disabling the backing file support.

If the image type is autodetected then fix it in the config so that it
will be persistant across reboots and migrations/snapshot & restores.
This also handles the case where the image type was not specified as
part of the disk configuration.

Signed-off-by: Rob Bradford <[email protected]>
If the disk image was autodetected to raw (not specified with image_type
= 0) then in the virtio-block subsystem generate errors for writes to
block 0 (treat as if read-only). This gives an immediate error vs using
the image implementations in the block subsystem.

Signed-off-by: Rob Bradford <[email protected]>
Remove the use of QCOW2 backing files in the test implementation used
for CI.

Signed-off-by: Rob Bradford <[email protected]>
As well as rejecting writes to sector 0 in the case of raw files where
the user hasn't specified the image_type also reject virtio requests of
type discard and write_zeroes.

Signed-off-by: Rob Bradford <[email protected]>
@rbradford
rbradford force-pushed the 202602/image-type-resiliency branch from 3cb6aac to a33bfb4 Compare February 19, 2026 21:48
@likebreath
likebreath enabled auto-merge February 19, 2026 22:37
@likebreath
likebreath added this pull request to the merge queue Feb 19, 2026
Merged via the queue into cloud-hypervisor:main with commit a63315d Feb 19, 2026
43 checks passed
@rbradford
rbradford deleted the 202602/image-type-resiliency branch June 12, 2026 10:36
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