From patchwork Mon May 23 16:09:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 96999 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8B3CBB6FA4 for ; Tue, 24 May 2011 02:15:34 +1000 (EST) Received: from localhost ([::1]:49787 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOXn1-0002JV-J9 for incoming@patchwork.ozlabs.org; Mon, 23 May 2011 12:15:31 -0400 Received: from eggs.gnu.org ([140.186.70.92]:57658) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOXi7-0002Zk-L8 for qemu-devel@nongnu.org; Mon, 23 May 2011 12:10:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOXi6-0001Rn-NK for qemu-devel@nongnu.org; Mon, 23 May 2011 12:10:27 -0400 Received: from mail-pv0-f173.google.com ([74.125.83.173]:50127) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOXi6-0001DU-Ie for qemu-devel@nongnu.org; Mon, 23 May 2011 12:10:26 -0400 Received: by mail-pv0-f173.google.com with SMTP id 3so3215837pvg.4 for ; Mon, 23 May 2011 09:10:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:cc:subject:date:message-id :x-mailer:in-reply-to:references; bh=2lGXwtek1WyI9B2GJGgTZM2r+HyKTI6vGxvyyP79uds=; b=YYh3vvH6G8owXLA3On8WW6u8En20dBC5OaHu7iBwqGlm3SBD2K4lk41BRuIBQf/NAC HNbyU2V6dEfep0pfvWxwvNEC+88p0V7lxz3kFBsIo/n8E4wJ4I8EqEJ8UiNXltRnX1Ba ksBzWZnSba3asHfASXiu2BCFRiPi9aVuWJYEI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; b=JsXssGgr5DOhGBVeAd71GCfLP/IO6oRvAt61BQA5uFHOtfe+wyTrS4uP+s4Bo20Jo6 n2lKtfB7ALWZoKh5TA9dTAN9vMGfFQq9fLzQijwTbWjOxcCKwUhtHR5B/1meOCC446A4 h+TSVVhc7L7YLj1D9IL+UED/N18sx0N6cBt+s= Received: by 10.142.144.8 with SMTP id r8mr830701wfd.142.1306167026107; Mon, 23 May 2011 09:10:26 -0700 (PDT) Received: from localhost.localdomain (93-34-184-88.ip51.fastwebnet.it [93.34.184.88]) by mx.google.com with ESMTPS id x12sm5946194wfd.6.2011.05.23.09.10.23 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 May 2011 09:10:25 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 23 May 2011 18:09:05 +0200 Message-Id: <1306166949-19698-21-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1306166949-19698-1-git-send-email-pbonzini@redhat.com> References: <1306166949-19698-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.83.173 Cc: hch@lst.de, Hannes Reinecke Subject: [Qemu-devel] [PATCH v4 20/24] scsi-generic: Handle queue full X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Signed-off-by: Paolo Bonzini Reviewed-by: Christoph Hellwig --- hw/scsi-generic.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c index 53114e5..30845c5 100644 --- a/hw/scsi-generic.c +++ b/hw/scsi-generic.c @@ -123,6 +123,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));