Fix Qemu probes for disk format and zero-byte skipping support - #14272
Open
sureshanaparti wants to merge 3 commits into
Open
sureshanaparti wants to merge 3 commits into
sureshanaparti wants to merge 3 commits into
Conversation
…pport probe
Due to changes in the format of `qemu-img --help` in Qemu 10.x, the previous logic always returns false, as --target-is-zero is no longer a top-level suggested flag.
The flag continues showing in qemu-img convert --help however. The whole skipZero feature appears unused by native CloudStack, but this preserves the support while remaining backwards compatible with Qemu 8.x
ie:
```
$ qemu-img --version && qemu-img convert --help | grep target-is-zero
qemu-img version 10.1.0 (qemu-kvm-10.1.0-17.el9_8.5)
Copyright (c) 2003-2025 Fabrice Bellard and the QEMU Project developers
[-n] [--target-is-zero] [-c]
--target-is-zero
```
```
$ qemu-img --version && qemu-img convert --help | grep target-is-zero
qemu-img version 8.2.0 (qemu-kvm-8.2.0-11.el9_4)
Copyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers
convert [--object objectdef] [--image-opts] [--target-image-opts] [--target-is-zero] [--bitmaps] [-U] [-C] [-c] [-p] [-q] [-n] [-f fmt] [-t cache] [-T src_cache] [-O output_fmt] [-B backing_file [-F backing_fmt]] [-o options] [-l snapshot_param] [-S sparse_size] [-r rate_limit] [-m num_coroutines] [-W] [--salvage] filename [filename2 [...]] output_filename
```
Due to changes in the format of `qemu-img --help` in Qemu 10.x, the previous logic always returns false: ``` $ qemu-img --help ... Supported image formats: blkdebug blklogwrites blkverify compress copy-before-write copy-on-read file ftp ftps host_cdrom host_device http https io_uring luks nbd null-aio null-co nvme nvme-io_uring preallocate qcow2 quorum raw rbd snapshot-access throttle vdi vhdx virtio-blk-vfio-pci virtio-blk-vhost-user virtio-blk-vhost-vdpa vmdk vpc ``` The approach of doing a create -f $format -o help and relying on the exit code is more robust as a first level probe
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
Author
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.22 #14272 +/- ##
============================================
- Coverage 18.00% 17.99% -0.02%
+ Complexity 16219 16214 -5
============================================
Files 5936 5936
Lines 535716 535721 +5
Branches 65596 65597 +1
============================================
- Hits 96459 96392 -67
- Misses 428268 428346 +78
+ Partials 10989 10983 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19354 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes two Qemu feature detection probes that broke between Qemu 8.x and Qemu 10.x:
Disk format support
Due to changes in the format of
qemu-img --helpin Qemu 10.x, the previous logic always returns false:The approach of doing a create -f $format -o help and relying on the exit code is more robust as a first level probe
--target-is-zero support
Due to changes in the format of
qemu-img --helpin Qemu 10.x, the previous logic always returns false, as --target-is-zero is no longer a top-level suggested flag.The flag continues showing in qemu-img convert --help however. The whole skipZero feature appears unused by native CloudStack, but this preserves the support while remaining backwards compatible with Qemu 8.x
ie:
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?