From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5hYm-00040L-MI for qemu-devel@nongnu.org; Thu, 08 Mar 2012 12:55:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5hYg-00046W-BY for qemu-devel@nongnu.org; Thu, 08 Mar 2012 12:55:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:12431) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5hYg-000469-3d for qemu-devel@nongnu.org; Thu, 08 Mar 2012 12:55:22 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q28HtK2r030564 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 8 Mar 2012 12:55:20 -0500 Message-ID: <4F58F286.6060209@redhat.com> Date: Thu, 08 Mar 2012 19:55:18 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1331226917-6658-1-git-send-email-pbonzini@redhat.com> <1331226917-6658-8-git-send-email-pbonzini@redhat.com> In-Reply-To: <1331226917-6658-8-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 07/17] block: make high level discard operation always zero List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On 03/08/2012 07:15 PM, Paolo Bonzini wrote: > While the formats/protocols are free to implement a discard operation > that does *not* zero the data, providing a common view to the guests is > the only way to avoid configuration and migration nightmares. (We don't > want the admin to manually set up discard_zeroes_data/discard_granularity!) > > This has a couple of drawbacks: > > 1) QEMU effectively will not try to use discard unless discard_zeroes_data > is true. To do this we could add a flag such as BDRV_ALWAYS_DISCARD, > which the device models could use if their discard_zeroes_data property is > set to false. However, I haven't done this, estimating that no strictly > positive integer could represent the number of people using it. > > 2) it may turn a thin-provisioning operation into a full preallocation, > which is not nice. > > 3) it may cost memory for a bounce buffer that only needs to be filled > with zeroes. > > While (3) can be worked around, the only way around the other two, > unfortunately, is support in the formats and protocols. We will still > provide device options to opt out of this, but with raw and qed covered > (+ qcow2 without backing file, and qcow3 in the future) it should not > be too bad. Can't qcow2 with a backing file also be supported? Zero out the first cluster, and remember it. The following discards can reuse this zero cluster, as long as it hasn't been overwritten. -- error compiling committee.c: too many arguments to function