On 02/16/2010 05:08 AM, Dave Allan wrote:

What about for a sparse file doing just

ftruncate (fd, 0);
ftruncate (fd, st.st_size);

That's a good point.  The only thing that makes me hesitate is that
I'm not certain that the file is guaranteed to contain zeros
following the second call to ftruncate,

I think since it's sparse, it must be a regular file?  If so, it would
be fine as Eric pointed out.

a volume represented by a regular file on a backend that doesn't
support volume delete. If that's so, we could just skip the whole
zeroing operation entirely for regular files.

Looks like it...

Paolo

--
libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to