From patchwork Tue May 17 11:01:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 95924 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 9D19FB6EDF for ; Tue, 17 May 2011 21:11:16 +1000 (EST) Received: from localhost ([::1]:45460 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMIBF-0002ao-O0 for incoming@patchwork.ozlabs.org; Tue, 17 May 2011 07:11:13 -0400 Received: from eggs.gnu.org ([140.186.70.92]:44457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMI3P-0005wk-GF for qemu-devel@nongnu.org; Tue, 17 May 2011 07:04:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMI2d-000551-6V for qemu-devel@nongnu.org; Tue, 17 May 2011 07:03:07 -0400 Received: from mail-iw0-f173.google.com ([209.85.214.173]:61697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMI2d-0004zI-2H for qemu-devel@nongnu.org; Tue, 17 May 2011 07:02:19 -0400 Received: by mail-iw0-f173.google.com with SMTP id 42so369736iwl.4 for ; Tue, 17 May 2011 04:02:18 -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=iOQBvAdnxiz1fVFfRbPXpnkJ7flqS46iJClTSLq+A/I=; b=h62wMfMp29Xs/GDl3X4vzx5rUm+d8mQRo+DoHxMeGoOPs6ww5lAvPZqHDdJv1X9g70 xyMfRjQN5AXfmrKH6GiG8S/MvXSznOwnxkydzs+G4ba5PxTc+N7HXoSeqx2R5gM/9Uo4 AP+oqqEIHAgK/DuhIv6pWyUh58B2L600uh1/I= 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=aSLh+0qzNr+yHEl0k5jASWinJ86QhuJ2/7KYk0yknKGcOkcB7cM2dAsoT80bPWcfeR ojPSDald3iRhSAMNEtfxcAxXMnQp5wnjufbpFLAZs2Ew4OMwxCbW4X064iAzRtOORlNI FWnb5bwRJnFii8PGcKVuE3hWvouqRkZ6hQ1uI= Received: by 10.231.96.144 with SMTP id h16mr323124ibn.182.1305630138747; Tue, 17 May 2011 04:02:18 -0700 (PDT) Received: from localhost.localdomain (93-34-184-88.ip51.fastwebnet.it [93.34.184.88]) by mx.google.com with ESMTPS id c16sm211390ibe.41.2011.05.17.04.02.16 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 May 2011 04:02:18 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 17 May 2011 13:01:06 +0200 Message-Id: <1305630067-2119-21-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1305630067-2119-1-git-send-email-pbonzini@redhat.com> References: <1305630067-2119-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.173 Cc: Hannes Reinecke Subject: [Qemu-devel] [PATCH v3 20/21] 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 1ea0930..0c04606 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));