]> git.proxmox.com Git - qemu.git/commitdiff
scsi-generic: Handle queue full
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 18 Apr 2011 12:29:16 +0000 (14:29 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 26 May 2011 10:14:17 +0000 (12:14 +0200)
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>
hw/scsi-generic.c

index 579bab9e7cb2c513d2cbd983863d03dd946d1532..76706064193d6ac94c43c26f5f5e0bd8d4f378f1 100644 (file)
@@ -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));