]> git.ipfire.org Git - thirdparty/qemu.git/commit
scsi-disk: Use positive return value for status in dma_readv/writev
authorKevin Wolf <kwolf@redhat.com>
Wed, 31 Jul 2024 12:32:04 +0000 (14:32 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 6 Aug 2024 18:12:39 +0000 (20:12 +0200)
commitcfe0880835cd364b590ffd27ef8dbd2ad8838bc5
tree99be3e664e99f7ba27d3f5b430e96c46ab6e53fb
parent7e1711164683b1036f7da5f87c5f66c17a043ab1
scsi-disk: Use positive return value for status in dma_readv/writev

In some error cases, scsi_block_sgio_complete() never calls the passed
callback, but directly completes the request. This leads to bugs because
its error paths are not exact copies of what the callback would normally
do.

In preparation to fix this, allow passing positive return values to the
callbacks that represent the status code that should be used to complete
the request.

scsi_handle_rw_error() already handles positive values for its ret
parameter because scsi_block_sgio_complete() calls directly into it.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <20240731123207.27636-2-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/scsi/scsi-disk.c