]> 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)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 10 Apr 2025 13:20:09 +0000 (16:20 +0300)
commitfc2b3245692eb54a626ead17d47cc43942069673
tree8919d8c6e048df446ccc090d63c855219045f76b
parent9c605185c2e0ad1d47a5008027ef27d90f57fcbd
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>
(cherry picked from commit cfe0880835cd364b590ffd27ef8dbd2ad8838bc5)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/scsi/scsi-disk.c