aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-04-18 14:29:16 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2011-05-26 12:14:17 +0200
commit2e7cc4d604206ce15d298686c0ffd77dcedc33a2 (patch)
treefda1c04629414e3c18ed26bda25bb00d4ee23422 /hw
parent42741212ebe703a5b9273475e7c65829b8fa2e51 (diff)
downloadqemu-2e7cc4d604206ce15d298686c0ffd77dcedc33a2.zip
qemu-2e7cc4d604206ce15d298686c0ffd77dcedc33a2.tar.gz
qemu-2e7cc4d604206ce15d298686c0ffd77dcedc33a2.tar.bz2
scsi-generic: Handle queue full
The sg driver currently has a hardcoded limit of commands it can handle simultaneously. When this limit is reached the driver will return -EDOM. So we need to capture this to enable proper return values here. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'hw')
-rw-r--r--hw/scsi-generic.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c
index 579bab9..7670606 100644
--- a/hw/scsi-generic.c
+++ b/hw/scsi-generic.c
@@ -124,6 +124,9 @@ static void scsi_command_complete(void *opaque, int ret)
if (ret != 0) {
switch (ret) {
+ case -EDOM:
+ r->req.status = TASK_SET_FULL;
+ break;
case -EINVAL:
r->req.status = CHECK_CONDITION;
scsi_set_sense(s, SENSE_CODE(INVALID_FIELD));