Commit 2e7cc4d6 authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

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: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent 42741212
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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));