diff mbox series

[kvmtool,08/16] virtio/scsi: Initialize max_target

Message ID 20230419132119.124457-9-jean-philippe@linaro.org (mailing list archive)
State New, archived
Headers show
Series Fix vhost-net, scsi and vsock | expand

Commit Message

Jean-Philippe Brucker April 19, 2023, 1:21 p.m. UTC
The Linux guest does not find any target when 'max_target' is 0.
Initialize it to the maximum defined by virtio, "5.6.4 Device
configuration layout":

	max_target SHOULD be less than or equal to 255.

Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
---
 virtio/scsi.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/virtio/scsi.c b/virtio/scsi.c
index f059fc37..fc1c2ad9 100644
--- a/virtio/scsi.c
+++ b/virtio/scsi.c
@@ -76,6 +76,7 @@  static void notify_status(struct kvm *kvm, void *dev, u32 status)
 	conf->sense_size = virtio_host_to_guest_u32(vdev, VIRTIO_SCSI_SENSE_SIZE);
 	conf->cdb_size = virtio_host_to_guest_u32(vdev, VIRTIO_SCSI_CDB_SIZE);
 	conf->max_lun = virtio_host_to_guest_u32(vdev, 16383);
+	conf->max_target = virtio_host_to_guest_u32(vdev, 255);
 	conf->event_info_size = virtio_host_to_guest_u32(vdev, sizeof(struct virtio_scsi_event));
 }