[PATCH v3 0/2] block: discard alignment fixes

2025-04-14 Thread Stefan Hajnoczi
v3: - Refine error handling when pdiscard_alignment is not a multiple of request_alignment [Hanna] v2: - Fix inverted logic in alignment check [Qing Wang] Two discard alignment issues were identified in https://issues.redhat.com/browse/RHEL-86032: 1. pdiscard_alignment is not populated for host_d

[PATCH v3 2/2] block/io: skip head/tail requests on EINVAL

2025-04-14 Thread Stefan Hajnoczi
When guests send misaligned discard requests, the block layer breaks them up into a misaligned head, an aligned main body, and a misaligned tail. The file-posix block driver on Linux returns -EINVAL on misaligned discard requests. This causes bdrv_co_pdiscard() to fail and guests configured with w

[PATCH v3 1/2] file-posix: probe discard alignment on Linux block devices

2025-04-14 Thread Stefan Hajnoczi
Populate the pdiscard_alignment block limit so the block layer is able align discard requests correctly. Signed-off-by: Stefan Hajnoczi --- block/file-posix.c | 67 +- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/block/file-posix.c b/b

Re: [PATCH 1/6] mirror: Skip pre-zeroing destination if it is already zero

2025-04-14 Thread Vladimir Sementsov-Ogievskiy
On 11.04.25 04:04, Eric Blake wrote: When doing a sync=full mirroring, QMP drive-mirror requests full zeroing if it did not just create the destination, and blockdev-mirror requests full zeroing unconditionally. This is because during a full sync, we must ensure that the portions of the disk tha

Re: [PATCH v2 1/2] file-posix: probe discard alignment on Linux block devices

2025-04-14 Thread Stefan Hajnoczi
On Fri, Apr 11, 2025 at 10:15:13AM +0200, Hanna Czenczek wrote: > On 10.04.25 20:41, Stefan Hajnoczi wrote: > > Populate the pdiscard_alignment block limit so the block layer is able > > align discard requests correctly. > > > > Signed-off-by: Stefan Hajnoczi > > --- > > block/file-posix.c | 56

Re: [PATCH 2/6] file-posix: Allow lseek at offset 0 when !want_zero

2025-04-14 Thread Vladimir Sementsov-Ogievskiy
On 11.04.25 04:04, Eric Blake wrote: The 'want_zero' parameter to raw_co_block_status() was added so that we can avoid potentially time-consuming lseek(SEEK_DATA) calls throughout the file (working around poor filesystems that have O(n) rather than O(1) extent probing). But when it comes to lear

Re: [PATCH 2/6] file-posix: Allow lseek at offset 0 when !want_zero

2025-04-14 Thread Eric Blake
On Mon, Apr 14, 2025 at 08:05:21PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 11.04.25 04:04, Eric Blake wrote: > > The 'want_zero' parameter to raw_co_block_status() was added so that > > we can avoid potentially time-consuming lseek(SEEK_DATA) calls > > throughout the file (working around po

Re: [PATCH 1/3] include/hw/pci: Attach BDF to Memory Attributes

2025-04-14 Thread Michael S. Tsirkin
On Sun, Mar 02, 2025 at 05:12:07PM +0800, Jason Chien wrote: > This commit adds the BDF to the memory attributes for DMA operations. > > Signed-off-by: Jason Chien > --- > include/hw/pci/pci_device.h | 10 -- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/include/hw/

Re: [PATCH v4] blockdev-backup: Add error handling option for copy-before-write jobs

2025-04-14 Thread Markus Armbruster
Raman Dzehtsiar writes: > This patch extends the blockdev-backup QMP command to allow users to specify > how to behave when IO errors occur during copy-before-write operations. > Previously, the behavior was fixed and could not be controlled by the user. > > The new 'on-cbw-error' option can be s

Re: [PATCH v3 05/12] iotests/common.rc: add disk_usage function

2025-04-14 Thread Andrey Drobyshev
On 4/11/25 8:48 PM, Eric Blake wrote: > On Fri, Sep 13, 2024 at 07:39:35PM +0300, Andrey Drobyshev wrote: >> Move the definition from iotests/250 to common.rc. This is used to >> detect real disk usage of sparse files. In particular, we want to use >> it for checking subclusters-based discards. >

Re: [PATCH v2] blockdev-backup: Add error handling option for copy-before-write jobs

2025-04-14 Thread Vladimir Sementsov-Ogievskiy
On 14.04.25 04:30, Raman Dzehtsiar wrote: Hi Vladimir, Thank you for your review. The patch looks good to me. Still, could you also provide a test for a new option? Probably the simplest would be add a test-case to `tests/qemu-iotests/tests/copy-before-write`, where existing on-cbw-error opt

Re: [PATCH v3 0/2] deprecate some block-job- APIs

2025-04-14 Thread Vladimir Sementsov-Ogievskiy
On 09.04.25 11:42, Vladimir Sementsov-Ogievskiy wrote: This is for 10.1, of course. v3: fix wording, typos v2: Update documentation: add patch 01 v1 was: [PATCH] [for-10.1] qapi/block-core: derpecate some block-job- APIs Supersedes: <20250401155730.103718-1-vsement...@yandex-team.ru> Vladimir

Re: [PATCH v3] blockdev-backup: Add error handling option for copy-before-write jobs

2025-04-14 Thread Raman Dzehtsiar
Hi Markus, Thanks for taking the time to review this patch. [...] > > +# @on-cbw-error: optional policy defining behavior on I/O errors in > > +# copy-before-write jobs; defaults to break-guest-write. (Since 10.0) [...] > Scratch "optional", please. Good point. I've removed "optional" from