From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1McwT7-00057i-9e for qemu-devel@nongnu.org; Mon, 17 Aug 2009 03:17:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1McwT2-00057W-OL for qemu-devel@nongnu.org; Mon, 17 Aug 2009 03:17:25 -0400 Received: from [199.232.76.173] (port=51723 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1McwT2-00057T-K9 for qemu-devel@nongnu.org; Mon, 17 Aug 2009 03:17:20 -0400 Received: from mx20.gnu.org ([199.232.41.8]:40798) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1McwT2-0004qz-1F for qemu-devel@nongnu.org; Mon, 17 Aug 2009 03:17:20 -0400 Received: from mx2.redhat.com ([66.187.237.31]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1McwT1-0000tC-9D for qemu-devel@nongnu.org; Mon, 17 Aug 2009 03:17:19 -0400 Message-ID: <4A8903B9.3010109@redhat.com> Date: Mon, 17 Aug 2009 09:16:09 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] qcow2: Metadata preallocation References: <1250262015-996-1-git-send-email-kwolf@redhat.com> <4A87F44B.5080308@redhat.com> <5b31733c0908160512r25abf0d2ld45a3602a8c540fa@mail.gmail.com> <20090816164841.GA27122@shareable.org> In-Reply-To: <20090816164841.GA27122@shareable.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jamie Lokier Cc: Filip Navara , Avi Kivity , qemu-devel@nongnu.org Jamie Lokier schrieb: > Filip Navara wrote: >> FILE_ATTRIBUTE_SPARSE_FILE? You can't actually set it when >> opening/creating the file, a separate call to >> DeviceIoControl/FSCTL_SET_SPARSE is needed. > > I see that you increase the file size by writing zeros to the end. > > Can't you use the Windows equivalent of unix ftruncate() to extend the > file instead, after FSCTL_SET_SPARSE? There actually exists a bdrv_truncate(). I wasn't aware of that. If you prefer, I can resend the patch with bdrv_truncate instead of a zero write. Kevin