[libvirt] [PATCHv2 3/3] command: add virCommandAbort for cleanup paths

Eric Blake eblake at redhat.com
Fri Mar 25 11:45:35 UTC 2011


On 03/24/2011 09:16 PM, Daniel Veillard wrote:
> On Wed, Mar 23, 2011 at 05:48:13PM -0600, Eric Blake wrote:
>> Sometimes, an asynchronous helper is started (such as a compressor
>> or iohelper program), but a later error means that we want to
>> abort that child.  Make this easier.
>>
>> Note that since daemons and virCommandRunAsync can't mix, the only
>> time virCommandFree can reap a process is if someone did
>> virCommandRunAsync for a non-daemon and didn't stash the pid.
>>
>> * src/util/command.h (virCommandAbort): New prototype.
>> * src/util/command.c (_virCommand): Add new field.
>> (virCommandRunAsync, virCommandWait): Track whether pid was used.
>> (virCommandFree): Reap child if caller did not request pid.
>> (virCommandAbort): New function.
>> * src/libvirt_private.syms (command.h): Export it.
>> * tests/commandtest.c (test19): New test.
>> ---
>>
>> v2: no change, but by adding patch 2, it should make it clear
>> that this patch is doing the right thing about not reaping
>> a long-running daemon.
>>
>>  src/libvirt_private.syms |    1 +
>>  src/util/command.c       |   66 ++++++++++++++++++++++++++++++++++++++++++++++
>>  src/util/command.h       |   12 +++++++-
>>  tests/commandtest.c      |   37 +++++++++++++++++++++++++
>>  4 files changed, 115 insertions(+), 1 deletions(-)
> 
>   ACK, including the followup patch to tests/commandtest.c,

Series pushed.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110325/4b1b3235/attachment-0001.sig>


More information about the libvir-list mailing list