summary refs log tree commit diff stats
path: root/hw/intc
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2025-04-17 11:05:28 -0400
committerKevin Wolf <kwolf@redhat.com>2025-04-25 16:42:06 +0200
commit4733cb0833c4b223f92ec0136980eeb5239ecb87 (patch)
tree1d8eb7cc69abfa18eabaa0ac2941aa545cd5d6a8 /hw/intc
parentf605796aae42885034400c83ed6a9b07cd6d6481 (diff)
downloadfocaccia-qemu-4733cb0833c4b223f92ec0136980eeb5239ecb87.tar.gz
focaccia-qemu-4733cb0833c4b223f92ec0136980eeb5239ecb87.zip
block/io: skip head/tail requests on EINVAL
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 werror=stop will pause.

Add a special case for misaligned head/tail requests. Simply continue
when EINVAL is encountered so that the aligned main body of the request
can be completed and the guest is not paused. This is the best we can do
when guest discard limits do not match the host discard limits.

Fixes: https://issues.redhat.com/browse/RHEL-86032
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Message-ID: <20250417150528.76470-3-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/intc')
0 files changed, 0 insertions, 0 deletions