From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=50012 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5cDx-0001eC-MN for qemu-devel@nongnu.org; Fri, 01 Apr 2011 07:09:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q5cDw-00058i-BK for qemu-devel@nongnu.org; Fri, 01 Apr 2011 07:09:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64483) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q5cDw-00058F-1a for qemu-devel@nongnu.org; Fri, 01 Apr 2011 07:09:04 -0400 Message-ID: <4D95B2D0.2040702@redhat.com> Date: Fri, 01 Apr 2011 13:11:12 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [RFC PATCH] qed: add support for Copy-on-Read References: <1301533714-28997-1-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1301533714-28997-1-git-send-email-aliguori@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, Stefan Hajnoczi Am 31.03.2011 03:08, schrieb Anthony Liguori: > When creating an image using qemu-img, just pass '-o copy_on_read' and then > whenever QED reads from a backing file, it will write the block to the QED > file after the read completes ensuring that you only fetch from the backing > device once. As you probably know, I don't agree with the interface. Copy on read should be first and foremost a runtime option. It's okay to fetch the default for this option from the image file, but it's not the right primary interface. > This is very useful for streaming images over a slow connection. > > This isn't ready for merge yet as it's not playing nice with synchronize I/O. Like Stefan I'm not sure what you mean here. One problem that I see is that if you have a concurrent write request from the guest, the COR write request may overwrite the guest's request, which is obviously wrong. Is this what you mean? > I think it's fairly easy to do the same thing in qcow2 by just hooking adding > some logic after bdrv_aio_write() to call back into qcow2 with a synchronous > I/O write in the backing file case. Thoughts on whether that would actually > work? I can't see a reason why it wouldn't work. Except that it has the same problem that I described above. A synchronous write isn't going to solve this, you'd additionally need a qemu_aio_flush() if you want to avoid proper locking. But that's really the same for QED and qcow2. Kevin