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
This commit is contained in:
Alexander Motin 2022-12-03 10:08:20 -05:00
parent e92d692345
commit b81ac5cdc3

View File

@ -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,