From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55585) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Su7Da-0003Dw-8X for qemu-devel@nongnu.org; Wed, 25 Jul 2012 15:25:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Su7DZ-0004hh-8Q for qemu-devel@nongnu.org; Wed, 25 Jul 2012 15:25:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Su7DY-0004hS-WB for qemu-devel@nongnu.org; Wed, 25 Jul 2012 15:25:57 -0400 Message-ID: <50104826.1040909@redhat.com> Date: Wed, 25 Jul 2012 13:25:26 -0600 From: Eric Blake MIME-Version: 1.0 References: <1343048885-1701-1-git-send-email-coreyb@linux.vnet.ibm.com> <1343048885-1701-7-git-send-email-coreyb@linux.vnet.ibm.com> <500E901D.3080801@redhat.com> <500F6B04.4020508@linux.vnet.ibm.com> <500FACD6.700@redhat.com> In-Reply-To: <500FACD6.700@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigC712A89F5BCB59F1D3E96773" Subject: Re: [Qemu-devel] [PATCH v5 6/6] block: Enable qemu_open/close to work with fd sets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com, libvir-list@redhat.com, Corey Bryant , qemu-devel@nongnu.org, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC712A89F5BCB59F1D3E96773 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable 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 ->=20 >> mon_fdset_t). Would it be too costly to loop through all the fdsets/f= ds=20 >> at the beginning of every qemu_close()? >=20 > 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(). --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigC712A89F5BCB59F1D3E96773 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJQEEgnAAoJEKeha0olJ0Nqgv0H+wWXSOCYy9+iMEohzcvJjfn0 2vBJYTdR2BDi1QNb2bNAQtkd+0o5Nc1ZKjXU5nytCnHkdIMSgWUpcIYRV5uRB9YY LokMv8Z4RbXxRkG7AdZNSLunaEdl1KGrO9TD+jCWcfjbe65FRgSm7D0CFwDVEtff VyLKm73PeSeUVyB1WE+bufnjazTiZr8ya7d6QpQu3KWk5P3yL2M8tDHWl3gIfUS+ Do4Hy0FiWg0+tGZoKwq/RixPBNzLj+kbJV1/ckmYC1MWBv8FzliUfviNJc3iidYF Piej0XgxGv57TbEhDLoxSHY/mlyC7kmYP7kEDemyahkJoOEZmjfQDes6cWaOXaw= =nHzm -----END PGP SIGNATURE----- --------------enigC712A89F5BCB59F1D3E96773--