labgrid/qemudriver: tie QEMU and QMP monitor start/stop to on_activate()/on_deactivate() #1771
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Until now the QEMU process and QMP monitor start was tied to the
on()/off()methods. This feels unnatural, preventing the user from interacting with the QEMU process via monitor commands before the emulation starts and meant starting a new process on each power cycle.Rework the driver to start QEMU and the QMP monitor in on_activate(), allowing interaction via
monitor_command()after activation. Theon()andoff()methods interact only via QMP now.All methods relying on a started QEMU and QMP monitor instance are decorated with
@Driver.check_activenow.The atexit handling is no longer required since the target's atexit handler already calls the driver's
on_deactivate().While at it, restructure the QEMU mock fixtures in the QEMUDriver tests.
Checklist
Alternative to one aspect of #1753