Skip to content

feat(qcow2util): Support Qcow2 subclusters - #170

Open
AnthoineB wants to merge 1 commit into
3.2.12-8.3-develfrom
abs-qcow2util-support-subclusters
Open

AnthoineB wants to merge 1 commit into
3.2.12-8.3-develfrom
abs-qcow2util-support-subclusters

Conversation

@AnthoineB

Copy link
Copy Markdown
Member

Create Qcow2 VDI with subclusters if the parent supports it. Without this patch we copy the large cluster size without extended_l2 set.

calcOverheadEmpty defaults to extended_l2 because subclusters needs more space at equivalent cluster size.

@AnthoineB
AnthoineB requested a review from a team September 16, 2026 15:28
@AnthoineB AnthoineB self-assigned this Sep 16, 2026
Comment thread drivers/qcow2util.py Outdated
@override
def getExtendedL2(self, path: str) -> bool:
self._read_qcow2(path)
return bool(self.header["incompatible_features"] & QCowUtil.QCOW2_INCOMPATIBLE_FEATURE_EXTENDED_L2)

@Wescoeur Wescoeur Sep 16, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nambrok I'm only noticing this now, but why use the name "QCowUtil" throughout the file instead of using self. or cls.? 😅 IMHO it simplifies maintenance in case of renaming.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. I follow the others constants. I will change this.

Comment thread drivers/qcow2util.py Outdated
@Wescoeur
Wescoeur requested a review from a team September 16, 2026 15:51
@AnthoineB
AnthoineB force-pushed the abs-qcow2util-support-subclusters branch from 492d822 to c5476ba Compare September 17, 2026 08:47
@AnthoineB
AnthoineB force-pushed the abs-qcow2util-support-subclusters branch from c5476ba to 8fb96fb Compare September 18, 2026 14:20
Comment thread drivers/qcow2util.py Outdated
@AnthoineB
AnthoineB requested a review from a team September 21, 2026 12:30
Comment thread drivers/qcow2util.py Outdated
Comment thread drivers/qcow2util.py Outdated
Comment thread drivers/qcow2util.py
Comment thread drivers/qcow2util.py Outdated
@AnthoineB
AnthoineB force-pushed the abs-qcow2util-support-subclusters branch 4 times, most recently from cbe9a10 to 515c4ec Compare September 21, 2026 15:16
Comment thread drivers/qcow2util.py
Comment thread drivers/qcow2util.py Outdated
@AnthoineB
AnthoineB force-pushed the abs-qcow2util-support-subclusters branch 2 times, most recently from a34b980 to d120ca3 Compare September 21, 2026 15:24
@Wescoeur
Wescoeur force-pushed the 3.2.12-8.3-devel branch 2 times, most recently from c302395 to 93648e6 Compare September 24, 2026 14:28
@AnthoineB
AnthoineB force-pushed the abs-qcow2util-support-subclusters branch 2 times, most recently from 3e37923 to 66cb747 Compare October 6, 2026 10:00
Create Qcow2 with subclusters if the parent support it.
calcOverheadEmpty defaults to extended_l2 because it needs more space.

Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@vates.tech>
@AnthoineB
AnthoineB force-pushed the abs-qcow2util-support-subclusters branch from 66cb747 to 69c176f Compare October 6, 2026 10:04
Comment thread drivers/qcow2util.py
Comment on lines +149 to +150
if incompatible_features & QCowUtil.IncompatibleFeatures.COMPRESSION_TYPE:
raise ValueError("QCOW2: Image compression is not supported")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for later: this incompatible feature is about non-default compression algorithms specifically; if we are to support compressed clusters in the future, but only with the default algorithm, then we mustn't mark this feature as supported.

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.

3 participants