[libvirt] [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets

Eric Blake eblake at redhat.com
Wed Jul 25 19:25:26 UTC 2012


On 07/25/2012 02:22 AM, Kevin Wolf wrote:
>>> Hm, not a nice interface where qemu_close() needs the filename and
>>> (worse) could be given a wrong filename. Maybe it would be better to
>>> maintain a list of fd -> fdset mappings in qemu_open/close?
>>>
>>
>> I agree, I don't really like it either.
>>
>> We already have a list of fd -> fdset mappings (mon_fdset_fd_t -> 
>> mon_fdset_t).  Would it be too costly to loop through all the fdsets/fds 
>> at the beginning of every qemu_close()?
> 
> I don't think so. qemu_close() is not a fast path and happens almost
> never, and the list is short enough that searching it isn't a problem
> anyway.

I agree - just do the loop to do the reverse lookup yourself, rather
than making qemu_close() have a different signature than close().

-- 
Eric Blake   eblake at 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: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120725/370704a7/attachment-0001.sig>


More information about the libvir-list mailing list