From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S62vf-000857-Ty for qemu-devel@nongnu.org; Fri, 09 Mar 2012 11:44:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S62vZ-0004MF-Qd for qemu-devel@nongnu.org; Fri, 09 Mar 2012 11:44:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S62vZ-0004Lu-IM for qemu-devel@nongnu.org; Fri, 09 Mar 2012 11:44:25 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q29GiO1Y025040 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 9 Mar 2012 11:44:24 -0500 Message-ID: <4F5A343B.3050905@redhat.com> Date: Fri, 09 Mar 2012 17:47:55 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <1331226917-6658-1-git-send-email-pbonzini@redhat.com> <1331226917-6658-4-git-send-email-pbonzini@redhat.com> In-Reply-To: <1331226917-6658-4-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 03/17] block: add discard properties to BlockDriverInfo List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org Am 08.03.2012 18:15, schrieb Paolo Bonzini: > In the next patches we will declare the guest's semantics for discard > to be "always zero the data". We need to know whether the operation > need to be emulated or can be passed down. For this purpose we need > to know the semantics of the operation and its granularity. > > The granularity may not be related to the cluster size (for example > "raw" does not have a cluster size), so add it separately. > > Signed-off-by: Paolo Bonzini > --- > block.h | 4 ++++ > block/qcow2.c | 2 ++ > qemu-io.c | 5 ++++- > 3 files changed, 10 insertions(+), 1 deletions(-) > > diff --git a/block.h b/block.h > index 48d0bf3..7feda73 100644 > --- a/block.h > +++ b/block.h > @@ -15,6 +15,10 @@ typedef struct BlockDriverInfo { > int cluster_size; > /* offset at which the VM state can be saved (0 if not possible) */ > int64_t vm_state_offset; > + /* whether discard is guaranteed to zero bytes */ > + bool discard_zeroes_data; > + /* discard granularity in sectors */ > + int discard_granularity; Why not in bytes? The arbitrary 512 byte units used in the block layer were probably not the best idea ever and we shouldn't spread it further. Kevin