Skip to content

Commit ad14a46

Browse files
gkurzmstsirkin
authored andcommitted
virtio-scsi: handle virtio_scsi_set_config() error
This error is caused by a buggy guest: let's switch the device to the broken state instead of terminating QEMU. Signed-off-by: Greg Kurz <[email protected]> Reviewed-by: Stefan Hajnoczi <[email protected]> Reviewed-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 661e32f commit ad14a46

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hw/scsi/virtio-scsi.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,9 @@ static void virtio_scsi_set_config(VirtIODevice *vdev,
644644

645645
if ((uint32_t) virtio_ldl_p(vdev, &scsiconf->sense_size) >= 65536 ||
646646
(uint32_t) virtio_ldl_p(vdev, &scsiconf->cdb_size) >= 256) {
647-
error_report("bad data written to virtio-scsi configuration space");
648-
exit(1);
647+
virtio_error(vdev,
648+
"bad data written to virtio-scsi configuration space");
649+
return;
649650
}
650651

651652
vs->sense_size = virtio_ldl_p(vdev, &scsiconf->sense_size);

0 commit comments

Comments
 (0)