You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "JoaoJandre (via GitHub)" <gi...@apache.org> on 2025/05/20 11:26:10 UTC
[PR] Check Qcow2 version before using --bitmaps [cloudstack]
JoaoJandre opened a new pull request, #10896:
URL: https://github.com/apache/cloudstack/pull/10896
### Description
This PR adds a validation on the volume copy process. Before adding the --bitmaps flag to the convert command, a check is made in the volume to guarantee that the volume is at least version 3; if it is not, the flag is not added.
### Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [X] Bug fix (non-breaking change which fixes an issue)
- [ ] 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
- [ ] Minor
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [X] Minor
- [ ] Trivial
### Screenshots (if appropriate):
### How Has This Been Tested?
Upload image with old compat version, e.g. http://dl.openvm.eu/cloudstack/macchinina/x86_64/macchinina-kvm.qcow2.bz2, attach to VM, stop VM, migrate volume.
Before:
```
Failed to convert [/mnt/b59eff0f-5b97-37ed-a513-9e1983d1d19b/2784ec51-4776-4b03-9a85-198c465e7d25] to [/mnt/a66f48f5-13c6-3676-b320-a15d32bbf32f/2784ec51-4776-4b03-9a85-198c465e7d25] due to: [qemu-img: Source lacks bitmap support]. org.apache.cloudstack.utils.qemu.QemuImgException: qemu-img: Source lacks bitmap support
```
After:
Image is converted successfully as the --bitmaps option is not informed.
#### 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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "rohityadavcloud (via GitHub)" <gi...@apache.org>.
rohityadavcloud commented on PR #10896:
URL: https://github.com/apache/cloudstack/pull/10896#issuecomment-2958147926
@blueorangutan package
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "rohityadavcloud (via GitHub)" <gi...@apache.org>.
rohityadavcloud closed pull request #10896: Check Qcow2 version before using --bitmaps
URL: https://github.com/apache/cloudstack/pull/10896
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10896:
URL: https://github.com/apache/cloudstack/pull/10896#issuecomment-2894252879
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13464
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10896:
URL: https://github.com/apache/cloudstack/pull/10896#issuecomment-2895133274
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13466
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on code in PR #10896:
URL: https://github.com/apache/cloudstack/pull/10896#discussion_r2097723392
##########
services/secondary-storage/server/src/main/java/org/apache/cloudstack/storage/formatinspector/Qcow2Inspector.java:
##########
@@ -108,6 +109,32 @@ public static Map<String, byte[]> unravelQcow2Header(InputStream qcow2InputStrea
return result;
}
+
+ /**
+ * Validates if the file has a minimum version.
+ * @param filePath Path of the file to be validated.
+ * @param minVersion the minimum version that it should contain.
+ * @throws RuntimeException If a IOException is thrown.
+ * @return true if file version is >= minVersion, false otherwise.
+ */
+ public static boolean validateQcow2Version(String filePath, int minVersion) {
+ try (InputStream inputStream = new FileInputStream(filePath)) {
+ for (Qcow2HeaderField qcow2Header : Qcow2HeaderField.values()) {
+ if (qcow2Header != Qcow2HeaderField.VERSION) {
+ skipHeader(inputStream, qcow2Header, filePath);
+ continue;
+ }
+
+ byte[] headerValue = readHeader(inputStream, qcow2Header, filePath);
+ int version = new BigInteger(headerValue).intValue();
+ return version >= minVersion;
+ }
+ } catch (IOException ex) {
+ throw new RuntimeException(String.format("Unable to validate file [%s] due to: ", filePath), ex);
Review Comment:
use `CloudRuntimeException` instead ?
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10896:
URL: https://github.com/apache/cloudstack/pull/10896#issuecomment-2958149751
@rohityadavcloud 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.
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #10896:
URL: https://github.com/apache/cloudstack/pull/10896#issuecomment-2894009080
## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/10896?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 3.97%. Comparing base [(`96b8e23`)](https://app.codecov.io/gh/apache/cloudstack/commit/96b8e23767ec1f01b66641edaa9bc94283e6528a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`0ebe79c`)](https://app.codecov.io/gh/apache/cloudstack/commit/0ebe79cfea1fcbaff03cce2a8411ccf1710fab1c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> :exclamation: There is a different number of reports uploaded between BASE (96b8e23) and HEAD (0ebe79c). Click for more details.
>
> <details><summary>HEAD has 1 upload less than BASE</summary>
>
>| Flag | BASE (96b8e23) | HEAD (0ebe79c) |
>|------|------|------|
>|unittests|1|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #10896 +/- ##
=============================================
- Coverage 16.52% 3.97% -12.56%
=============================================
Files 5717 405 -5312
Lines 506302 32877 -473425
Branches 61440 5834 -55606
=============================================
- Hits 83690 1306 -82384
+ Misses 413235 31421 -381814
+ Partials 9377 150 -9227
```
| [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/10896/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/10896/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `3.97% <ø> (ø)` | |
| [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/10896/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/10896?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10896:
URL: https://github.com/apache/cloudstack/pull/10896#issuecomment-2966019809
<b>[SF] Trillian test result (tid-13504)</b>
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 54874 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10896-t13504-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:
Test | Result | Time (s) | Test File
--- | --- | --- | ---
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #10896:
URL: https://github.com/apache/cloudstack/pull/10896#issuecomment-2894850895
@blueorangutan package
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland merged PR #10896:
URL: https://github.com/apache/cloudstack/pull/10896
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10896:
URL: https://github.com/apache/cloudstack/pull/10896#issuecomment-2895210011
@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "JoaoJandre (via GitHub)" <gi...@apache.org>.
JoaoJandre commented on PR #10896:
URL: https://github.com/apache/cloudstack/pull/10896#issuecomment-2898058393
> [SF] Trillian test result (tid-13366) Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8 Total time taken: 55694 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10896-t13366-kvm-ol8.zip Smoke tests completed. 139 look OK, 2 have errors, 0 did not run Only failed and skipped tests results shown below:
> Test Result Time (s) Test File
> test_08_arping_in_ssvm `Failure` 5.51 test_diagnostics.py
> test_09_arping_in_cpvm `Failure` 5.26 test_diagnostics.py
> test_18_retrieve_cpvm_single_file `Failure` 129.48 test_diagnostics.py
> test_create_pvlan_network `Error` 0.11 test_pvlan.py
Looking at the logs, three of them seem network related. While I don't understand the failure on `test_18_retrieve_cpvm_single_file`; it seems like an issue with the test itself (the command returned a URL but it was not what the test was expecting). In any case, none of the failures seem to be caused by this change.
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10896:
URL: https://github.com/apache/cloudstack/pull/10896#issuecomment-2897226038
<b>[SF] Trillian test result (tid-13366)</b>
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 55694 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10896-t13366-kvm-ol8.zip
Smoke tests completed. 139 look OK, 2 have errors, 0 did not run
Only failed and skipped tests results shown below:
Test | Result | Time (s) | Test File
--- | --- | --- | ---
test_08_arping_in_ssvm | `Failure` | 5.51 | test_diagnostics.py
test_09_arping_in_cpvm | `Failure` | 5.26 | test_diagnostics.py
test_18_retrieve_cpvm_single_file | `Failure` | 129.48 | test_diagnostics.py
test_create_pvlan_network | `Error` | 0.11 | test_pvlan.py
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10896:
URL: https://github.com/apache/cloudstack/pull/10896#issuecomment-2894857257
@weizhouapache 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.
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #10896:
URL: https://github.com/apache/cloudstack/pull/10896#issuecomment-2895205204
@blueorangutan test
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10896:
URL: https://github.com/apache/cloudstack/pull/10896#issuecomment-2963744091
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #10896:
URL: https://github.com/apache/cloudstack/pull/10896#issuecomment-2963738055
@blueorangutan test
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10896:
URL: https://github.com/apache/cloudstack/pull/10896#issuecomment-2958442722
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13685
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10896:
URL: https://github.com/apache/cloudstack/pull/10896#issuecomment-2893999260
@weizhouapache 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.
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #10896:
URL: https://github.com/apache/cloudstack/pull/10896#issuecomment-2893994633
@blueorangutan package
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Check Qcow2 version before using --bitmaps [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #10896:
URL: https://github.com/apache/cloudstack/pull/10896#issuecomment-2971229636
Tested with both ROOT and DATA volumes created from the mentioned image.
--
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: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org