From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPK86-0003GK-Oi for qemu-devel@nongnu.org; Tue, 01 May 2012 16:57:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SPK84-000391-Fy for qemu-devel@nongnu.org; Tue, 01 May 2012 16:57:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPK84-00038s-6m for qemu-devel@nongnu.org; Tue, 01 May 2012 16:57:00 -0400 Message-ID: <4FA04E12.2090206@redhat.com> Date: Tue, 01 May 2012 14:56:50 -0600 From: Eric Blake MIME-Version: 1.0 References: <1335886307-27586-1-git-send-email-stefanha@linux.vnet.ibm.com> <4FA046C6.5080909@us.ibm.com> In-Reply-To: <4FA046C6.5080909@us.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigF904C7228568327F187A1712" Subject: Re: [Qemu-devel] [libvirt] [RFC 0/5] block: File descriptor passing using -open-hook-fd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Kevin Wolf , libvir-list@redhat.com, Stefan Hajnoczi , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigF904C7228568327F187A1712 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 05/01/2012 02:25 PM, Anthony Liguori wrote: > Thanks for sending this out Stefan. Indeed. >> This series adds the -open-hook-fd command-line option. Whenever QEMU= >> needs to >> open an image file it sends a request over the given UNIX domain >> socket. The >> response includes the file descriptor or an errno on failure. Please >> see the >> patches for details on the protocol. >> >> The -open-hook-fd approach allows QEMU to support file descriptor pass= ing >> without changing -drive. It also supports snapshot_blkdev and other >> commands >> that re-open image files. >> >> Anthony Liguori wrote most of these patches. I >> added a >> demo -open-hook-fd server and added some small fixes. Since Anthony i= s >> traveling right now I'm sending the RFC for discussion. >=20 > What I like about this approach is that it's useful outside the block > layer and is conceptionally simple from a QEMU PoV. We simply delegate= > open() to libvirt and let libvirt enforce whatever rules it wants. >=20 > This is not meant to be an alternative to blockdev, but even with > blockdev, I think we still want to use a mechanism like this even with > blockdev. The overall series looks like it would be rather interesting. What sort of timing restrictions are there? For example, the proposed 'drive-reopen' command (probably now delegated to qemu 1.2) would mean that qemu would be calling back into libvirt in order to do the reopen. If libvirt takes its time in passing back an open fd, is it going to starve qemu from answering unrelated monitor commands in the meantime? I definitely want to make sure we avoid deadlock where libvirt is waiting on a monitor command, but the monitor command is waiting on libvirt to pass an fd. Is this also an opportunity to request whether a particular fd must be seekable vs. acceptable as a one-pass read or write, perhaps by whether the command is 1 (seekable open) or 2 (one-pass open)? For example, migration is one-pass (and therefore libvirt passes a pipe which is hooked up to a helper app that uses O_DIRECT), while block devices must be seekable. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigF904C7228568327F187A1712 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/ iQEcBAEBCAAGBQJPoE4SAAoJEKeha0olJ0NqHvQH/39N7IrDUlIfomSFwy11V9SG vCi8A4JUzHGL3FeSQdaMdwAOl7c9TK/rawFb/0CVjkk7EzaW1wgDo6zo82bRMm6X s0yCX6AHJvh6qwSulLyrhCdO6wZSPtx/ZH833g+MKLrQlllJWTcw+yIETuyp2H91 aFH8fZDy5g2X81qd+9wt2xOv6ClAk/OZxn5hx2O433ciCjdV2yRG1rV+PycVQRlv fh24lYH6pC5YBivsRH/o+jGOklOy7OFWcktYCsVEOIw3dkqXLnT7zszswtqW8BVS ORxBeM2JzwWbuYcGBD6lHdE1Po2uS62j43ISTx8gD5cYxnE+yeOcEJ2BOSKG76o= =zy28 -----END PGP SIGNATURE----- --------------enigF904C7228568327F187A1712--