Re: [PATCH v2 12/17] virshStreamSkip: Emulate skip for block devices

2020-08-20 Thread Peter Krempa
On Tue, Jul 07, 2020 at 21:46:30 +0200, Michal Privoznik wrote: > This callback is called when the server sends us STREAM_HOLE > meaning there is no real data, only zeroes. For regular files > we would just seek() beyond EOF and ftruncate() to create the > hole. But for block devices this won't

[PATCH v2 12/17] virshStreamSkip: Emulate skip for block devices

2020-07-07 Thread Michal Privoznik
This callback is called when the server sends us STREAM_HOLE meaning there is no real data, only zeroes. For regular files we would just seek() beyond EOF and ftruncate() to create the hole. But for block devices this won't work. Not only we can't seek() beyond EOF, and ftruncate() will fail, this