From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ITQGY-0004dK-SN for qemu-devel@nongnu.org; Thu, 06 Sep 2007 18:56:02 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ITQGW-0004d8-D4 for qemu-devel@nongnu.org; Thu, 06 Sep 2007 18:56:01 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ITQGW-0004d5-9f for qemu-devel@nongnu.org; Thu, 06 Sep 2007 18:56:00 -0400 Received: from motoko.lapo.it ([88.198.0.105] helo=mail.lapo.it) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1ITQGV-0004js-2f for qemu-devel@nongnu.org; Thu, 06 Sep 2007 18:55:59 -0400 Message-ID: <46E0854D.8000301@lapo.it> Date: Fri, 07 Sep 2007 00:55:09 +0200 From: Lapo Luchini MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] copy on write-but-no-change Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org I noticed that cow adds space also if the written data is the same as the one it was there already. Is there a reason why checking it would be bad/difficult/slow/other? Simply no one had the will to code the check? I ask because for shrinking drives I usually create big zero-filled files... and this grows the qcow2 image like mad, and only a compressed convert can properly shrink it back. OK, it is not to be done very very often, but not copying those writes that don't actually change the data seems like a good idea... don't know about the speed hit, though. Another idea would be to detect "only zero" write blocks and simply interpret them as "put a hole in the sparse file" instead of actually writing data to disk. Just the first idea that hit me after a few hours of qemu usage, don't hit me with a brick if it has already been discussed to death: I searched it in the gmane.org archives to no avail ;-) -- Lapo Luchini lapo@lapo.it (OpenPGP & X.509) www.lapo.it (Jabber, ICQ, MSN)