Re: [PATCH 2/3] avoid closing fd more than once

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

 



On 05/30/2012 09:03 PM, Wen Congyang wrote:
> At 05/30/2012 09:17 PM, Eric Blake Wrote:
>> On 05/30/2012 03:20 AM, Wen Congyang wrote:
>>> fdstream:
>>>     If fd is fds[0] or fds[1], we should set to -1 if we meet
>>>     some error.
>>>
>>>     childfd is fds[0] or fds[1], so we should close it only when
>>>     virFDStreamOpenFileInternal() successes.
>>>
>>> qemu_migration:
>>>     If we migrate to fd, spec->fwdType is not MIGRATION_FWD_DIRECT,
>>>     we will close spec->dest.fd.local in qemuMigrationRun(). So we
>>>     should set spec->dest.fd.local to -1 in qemuMigrationRun(). 
>>>
>>> command:
>>>     we should not set *outfd or *errfd if virExecWithHook() failed
>>>     because the caller may close these fds.
>>
>> We should split this into three separate patches, to aid backporting
>> each patch across appropriate versions.  Needs a v2 for this reason; as
>> I want these bugs fixed sooner rather than later, I'll probably help by
>> reposting things myself.
>>

> 
>>
>> Maybe a better solution here would be that when we assign fd and childfd
>> to elements of fds[], then we also assign fds to -1, as in:
> 
> Good idea.

Looks like our email is crossing paths; I just reposted 4 patches as a
v2 series.

I like my version better than your repost, if only because I spent time
in 'git gui blame' tracking down which commit introduced each bug.

-- 
Eric Blake   eblake@xxxxxxxxxx    +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]