Skip to content

Conversation

JSydll
Copy link

@JSydll JSydll commented Oct 6, 2025

Description

Two minor features are added to the QemuDriver:

Support machine-specific options (e.g. -machine virt,secure=on)

While raising an exception for unsupported machines/boards is reasonable, adding machine-specific options shall not break the parsing. Therefore, the check is adjusted to only account for the leading board name.

Support interactions with the QEMU instance via QMP before releasing CPU(s)

Especially for bad case testing, it can be useful to be able to interact with the prepared but not yet spun off instance - e.g. to corrupt the boot medium without the need to build a corrupted image only for that purpose.

For both features, straight forward unit tests are provided.
Lastly, the changeset includes minor documentation updates and the introduction of type hints for the qemudriver.py file.

Checklist

  • Documentation for the feature
  • Tests for the feature
  • PR has been tested

@JSydll JSydll requested a review from krevsbech as a code owner October 6, 2025 04:58
@JSydll JSydll force-pushed the qemudriver/support-extended-test-scenarios branch from 680d6cd to 6d45393 Compare October 6, 2025 04:58
Copy link
Member

@Emantor Emantor left a comment

Choose a reason for hiding this comment

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

Rather than adding a pre-start hook, I think it is more clear to expose somthing like a prepare() function which sets up the qemu process, and than have on() only do the cont monitor command. For backwards compatibility, the class can check whether the self._child attribute exists and call prepare() in on() if that was not done yet.

@JSydll
Copy link
Author

JSydll commented Oct 10, 2025

@Emantor where would you inject the - potentially test case individual - manipulations then? I can't see fit for function overriding here, so I'd expect some sort of callable injection...

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.

2 participants