Re: [PATCH v2] Consider discard option when writing zeros

2024-06-28 Thread Nir Soffer
On Thu, Jun 27, 2024 at 2:42 PM Kevin Wolf wrote: > Am 26.06.2024 um 18:27 hat Nir Soffer geschrieben: > > On Wed, Jun 26, 2024 at 12:17 PM Daniel P. Berrangé > > > wrote: > > > > > On Mon, Jun 24, 2024 at 06:08:26PM +0200, Kevin Wolf wrote: > > > > Am 24.06.2024 um 17:23 hat Stefan Hajnoczi

Re: [PATCH v2] Consider discard option when writing zeros

2024-06-27 Thread Kevin Wolf
Am 26.06.2024 um 18:27 hat Nir Soffer geschrieben: > On Wed, Jun 26, 2024 at 12:17 PM Daniel P. Berrangé > wrote: > > > On Mon, Jun 24, 2024 at 06:08:26PM +0200, Kevin Wolf wrote: > > > Am 24.06.2024 um 17:23 hat Stefan Hajnoczi geschrieben: > > > > On Wed, Jun 19, 2024 at 08:43:25PM +0300, Nir

Re: [PATCH v2] Consider discard option when writing zeros

2024-06-26 Thread Nir Soffer
On Wed, Jun 26, 2024 at 12:17 PM Daniel P. Berrangé wrote: > On Mon, Jun 24, 2024 at 06:08:26PM +0200, Kevin Wolf wrote: > > Am 24.06.2024 um 17:23 hat Stefan Hajnoczi geschrieben: > > > On Wed, Jun 19, 2024 at 08:43:25PM +0300, Nir Soffer wrote: > > > > Tested using: > > > > > > Hi Nir, > > >

Re: [PATCH v2] Consider discard option when writing zeros

2024-06-26 Thread Nir Soffer
On Wed, Jun 26, 2024 at 11:42 AM Kevin Wolf wrote: > Am 24.06.2024 um 23:12 hat Nir Soffer geschrieben: > > On Mon, Jun 24, 2024 at 7:08 PM Kevin Wolf wrote: > > > > > Am 24.06.2024 um 17:23 hat Stefan Hajnoczi geschrieben: > > > > On Wed, Jun 19, 2024 at 08:43:25PM +0300, Nir Soffer wrote: > >

Re: [PATCH v2] Consider discard option when writing zeros

2024-06-26 Thread Daniel P . Berrangé
On Mon, Jun 24, 2024 at 06:08:26PM +0200, Kevin Wolf wrote: > Am 24.06.2024 um 17:23 hat Stefan Hajnoczi geschrieben: > > On Wed, Jun 19, 2024 at 08:43:25PM +0300, Nir Soffer wrote: > > > Tested using: > > > > Hi Nir, > > This looks like a good candidate for the qemu-iotests test suite. Adding >

Re: [PATCH v2] Consider discard option when writing zeros

2024-06-26 Thread Kevin Wolf
Am 24.06.2024 um 23:12 hat Nir Soffer geschrieben: > On Mon, Jun 24, 2024 at 7:08 PM Kevin Wolf wrote: > > > Am 24.06.2024 um 17:23 hat Stefan Hajnoczi geschrieben: > > > On Wed, Jun 19, 2024 at 08:43:25PM +0300, Nir Soffer wrote: > > > > Tested using: > > > > > > Hi Nir, > > > This looks like a

Re: [PATCH v2] Consider discard option when writing zeros

2024-06-24 Thread Nir Soffer
On Mon, Jun 24, 2024 at 7:08 PM Kevin Wolf wrote: > Am 24.06.2024 um 17:23 hat Stefan Hajnoczi geschrieben: > > On Wed, Jun 19, 2024 at 08:43:25PM +0300, Nir Soffer wrote: > > > Tested using: > > > > Hi Nir, > > This looks like a good candidate for the qemu-iotests test suite. Adding > > it to

Re: [PATCH v2] Consider discard option when writing zeros

2024-06-24 Thread Kevin Wolf
Am 24.06.2024 um 17:23 hat Stefan Hajnoczi geschrieben: > On Wed, Jun 19, 2024 at 08:43:25PM +0300, Nir Soffer wrote: > > Tested using: > > Hi Nir, > This looks like a good candidate for the qemu-iotests test suite. Adding > it to the automated tests will protect against future regressions. > >

Re: [PATCH v2] Consider discard option when writing zeros

2024-06-24 Thread Stefan Hajnoczi
On Wed, Jun 19, 2024 at 08:43:25PM +0300, Nir Soffer wrote: > Tested using: Hi Nir, This looks like a good candidate for the qemu-iotests test suite. Adding it to the automated tests will protect against future regressions. Please add the script and the expected output to

Re: [PATCH v2] Consider discard option when writing zeros

2024-06-19 Thread Nir Soffer
On Wed, Jun 19, 2024 at 8:40 PM Nir Soffer wrote: > - Need to run all block tests > Stale note, make check pass

Re: [PATCH v2] Consider discard option when writing zeros

2024-06-19 Thread Nir Soffer
Tested using: $ cat test-unmap.sh #!/bin/sh qemu=${1:?Usage: $0 qemu-executable} img=/tmp/test.raw echo echo "defaults - write zeroes" fallocate -l 1m $img echo -e 'qemu-io none0 "write -z 0 1m"\nquit' | $qemu -monitor stdio \ -drive if=none,file=$img,format=raw >/dev/null du -sh $img echo

[PATCH v2] Consider discard option when writing zeros

2024-06-19 Thread Nir Soffer
When opening an image with discard=off, we punch hole in the image when writing zeroes, making the image sparse. This breaks users that want to ensure that writes cannot fail with ENOSPACE by using fully allocated images. bdrv_co_pwrite_zeroes() correctly disable BDRV_REQ_MAY_UNMAP if we opened