diff mbox series

[kvmtool,v2,08/17] virtio/scsi: Initialize max_target

Message ID 20230606130426.978945-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 June 6, 2023, 1:04 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 db4adc75..4d1ed9b8 100644
--- a/virtio/scsi.c
+++ b/virtio/scsi.c
@@ -73,6 +73,7 @@  static void notify_status(struct kvm *kvm, void *dev, u32 status)
 	conf->cmd_per_lun = virtio_host_to_guest_u32(endian, 128);
 	conf->sense_size = virtio_host_to_guest_u32(endian, VIRTIO_SCSI_SENSE_SIZE);
 	conf->cdb_size = virtio_host_to_guest_u32(endian, VIRTIO_SCSI_CDB_SIZE);
+	conf->max_target = virtio_host_to_guest_u16(endian, 255);
 	conf->max_lun = virtio_host_to_guest_u32(endian, 16383);
 	conf->event_info_size = virtio_host_to_guest_u32(endian, sizeof(struct virtio_scsi_event));
 }