New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
qemudriver: export get_qemu_base_args method #1212
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1212 +/- ##
========================================
- Coverage 62.9% 62.9% -0.1%
========================================
Files 159 159
Lines 11737 11746 +9
========================================
+ Hits 7388 7393 +5
- Misses 4349 4353 +4
☔ View full report in Codecov by Sentry. |
280a1be
to
e1fb3b6
Compare
This introduces no functional change, but makes it easier to split the function into two in a follow-up commit: - one function to just compute the base command line - one function to actually store the command line into the object along with QMP-specific options Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Next commit will factor command line computation out of on_activate to make it available for use with an interactively started Qemu. Prepare for this by collecting everything that is not applicable to non-QMP usage at the end of the function. No functional change intended. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
For debugging, it can be useful to start an interactive session for the user to access the DUT console. This is possible with real targets through labgrid-client -s STATE console, but no equivalent exists yet for targets using QEMUDriver. Resolving that may be a bigger undertaking, so for now, let's provide a class method get_qemu_base_args, that returns the list of arguments sans QMP parts. Users can then initialize labgrid as usual and call the function to get the command line and start Qemu for interactive use without having to duplicate the labgrid environment parsing as in [1]. [1]: https://github.com/barebox/barebox/blob/v2023.05.0/test/emulate.pl#L226 Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear to me how this is used in the supplied test script? The only caller introduced in the commits is the old location you extracted the function from. Please explain how this works in conjunction with your perl script.
barebox test/emulate.pl duplicates the YAML parsing to be able to run Qemu interactively. This PR is preparation for using existing labgrid infrastructure for that. See here for how it's used: https://lore.barebox.org/barebox/20230619095240.4168216-4-a.fatoum@pengutronix.de/T/#m6e6deb363efc855b0ec77d46d8f2ba6c0f67ff21 My first PR attempt just started QEMU directly. I am open to implement it either way. |
Is this ok? Should I split this PR up, so the non-functional changes can be merged first and I can submti PRs for other Qemu related things? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e1fb3b6
to
318e778
Compare
For debugging, it can be useful to start an interactive session for the
user to access the DUT console. This is possible with real targets
through labgrid-client -s STATE console, but no equivalent exists yet
for targets using QEMUDriver. Resolving that may be a bigger
undertaking, so for now, let's provide a class method
get_qemu_base_args, that returns the list of arguments sans QMP parts.
Users can then initialize labgrid as usual and call the function to
get the command line and start Qemu for interactive use without having
to duplicate the labgrid environment parsing as in 1.
- what do you use the feature for? Start Qemu interactively with same environment yaml used for testing
- how does labgrid benefit as a testing library from the feature? makes debugging failing tests easier
- how did you verify the feature works? I verified tests work and that calling the function starts a usable qemu
Checklist
THis is rebased on #1211 to avoid a conflict.