From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdOdr-0002Ah-DE for qemu-devel@nongnu.org; Wed, 21 Dec 2011 11:03:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RdOdl-0002DE-NQ for qemu-devel@nongnu.org; Wed, 21 Dec 2011 11:03:43 -0500 Received: from mail-we0-f173.google.com ([74.125.82.173]:63655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RdOdl-0002Bg-GI for qemu-devel@nongnu.org; Wed, 21 Dec 2011 11:03:37 -0500 Received: by werb10 with SMTP id b10so3226879wer.4 for ; Wed, 21 Dec 2011 08:03:36 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1324483240-31726-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1324483240-31726-1-git-send-email-stefanha@linux.vnet.ibm.com> Date: Wed, 21 Dec 2011 16:03:36 +0000 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 0/6] block: zero writes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Marcelo Tosatti , qemu-devel@nongnu.org On Wed, Dec 21, 2011 at 4:00 PM, Stefan Hajnoczi wrote: > This series adds an interface for efficient writes when data contains all > zeros. =A0It also takes advantage of this new interface by extending the > copy-on-read feature to perform zero-detection. > > The details of efficient zero representations depend on the image format.= =A0This > series includes a patch for the QED image format to write special "zero > clusters" that keep the image file compact. =A0In the future qcow2v3 coul= d also > support an efficient zero representation. > > The new BlockDriver interface is called .bdrv_co_write_zeroes() and is > optional. =A0If the interface is not implemented by a BlockDriver then a = regular > .bdrv_co_writev() operation will be performed. =A0The public interface is= called > bdrv_co_write_zeroes() and can be tested via the new qemu-io write -z opt= ion. > > Copy-on-read is extended to detect zeroes and invoke the > .bdrv_co_write_zeroes() interface when possible. =A0As a result we avoid = bloating > the image file if the backing file contains zeroes. > > My motivation for this feature is efficient image streaming. =A0The desti= nation > file must stay compact even when copying zeroes from the source file. > > We now only do zero detection for copy-on-read requests, whereas previous > revisions of this patch series scanned all write requests for zeroes. =A0= The old > behavior wasted CPU cycles in most cases but we could add a feature to > explicitly scan guest writes for zeroes in the future, if desired. > > v2: Typo: s/v2/v3/ Stefan