From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1McmL2-0005UP-PQ for qemu-devel@nongnu.org; Sun, 16 Aug 2009 16:28:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1McmKx-0005SM-4J for qemu-devel@nongnu.org; Sun, 16 Aug 2009 16:28:23 -0400 Received: from [199.232.76.173] (port=57699 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1McmKw-0005SJ-V3 for qemu-devel@nongnu.org; Sun, 16 Aug 2009 16:28:18 -0400 Received: from mail2.shareable.org ([80.68.89.115]:42296) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1McmKw-0002Q8-M0 for qemu-devel@nongnu.org; Sun, 16 Aug 2009 16:28:18 -0400 Date: Sun, 16 Aug 2009 21:28:15 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] [PATCH] qcow2: Metadata preallocation Message-ID: <20090816202815.GA7162@shareable.org> References: <1250262015-996-1-git-send-email-kwolf@redhat.com> <4A87F44B.5080308@redhat.com> <5b31733c0908160512r25abf0d2ld45a3602a8c540fa@mail.gmail.com> <20090816164841.GA27122@shareable.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090816164841.GA27122@shareable.org> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Filip Navara Cc: Kevin Wolf , Avi Kivity , qemu-devel@nongnu.org Jamie Lokier wrote: > 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? Specifically: SetEndOfFile Use this after SetFilePointer to change the length of a file or stream. If used on a sparse file or stream, increasing the length creates a sparse region. -- Jamie