Skip to content

Conversation

@weltling
Copy link
Member

In course of handling QCOW issues, things done in this PR

  • Extend tests to cover both zstd and uncompressed backing file code paths
  • Fix path handling for the qemu-img check ... functionality

This PR is yet supposed to fail. Some work is in progress to fix the remaining issues at least in QCOW backing file support. See also the discussion in #7526 (comment)

@weltling weltling requested a review from a team as a code owner November 28, 2025 17:14
@liuw
Copy link
Member

liuw commented Nov 28, 2025

Good catch. I forgot the test infra copies the OS disk.

@liuw
Copy link
Member

liuw commented Nov 28, 2025

This should only be merged until after all bugs in QCOW2 code is fixed.

@weltling
Copy link
Member Author

Yep. Also, it seems to show some more issues than initially expected. Some might be compression specific. Thanks

@liuw
Copy link
Member

liuw commented Nov 28, 2025

qemu-img's manual says vhdx format is supported. Why do you say it is not? I tested that on a deliberately truncated vhdx file and it reported errors as expected.

@weltling
Copy link
Member Author

qemu-img's manual says vhdx format is supported. Why do you say it is not? I tested that on a deliberately truncated vhdx file and it reported errors as expected.

The first run on GH said this


    test common_parallel::test_virtio_block_dynamic_vhdx_expand ... FAILED

    failures:

    failures:
        common_parallel::test_virtio_block_dynamic_vhdx_expand

    test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 131 filtered out; finished in 11.07s

  stderr ───

    thread 'common_parallel::test_virtio_block_dynamic_vhdx_expand' panicked at tests/integration.rs:3532:9:
    qemu-img check failed: qemu-img: This image format does not support checks

https://github.com/cloud-hypervisor/cloud-hypervisor/actions/runs/19770170937/job/56652412276?pr=7527#step:6:969

Could it be some qemu version issue? The container could have some older version, perhaps.

Thanks

@liuw
Copy link
Member

liuw commented Nov 29, 2025

qemu-img's manual says vhdx format is supported. Why do you say it is not? I tested that on a deliberately truncated vhdx file and it reported errors as expected.

The first run on GH said this


    test common_parallel::test_virtio_block_dynamic_vhdx_expand ... FAILED

    failures:

    failures:
        common_parallel::test_virtio_block_dynamic_vhdx_expand

    test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 131 filtered out; finished in 11.07s

  stderr ───

    thread 'common_parallel::test_virtio_block_dynamic_vhdx_expand' panicked at tests/integration.rs:3532:9:
    qemu-img check failed: qemu-img: This image format does not support checks

https://github.com/cloud-hypervisor/cloud-hypervisor/actions/runs/19770170937/job/56652412276?pr=7527#step:6:969

Could it be some qemu version issue? The container could have some older version, perhaps.

Thanks

I verified again my qemu-img (8.2.2) works with VHDX. The VHDX file is generated with the exact same command used in the test case.

This test failed on ARM64. The same test passed on x86. The old code passed on the ARM64 architecture, too. I'm not sure what had changed.

https://github.com/cloud-hypervisor/cloud-hypervisor/actions/runs/19772052947/job/56657969661?pr=7527#step:7:1760

@weltling weltling force-pushed the qcow-fixes-tests-backing branch from 508d165 to 42236de Compare November 29, 2025 09:41
@weltling
Copy link
Member Author

weltling commented Nov 29, 2025

It seems, that the same version of qemu-img is in the test container used on github.

> docker image ls
REPOSITORY                                  TAG          IMAGE ID       CREATED       SIZE
ghcr.io/cloud-hypervisor/cloud-hypervisor   20251114-0   33e41292131c   11 days ago   2.48GB
> docker run -it --rm 33e41292131c /bin/bash
root@1c4c6d21612f:/# qemu-img --version 
qemu-img version 8.2.2 (Debian 1:8.2.2+ds-0ubuntu1.10)
Copyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers

I removed the VHDX exclusion commit, further runs to be observed then. There must have been some other discrepancy.

Thanks

@liuw liuw marked this pull request as draft December 1, 2025 18:00
@weltling
Copy link
Member Author

weltling commented Dec 2, 2025

With the VHDX part, I went to check the aarch64 image and qemu-img there seems ok. Just took a random VHDX image on the net and the check was ok

root@1f88c6bacfb0:/# uname -a
Linux 1f88c6bacfb0 6.8.0-1031-azure #36~22.04.1-Ubuntu SMP Tue Jul  1 03:59:37 UTC 2025 aarch64 aarch64 aarch64 GNU/Linux
root@1f88c6bacfb0:/# wget https://github.com/AndrewRathbun/Anti-Forensics-VHDX/raw/refs/heads/main/Versions/1.0/Anti-Forensics%20Disk%20Image%20v1.0.vhdx
--2025-12-02 15:19:37--  https://github.com/AndrewRathbun/Anti-Forensics-VHDX/raw/refs/heads/main/Versions/1.0/Anti-Forensics%20Disk%20Image%20v1.0.vhdx
Resolving github.com (github.com)... 140.82.116.3
Connecting to github.com (github.com)|140.82.116.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://raw.githubusercontent.com/AndrewRathbun/Anti-Forensics-VHDX/refs/heads/main/Versions/1.0/Anti-Forensics%20Disk%20Image%20v1.0.vhdx [following]
--2025-12-02 15:19:37--  https://raw.githubusercontent.com/AndrewRathbun/Anti-Forensics-VHDX/refs/heads/main/Versions/1.0/Anti-Forensics%20Disk%20Image%20v1.0.vhdx
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.110.133, 185.199.111.133, 185.199.108.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 31457280 (30M) [application/octet-stream]
Saving to: 'Anti-Forensics Disk Image v1.0.vhdx'

Anti-Forensics Disk Image v1.0.vhdx                  100%[====================================================================================================================>]  30.00M   137MB/s    in 0.2s

2025-12-02 15:19:37 (137 MB/s) - 'Anti-Forensics Disk Image v1.0.vhdx' saved [31457280/31457280]

root@1f88c6bacfb0:/# qemu-img check Anti-Forensics\ Disk\ Image\ v1.0.vhdx
No errors were found on the image.
root@1f88c6bacfb0:/# qemu-img info Anti-Forensics\ Disk\ Image\ v1.0.vhdx
image: Anti-Forensics Disk Image v1.0.vhdx
file format: vhdx
virtual size: 25 MiB (26214400 bytes)
disk size: 30 MiB
cluster_size: 2097152
Child node '/file':
    filename: Anti-Forensics Disk Image v1.0.vhdx
    protocol type: file
    file length: 30 MiB (31457280 bytes)
    disk size: 30 MiB

It seems therefore, the case is that VHDX image most likely becomes corrupt enough for the tool to not recognize it as a supported format anymore.

Thanks

The image passed for the guest construction is copied. Previously,
check-img has been checking the unchanged image from the workspace dir,
which is supposed to be error free.

Signed-off-by: Anatol Belski <[email protected]>
@weltling weltling force-pushed the qcow-fixes-tests-backing branch from 42236de to 26ec153 Compare December 2, 2025 15:44
@weltling
Copy link
Member Author

weltling commented Dec 2, 2025

The issue with test_virtio_block_dynamic_vhdx_expand is fixed now. It turned out to be checking a wrong disk.

Thanks!

@weltling
Copy link
Member Author

weltling commented Dec 3, 2025

These test changes have been pulled into #7537 to cover the bugfix patches. Hence, closing this PR.

Thanks

@weltling weltling closed this Dec 3, 2025
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