[libvirt] [PATCHv2] qemu: don't leak vm on failure

Eric Blake eblake at redhat.com
Mon Sep 9 15:08:48 UTC 2013


On 09/08/2013 08:29 AM, Osier Yang wrote:
> On 07/09/13 01:55, Eric Blake wrote:
>> Failure to attach to a domain during 'virsh qemu-attach' left
>> the list of domains in an odd state:
>>
>> $ virsh qemu-attach 4176
>> error: An error occurred, but the cause is unknown
>>

>>
>> * src/qemu/qemu_driver.c (qemuDomainCreateXML): Don't leak vm on
>> failure to obtain job.
>> (qemuDomainQemuAttach): Match cleanup of qemuDomainCreateXML.
>>
>> Signed-off-by: Eric Blake <eblake at redhat.com>
>> ---
>>
>> v1 was discussed here:
>> https://www.redhat.com/archives/libvir-list/2013-September/msg00362.html
>> changes since then: plug another leak of vm, and clean up some style.
>> Expand the commit message to explain unusual paths.
>>

>>
>>       if (qemuProcessAttach(conn, driver, vm, pid,
>>                             pidfile, monConfig, monJSON) < 0) {
>> +        if (qemuDomainObjEndJob(driver, vm) > 0)
> 
> Just realized that qemuDomainObjEndJob returns bool value. We may need a
> follow up patch to clean it up.

I'll work on that; as you say, it can be a followup, and touches more
call sites.

> 
> ACK with "{" removed.

Thanks; pushed.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list