From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ShJ2B-0001Mt-4X for qemu-devel@nongnu.org; Wed, 20 Jun 2012 07:25:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ShJ26-0007pi-3B for qemu-devel@nongnu.org; Wed, 20 Jun 2012 07:25:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ShJ25-0007nJ-RW for qemu-devel@nongnu.org; Wed, 20 Jun 2012 07:25:10 -0400 Message-ID: <4FE1B308.2080100@redhat.com> Date: Wed, 20 Jun 2012 05:24:56 -0600 From: Eric Blake MIME-Version: 1.0 References: <1339689305-27031-1-git-send-email-coreyb@linux.vnet.ibm.com> <4FE09EE3.9070603@redhat.com> <4FE0A15F.7070606@redhat.com> <4FE0A579.40307@redhat.com> <4FE17AE9.90205@redhat.com> <20120620083122.GC20792@redhat.com> In-Reply-To: <20120620083122.GC20792@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig636C48F55E2BCCEA41EE9576" Subject: Re: [Qemu-devel] [PATCH v3 0/5] file descriptor passing using pass-fd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: Kevin Wolf , aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com, libvir-list@redhat.com, Jeff Cody , Corey Bryant , qemu-devel@nongnu.org, Luiz Capitulino , pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig636C48F55E2BCCEA41EE9576 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/20/2012 02:31 AM, Daniel P. Berrange wrote: >> This might mean that libvirt should only closefd the file when it >> becomes unused (like after hot unplug); or that qemu must keep it open= >> internally even after closefd as long as the block device is still in = use. >=20 > As it works today, the only time libvirt would call "closefd", is if > the monitor command it was trying to use the FD with (eg drive_add) > failed. If drive_add was successfully run, then libvirt would not be > invoking closefd. But right now, the only time libvirt uses 'getfd' is with commands like 'migrate' that implicitly close the fd after it is used by name; we don't have any experience in using fds by '/dev/fd/nn' notation instead of name. It is the fact that /dev/fd/nn will allow us to use 'pass-fd' in more situations in before, by dup()ing the fd, that libvirt all the sudden becomes responsible for using 'closefd' at the appropriate moments= =2E I guess I can live with a rule that libvirt must not call 'closefd' on any fd that it might later want to reassign to a new copy of the fd; that is, with backing chains, if libvirt originally calls 'pass-fd drive-virtio1' with an O_RDONLY fd and gets back 21, then libvirt must not call 'closefd drive-virtio1' until it knows drive-virtio1 is no longer needed. Converting the 'drive-virtio1' fd to O_RDWR while still keeping it at /dev/fd/21 could be done via 'pass-fd -f drive-virtio1', where -f is an optional bool parameter to force a reassociation of a given name back to the previously assigned value instead of the normal error path for accidentally passing an fd to an already in-use name. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig636C48F55E2BCCEA41EE9576 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/ iQEcBAEBCAAGBQJP4bMIAAoJEKeha0olJ0NqrDsH+QFT4OQwxIrSXPCCN+rnwR5N sDKd3nj6LEOcNVHRSiINgZbIwP9m3a+22To7sa7GuTuCw6CDc0ulC52KZj2+zBF7 kQGa7+z3wcnbC1lyzVZ8HoRJ/iJwkU0qc/tPNggHA+dFghfcDFvaa23rHhnNMD0D l6KbZi0pz/Gf2TG5l244MeoJd5aPU159mh14CRj/Tiem3SxOfes6TgZ177N/uaf1 92MbL3fvUCC0jOktsCUtINwN1sl8LNCK3JkxsMS42BsPeGokPSDPoAUtETgSoDt3 IGsw8C/eK1RBjRnzAgRqjcIjSxY9EFBO7gIOsAAdSrVjGaoHihTDdS/uf2a2e+Y= =peo5 -----END PGP SIGNATURE----- --------------enig636C48F55E2BCCEA41EE9576--