aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2022-12-03 15:08:20 +0000
committerAlexander Motin <mav@FreeBSD.org>2022-12-03 15:08:20 +0000
commitb81ac5cdc355029b4d5723fcdfcbcbedeb94dcd9 (patch)
tree2114e167bc7719279283320cefa56ee22116b6f6
parente92d69234579395a79807fe303a75ba3c614c90f (diff)
downloadsrc-b81ac5cdc355029b4d5723fcdfcbcbedeb94dcd9.tar.gz
src-b81ac5cdc355029b4d5723fcdfcbcbedeb94dcd9.zip
bhyve virtio-scsi: Fix residual reporting.
CTL does not really use residual field and it always returned zero. Use ext_data_filled instead. MFC after: 2 weeks
-rw-r--r--usr.sbin/bhyve/pci_virtio_scsi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/bhyve/pci_virtio_scsi.c b/usr.sbin/bhyve/pci_virtio_scsi.c
index 7f8d5a8866c9..bad95e4e85b0 100644
--- a/usr.sbin/bhyve/pci_virtio_scsi.c
+++ b/usr.sbin/bhyve/pci_virtio_scsi.c
@@ -557,7 +557,7 @@ pci_vtscsi_request_handle(struct pci_vtscsi_queue *q, struct iovec *iov_in,
} else {
cmd_wr->sense_len = MIN(io->scsiio.sense_len,
sc->vss_config.sense_size);
- cmd_wr->residual = io->scsiio.residual;
+ cmd_wr->residual = ext_data_len - io->scsiio.ext_data_filled;
cmd_wr->status = io->scsiio.scsi_status;
cmd_wr->response = VIRTIO_SCSI_S_OK;
memcpy(&cmd_wr->sense, &io->scsiio.sense_data,