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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
>> ---
>>
>> 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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]