Skip to content

feat:support convert qcow2 img to overlaybd#407

Merged
BigVan merged 2 commits into
containerd:mainfrom
xiecl666:feature/support_qcow2
Jun 18, 2026
Merged

feat:support convert qcow2 img to overlaybd#407
BigVan merged 2 commits into
containerd:mainfrom
xiecl666:feature/support_qcow2

Conversation

@xiecl666

Copy link
Copy Markdown
Contributor

To support sandbox,qcow2 img converter is necessary.

Comment thread src/tools/qcow2converter.h Outdated
@xiecl666 xiecl666 force-pushed the feature/support_qcow2 branch 2 times, most recently from 902145d to 1611bea Compare June 15, 2026 10:06
@xiecl666 xiecl666 force-pushed the feature/support_qcow2 branch from 1611bea to 321a234 Compare June 15, 2026 10:08
Comment thread src/tools/overlaybd-apply.cpp Outdated
app.add_option("--checksum", sha256_checksum, "sha256 checksum for origin uncompressed data");
app.add_option("input_path", input_path, "input OCIv1 tar layer path")->type_name("FILEPATH")->check(CLI::ExistingFile)->required();

app.add_option("input_path", input_path, "input OCIv1 tar layer path")->type_name("FILEPATH")->check(CLI::ExistingFile);

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.

please update the description.

Comment thread src/tools/qcow2converter.cpp Outdated
const auto &cm = mappings[i];

if (verbose && (i % 1000 == 0 || i == mappings.size() - 1)) {
printf("\r Processing cluster %zu/%zu (%.1f%%)...",

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.

remove the process bar...

Comment thread src/tools/qcow2converter.cpp Outdated
@@ -0,0 +1,1072 @@
/*
* qcow2converter.cpp - Convert QCOW2 images to LSMT (zfile-compressed) format

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.

It changes qcow2 to LSMTFile without compression?

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds QCOW2→OverlayBD conversion support to enable sandbox workflows by letting overlaybd-apply ingest a QCOW2 image and write it into an existing OverlayBD ImageFile.

Changes:

  • Introduces qcow2converter (reader + partition/rootfs filtering + writer into IFile).
  • Adds --from_qcow2 mode to overlaybd-apply to trigger QCOW2 conversion instead of tar apply.
  • Updates tools build to compile qcow2converter.cpp into overlaybd-apply.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 12 comments.

File Description
src/tools/qcow2converter.h Declares the QCOW2→IFile conversion entrypoint and default block size.
src/tools/qcow2converter.cpp Implements QCOW2 parsing, optional rootfs extraction, and writing clusters into OverlayBD ImageFile.
src/tools/overlaybd-apply.cpp Adds CLI flag and calls converter to populate the image from a QCOW2 input.
src/tools/CMakeLists.txt Adds converter source to overlaybd-apply build.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/tools/qcow2converter.h
Comment thread src/tools/qcow2converter.cpp
Comment thread src/tools/qcow2converter.cpp
Comment thread src/tools/qcow2converter.cpp
Comment thread src/tools/qcow2converter.cpp Outdated
Comment thread src/tools/qcow2converter.cpp Outdated
Comment thread src/tools/overlaybd-apply.cpp Outdated
Comment thread src/tools/overlaybd-apply.cpp Outdated
Comment thread src/tools/overlaybd-apply.cpp
Comment thread src/tools/CMakeLists.txt Outdated
@xiecl666 xiecl666 force-pushed the feature/support_qcow2 branch 2 times, most recently from 7d67cd0 to 6884121 Compare June 17, 2026 01:52
Comment thread src/tools/qcow2converter.cpp Outdated
@xiecl666 xiecl666 force-pushed the feature/support_qcow2 branch from ad1915f to 7abac8d Compare June 18, 2026 06:11
@BigVan BigVan merged commit 79981d3 into containerd:main Jun 18, 2026
2 checks passed
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