From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYesE-00069B-Bg for qemu-devel@nongnu.org; Mon, 20 Jun 2011 09:50:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QYesC-0004Uh-Sp for qemu-devel@nongnu.org; Mon, 20 Jun 2011 09:50:42 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:55894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYesC-0004UY-EU for qemu-devel@nongnu.org; Mon, 20 Jun 2011 09:50:40 -0400 Received: by pzk30 with SMTP id 30so3839234pzk.4 for ; Mon, 20 Jun 2011 06:50:39 -0700 (PDT) Message-ID: <4DFF502A.9020400@codemonkey.ws> Date: Mon, 20 Jun 2011 08:50:34 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <4DF762A4.2040503@us.ibm.com> <4DFF4DD1.50502@redhat.com> In-Reply-To: <4DFF4DD1.50502@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] Add support for fd: protocol List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: libvir-list@redhat.com, Anthony Liguori , Corey Bryant , Tyler C Hicks , qemu-devel@nongnu.org On 06/20/2011 08:40 AM, Avi Kivity wrote: > On 06/14/2011 04:31 PM, Corey Bryant wrote: >> - Starting Qemu with a backing file >> > > For this we could tell qemu that a file named "xyz" is available via fd > n, via an extension of the getfd command. > > For example > > (qemu) getfd path="/images/my-image.img" > (qemu) getfd path="/images/template.img" > (qemu) drive-add path="/images/my-image.img" > > The open() for my-image.img first looks up the name in the getfd > database, and finds it, so it returns the fd from there instead of > opening. It then opens the backing file ("template.img") and looks it up > again, and finds the second fd from the session. The way I've been thinking about this is: -blockdev id=hd0-back,file=fd:4,format=raw \ -blockdev file=fd:3,format=qcow2,backing=hd0-back While your proposal is clever, it makes me a little nervous about subtle security ramifications. Regards, Anthony Liguori > > The result is that open()s are satisfied from the monitor, instead of > the host kernel, but without reversing the request/reply nature of the > monitor protocol. > > A similar extension could be added to the command line: > > qemu -drive file=fd:4,cache=none -path-alias > name=/images/template.img,path=fd:5 > > Here the main image is opened via a fd 4; if it needs template.img, it > gets shunted to fd 5. >