Skip to content

feat: Add QEMU disk image parameter - #139

Merged
lurtz merged 2 commits into
mainfrom
add-disk-parameter-to-qemu-plugin
Sep 10, 2026
Merged

feat: Add QEMU disk image parameter#139
lurtz merged 2 commits into
mainfrom
add-disk-parameter-to-qemu-plugin

Conversation

@lurtz

@lurtz lurtz commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

For running integration tests the binaries and their data have to be made available in the image.

Mounting the data via an extra image is the easiest and fastest way. It has lesser system requirements compared to e.g. mounting and modifying a QCOW2 image.

Depends on eclipse-score/rules_imagefs#16

Comment thread score/itf/plugins/qemu/qemu.py Outdated
Comment thread MODULE.bazel Outdated
@lurtz
lurtz marked this pull request as ready for review August 25, 2026 08:52
@lurtz
lurtz deployed to workflow-approval August 25, 2026 09:06 — with GitHub Actions Active
@lurtz
lurtz requested a lite review from Copilot August 25, 2026 09:12

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

Adds optional QEMU disk-image support for integration tests, including architecture-aware attachment, overlay handling, and ext4 test fixtures.

Changes:

  • Propagates --qemu-disk through the QEMU plugin and process.
  • Adds disk-image generation and integration coverage.
  • Pins the required imagefs dependency.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Summary Review notes
test/unit/test_qemu.py Tests disk argument generation. Rename the read-only test or add a real read-only assertion.
test/resources/qemu_disk_content.txt Provides disk fixture content.
test/resources/BUILD Builds the ext4 disk image.
test/integration/test_qemu_disk.py Tests disk visibility, mounting, and writing.
test/integration/BUILD Registers disk integration tests. Add the Linux compatibility constraint, including at line 280.
score/itf/plugins/qemu/qemu.py Builds architecture-aware disk arguments.
score/itf/plugins/qemu/qemu_target.py Forwards disk configuration.
score/itf/plugins/qemu/qemu_process.py Passes and logs the disk image.
score/itf/plugins/qemu/__init__.py Adds CLI handling and overlay lifecycle. Ensure both overlay creations are covered by cleanup handling.
MODULE.bazel Pins the required imagefs revision.
Suppressed comments (2)

score/itf/plugins/qemu/qemu.py:175

  • The new architecture-dependent ordering is not covered by the unit tests: the combined test calls __disk_args directly and never exercises __disks_args, including the aarch64 reversal. Add unit assertions through __disks_args() for both machines so a regression in the /dev/vda//dev/vdb mapping is caught without relying only on the manual integration tests.
        if self.__arch_config["block_device_order"] == "descending":
            disks = list(reversed(disks))

test/integration/BUILD:280

  • This test depends on //test/resources:qemu_disk_image, which is explicitly Linux-only (test/resources/BUILD:115). Without a matching target_compatible_with here, analyzing or building this integration target on a non-Linux platform fails on the incompatible data dependency instead of skipping it; add the Linux constraint used by the other host-dependent tests.
py_itf_test(

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread score/itf/plugins/qemu/__init__.py Outdated
Comment thread test/integration/BUILD Outdated
Comment thread test/unit/test_qemu.py Outdated
@lurtz
lurtz deployed to workflow-approval August 25, 2026 09:53 — with GitHub Actions Active
@lurtz
lurtz deployed to workflow-approval September 3, 2026 11:07 — with GitHub Actions Active
@lurtz
lurtz deployed to workflow-approval September 3, 2026 11:14 — with GitHub Actions Active
@lurtz
lurtz deployed to workflow-approval September 3, 2026 11:19 — with GitHub Actions Active
@lurtz
lurtz deployed to workflow-approval September 3, 2026 11:43 — with GitHub Actions Active
@lurtz
lurtz deployed to workflow-approval September 3, 2026 11:49 — with GitHub Actions Active
For running integration tests the binaries and their data have to be made available in the image.

Mounting the data via an extra image is the easiest and fastest way. It has lesser system requirements compared to e.g. mounting and modifying a QCOW2 image.
@lurtz
lurtz force-pushed the add-disk-parameter-to-qemu-plugin branch from d2fbe5b to 94f579b Compare September 3, 2026 11:54
@lurtz
lurtz deployed to workflow-approval September 3, 2026 11:55 — with GitHub Actions Active
@AlexanderLanin
AlexanderLanin requested a balanced review from Copilot September 3, 2026 23:00

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.

🟡 Changes recommended

The optional parameter currently introduces breaking requirements across public QEMU APIs.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 12/13 changed files
  • Comments generated: 4
  • Review effort level: Balanced

port_forwarding,
rootfs,
kernel_cmdline,
disk,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it is optional at the interface of __init__.py, where the default is None. IMHO carrying this into each and every function call with default parameters, makes the code more complicated.

machine,
rootfs,
kernel_cmdline,
disk,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it is optional at the interface of __init__.py, where the default is None. IMHO carrying this into each and every function call with default parameters, makes the code more complicated.

machine=test_config.qemu_config.qemu_machine,
rootfs=test_config.qemu_rootfs,
kernel_cmdline=test_config.qemu_config.qemu_kernel_cmdline,
disk=test_config.qemu_disk,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it is optional at the interface of __init__.py, where the default is None. IMHO carrying this into each and every function call with default parameters, makes the code more complicated.

Comment thread MODULE.bazel Outdated
)
use_repo(imagefs, "score_qnx_x86_64_ifs_toolchain")
imagefs.toolchain(
name = "score_qnx_x86_64_ext4_toolchain",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

@lurtz
lurtz deployed to workflow-approval September 4, 2026 09:50 — with GitHub Actions Active
@draganbjedov
draganbjedov added this pull request to the merge queue Sep 9, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 9, 2026
@lurtz
lurtz added this pull request to the merge queue Sep 10, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 10, 2026
@lurtz
lurtz added this pull request to the merge queue Sep 10, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 10, 2026
@lurtz
lurtz added this pull request to the merge queue Sep 10, 2026
Merged via the queue into main with commit 38ae9a3 Sep 10, 2026
13 checks passed
@lurtz
lurtz deleted the add-disk-parameter-to-qemu-plugin branch September 10, 2026 11:05
@github-project-automation github-project-automation Bot moved this from Backlog to Done in TST - Testing Community Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants