From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeuTe-0004wX-Ca for qemu-devel@nongnu.org; Wed, 13 Jun 2012 16:47:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SeuTc-0006Kj-Ax for qemu-devel@nongnu.org; Wed, 13 Jun 2012 16:47:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14828) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeuTc-0006KW-2s for qemu-devel@nongnu.org; Wed, 13 Jun 2012 16:47:40 -0400 Message-ID: <4FD8FC61.1080204@redhat.com> Date: Wed, 13 Jun 2012 14:47:29 -0600 From: Eric Blake MIME-Version: 1.0 References: <1339170179-2554-1-git-send-email-coreyb@linux.vnet.ibm.com> <1339170179-2554-3-git-send-email-coreyb@linux.vnet.ibm.com> <20120613164649.04b13706@doriath.home> <4FD8F734.7030301@linux.vnet.ibm.com> In-Reply-To: <4FD8F734.7030301@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig35579640319C95BE3BDECC40" Subject: Re: [Qemu-devel] [PATCH v2 2/4] qapi: Add passfd QMP command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Corey Bryant Cc: kwolf@redhat.com, aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com, libvir-list@redhat.com, qemu-devel@nongnu.org, Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig35579640319C95BE3BDECC40 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 06/13/2012 02:25 PM, Corey Bryant wrote: >> Also, getfd automatically closes a fd if an existing fdname is passed >> again. >> I don't think this is a good behavior, I think pass-fd should fail >> instead >> (note that we can't fix getfd though). >> >=20 > I agree. It makes sense to fail rather than blindly closing the > existing fd. It can be closed explicitly with closefd if the user want= s > it closed. Hmm - what happens if I do 'pass-fd name', learn that qemu is using fd 42, then do 'getfd name'? I silently wipe out fd 42 and replace it with the new fd passed in by getfd. Which means my use of /dev/fd/42 will now be broken. Obviously that means that 'getfd' should NOT be used by any application using 'pass-fd', and that libvirt should NOT be reusing names (I think the latter is already true). But I agree that for back-compat we can't get rid of the current (evil) semantics of a duplicated 'getfd'. You may also want to mention that when using 'getfd' or 'pass-fd', there are some commands (like migrate) that use the fd:name protocol, and that a successful use of one of these commands implicitly closes the named fd; but that all new uses of /dev/fd/nnn leave the fd open and an explicit closefd must be used to avoid leaking indefinitely-opened fds in qemu. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig35579640319C95BE3BDECC40 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/ iQEcBAEBCAAGBQJP2PxiAAoJEKeha0olJ0NqpzoH/1+2Fezjk9XqYvE1Kte2n2Ny 8RGvoM9bn5XcM8x5wHkCrF61guuuHaERHiU2SajR6rr2zigghJwc0q6eR5nomvGp 8CwBC+miBvbqYAvE/5+O9SVAylxW5EYYFHm0R10f3x8JWFIMoJdSIlYNkunTOyHV 05zWLwxX0I0n3bn6AEARR44YuK86M1VoLkSm8jH3/5TMmtiPtfwLcGmB5yCRp4k5 kOekAR3V/hwuhuk2SilOoNzCqpvtk2NYBGzYHeFLgVx8v6QyqeEqVzzkyIO0L664 8B+x5GxfNzp45/0+h4TJg19/DTflgE6a68N1pYZsoSF0WSc7fWzdGzGlkjPHTmU= =ul2z -----END PGP SIGNATURE----- --------------enig35579640319C95BE3BDECC40--