From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LhXPU-0004dc-Kq for qemu-devel@nongnu.org; Wed, 11 Mar 2009 19:00:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LhXPS-0004cr-SU for qemu-devel@nongnu.org; Wed, 11 Mar 2009 19:00:24 -0400 Received: from [199.232.76.173] (port=52709 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LhXPS-0004co-Mm for qemu-devel@nongnu.org; Wed, 11 Mar 2009 19:00:22 -0400 Received: from mx2.redhat.com ([66.187.237.31]:54260) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LhXPQ-0002Sv-LZ for qemu-devel@nongnu.org; Wed, 11 Mar 2009 19:00:22 -0400 Message-ID: <49B84268.9030002@redhat.com> Date: Thu, 12 Mar 2009 00:59:52 +0200 From: Uri Lublin MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: Problems KVM-84 References: <49B79D50.4090300@redhat.com> <49B7C6BF.6030803@codemonkey.ws> <20090311160636.GA18390@shareable.org> In-Reply-To: <20090311160636.GA18390@shareable.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 Cc: Jay Mann , Uri Lublin , Avi Kivity , kvm@vger.kernel.org Jamie Lokier wrote: > Anthony Liguori wrote: >>> block-qcow2: keep highest allocated byte (Uri Lublin) >>> We want to know the highest written offset for qcow2 images. >>> This gives a pretty good (and easy to calculate) estimation to how >>> much more allocation can be done for the block device. >>> It can be usefull for allocating more diskspace for that image >>> (if possible, e.g. lvm) before we run out-of-disk-space >>> Signed-off-by: Uri Lublin >>> Signed-off-by: Anthony Liguori >>> >>> Scanning the file at startup is slow. We need to find a better way. >> Any quick ideas? Seems like this is broken by design. Unless we can >> find a quick fix, I'm going to revert this in the stable tree. > > I still don't understand the point in that feature. > > You have the size of the qcow2 file (how much data is used), and the > size of the image it's representing (how much it could expand to). > > What does the highest written offset help you anticipate? You assume there is a file system installed. If I want to use e.g. LVM's logical volume, I can not tell the size of the qcow2 image. I want to be able to set a watermark and handle out-of-disk-space before it actually happens. > > Many guest filesystems write data all over the block device, not > concentrated at the start. (E.g. ext2/3/4 and it's block groups). qcow2 allocates disk space regardless of the guest write offset. And if it happen that the image is sparse (or fragmented), num_free_bytes can tell us that. Regards, Uri.