If you want to replace fork() + exec() with subprocess, be my guest -- I
was just saying that trying to use subprocess.Popen directly (which
returns an object), doesn't buy you anything extra -- you still need to
read the controlling pty from output and record the PID in case of NM
failure or rolling restart.
- Michael
On 11/11/2010 7:26 PM, Michael Stroucken wrote:
Michael Ryan wrote:
How do you create a subprocess object from a PID? If the NM gets
restarted, it needs to be able to manage the processes. It was mainly
for consistency -- so that some VMs weren't managed by Popen objects
and others by PIDs.
So as I see it, the code uses fork and exec to start the qemu process in
the background and record the pid. On initialization, the NM collects
the information from storage into ControlledVMs to resume control. In
all cases, ControlledVMs contains the information of running VMs.
I don't think you'd need to create a subprocess object. You collect it
when starting a VM, but save the data into ControlledVMs right
afterwards (as is done now) and continue.
Greetings,
Michael.