Skip to content

Commit

Permalink
virtio-scsi: handle virtio_scsi_set_config() error
Browse files Browse the repository at this point in the history
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 <groug@kaod.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
gkurz authored and mstsirkin committed Oct 9, 2016
1 parent 661e32f commit ad14a46
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hw/scsi/virtio-scsi.c
Expand Up @@ -644,8 +644,9 @@ static void virtio_scsi_set_config(VirtIODevice *vdev,

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

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

0 comments on commit ad14a46

Please sign in to comment.