]> git.proxmox.com Git - mirror_qemu.git/commit - hw/scsi-bus.c
scsi: Update sense code handling
authorHannes Reinecke <hare@suse.de>
Mon, 18 Apr 2011 10:53:14 +0000 (12:53 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 26 May 2011 10:14:16 +0000 (12:14 +0200)
commita1f0cce2ac0243572ff72aa561da67fe3766a395
tree4680cabf1c9098c422e6c40abc2620f9f9a69cba
parent2b8b3bb9dd1c67d8296b7610dca909539e25a196
scsi: Update sense code handling

The SCSI spec has a quite detailed list of sense codes available.
It even mandates the use of specific ones for some failure cases.
The current implementation just has one type of generic error
which is actually a violation of the spec in certain cases.
This patch introduces various predefined sense codes to have the
sense code reporting more in line with the spec.

On top of Hannes's patch I fixed the reply to REQUEST SENSE commands
with DESC=0 and a small (<18) length.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
hw/scsi-bus.c
hw/scsi-disk.c
hw/scsi-generic.c
hw/scsi.h