Bug 10829

Summary: runqemu: Add python module
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Mariano Lopez <mariano.lopez>
Component: Scripts and ToolsAssignee: Unassigned <unassigned>
Status: RESOLVED OBSOLETE QA Contact:
Severity: enhancement    
Priority: Medium CC: benjamin.esquivel, randy.macleod, rebecca.swee.fun.chang, richard.purdie, ross.burton, sgw, tim.orling
Version: unspecified   
Target Milestone: Future   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: New (Never tested)
Verified: Documentation change: Don't know

Description Mariano Lopez 2016-12-20 16:20:26 UTC
Now that runqemu was refactor to use python it would be nice to have a module that can be imported in other parts of the project. This would be beneficial specially for selftest and runtime testing. The current implementation has to run qemu using a shell, and because of that there are checks to be sure that qemu is killed after the parent process is killed or ends unexpectedly.
Comment 1 Benjamin Esquivel 2016-12-22 16:09:26 UTC
Mariano, would you add these 2 things to the bug description:

1. source of the requirement (which effort or module requires it?)
2. benefits that are sought with this enhancement
Comment 2 Mariano Lopez 2016-12-22 16:33:34 UTC
(In reply to comment #1)
> Mariano, would you add these 2 things to the bug description:
> 
> 1. source of the requirement (which effort or module requires it?)
The main consumer that I see is the QemuRunner class in oeqa library, currently runqemu has to be called using a shell because of the command line parameters used in the script.

> 2. benefits that are sought with this enhancement
In QemuRunner class we have some hacks to kill the shell that called runqemu, and the qemu-system process in case QemuRunner's process ends unexpectedly. I've been working lately with QemuRunner and it seems qemu-system is not always killed when a bitbake worker (using testimage) is killed; I must admit that it happens sporadically, about 10% of the time.

So, the benefit here is to have call directly runqemu from python without using a shell, with this we would have better control of the qemu process avoiding hacks.
Comment 3 Ed Bartosh 2017-03-07 11:27:40 UTC
I don't think I'll have time to work on this in 2.3 time frame.
moving to 2.4, increasing estimate.
Comment 4 Randy MacLeod 2021-06-17 15:27:22 UTC
Still a good idea. Any volunteers?
Comment 5 Randy MacLeod 2023-06-22 15:21:12 UTC
We've had many changes in runqemu since this was written. Open a new defect if there are similar ERs you would like to see.
-- YP bug review.