sureshanaparti opened a new pull request, #14272:
URL: https://github.com/apache/cloudstack/pull/14272
### Description
This PR fixes two Qemu feature detection probes that broke between Qemu 8.x
and Qemu 10.x:
- Disk format support
- Zero-bytes skipping
### Disk format support
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
### --target-is-zero support
> Note: From what I can tell, this is unused in native CloudStack plugins,
but I figured this is easier to upstream if fixing this at the same time
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
```
<!--- Describe your changes in DETAIL - And how has behaviour functionally
changed. -->
<!-- For new features, provide link to FS, dev ML discussion etc. -->
<!-- In case of bug fix, the expected and actual behaviours, steps to
reproduce. -->
<!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be
closed when this PR gets merged -->
<!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
<!-- Fixes: # -->
<!---
*******************************************************************************
-->
<!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE
DOCUMENTATION. -->
<!--- PLEASE PUT AN 'X' in only **ONE** box -->
<!---
*******************************************************************************
-->
### Types of changes
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] Build/CI
- [ ] Test (unit or integration test code)
### Feature/Enhancement Scale or Bug Severity
#### Feature/Enhancement Scale
- [ ] Major
- [x] Minor
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [ ] Minor
- [ ] Trivial
### Screenshots (if appropriate):
### How Has This Been Tested?
<!-- Please describe in detail how you tested your changes. -->
<!-- Include details of your testing environment, and the tests you ran to
-->
#### How did you try to break this feature and the system with this change?
<!-- see how your change affects other areas of the code, etc. -->
<!-- Please read the
[CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
document -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]