From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=54655 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSAvr-0008Da-95 for qemu-devel@nongnu.org; Mon, 13 Dec 2010 11:07:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSAvp-0006Od-5k for qemu-devel@nongnu.org; Mon, 13 Dec 2010 11:07:22 -0500 Received: from mail-bw0-f45.google.com ([209.85.214.45]:58381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSAvo-0006OG-WF for qemu-devel@nongnu.org; Mon, 13 Dec 2010 11:07:21 -0500 Received: by bwz16 with SMTP id 16so6780290bwz.4 for ; Mon, 13 Dec 2010 08:07:19 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4D0644BF.3020701@redhat.com> Date: Mon, 13 Dec 2010 17:07:27 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20101125135657.GA2814@lst.de> <20101201153504.GA6056@lst.de> <20101201153514.GA6310@lst.de> <4CF78D1D.3060107@redhat.com> <20101210133843.GA28846@lst.de> In-Reply-To: <20101210133843.GA28846@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 1/5] block: add discard support List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: Kevin Wolf , qemu-devel@nongnu.org On 12/10/2010 02:38 PM, Christoph Hellwig wrote: > if it's smaller than the block size we'll zero out the remainder of > the block. I think it should fail at VM startup time, or even better do nothing at all. When you write in the middle of an absent block, and a partially-zero block is created, this is not visible: a read cannot see the difference between "all zeros because it's sparse" and "all zeros because it's zero". If I ask you to (optionally) punch a 1kb hole but all you can do is punch a 2kb hole, I do care about the second kilobyte of data. Since the hole punching of bdrv_discard is completely optional, it should not be done in this case. Paolo